Package iota
Class IExpression
java.lang.Object
iota.IAST
iota.IStatement
iota.IExpression
- Direct Known Subclasses:
IBinaryExpression
,ILiteralBoolean
,ILiteralInt
,IMessageExpression
,IUnaryExpression
,IVariable
,IWildExpression
The AST node for an expression. Every expression has a type and a flag indicating whether or not it's a
statement-expression.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
Whether or not this expression is a statement.protected Type
Expression type.Fields inherited from class iota.IAST
compilationUnit, line
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
IExpression
(int line) Constructs an AST node for an expression. -
Method Summary
Modifier and TypeMethodDescriptionabstract IExpression
Analyzes and returns an IExpression.void
Performs short-circuit code generation for a boolean expression, given the code emitter, a target label, and whether we branch to that label on true or on false.type()
Returns the expression type.Methods inherited from class iota.IAST
codegen, line, preAnalyze, toJSON
-
Field Details
-
type
Expression type. -
isStatementExpression
protected boolean isStatementExpressionWhether or not this expression is a statement.
-
-
Constructor Details
-
IExpression
protected IExpression(int line) Constructs an AST node for an expression.- Parameters:
line
- line in which the expression occurs in the source file.
-
-
Method Details
-
type
Returns the expression type.- Returns:
- the expression type.
-
analyze
Analyzes and returns an IExpression. -
codegen
Performs short-circuit code generation for a boolean expression, given the code emitter, a target label, and whether we branch to that label on true or on false.- Parameters:
output
- the code emitter.targetLabel
- the label to which we should branch.onTrue
- do we branch on true?
-