1 16 package com.google.gwt.dev.js.ast; 17 18 21 public final class JsUnaryOperator extends JsOperator { 22 26 public static final JsUnaryOperator BIT_NOT = create("~", 14, PREFIX); 27 public static final JsUnaryOperator NEG = create("-", 14, PREFIX); 28 public static final JsUnaryOperator NOT = create("!", 14, PREFIX); 29 public static final JsUnaryOperator DEC = create("--", 14, POSTFIX | PREFIX); 30 public static final JsUnaryOperator INC = create("++", 14, POSTFIX | PREFIX); 31 public static final JsUnaryOperator DELETE = create("delete", 14, PREFIX); 32 public static final JsUnaryOperator TYPEOF = create("typeof", 14, PREFIX); 33 public static final JsUnaryOperator VOID = create("void", 14, PREFIX); 34 35 private static JsUnaryOperator create(String symbol, int precedence, int mask) { 36 JsUnaryOperator op = new JsUnaryOperator(symbol, precedence, mask); 37 return op; 38 } 39 40 private JsUnaryOperator(String symbol, int precedence, int mask) { 41 super(symbol, precedence, mask); 42 } 43 44 public boolean isKeyword() { 45 return this == DELETE || this == TYPEOF || this == VOID; 46 } 47 48 public boolean isModifying() { 49 return this == DEC || this == INC || this == DELETE; 50 } 51 } 52 | Popular Tags |