Class TreeBuilder

java.lang.Object
autumn.lang.compiler.TreeBuilder

public final class TreeBuilder extends Object
Use an instance of this class when building the abstract-syntax-tree of a module.

An instance of this class can be thought of as a stack-machine. Calling methods, such as createDatum(String), causes leaf AST nodes to be pushed onto the stack. Calling methods, such as createSequenceStatement(), causes an inner AST node to be created. Using these different types of methods in combination facilitates the construction of an AST.

This stack-machine employs a primary-stack and a stack-of-stacks. The primary stack is the stack that is manipulated when building an AST node. Sometimes it is necessary to limit the scope of a node construction operation. As a result, it is possible to push the current primary-stack onto the stack-of-stacks. When the primary-stack is pushed onto the stack-of-stacks, a new stack will replace it. Later, the old primary-stack can be restored by popping it off of the stack-of-stacks.

Some methods herein denote the bottom element on the primary-stack as ".....". This means that the method only manipulates the topmost element(s) on the stack. The elements below the manipulated elements will not be popped, relocated, etc. On the other hand, some methods do not denote the bottom element as ".....". These methods may manipulate the entire primary-stack.

Author:
Mackenzie High
  • Constructor Details

    • TreeBuilder

      public TreeBuilder()
      Sole Constructor.
  • Method Details

    • setSourceLocation

      public void setSourceLocation(URL file, Integer line, Integer column, Object additional_info)
      This method sets the source-location information for the topmost node on the stack.

      This method has no effect, if the stack is empty or the topmost node is null.

      Parameters:
      file - is the path to the source-code file. This is null, if no file is specified.
      line - is the one-based line-number where the node starts. This is null, if no line-number is specified.
      column - is the one-based column-number where the node starts. This is null, if the column-number is specified.
      additional_info - is additional information that helps locate the node. This is null, if no additional-info is specified.
    • pushStack

      public void pushStack()
      This method pushes the primary-stack onto the stack-of-stacks.
    • popStack

      public void popStack()
      This method restores the previous stack, by popping it off of the stack-of-stacks.

      Note: If the current stack is not empty, then its elements will be pushed onto the restored stack.

      Warning: Do not confuse this method with pop().

    • pushNull

      public void pushNull()
      This method pushes null onto the primary-stack.
    • push

      public void push(IConstruct value)
      This method pushes a construct onto the primary-stack.
      Parameters:
      value - is the value to push onto the stack.
    • peek

      public IConstruct peek()
      This method retrieves, but does not remove, the topmost value on the primary-stack.
      Returns:
      the topmost value on the stack.
    • pop

      public IConstruct pop()
      This method retrieves and removes the topmost value on the primary-stack.
      Returns:
      the topmost value on the stack.
    • copyStack

      public Stack<IConstruct> copyStack()
      This method creates and returns a copy of the primary-stack.
      Returns:
      a copy of the stack.
    • isEmpty

      public boolean isEmpty()
      This method determines whether the primary-stack is empty.
      Returns:
      true, iff the stack is empty.
    • size

      public int size()
      This method retrieves the current size of the primary-stack.
      Returns:
      the number of values on the stack.
    • clear

      public void clear()
      This method removes all the elements off of the primary-stack.
    • createModule

      public void createModule()
      This method creates a module.

      Precondition of the Stack

      • module-member[n]
      • module-member[2]
      • module-member[1]
      • module-member[0]

      A module-member is one of:

      • ModuleDirective
      • ImportDirective
      • AnnotationDefinition
      • ExceptionDefinition
      • FunctorDefinition
      • EnumDefinition
      • DesignDefinition
      • StructDefinition
      • TupleDefinition
      • FunctionDefinition

      Postcondition of the Stack

      • result : Module

    • createDirectiveModule

      public void createDirectiveModule()
      This method creates a module-directive.

      Precondition of the Stack

      • namespace : Namespace
      • name : Name
      • annotations : AnnotationList
      • comment : DocComment

      The name must be null, if the module is anonymous.

      Postcondition of the Stack

      • result : ModuleDirective

    • createDirectiveImport

      public void createDirectiveImport()
      This method creates an import-directive.

      Precondition of the Stack

      • type : TypeSpecifier

      Postcondition of the Stack

      • result : ImportDirective

    • createDefinitionAnnotation

      public void createDefinitionAnnotation()
      This method creates an annotation-definition.

      Precondition of the Stack

      • name : Name
      • annotations : AnnotationList
      • comment : DocComment

      Postcondition of the Stack

      • result : AnnotationDefinition

    • createDefinitionException

      public void createDefinitionException()
      This method creates an exception-definition.

      Precondition of the Stack

      • superclass : TypeSpecifier
      • name : Name
      • annotations : AnnotationList
      • comment : DocComment

      Postcondition of the Stack

      • result : ExceptionDefinition

    • createDefinitionDesign

      public void createDefinitionDesign()
      This method creates an design-definition.

      Precondition of the Stack

      • supertype[n] : TypeSpecifier
      • supertype[.] : TypeSpecifier
      • supertype[2] : TypeSpecifier
      • supertype[1] : TypeSpecifier
      • supertype[0] : TypeSpecifier
      • elements : ElementList
      • name : Name
      • annotations : AnnotationList
      • comment : DocComment

      Postcondition of the Stack

      • result : DesignDefinition

    • createDefinitionTuple

      public void createDefinitionTuple()
      This method creates an tuple-definition.

      Precondition of the Stack

      • supertype[n] : TypeSpecifier
      • supertype[.] : TypeSpecifier
      • supertype[2] : TypeSpecifier
      • supertype[1] : TypeSpecifier
      • supertype[0] : TypeSpecifier
      • elements : ElementList
      • name : Name
      • annotations : AnnotationList
      • comment : DocComment

      Postcondition of the Stack

      • result : TupleDefinition

    • createDefinitionStruct

      public void createDefinitionStruct()
      This method creates a struct-definition.

      Precondition of the Stack

      • supertype[m] : TypeSpecifier
      • supertype[.] : TypeSpecifier
      • supertype[2] : TypeSpecifier
      • supertype[1] : TypeSpecifier
      • supertype[0] : TypeSpecifier
      • elements : ElementList
      • name : Name
      • annotations : AnnotationList
      • comment : DocComment

      Postcondition of the Stack

      • result : StructDefinition

    • createDefinitionFunctor

      public void createDefinitionFunctor()
      This method creates an functor-definition.

      Precondition of the Stack

      • superclass : TypeSpecifier
      • return-type : TypeSpecifier
      • parameters : FormalParameterList
      • name : Name
      • annotations : AnnotationList
      • comment : DocComment

      Postcondition of the Stack

      • result : FunctorDefinition

    • createDefinitionEnum

      public void createDefinitionEnum()
      This method creates an enum-definition.

      Precondition of the Stack

      • constant[n] : Name
      • constant[2] : Name
      • constant[1] : Name
      • constant[0] : Name
      • name : Name
      • annotations : AnnotationList
      • comment : DocComment

      Postcondition of the Stack

      • result : EnumDefinition

    • createDefinitionFunction

      public void createDefinitionFunction()
      This method creates a function-definition.

      Precondition of the Stack

      • body : SequenceStatement
      • return-type : TypeSpecifier
      • parameters : FormalParameterList
      • name : Name
      • annotations : AnnotationList
      • comment : DocComment

      Postcondition of the Stack

      • result : FunctionDefinition

    • createStatementIf

      public void createStatementIf()
      This method creates an if-statement.

      Precondition of the Stack

      • else-case : SequenceStatement
      • elif-case[n] : ConditionCase
      • elif-case[2] : ConditionCase
      • elif-case[1] : ConditionCase
      • elif-case[0] : ConditionCase
      • main-case : ConditionCase

      Note: The elif-cases and the else-case are optional.

      Postcondition of the Stack

      • result : IfStatement

    • createStatementGoto

      public void createStatementGoto()
      This method creates a goto-statement.

      Precondition of the Stack

      • label : Label

      Postcondition of the Stack

      • result : GotoStatement

    • createStatementMarker

      public void createStatementMarker()
      This method creates a marker-statement.

      Precondition of the Stack

      • label : Label

      Postcondition of the Stack

      • result : MarkerStatement

    • createStatementBranch

      public void createStatementBranch()
      This method creates a branch-statement.

      Precondition of the Stack

      • default-label : Label
      • label[n] : Label
      • label[.] : Label
      • label[3] : Label
      • label[2] : Label
      • label[1] : Label
      • label[0] : Label
      • index : IExpression

      Postcondition of the Stack

      • result : BranchStatement

    • createStatementWhen

      public void createStatementWhen()
      This method creates a when-statement.

      Precondition of the Stack

      • body : SequenceStatement
      • condition : IExpression

      Postcondition of the Stack

      • result : WhenStatement

    • createStatementForever

      public void createStatementForever()
      This method creates a forever-loop statement.

      Precondition of the Stack

      • body : SequenceStatement

      Postcondition of the Stack

      • result : ForeverStatement

    • createStatementDoWhile

      public void createStatementDoWhile()
      This method creates a do-while-loop statement.

      Precondition of the Stack

      • condition : IExpression
      • body : SequenceStatement

      Postcondition of the Stack

      • result : DoWhileStatement

    • createStatementDoUntil

      public void createStatementDoUntil()
      This method creates a do-until-loop statement.

      Precondition of the Stack

      • condition : IExpression
      • body : SequenceStatement

      Postcondition of the Stack

      • result : DoUntilStatement

    • createStatementBreak

      public void createStatementBreak()
      This method creates a break-statement.

      Postcondition of the Stack

      • result : BreakStatement

    • createStatementContinue

      public void createStatementContinue()
      This method creates a continue-statement.

      Postcondition of the Stack

      • result : ContinueStatement

    • createStatementRedo

      public void createStatementRedo()
      This method creates a redo-statement.

      Postcondition of the Stack

      • result : RedoStatement

    • createStatementForeach

      public void createStatementForeach()
      This method creates a foreach-statement.

      Precondition of the Stack

      • body : SequenceStatement
      • iterable : IExpression
      • type : TypeSpecifier
      • variable : Variable

      Postcondition of the Stack

      • result : ForeachStatement

    • createStatementFor

      public void createStatementFor()
      This method creates a for-statement.

      Precondition of the Stack

      • body : SequenceStatement
      • next : IExpression
      • condition : IExpression
      • initializer : IExpression
      • variable : Variable

      Note: The step is null, iff the step is implicit.

      Postcondition of the Stack

      • result : ForStatement

    • createStatementWhile

      public void createStatementWhile()
      This method creates a while-statement.

      Precondition of the Stack

      • body : SequenceStatement
      • condition : IExpression

      Postcondition of the Stack

      • result : WhileStatement

    • createStatementUntil

      public void createStatementUntil()
      This method creates a until-statement.

      Precondition of the Stack

      • body : SequenceStatement
      • condition : IExpression

      Postcondition of the Stack

      • result : UntilStatement

    • createStatementAssert

      public void createStatementAssert()
      This method creates an assert-statement.

      Precondition of the Stack

      • message : IExpression
      • condition : IExpression

      Note: The message must be null, if the message is unspecified.

      Postcondition of the Stack

      • result : AssertStatement

    • createStatementAssume

      public void createStatementAssume()
      This method creates an assume-statement.

      Precondition of the Stack

      • message : IExpression
      • condition : IExpression

      Note: The message must be null, if the message is unspecified.

      Postcondition of the Stack

      • result : AssumeStatement

    • createStatementThrow

      public void createStatementThrow()
      This method creates a throw-statement.

      Precondition of the Stack

      • exception : IExpression

      Postcondition of the Stack

      • result : ThrowStatement

    • createStatementTryCatch

      public void createStatementTryCatch()
      This method creates a try-catch statement.

      Precondition of the Stack

      • handler[n] : ExceptionHandler
      • handler[2] : ExceptionHandler
      • handler[1] : ExceptionHandler
      • handler[0] : ExceptionHandler
      • body : SequenceStatement

      Note: At least one exception-handler must be provided.

      Postcondition of the Stack

      • result : TryCatchStatement

    • createComponentExceptionHandler

      public void createComponentExceptionHandler()
      This method creates an exception-handler for a try-catch statement.

      Precondition of the Stack

      • body : SequenceStatement
      • type : TypeSpecifier
      • variable : Variable

      Postcondition of the Stack

      • result : ExceptionHandler

    • createStatementVar

      public void createStatementVar()
      This method creates a var-statement.

      Precondition of the Stack

      • value : IExpression
      • variable : Variable

      Postcondition of the Stack

      • result : VarStatement

    • createStatementVal

      public void createStatementVal()
      This method creates a val-statement.

      Precondition of the Stack

      • value : IExpression
      • variable : Variable

      Postcondition of the Stack

      • result : ValStatement

    • createStatementLet

      public void createStatementLet()
      This method creates a let-statement.

      Precondition of the Stack

      • value : IExpression
      • variable : Variable

      Postcondition of the Stack

      • result : LetStatement

    • createStatementNop

      public void createStatementNop()
      This method creates a nop-statement.

      Postcondition of the Stack

      • result : NopStatement

    • createStatementReturnValue

      public void createStatementReturnValue()
      This method creates a return-value statement.

      Precondition of the Stack

      • value : IExpression

      Postcondition of the Stack

      • result : ReturnValueStatement

    • createStatementReturnVoid

      public void createStatementReturnVoid()
      This method creates a return-void statement.

      Postcondition of the Stack

      • result : ReturnVoidStatement
      • .....

    • createStatementRecur

      public void createStatementRecur()
      This method creates a recur-statement.

      Precondition of the Stack

      • argument[n] : IExpression
      • argument[2] : IExpression
      • argument[1] : IExpression
      • argument[0] : IExpression

      Postcondition of the Stack

      • result : RecurStatement

    • createStatementExpression

      public void createStatementExpression()
      This method creates an expression-statement.

      Precondition of the Stack

      • expression : IExpression

      Postcondition of the Stack

      • result : ExpressionStatement

    • createStatementSequence

      public void createStatementSequence()
      This method creates a sequence-statement.

      Precondition of the Stack

      • element[n] : IStatement
      • element[.] : IStatement
      • element[2] : IStatement
      • element[1] : IStatement
      • element[0] : IStatement

      Postcondition of the Stack

      • result : SequenceStatement

    • createOperationAs

      public void createOperationAs()
      This method creates an as-operation.

      Precondition of the Stack

      • type : TypeSpecifier
      • value : IExpression
      • .....

      Postcondition of the Stack

      • result : AsOperation
      • .....

    • createOperationIs

      public void createOperationIs()
      This method creates an is-operation.

      Precondition of the Stack

      • type : TypeSpecifier
      • value : IExpression
      • .....

      Postcondition of the Stack

      • result : AsOperation
      • .....

    • createOperationNullCoalescing

      public void createOperationNullCoalescing()
      This method creates a null-coalescing operation.

      Precondition of the Stack

      • right-operand : IExpression
      • left-operand : IExpression
      • .....

      Postcondition of the Stack

      • result : NullCoalescingOperation
      • .....

    • createOperationAnd

      public void createOperationAnd()
      This method creates an AND-operation.

      Precondition of the Stack

      • right-operand : IExpression
      • left-operand : IExpression
      • .....

      Postcondition of the Stack

      • result : AndOperation
      • .....

    • createOperationOr

      public void createOperationOr()
      This method creates an OR-operation.

      Precondition of the Stack

      • right-operand : IExpression
      • left-operand : IExpression
      • .....

      Postcondition of the Stack

      • result : OrOperation
      • .....

    • createOperationXor

      public void createOperationXor()
      This method creates an XOR-operation.

      Precondition of the Stack

      • right-operand : IExpression
      • left-operand : IExpression
      • .....

      Postcondition of the Stack

      • result : XorOperation
      • .....

    • createOperationImplies

      public void createOperationImplies()
      This method creates an IMPLIES-operation.

      Precondition of the Stack

      • right-operand : IExpression
      • left-operand : IExpression
      • .....

      Postcondition of the Stack

      • result : ImpliesOperation
      • .....

    • createOperationIdentityEquals

      public void createOperationIdentityEquals()
      This method creates an identity-equals operation.

      Precondition of the Stack

      • right-operand : IExpression
      • left-operand : IExpression
      • .....

      Postcondition of the Stack

      • result : IdentityEqualsOperation
      • .....

    • createOperationIdentityNotEquals

      public void createOperationIdentityNotEquals()
      This method creates an identity-not-equals operation.

      Precondition of the Stack

      • right-operand : IExpression
      • left-operand : IExpression
      • .....

      Postcondition of the Stack

      • result : IdentityNotEqualsOperation
      • .....

    • createOperationEquals

      public void createOperationEquals()
      This method creates an equals-operation.

      Precondition of the Stack

      • right-operand : IExpression
      • left-operand : IExpression
      • .....

      Postcondition of the Stack

      • result : EqualsOperation
      • .....

    • createOperationNotEquals

      public void createOperationNotEquals()
      This method creates an not-equals-operation.

      Precondition of the Stack

      • right-operand : IExpression
      • left-operand : IExpression
      • .....

      Postcondition of the Stack

      • result : NotEqualsOperation
      • .....

    • createOperationLessThan

      public void createOperationLessThan()
      This method creates a less-than operation.

      Precondition of the Stack

      • right-operand : IExpression
      • left-operand : IExpression
      • .....

      Postcondition of the Stack

      • result : LessThanOperation
      • .....

    • createOperationLessThanOrEquals

      public void createOperationLessThanOrEquals()
      This method creates a less-than-or-equals operation.

      Precondition of the Stack

      • right-operand : IExpression
      • left-operand : IExpression
      • .....

      Postcondition of the Stack

      • result : LessThanOrEqualsOperation
      • .....

    • createOperationGreaterThan

      public void createOperationGreaterThan()
      This method creates a greater-than operation.

      Precondition of the Stack

      • right-operand : IExpression
      • left-operand : IExpression
      • .....

      Postcondition of the Stack

      • result : GreaterThanOperation
      • .....

    • createOperationGreaterThanOrEquals

      public void createOperationGreaterThanOrEquals()
      This method creates a greater-than-or-equals operation.

      Precondition of the Stack

      • right-operand : IExpression
      • left-operand : IExpression
      • .....

      Postcondition of the Stack

      • result : GreaterThanOrEqualsOperation
      • .....

    • createOperationAdd

      public void createOperationAdd()
      This method creates a add-operation.

      Precondition of the Stack

      • right-operand : IExpression
      • left-operand : IExpression
      • .....

      Postcondition of the Stack

      • result : AddOperation
      • .....

    • createOperationSubtract

      public void createOperationSubtract()
      This method creates a subtract-operation.

      Precondition of the Stack

      • right-operand : IExpression
      • left-operand : IExpression
      • .....

      Postcondition of the Stack

      • result : SubtractOperation
      • .....

    • createOperationConcat

      public void createOperationConcat()
      This method creates a concat-operation.

      Precondition of the Stack

      • right-operand : IExpression
      • left-operand : IExpression
      • .....

      Postcondition of the Stack

      • result : AndOperation
      • .....

    • createOperationMultiply

      public void createOperationMultiply()
      This method creates a multiply-operation.

      Precondition of the Stack

      • right-operand : IExpression
      • left-operand : IExpression
      • .....

      Postcondition of the Stack

      • result : MultiplyOperation
      • .....

    • createOperationModulo

      public void createOperationModulo()
      This method creates a modulo-operation.

      Precondition of the Stack

      • right-operand : IExpression
      • left-operand : IExpression
      • .....

      Postcondition of the Stack

      • result : ModuloOperation
      • .....

    • createOperationDivide

      public void createOperationDivide()
      This method creates a divide-operation.

      Precondition of the Stack

      • right-operand : IExpression
      • left-operand : IExpression
      • .....

      Postcondition of the Stack

      • result : DivideOperation
      • .....

    • createOperationNegate

      public void createOperationNegate()
      This method creates a negate-operation.

      Precondition of the Stack

      • operand : IExpression
      • .....

      Postcondition of the Stack

      • result : NegateOperation
      • .....

    • createOperationNot

      public void createOperationNot()
      This method creates a not-operation.

      Precondition of the Stack

      • operand : IExpression
      • .....

      Postcondition of the Stack

      • result : NotOperation
      • .....

    • createExpressionDispatch

      public void createExpressionDispatch()
      This method creates a dispatch-expression.

      Precondition of the Stack

      • argument[n] : IExpression
      • argument[2] : IExpression
      • argument[1] : IExpression
      • argument[0] : IExpression
      • name : Name

      Postcondition of the Stack

      • result : DispatchExpression

    • createExpressionNew

      public void createExpressionNew()
      This method creates a new-expression.

      Precondition of the Stack

      • argument[n] : IExpression
      • argument[2] : IExpression
      • argument[1] : IExpression
      • argument[0] : IExpression
      • type : TypeSpecifier

      Postcondition of the Stack

      • result : NewExpression

    • createExpressionCallMethod

      public void createExpressionCallMethod()
      This method creates a call-method expression.

      Precondition of the Stack

      • argument[n] : IExpression
      • argument[2] : IExpression
      • argument[1] : IExpression
      • argument[0] : IExpression
      • name : Name
      • owner : IExpression

      Postcondition of the Stack

      • result : CallMethodExpression

    • createExpressionCallStaticMethod

      public void createExpressionCallStaticMethod()
      This method creates a call-static-method expression.

      Precondition of the Stack

      • argument[n] : IExpression
      • argument[2] : IExpression
      • argument[1] : IExpression
      • argument[0] : IExpression
      • name : Name
      • owner : TypeSpecifier (null, if inferred)

      Postcondition of the Stack

      • result : CallStaticMethodExpression

    • createExpressionSetField

      public void createExpressionSetField()
      This method creates a set-field expression.

      Precondition of the Stack

      • value : IExpression
      • name : Name
      • owner : IExpression

      Postcondition of the Stack

      • result : SetFieldExpression

    • createExpressionGetField

      public void createExpressionGetField()
      This method creates a get-field expression.

      Precondition of the Stack

      • name : Name
      • owner : IExpression

      Postcondition of the Stack

      • result : GetFieldExpression

    • createExpressionSetStaticField

      public void createExpressionSetStaticField()
      This method creates a set-static-field expression.

      Precondition of the Stack

      • value : IExpression
      • name : Name
      • owner : TypeSpecifier (null, if inferred)

      Postcondition of the Stack

      • result : SetStaticFieldExpression

    • createExpressionGetStaticField

      public void createExpressionGetStaticField()
      This method creates a get-static-field expression.

      Precondition of the Stack

      • name : Name
      • owner : TypeSpecifier (null, if inferred)

      Postcondition of the Stack

      • result : GetStaticFieldExpression

    • createExpressionInstanceOf

      public void createExpressionInstanceOf()
      This method creates an instanceof-expression.

      Precondition of the Stack

      • owner : TypeSpecifier
      • value : IExpression

      Postcondition of the Stack

      • result : InstanceOfExpression

    • createExpressionTernaryConditional

      public void createExpressionTernaryConditional()
      This method creates an ternary-conditional expression.

      Precondition of the Stack

      • option-false : IExpression
      • option-true : IExpression
      • condition : IExpression

      Postcondition of the Stack

      • result : TernaryConditionalExpression

    • createExpressionProgn

      public void createExpressionProgn()
      This method creates a progn-expression.

      Precondition of the Stack

      • expression[n] : IExpression
      • expression[2] : IExpression
      • expression[1] : IExpression
      • expression[0] : IExpression

      Postcondition of the Stack

      • result : PrognExpression

    • createExpressionList

      public void createExpressionList()
      This method creates a list-expression.

      Precondition of the Stack

      • element[n] : IExpression
      • element[.] : IExpression
      • element[2] : IExpression
      • element[1] : IExpression
      • element[0] : IExpression

      Postcondition of the Stack

      • result : ListExpression

    • createExpressionListComprehension

      public void createExpressionListComprehension()
      This method creates a list-comprehension-expression.

      Precondition of the Stack

      • condition : IExpression
      • iterable : IExpression
      • type : TypeSpecifier
      • variable : Variable
      • modifier : IExpression

      The condition is optional.

      Postcondition of the Stack

      • result : ListComprehensionExpression

    • createStatementLambda

      public void createStatementLambda()
      This method creates a lambda-statement.

      Precondition of the Stack

      • body : IExpression
      • formal[n] : Variable
      • formal[3] : Variable
      • formal[2] : Variable
      • formal[1] : Variable
      • formal[0] : Variable
      • type : TypeSpecifier
      • variable : Variable

      Postcondition of the Stack

      • result : LambdaStatement

    • createStatementDelegate

      public void createStatementDelegate()
      This method creates a delegate-statement.

      Precondition of the Stack

      • name : Name
      • owner : TypeSpecifier
      • type : TypeSpecifier
      • variable : Variable

      Postcondition of the Stack

      • result : DelegateStatement

    • createExpressionLocals

      public void createExpressionLocals()
      This method creates a locals-expression.

      Precondition of the Stack

      • .....

      Postcondition of the Stack

      • result : LocalsExpression

    • createExpressionOnce

      public void createExpressionOnce()
      This method creates a once-expression.

      Precondition of the Stack

      • value : IExpression

      Postcondition of the Stack

      • result : OnceExpression

    • createDatum

      public void createDatum(boolean value)
      This method creates a boolean-datum.

      Precondition of the Stack

      • .....

      Postcondition of the Stack

      • result : BooleanDatum
      • .....

      Parameters:
      value - is the value that the new datum represents.
    • createDatum

      public void createDatum(CharLiteral value)
      This method creates a char-datum.

      Precondition of the Stack

      • .....

      Postcondition of the Stack

      • result : CharDatum
      • .....

      Parameters:
      value - is the value that the new datum represents.
    • createDatum

      public void createDatum(ByteLiteral value)
      This method creates a byte-datum.

      Precondition of the Stack

      • .....

      Postcondition of the Stack

      • result : ByteDatum
      • .....

      Parameters:
      value - is the value that the new datum represents.
    • createDatum

      public void createDatum(ShortLiteral value)
      This method creates a short-datum.

      Precondition of the Stack

      • .....

      Postcondition of the Stack

      • result : ShortDatum
      • .....

      Parameters:
      value - is the value that the new datum represents.
    • createDatum

      public void createDatum(IntLiteral value)
      This method creates a int-datum.

      Precondition of the Stack

      • .....

      Postcondition of the Stack

      • result : IntDatum
      • .....

      Parameters:
      value - is the value that the new datum represents.
    • createDatum

      public void createDatum(LongLiteral value)
      This method creates a long-datum.

      Precondition of the Stack

      • .....

      Postcondition of the Stack

      • result : LongDatum
      • .....

      Parameters:
      value - is the value that the new datum represents.
    • createDatum

      public void createDatum(FloatLiteral value)
      This method creates a float-datum.

      Precondition of the Stack

      • .....

      Postcondition of the Stack

      • result : FloatDatum
      • .....

      Parameters:
      value - is the value that the new datum represents.
    • createDatum

      public void createDatum(DoubleLiteral value)
      This method creates a double-datum.

      Precondition of the Stack

      • .....

      Postcondition of the Stack

      • result : DoubleDatum
      • .....

      Parameters:
      value - is the value that the new datum represents.
    • createDatum

      public void createDatum(BigIntegerLiteral value)
      This method creates a big-integer-datum.

      Precondition of the Stack

      • .....

      Postcondition of the Stack

      • result : BigIntegerDatum
      • .....

      Parameters:
      value - is the value that the new datum represents.
    • createDatum

      public void createDatum(BigDecimalLiteral value)
      This method creates a big-decimal-datum.

      Precondition of the Stack

      • .....

      Postcondition of the Stack

      • result : BigDecimalDatum
      • .....

      Parameters:
      value - is the value that the new datum represents.
    • createDatum

      public void createDatum(boolean verbatim, String value)
      This method creates a String-datum.

      Precondition of the Stack

      • .....

      Postcondition of the Stack

      • result : StringDatum
      • .....

      Parameters:
      verbatim - is false, if the string may contain escape sequences.
      value - is the value that the new datum represents.
    • createDatumClass

      public void createDatumClass()
      This method creates a class-datum.

      Precondition of the Stack

      • type : TypeSpecifier
      • .....

      Postcondition of the Stack

      • result : ClassDatum
      • .....

    • createDatumNull

      public void createDatumNull()
      This method creates a null-datum.

      Precondition of the Stack

      • .....

      Postcondition of the Stack

      • result : NullDatum
      • .....

    • createDatumVariable

      public void createDatumVariable()
      This method creates a variable-datum.

      Precondition of the Stack

      • variable : Variable
      • .....

      Postcondition of the Stack

      • result : VariableDatum
      • .....

    • createComponentDocComment

      public void createComponentDocComment()
      This method creates a doc-comment.

      Precondition of the Stack

      • line[n] : DocCommentLine
      • line[2] : DocCommentLine
      • line[1] : DocCommentLine
      • line[0] : DocCommentLine
      • .....

      There may be zero or more lines.

      Postcondition of the Stack

      • result : DocComment
      • .....

    • createComponentDocCommentLine

      public void createComponentDocCommentLine(String text)
      This method creates a doc-comment-line.

      Precondition of the Stack

      • .....

      There may be zero or more lines.

      Postcondition of the Stack

      • result : DocCommentLine
      • .....

      Parameters:
      text - is the comment line itself.
    • createComponentAnnotation

      public void createComponentAnnotation(List<String> values)
      This method creates an annotation-usage.

      Precondition of the Stack

      • annotation-type : TypeSpecifier

      Postcondition of the Stack

      • result : Annotation

      Parameters:
      values - are the values to store in the annotation.
    • createComponentAnnotationList

      public void createComponentAnnotationList()
      This method creates an annotation-list.

      Precondition of the Stack

      • annotation[n] : Annotation
      • annotation[2] : Annotation
      • annotation[1] : Annotation
      • annotation[0] : Annotation

      Postcondition of the Stack

      • result : AnnotationList

    • createComponentTypeSpecifier

      public void createComponentTypeSpecifier(Integer dimensions)
      This method creates a type-specifier for an array-type.

      Precondition of the Stack

      • simple-name : Name
      • namespace : Namespace
      • .....

      Note: The namespace must be null, if the namespace is implicit.

      Postcondition of the Stack

      • result : TypeSpecifier
      • .....

      Parameters:
      dimensions - are the the number of dimensions in the array type.
    • createComponentTypeSpecifier

      public void createComponentTypeSpecifier()
      This method creates a type-specifier for an array-type.

      Precondition of the Stack

      • simple-name : Name
      • namespace : Namespace
      • .....

      Note: The namespace must be null, if the namespace is implicit.

      Postcondition of the Stack

      • result : TypeSpecifier
      • .....

    • createComponentVariable

      public void createComponentVariable(String name)
      This method creates a variable.

      Precondition of the Stack

      • .....

      Postcondition of the Stack

      • result : Variable
      • .....

    • createComponentLabel

      public void createComponentLabel(String name)
      This method creates a label.

      Precondition of the Stack

      • .....

      Postcondition of the Stack

      • result : Label
      • .....

    • createComponentName

      public void createComponentName(String name)
      This method creates a name.

      Precondition of the Stack

      • .....

      Postcondition of the Stack

      • result : Name
      • .....

    • createComponentElement

      public void createComponentElement()
      This method creates an element.

      Precondition of the Stack

      • type : TypeSpecifier
      • name : Name

      Postcondition of the Stack

      • result : Element

    • createComponentElementList

      public void createComponentElementList()
      This method creates an element-list.

      Precondition of the Stack

      • element[n] : Element
      • element[2] : Element
      • element[1] : Element
      • element[0] : Element

      Postcondition of the Stack

      • result : ElementList

    • createComponentFormalParameter

      public void createComponentFormalParameter()
      This method creates a formal-parameter.

      Precondition of the Stack

      • type : TypeSpecifier
      • variable : Variable

      Postcondition of the Stack

      • result : FormalParameter

    • createComponentFormalParameterList

      public void createComponentFormalParameterList()
      This method creates a formal-parameter.

      Precondition of the Stack

      • parameter[n] : FormalParameter
      • parameter[2] : FormalParameter
      • parameter[1] : FormalParameter
      • parameter[0] : FormalParameter

      Postcondition of the Stack

      • result : FormalParameter

    • createComponentNamespace

      public void createComponentNamespace()
      This method creates a namespace component.

      Precondition of the Stack

      • name[n] : Name
      • name[2] : Name
      • name[1] : Name
      • name[0] : Name

      Example: If the namespace is "java.util", then name[0] = "java" and name[1] = "util".

      Postcondition of the Stack

      • result : Namespace

    • createComponentConditionalCase

      public void createComponentConditionalCase()
      This method creates a conditional-case.

      Precondition of the Stack

      • body : SequenceStatement
      • condition : IExpression

      Postcondition of the Stack

      • result : ConditionalCase