View Javadoc

    1   /**
    2    * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
    3    */
    4   package net.sourceforge.pmd.lang.ecmascript.ast;
    5
    6   import org.mozilla.javascript.ast.AstRoot;
    7   import org.mozilla.javascript.ast.InfixExpression;
    8
    9   public class AbstractInfixEcmascriptNode<T extends InfixExpression> extends AbstractEcmascriptNode<T> {
    10
    11      public AbstractInfixEcmascriptNode(T infixExpression) {
    12  	this(infixExpression, true);
    13      }
    14
    15      public AbstractInfixEcmascriptNode(T infixExpression, boolean setImage) {
    16  	super(infixExpression);
    17  	if (setImage) {
    18  	    super.setImage(AstRoot.operatorToString(infixExpression.getOperator()));
    19  	}
    20      }
    21
    22      public EcmascriptNode getLeft() {
    23  	return (EcmascriptNode) jjtGetChild(0);
    24      }
    25
    26      public EcmascriptNode getRight() {
    27  	return (EcmascriptNode) jjtGetChild(1);
    28      }
    29  }