1 31 package org.jruby.lexer.yacc; 32 33 37 public final class LexState { 38 public static final LexState EXPR_BEG = new LexState("EXPR_BEG"); 39 public static final LexState EXPR_END = new LexState("EXPR_END"); 40 public static final LexState EXPR_ARG = new LexState("EXPR_ARG"); 41 public static final LexState EXPR_CMDARG = new LexState("EXPR_CMDARG"); 42 public static final LexState EXPR_ENDARG = new LexState("EXPR_ENDARG"); 43 public static final LexState EXPR_MID = new LexState("EXPR_MID"); 44 public static final LexState EXPR_FNAME = new LexState("EXPR_FNAME"); 45 public static final LexState EXPR_DOT = new LexState("EXPR_DOT"); 46 public static final LexState EXPR_CLASS = new LexState("EXPR_CLASS"); 47 48 private final String debug; 49 50 private LexState(String debug) { 51 this.debug = debug; 52 } 53 54 public boolean isExprBeg() { 55 return this == EXPR_BEG; 56 } 57 58 public boolean isExprEnd() { 59 return this == EXPR_END; 60 } 61 62 public boolean isExprArg() { 63 return this == EXPR_ARG; 64 } 65 66 public boolean isExprCmdArg() { 67 return this == EXPR_CMDARG; 68 } 69 70 public boolean isExprEndArg() { 71 return this == EXPR_ENDARG; 72 } 73 74 public boolean isExprMid() { 75 return this == EXPR_MID; 76 } 77 78 public boolean isExprFName() { 79 return this == EXPR_FNAME; 80 } 81 82 public boolean isExprDot() { 83 return this == EXPR_DOT; 84 } 85 86 public boolean isExprClass() { 87 return this == EXPR_CLASS; 88 } 89 90 public boolean isArgument () { 91 return this == EXPR_ARG || this == EXPR_CMDARG; 92 } 93 94 public String toString() { 95 return debug; 96 } 97 } 98 | Popular Tags |