Package autumn.lang.compiler.ast.nodes
Class WhenStatement
java.lang.Object
autumn.lang.compiler.ast.nodes.WhenStatement
- All Implemented Interfaces:
IConstruct,IStatement
An instance of this class is an AST node that represents a when statement.
| Property Name | Property Description |
condition | This condition controls the execution of the body. |
body | This is the statement that is conditionally executed. |
location | This is the source-location information regarding this construct. |
This file was auto-generated on (Sun May 31 11:54:11 EDT 2015).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(IAstVisitor visitor) This method welcomes a visitor that wants to visit this object.copy()This method creates a shallow copy of this object.static WhenStatementcreate(IExpression condition, IStatement body, SourceLocation location) This method creates a new instance of this class.getBody()Getter.Getter.Getter.setBody(IStatement value) Setter.setCondition(IExpression value) Setter.setLocation(SourceLocation value) Setter.toMap()This method creates a map representation of this struct.toString()
-
Constructor Details
-
WhenStatement
public WhenStatement()
-
-
Method Details
-
setCondition
Setter.- Parameters:
value- is the new value of propertycondition.- Returns:
- a copy of this object with property
conditionset to value.
-
getCondition
Getter.- Returns:
- the value of property
condition.
-
setBody
Setter.- Parameters:
value- is the new value of propertybody.- Returns:
- a copy of this object with property
bodyset to value.
-
getBody
Getter.- Returns:
- the value of property
body.
-
setLocation
Setter.- Specified by:
setLocationin interfaceIConstruct- Parameters:
value- is the new value of propertylocation.- Returns:
- a copy of this object with property
locationset to value.
-
getLocation
Getter.- Specified by:
getLocationin interfaceIConstruct- Returns:
- the value of property
location.
-
create
This method creates a new instance of this class.- Parameters:
condition- is the value for propertycondition.body- is the value for propertybody.location- is the value for propertylocation.- Returns:
- a new instance of this class.
-
accept
This method welcomes a visitor that wants to visit this object.- Specified by:
acceptin interfaceIConstruct- Parameters:
visitor- is the visitor that is visiting this object.
-
copy
This method creates a shallow copy of this object.- Specified by:
copyin interfaceIConstruct- Returns:
- a shallow copy of this object.
-
toMap
This method creates a map representation of this struct.Each key is the name of a field. Each value is the result of calling the key field's getter.
- Returns:
- a map containing the entries in this struct.
-
toString
-