Changes between Version 9 and Version 10 of AST


Ignore:
Timestamp:
04/19/11 20:32:48 (15 years ago)
Author:
Stephen Siegel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AST

    v9 v10  
    3030All AST nodes have source information.
    3131
    32 Types of AST Node
     32ASTNodeIF extends SourceableIF
     33* methods
     34   * numChildren: int
     35   * child(int i): ASTNodeIF
     36
     37The following extend ASTNodeIF:
    3338 * IdentifierNodeIF: wraps a string. represents an identifier occurrence in code
    3439    * methods
     
    6772 * VariableDefinitionNodeIF
    6873    * methods
    69        * scope: ? (global, input/output, ...)
     74       * scope: ? (global, input/output, local,...)
    7075       * name: IdentifierNodeIF (together with scope, this uniquely identifies the variable)
    7176       * type: TypeNodeIF
     77       * initializer: ExpressionNodeIF
    7278 * VariableDeclarationNodeIF: each declaration has an associated definition.  There can be many decls associated to one def.    This is a linking thing: a single variable that is to be used in several files will be defined in one file but be declared in all
    7379    * methods
     
    108114    * SwitchStatementNodeIF: this can be used to model C's switch
    109115       * methods
    110           * expression: expression that is evaluated
     116          * expression: ExpressionNodeIF: expression that is evaluated
    111117          * numCases: int
    112118          * case(int i): ValueLocationPairNodeIF (ordered pair (v,l), where v is a ValueNodeIF, and l is an ASTStatementNodeIF)
     
    129135         * body: StatementNodeIF
    130136   * DoUntilNodeIF
    131    * break
    132    * continue
    133    * goto
     137   * BreakNodeIF
     138   * ContinueNodeIF
     139   * GotoNodeIF
    134140      * label (this is the kind before processing)
    135141      * statement (after processing)
    136    * return
     142   * ReturnNodeIF
    137143      * expression (may be null)
    138    * no-op
    139    * block ({...})
     144   * NoopNodeIF
     145   * BlockNodeIF: ({...} in C)
    140146      * sequence of variable definitions
    141147      * sequence of statements
    142    * variable definition
    143       * with possible initialization expression
    144       * possible array extents information and other information modifying type?
    145       * storage class: automatic, static, extern, ...?
    146    * expressions: these are considered a kind of statement (as in C)
    147       * pure expressions (side-effect-free)
    148          * literals (including named literals): integers, reals, strings, chars
    149          * variable
    150          * operators
     148   * ExpressionNodeIF: expressions--these are considered a kind of statement (as in C)
     149      * PureExpressionNodeIF: side-effect-free expressions
     150         * LiteralNodeIF (including named literals): integers, reals, strings, chars
     151         * VariableExpressionNodeIF
     152         * OperatorNodeIF
    151153            * +,-,*,/,%,<,<=,>,>=,==,!=,!,&&, | |, (x?y:z), bitand, bitor, bitxor, lshift, rshift, & (address-of), * (dereference)
    152          * cast-to-t
    153          * a[i] (array index)
    154          * x.a (record navigation)
    155          * quantifiers: \forall, \exists, \uniform, \sum
    156          * initializers (special kind of expression used to initialize variables in their decl)
    157          * sizeof (type, expression, or string literal)
    158          * startOf(a): &a[0] -- that is the Cil way of converting an array to pointer to first element
    159          * function invocation f(x) when f is abstract (pure) function
    160       * expressions with side-effects
    161          * assignments: x=expr, x++, x--, ++x, --x
    162          * function invocation f(x) when f is concrete
     154         * CastNodeIF
     155            * newType: TypeNodeIF (type you are casting to)
     156            * expression: ExpressionNodeIF
     157         * ArrayIndexNodeIF (a[i])
     158         * RecordNavigationNodeIF: (x.a)
     159         * QuantifierNodeIF
     160            * quantifier: {FORALL, EXISTS, LAMBDA, UNIFORM, SUM}
     161            * boundVariable: VariableDefinitionNodeIF
     162            * constraint: ExpressionNodeIF
     163            * expression: ExpressionNodeIF
     164         * InitializerNodeIF: special kind of expression used to initialize variables in their decl
     165         * SizeOfNodeIF: type, expression, or string literal
     166         * StartOfNodeIF:  &a[0] -- that is the Cil way of converting an array to pointer to first element
     167         * FunctionApplicationNodeIF: invocation f(x) when f is abstract (pure) function
     168      * SideEffectExpressionNodeIF: expressions with side-effects
     169         * AssignmentNodeIF: x=expr, x++, x--, ++x, --x
     170         * FunctionInvocationNodeIF: invocation f(x) when f is concrete
    163171
    164172