jltools.ext.jl.ast
Class Binary_c
java.lang.Object
|
+--jltools.ext.jl.ast.Node_c
|
+--jltools.ext.jl.ast.Expr_c
|
+--jltools.ext.jl.ast.Binary_c
- All Implemented Interfaces:
- Binary, java.lang.Cloneable, Copy, Expr, Node, Prefix, Receiver, java.io.Serializable, Typed
- public class Binary_c
- extends Expr_c
- implements Binary
A Binary
represents a Java binary expression, an
immutable pair of expressions combined with an operator.
- See Also:
- Serialized Form
Fields inherited from class jltools.ext.jl.ast.Expr_c |
type |
Fields inherited from interface jltools.ast.Binary |
ADD, BIT_AND, BIT_OR, BIT_XOR, COND_AND, COND_OR, DIV, EQ, GE, GT, LE, LT, MOD, MUL, NE, SHL, SHR, SUB, USHR |
Methods inherited from class jltools.ext.jl.ast.Node_c |
buildTypes, buildTypesOverride_, buildTypesOverride, copy, disambiguate_, disambiguate, disambiguateOverride_, disambiguateOverride, disambiguateTypes_, disambiguateTypes, disambiguateTypesOverride_, disambiguateTypesOverride, enterScope, exceptionCheck, exceptionCheckOverride_, exceptionCheckOverride, ext, ext, foldConstants, foldConstantsOverride_, foldConstantsOverride, leaveScope, position, position, reconstructTypes, translate, translateBlock, translateSubstmt, typeCheck, typeCheckOverride_, typeCheckOverride, visit, visitList |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface jltools.ast.Expr |
type |
Methods inherited from interface jltools.ast.Node |
buildTypes_, buildTypesOverride_, copy, disambiguate_, disambiguateOverride_, disambiguateTypes_, disambiguateTypesOverride_, dump, enterScope, exceptionCheckOverride_, ext, ext, foldConstantsOverride_, leaveScope, position, position, reconstructTypes_, typeCheckOverride_, visit |
Methods inherited from interface jltools.ast.Typed |
type |
left
protected Expr left
op
protected jltools.ext.jl.ast.Operator op
right
protected Expr right
precedence
protected Precedence precedence
Binary_c
public Binary_c(Ext ext,
Position pos,
Expr left,
jltools.ext.jl.ast.Operator op,
Expr right)
left
public Expr left()
- Get the left operand of the expression.
- Specified by:
left
in interface Binary
left
public Binary left(Expr left)
- Set the left operand of the expression.
- Specified by:
left
in interface Binary
operator
public jltools.ext.jl.ast.Operator operator()
- Get the operator of the expression.
- Specified by:
operator
in interface Binary
operator
public Binary operator(jltools.ext.jl.ast.Operator op)
- Set the operator of the expression.
right
public Expr right()
- Get the right operand of the expression.
- Specified by:
right
in interface Binary
right
public Binary right(Expr right)
- Set the right operand of the expression.
- Specified by:
right
in interface Binary
precedence
public Precedence precedence()
- Get the precedence of the expression.
- Specified by:
precedence
in interface Expr
- Overrides:
precedence
in class Expr_c
precedence
protected Binary precedence(Precedence precedence)
reconstruct
protected Binary_c reconstruct(Expr left,
Expr right)
- Reconstruct the expression.
visitChildren
public Node visitChildren(NodeVisitor v)
- Visit the children of the expression.
- Specified by:
visitChildren
in interface Node
- Overrides:
visitChildren
in class Node_c
foldConstants_
public Node foldConstants_(ConstantFolder cf)
- Fold constants for the expression.
- Specified by:
foldConstants_
in interface Node
- Overrides:
foldConstants_
in class Node_c
typeCheck_
public Node typeCheck_(TypeChecker tc)
throws SemanticException
- Type check the expression.
- Specified by:
typeCheck_
in interface Node
- Overrides:
typeCheck_
in class Node_c
exceptionCheck_
public Node exceptionCheck_(ExceptionChecker ec)
throws SemanticException
- Check exceptions thrown by the expression.
- Specified by:
exceptionCheck_
in interface Node
- Overrides:
exceptionCheck_
in class Node_c
throwsArithmeticException
public boolean throwsArithmeticException()
- Get the throwsArithmeticException of the expression.
- Specified by:
throwsArithmeticException
in interface Binary
toString
public java.lang.String toString()
- Overrides:
toString
in class Node_c
translate_
public void translate_(CodeWriter w,
Translator tr)
- Write the expression to an output file.
- Specified by:
translate_
in interface Node
- Overrides:
translate_
in class Node_c
- Following copied from interface:
jltools.ast.Node
- Parameters:
w
- The code writer to which to write.tr
- The translation pass. This is not a visitor.