Class BlockStatement

    • Constructor Detail

      • BlockStatement

        BlockStatement​(Node parent)
    • Method Detail

      • getVar

        public Variable getVar​(java.lang.String ident)
        Look up the ident to see if it has an associated Variable in this block.
      • isEmpty

        public boolean isEmpty()
        Return true iff this BlockStatement contains no local variables or statements.
      • body

        public java.util.List<Statement> body()
        Return the list of Statements in this BlockStatement.
      • exprFactory

        public ExpressionFactory exprFactory()
        Return the ExpressionFactory that must be used to create any expressions occuring either in expressions added to the body, or in other statements immediately contained in this BlockStatement.
      • addBreak

        public void addBreak()
        Add a break statement to this BlockStatement.
      • addReturn

        public void addReturn()
        Add an empty return to this BlockStatement. The enclosing MethodGenerator must have a void return type.
      • addReturn

        public void addReturn​(Expression expr)
        Add a return with an expression to this BlockStatement. The enclosing MethodGenerator must have a return type that is assignment compatible with the type of expr.
      • addThrow

        public void addThrow​(Expression expr)
      • checkSwitchExpressionType

        private void checkSwitchExpressionType​(Type type)
      • addExpression

        public void addExpression​(Expression expr)
      • accept

        public void accept​(Visitor visitor)
        Description copied from interface: Node
        Accept the visitor and allow it to perform actions on this Node.
        Specified by:
        accept in interface Node
        Overrides:
        accept in class NodeBase