Class ASTPtLogicalNode

  • All Implemented Interfaces:
    java.lang.Cloneable, Node

    public class ASTPtLogicalNode
    extends ASTPtRootNode
    The parse tree created from the expression string consists of a hierarchy of node objects. This class represents logical 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 Detail

      • _lexicalToken

        protected Token _lexicalToken
    • Constructor Detail

      • ASTPtLogicalNode

        public ASTPtLogicalNode​(int id)
      • ASTPtLogicalNode

        public ASTPtLogicalNode​(PtParser p,
                                int id)
    • Method Detail

      • getOperator

        public Token getOperator()
        Return the operator for child nodes of this node.
        Returns:
        the operator for child nodes of this node.
      • 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:
        isCongruent in class ASTPtRootNode
        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.
      • isLogicalAnd

        public boolean isLogicalAnd()
        Return true if the node represents the logical AND of its children.
        Returns:
        true if the node represents the logical AND of its children.
      • isLogicalOr

        public boolean isLogicalOr()
        Return true if the node represents the logical OR of its children.
        Returns:
        true if the node represents the logical OR of its children.