001/* ASTPtFunctionalIfNode represents method calls on other Tokens and functional
002 if-then else (?:) constructs.
003
004 Copyright (c) 1998-2014 The Regents of the University of California.
005 All rights reserved.
006 Permission is hereby granted, without written agreement and without
007 license or royalty fees, to use, copy, modify, and distribute this
008 software and its documentation for any purpose, provided that the above
009 copyright notice and the following two paragraphs appear in all copies
010 of this software.
011
012 IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
013 FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
014 ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
015 THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
016 SUCH DAMAGE.
017
018 THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
019 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
020 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
021 PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
022 CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
023 ENHANCEMENTS, OR MODIFICATIONS.
024
025 PT_COPYRIGHT_VERSION_2
026 COPYRIGHTENDKEY
027
028
029 Created : May 1998
030
031 */
032package ptolemy.data.expr;
033
034import ptolemy.kernel.util.IllegalActionException;
035
036//////////////////////////////////////////////////////////////////////////
037//// ASTPtFunctionalIfNode
038
039/**
040 The parse tree created from the expression string consists of a
041 hierarchy of node objects. This class represents functional if-then-else
042 nodes.
043 <p>
044 A functional if-then-else if of the form booleanToken ? token : token
045 The token returned depends on the value of the boolean.
046 <p>
047 @author Neil Smyth
048 @version $Id$
049 @since Ptolemy II 0.2
050 @Pt.ProposedRating Yellow (nsmyth)
051 @Pt.AcceptedRating Red (cxh)
052 @see ptolemy.data.expr.ASTPtRootNode
053 @see ptolemy.data.expr.PtParser
054 @see ptolemy.data.Token
055 */
056public class ASTPtFunctionalIfNode extends ASTPtRootNode {
057    public ASTPtFunctionalIfNode(int id) {
058        super(id);
059    }
060
061    public ASTPtFunctionalIfNode(PtParser p, int id) {
062        super(p, id);
063    }
064
065    /** Traverse this node with the given visitor.
066     */
067    @Override
068    public void visit(ParseTreeVisitor visitor) throws IllegalActionException {
069        visitor.visitFunctionalIfNode(this);
070    }
071}