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.UnaryExpression;
    8
    9   public class ASTUnaryExpression extends AbstractEcmascriptNode<UnaryExpression> {
    10      public ASTUnaryExpression(UnaryExpression unaryExpression) {
    11  	super(unaryExpression);
    12  	super.setImage(AstRoot.operatorToString(unaryExpression.getOperator()));
    13      }
    14
    15      /**
    16       * Accept the visitor.
    17       */
    18      @Override
    19      public Object jjtAccept(EcmascriptParserVisitor visitor, Object data) {
    20  	return visitor.visit(this, data);
    21      }
    22
    23      public EcmascriptNode getOperand() {
    24  	return (EcmascriptNode)jjtGetChild(0);
    25      }
    26
    27      public boolean isPrefix() {
    28  	return node.isPrefix();
    29      }
    30
    31      public boolean isPostfix() {
    32  	return node.isPostfix();
    33      }
    34  }