# Path: AOR/Location.py
# class Location:
#     def __init__(self, loc): self.loc=loc
#     # --------------------------------------------------------------------------
#     def SetEndLocation(self, loc): self.endloc = loc
#     # --------------------------------------------------------------------------
#     def GetLocation(self):    return self.loc
#     # --------------------------------------------------------------------------
#     def GetEndLocation(self): return self.endloc
# 
# Path: AOR/BasicStatement.py
# class BasicStatement(Label, Location):
# 
#     def __init__(self, sLabel=None, loc=None, nIndent=0, isDeclaration=1):
#         Label.__init__(self, sLabel)
#         Location.__init__(self, loc)
#         self._isDeclaration=isDeclaration
#         self.nIndent=nIndent
#     # --------------------------------------------------------------------------
#     def isA(self, c):
#         return self.__class__ == c
#     # --------------------------------------------------------------------------
#     # Returns true if the statement is a 'real' fortran statement (as opposed to
#     # a compiler directive, comment line, preprocessor directive). This method
#     # is overwritten in those classes.
#     def isStatement(self): return 1
#     # --------------------------------------------------------------------------
#     # Returns if this statement is a declaration statement or not
#     def isDeclaration(self): return self._isDeclaration
#     # --------------------------------------------------------------------------
#     def ToString(self, stylesheet): return stylesheet.ToString(self)
#     # --------------------------------------------------------------------------
#     def GetIndentation(self): return self.nIndent
#     # --------------------------------------------------------------------------
#     def GetVarUsage(self, varUsage, sType="", obj=None, loc=None): return
#     # --------------------------------------------------------------------------
#     def ToList(self, stylesheet, l):
#         Label.ToList(self, stylesheet, l)
#         l.append(stylesheet.GetIndentation(self))
#     # --------------------------------------------------------------------------
#     def __str__(self): return self.__repr__()
#     # --------------------------------------------------------------------------
#     def __repr__(self):
#         stylesheet = DefaultStylesheet()
#         return "%s%s"%(Label.__repr__(self),
#                        "".join(stylesheet.ToString(self)))


from UserString         import UserString
from AOR.Location       import Location
from AOR.BasicStatement import BasicStatement
    def isStatement(self): return 0
    # --------------------------------------------------------------------------
    def GetVarUsage(self, v): return
    # --------------------------------------------------------------------------
    def ToList(self, stylesheet, l):
        # Do not use BasicStatement.ToList, since it will indent lines to the
        # start column specified in the stylesheet.
        # First "" is for label, second for correct indentation
        l.extend(["","",self.__repr__()])
    # --------------------------------------------------------------------------
    def __repr__(self): return UserString.__str__(self)
# ==============================================================================
# Stores a comment at the end of a line
class Comment(BasicNonStatement):
    def __init__(self, sComment, loc):
        BasicNonStatement.__init__(self, sComment, loc)

# ==============================================================================
class CommentLine(BasicNonStatement):
    def __init__(self, sComment, loc=None):
        BasicNonStatement.__init__(self, sComment, loc)
       
# ==============================================================================
class PreDirective(BasicNonStatement):
    def __init__(self, sPreDirective, loc):
        BasicNonStatement.__init__(self, sPreDirective, loc)
    
# ==============================================================================
class CompilerDirective(BasicNonStatement):
    def __init__(self, sCompilerDirective, loc):

# Path: AOR/Location.py
# class Location:
#     def __init__(self, loc): self.loc=loc
#     # --------------------------------------------------------------------------
#     def SetEndLocation(self, loc): self.endloc = loc
#     # --------------------------------------------------------------------------
#     def GetLocation(self):    return self.loc
#     # --------------------------------------------------------------------------
#     def GetEndLocation(self): return self.endloc
# 
# Path: AOR/BasicStatement.py
# class BasicStatement(Label, Location):
# 
#     def __init__(self, sLabel=None, loc=None, nIndent=0, isDeclaration=1):
#         Label.__init__(self, sLabel)
#         Location.__init__(self, loc)
#         self._isDeclaration=isDeclaration
#         self.nIndent=nIndent
#     # --------------------------------------------------------------------------
#     def isA(self, c):
#         return self.__class__ == c
#     # --------------------------------------------------------------------------
#     # Returns true if the statement is a 'real' fortran statement (as opposed to
#     # a compiler directive, comment line, preprocessor directive). This method
#     # is overwritten in those classes.
#     def isStatement(self): return 1
#     # --------------------------------------------------------------------------
#     # Returns if this statement is a declaration statement or not
#     def isDeclaration(self): return self._isDeclaration
#     # --------------------------------------------------------------------------
#     def ToString(self, stylesheet): return stylesheet.ToString(self)
#     # --------------------------------------------------------------------------
#     def GetIndentation(self): return self.nIndent
#     # --------------------------------------------------------------------------
#     def GetVarUsage(self, varUsage, sType="", obj=None, loc=None): return
#     # --------------------------------------------------------------------------
#     def ToList(self, stylesheet, l):
#         Label.ToList(self, stylesheet, l)
#         l.append(stylesheet.GetIndentation(self))
#     # --------------------------------------------------------------------------
#     def __str__(self): return self.__repr__()
#     # --------------------------------------------------------------------------
#     def __repr__(self):
#         stylesheet = DefaultStylesheet()
#         return "%s%s"%(Label.__repr__(self),
#                        "".join(stylesheet.ToString(self)))


# Path: AOR/SpecialStatements.py
from UserString         import UserString
from AOR.Location       import Location
from AOR.BasicStatement import BasicStatement

    def isStatement(self): return 0
    # --------------------------------------------------------------------------
    def GetVarUsage(self, v): return
    # --------------------------------------------------------------------------
    def ToList(self, stylesheet, l):
        # Do not use BasicStatement.ToList, since it will indent lines to the
        # start column specified in the stylesheet.
        # First "" is for label, second for correct indentation
        l.extend(["","",self.__repr__()])
    # --------------------------------------------------------------------------
    def __repr__(self): return UserString.__str__(self)
# ==============================================================================
# Stores a comment at the end of a line
class Comment(BasicNonStatement):
    def __init__(self, sComment, loc):
        BasicNonStatement.__init__(self, sComment, loc)

# ==============================================================================
class CommentLine(BasicNonStatement):
    def __init__(self, sComment, loc=None):
        BasicNonStatement.__init__(self, sComment, loc)
       
# ==============================================================================
class PreDirective(BasicNonStatement):
    def __init__(self, sPreDirective, loc):
        BasicNonStatement.__init__(self, sPreDirective, loc)
    
# ==============================================================================
class CompilerDirective(BasicNonStatement):
    def __init__(self, sCompilerDirective, loc):

        BasicNonStatement.__init__(self, sCompilerDirective, loc)