jltools.ext.jl.ast
Class Unary_c

java.lang.Object
  |
  +--jltools.ext.jl.ast.Node_c
        |
        +--jltools.ext.jl.ast.Expr_c
              |
              +--jltools.ext.jl.ast.Unary_c
All Implemented Interfaces:
java.lang.Cloneable, Copy, Expr, Node, Prefix, Receiver, java.io.Serializable, Typed, Unary

public class Unary_c
extends Expr_c
implements Unary

A Unary represents a Java unary expression, an immutable pair of an expression and an an operator.

See Also:
Serialized Form

Inner classes inherited from class jltools.ext.jl.ast.Node_c
Node_c.StringCodeWriter
 
Inner classes inherited from class jltools.ast.Unary
Unary.Operator
 
Field Summary
protected  Expr expr
           
protected  Unary.Operator op
           
 
Fields inherited from class jltools.ext.jl.ast.Expr_c
type
 
Fields inherited from class jltools.ext.jl.ast.Node_c
ext, position
 
Fields inherited from interface jltools.ast.Unary
BIT_NOT, NEG, NOT, POS, POST_DEC, POST_INC, PRE_DEC, PRE_INC
 
Constructor Summary
Unary_c(Ext ext, Position pos, Unary.Operator op, Expr expr)
           
 
Method Summary
 Expr expr()
          Get the sub-expression of the expression.
 Unary expr(Expr expr)
          Set the sub-expression of the expression.
 Node foldConstants_(ConstantFolder cf)
          Fold constants for the expression.
 Unary.Operator operator()
          Get the operator.
 Unary operator(Unary.Operator op)
          Set the operator.
 Precedence precedence()
          Get the precedence of the expression.
protected  Unary_c reconstruct(Expr expr)
          Reconstruct the expression.
 java.lang.String toString()
           
 void translate_(CodeWriter w, Translator tr)
          Translate the AST using the given code writer.
 Node typeCheck_(TypeChecker tc)
          Type check the expression.
 Node visitChildren(NodeVisitor v)
          Visit the children of the expression.
 
Methods inherited from class jltools.ext.jl.ast.Expr_c
buildTypes_, dump, reconstructTypes_, translateSubexpr, type, type
 
Methods inherited from class jltools.ext.jl.ast.Node_c
buildTypes, buildTypesOverride_, buildTypesOverride, copy, disambiguate_, disambiguate, disambiguateOverride_, disambiguateOverride, disambiguateTypes_, disambiguateTypes, disambiguateTypesOverride_, disambiguateTypesOverride, enterScope, exceptionCheck_, 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, exceptionCheck_, exceptionCheckOverride_, ext, ext, foldConstantsOverride_, leaveScope, position, position, reconstructTypes_, typeCheckOverride_, visit
 
Methods inherited from interface jltools.ast.Typed
type
 

Field Detail

op

protected Unary.Operator op

expr

protected Expr expr
Constructor Detail

Unary_c

public Unary_c(Ext ext,
               Position pos,
               Unary.Operator op,
               Expr expr)
Method Detail

precedence

public Precedence precedence()
Get the precedence of the expression.
Specified by:
precedence in interface Expr
Overrides:
precedence in class Expr_c

expr

public Expr expr()
Get the sub-expression of the expression.
Specified by:
expr in interface Unary

expr

public Unary expr(Expr expr)
Set the sub-expression of the expression.
Specified by:
expr in interface Unary

operator

public Unary.Operator operator()
Get the operator.
Specified by:
operator in interface Unary

operator

public Unary operator(Unary.Operator op)
Set the operator.
Specified by:
operator in interface Unary

reconstruct

protected Unary_c reconstruct(Expr expr)
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

toString

public java.lang.String toString()
Overrides:
toString in class Node_c

translate_

public void translate_(CodeWriter w,
                       Translator tr)
Description copied from interface: Node
Translate the AST using the given code writer.
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.