tools/pas2c/PascalUnitSyntaxTree.hs
branchwebgl
changeset 8020 00b1facf2805
parent 7969 7fcbbd46704a
child 10015 4feced261c68
equal deleted inserted replaced
8018:091293bc974f 8020:00b1facf2805
    17     deriving Show
    17     deriving Show
    18 data TypesAndVars = TypesAndVars [TypeVarDeclaration]
    18 data TypesAndVars = TypesAndVars [TypeVarDeclaration]
    19     deriving Show
    19     deriving Show
    20 data TypeVarDeclaration = TypeDeclaration Identifier TypeDecl
    20 data TypeVarDeclaration = TypeDeclaration Identifier TypeDecl
    21     | VarDeclaration Bool Bool ([Identifier], TypeDecl) (Maybe InitExpression)
    21     | VarDeclaration Bool Bool ([Identifier], TypeDecl) (Maybe InitExpression)
    22     | FunctionDeclaration Identifier Bool TypeDecl [TypeVarDeclaration] (Maybe (TypesAndVars, Phrase))
    22     | FunctionDeclaration Identifier Bool Bool TypeDecl [TypeVarDeclaration] (Maybe (TypesAndVars, Phrase))
    23     | OperatorDeclaration String Identifier Bool TypeDecl [TypeVarDeclaration] (Maybe (TypesAndVars, Phrase))
    23     | OperatorDeclaration String Identifier Bool TypeDecl [TypeVarDeclaration] (Maybe (TypesAndVars, Phrase))
    24     deriving Show
    24     deriving Show
    25 data TypeDecl = SimpleType Identifier
    25 data TypeDecl = SimpleType Identifier
    26     | RangeType Range
    26     | RangeType Range
    27     | Sequence [Identifier]
    27     | Sequence [Identifier]
   101     deriving Show
   101     deriving Show
   102 
   102 
   103 data BaseType = BTUnknown
   103 data BaseType = BTUnknown
   104     | BTChar
   104     | BTChar
   105     | BTString
   105     | BTString
   106     | BTInt
   106     | BTInt Bool -- second param indicates whether signed or not
   107     | BTBool
   107     | BTBool
   108     | BTFloat
   108     | BTFloat
   109     | BTRecord String [(String, BaseType)]
   109     | BTRecord String [(String, BaseType)]
   110     | BTArray Range BaseType BaseType
   110     | BTArray Range BaseType BaseType
   111     | BTFunction Bool Int BaseType
   111     | BTFunction Bool [(Bool, BaseType)] BaseType -- (Bool, BaseType), Bool indiciates whether var or not
   112     | BTPointerTo BaseType
   112     | BTPointerTo BaseType
   113     | BTUnresolved String
   113     | BTUnresolved String
   114     | BTSet BaseType
   114     | BTSet BaseType
   115     | BTEnum [String]
   115     | BTEnum [String]
   116     | BTVoid
   116     | BTVoid