Class BoxForIn

All Implemented Interfaces:
BoxVisitable

public class BoxForIn extends BoxStatement
AST Node representing a for statement
  • Constructor Details

    • BoxForIn

      public BoxForIn(String label, BoxExpression variable, BoxExpression expression, BoxStatement body, Boolean hasVar, Position position, String sourceText)
      Creates the AST node
      Parameters:
      variable - for loop variable
      expression - for loop collection
      body - list of the statement in the body of the loop
      position - position of the statement in the source code
      sourceText - source code that originated the Node
  • Method Details

    • getVariable

      public BoxExpression getVariable()
    • getExpression

      public BoxExpression getExpression()
    • getBody

      public BoxStatement getBody()
    • getHasVar

      public Boolean getHasVar()
    • setVariable

      public void setVariable(BoxExpression variable)
    • setExpression

      public void setExpression(BoxExpression expression)
    • setBody

      public void setBody(BoxStatement body)
    • setHasVar

      public void setHasVar(Boolean hasVar)
    • getLabel

      public String getLabel()
      Gets the label of the statement
      Returns:
      the label of the statement
    • setLabel

      public void setLabel(String label)
      Sets the label of the statement
      Parameters:
      label - the label of the statement
    • toMap

      public Map<String,Object> toMap()
      Overrides:
      toMap in class BoxNode
    • accept

      public void accept(VoidBoxVisitor v)
      Description copied from interface: BoxVisitable
      Accept method for visitor support.
      Parameters:
      v - the visitor implementation
    • accept

      public BoxNode accept(ReplacingBoxVisitor v)
      Description copied from interface: BoxVisitable
      Accept method for replacing visitor support. Each accept returns the node, or a replacement node.
      Parameters:
      v - the visitor implementation