Package ptolemy.data.expr
Class ASTPtBitwiseNode
- java.lang.Object
-
- ptolemy.data.expr.ASTPtRootNode
-
- ptolemy.data.expr.ASTPtBitwiseNode
-
- All Implemented Interfaces:
java.lang.Cloneable,Node
public class ASTPtBitwiseNode extends ASTPtRootNode
The parse tree created from the expression string consists of a hierarchy of node objects. This class represents bitwise operator(&, |, ^) nodes in the parse tree.- Since:
- Ptolemy II 0.2
- Version:
- $Id$
- Author:
- Neil Smyth, Steve Neuendorffer
- See Also:
ASTPtRootNode,PtParser,Token- Pt.AcceptedRating:
- Red (cxh)
- Pt.ProposedRating:
- Yellow (nsmyth)
-
-
Field Summary
Fields Modifier and Type Field Description protected Token_lexicalToken-
Fields inherited from class ptolemy.data.expr.ASTPtRootNode
_children, _id, _isConstant, _parent, _ptToken, _ptType
-
-
Constructor Summary
Constructors Constructor Description ASTPtBitwiseNode(int id)ASTPtBitwiseNode(PtParser p, int id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TokengetOperator()Return the token that represents the operation of this node.booleanisBitwiseAnd()Return true if this operation represents a boolean AND operation.booleanisBitwiseOr()Return true if this operation represents a boolean OR operation.booleanisBitwiseXor()Return true if this operation represents a boolean XOR operation.booleanisCongruent(ASTPtRootNode node, java.util.Map renaming)Return true if this node is (hierarchically) congruent to the given node, under the given renaming of bound identifiers.voidvisit(ParseTreeVisitor visitor)Traverse this node with the given visitor.-
Methods inherited from class ptolemy.data.expr.ASTPtRootNode
clone, displayParseTree, evaluateParseTree, getToken, getType, isConstant, isEvaluated, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent, setConstant, setToken, setType, toString, toString
-
-
-
-
Field Detail
-
_lexicalToken
protected Token _lexicalToken
-
-
Constructor Detail
-
ASTPtBitwiseNode
public ASTPtBitwiseNode(int id)
-
ASTPtBitwiseNode
public ASTPtBitwiseNode(PtParser p, int id)
-
-
Method Detail
-
getOperator
public Token getOperator()
Return the token that represents the operation of this node.- Returns:
- the token that represents the operation of this node.
-
isBitwiseAnd
public boolean isBitwiseAnd()
Return true if this operation represents a boolean AND operation.- Returns:
- true if this operation represents a boolean AND operation.
-
isBitwiseOr
public boolean isBitwiseOr()
Return true if this operation represents a boolean OR operation.- Returns:
- true if this operation represents a boolean OR operation.
-
isBitwiseXor
public boolean isBitwiseXor()
Return true if this operation represents a boolean XOR operation.- Returns:
- true if this operation represents a boolean XOR operation.
-
isCongruent
public boolean isCongruent(ASTPtRootNode node, java.util.Map renaming)
Return true if this node is (hierarchically) congruent to the given node, under the given renaming of bound identifiers. Derived classes should extend this method to add additional necessary congruency checks.- Overrides:
isCongruentin classASTPtRootNode- Parameters:
node- The node to compare to.renaming- A map from String to String that gives a renaming from identifiers in this node to identifiers in the given node.- Returns:
- True if the node is congruent.
-
visit
public void visit(ParseTreeVisitor visitor) throws IllegalActionException
Traverse this node with the given visitor.- Overrides:
visitin classASTPtRootNode- Parameters:
visitor- The visitor.- Throws:
IllegalActionException- Always thrown in this base class the visit() method is not implemented here.
-
-