polyglot.ast
Interface Binary

All Superinterfaces:
java.lang.Cloneable, Copy, Expr, JL, Node, NodeOps, Prefix, Receiver, Term, Typed
All Known Implementing Classes:
Binary_c

public interface Binary
extends Expr

A Binary represents a Java binary expression, an immutable pair of expressions combined with an operator.


Nested Class Summary
static class Binary.Operator
          Binary expression operator.
 
Field Summary
static Binary.Operator ADD
           
static Binary.Operator BIT_AND
           
static Binary.Operator BIT_OR
           
static Binary.Operator BIT_XOR
           
static Binary.Operator COND_AND
           
static Binary.Operator COND_OR
           
static Binary.Operator DIV
           
static Binary.Operator EQ
           
static Binary.Operator GE
           
static Binary.Operator GT
           
static Binary.Operator LE
           
static Binary.Operator LT
           
static Binary.Operator MOD
           
static Binary.Operator MUL
           
static Binary.Operator NE
           
static Binary.Operator SHL
           
static Binary.Operator SHR
           
static Binary.Operator SUB
           
static Binary.Operator USHR
           
 
Method Summary
 Expr left()
          Left child of the binary.
 Binary left(Expr left)
          Set the left child of the binary.
 Binary.Operator operator()
          The binary's operator.
 Binary operator(Binary.Operator op)
          Set the binary's operator.
 Binary precedence(Precedence precedence)
          Set the precedence of the expression.
 Expr right()
          Right child of the binary.
 Binary right(Expr right)
          Set the right child of the binary.
 boolean throwsArithmeticException()
          Returns true if the binary might throw an arithmetic exception, such as division by zero.
 
Methods inherited from interface polyglot.ast.Expr
constantValue, isConstant, precedence, printSubExpr, printSubExpr, type
 
Methods inherited from interface polyglot.ast.Node
childExpectedType, del, del, dump, ext, ext, ext, ext, position, position, visit, visitChild, visitEdge, visitList
 
Methods inherited from interface polyglot.ast.JL
init, node
 
Methods inherited from interface polyglot.ast.NodeOps
addDecls, addMembers, addMembersEnter, buildTypes, buildTypesEnter, disambiguate, disambiguateEnter, enterScope, enterScope, exceptionCheck, exceptionCheckEnter, prettyPrint, throwTypes, translate, typeCheck, typeCheckEnter, visitChildren
 
Methods inherited from interface polyglot.util.Copy
copy
 
Methods inherited from interface polyglot.ast.Typed
type
 
Methods inherited from interface polyglot.ast.Term
acceptCFG, entry, exceptions, exceptions, reachable, reachable
 

Field Detail

GT

static final Binary.Operator GT

LT

static final Binary.Operator LT

EQ

static final Binary.Operator EQ

LE

static final Binary.Operator LE

GE

static final Binary.Operator GE

NE

static final Binary.Operator NE

COND_OR

static final Binary.Operator COND_OR

COND_AND

static final Binary.Operator COND_AND

ADD

static final Binary.Operator ADD

SUB

static final Binary.Operator SUB

MUL

static final Binary.Operator MUL

DIV

static final Binary.Operator DIV

MOD

static final Binary.Operator MOD

BIT_OR

static final Binary.Operator BIT_OR

BIT_AND

static final Binary.Operator BIT_AND

BIT_XOR

static final Binary.Operator BIT_XOR

SHL

static final Binary.Operator SHL

SHR

static final Binary.Operator SHR

USHR

static final Binary.Operator USHR
Method Detail

left

Expr left()
Left child of the binary.


left

Binary left(Expr left)
Set the left child of the binary.


operator

Binary.Operator operator()
The binary's operator.


operator

Binary operator(Binary.Operator op)
Set the binary's operator.


right

Expr right()
Right child of the binary.


right

Binary right(Expr right)
Set the right child of the binary.


throwsArithmeticException

boolean throwsArithmeticException()
Returns true if the binary might throw an arithmetic exception, such as division by zero.


precedence

Binary precedence(Precedence precedence)
Set the precedence of the expression.