PageRenderTime 50ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/groovy-eclipse/org.codehaus.groovy.eclipse.core/src/org/codehaus/groovy/eclipse/core/compiler/internal/antlr/GroovyLexer.java

http://groovy-eclipse.googlecode.com/
Java | 2004 lines | 1944 code | 31 blank | 29 comment | 111 complexity | 747e7a839ee1edcdb5655930d962160b MD5 | raw file
Possible License(s): Apache-2.0

Large files files are truncated, but you can click here to view the full file

  1. // $ANTLR 2.7.7 (20060930): "groovy.g" -> "GroovyLexer.java"$
  2. package org.codehaus.groovy.eclipse.core.compiler.internal.antlr;
  3. import org.codehaus.groovy.antlr.*;
  4. import java.util.*;
  5. import java.io.InputStream;
  6. import java.io.Reader;
  7. import antlr.InputBuffer;
  8. import antlr.LexerSharedInputState;
  9. import antlr.CommonToken;
  10. import org.codehaus.groovy.GroovyBugError;
  11. import antlr.TokenStreamRecognitionException;
  12. import java.io.InputStream;
  13. import antlr.TokenStreamException;
  14. import antlr.TokenStreamIOException;
  15. import antlr.TokenStreamRecognitionException;
  16. import antlr.CharStreamException;
  17. import antlr.CharStreamIOException;
  18. import antlr.ANTLRException;
  19. import java.io.Reader;
  20. import java.util.Hashtable;
  21. import antlr.CharScanner;
  22. import antlr.InputBuffer;
  23. import antlr.ByteBuffer;
  24. import antlr.CharBuffer;
  25. import antlr.Token;
  26. import antlr.CommonToken;
  27. import antlr.RecognitionException;
  28. import antlr.NoViableAltForCharException;
  29. import antlr.MismatchedCharException;
  30. import antlr.TokenStream;
  31. import antlr.ANTLRHashString;
  32. import antlr.LexerSharedInputState;
  33. import antlr.collections.impl.BitSet;
  34. import antlr.SemanticException;
  35. public class GroovyLexer extends antlr.CharScanner implements GroovyTokenTypes, TokenStream
  36. {
  37. /** flag for enabling the "assert" keyword */
  38. private boolean assertEnabled = true;
  39. /** flag for enabling the "enum" keyword */
  40. private boolean enumEnabled = true;
  41. /** flag for including whitespace tokens (for IDE preparsing) */
  42. private boolean whitespaceIncluded = false;
  43. /** Enable the "assert" keyword */
  44. public void enableAssert(boolean shouldEnable) { assertEnabled = shouldEnable; }
  45. /** Query the "assert" keyword state */
  46. public boolean isAssertEnabled() { return assertEnabled; }
  47. /** Enable the "enum" keyword */
  48. public void enableEnum(boolean shouldEnable) { enumEnabled = shouldEnable; }
  49. /** Query the "enum" keyword state */
  50. public boolean isEnumEnabled() { return enumEnabled; }
  51. /** Include whitespace tokens. Note that this breaks the parser. */
  52. public void setWhitespaceIncluded(boolean z) { whitespaceIncluded = z; }
  53. /** Are whitespace tokens included? */
  54. public boolean isWhitespaceIncluded() { return whitespaceIncluded; }
  55. {
  56. // Initialization actions performed on construction.
  57. setTabSize(1); // get rid of special tab interpretation, for IDEs and general clarity
  58. }
  59. /** Bumped when inside '[x]' or '(x)', reset inside '{x}'. See ONE_NL. */
  60. protected int parenLevel = 0;
  61. protected int suppressNewline = 0; // be really mean to newlines inside strings
  62. protected static final int SCS_TYPE = 3, SCS_VAL = 4, SCS_LIT = 8, SCS_LIMIT = 16;
  63. protected static final int SCS_SQ_TYPE = 0, SCS_TQ_TYPE = 1, SCS_RE_TYPE = 2;
  64. protected int stringCtorState = 0; // hack string and regexp constructor boundaries
  65. /** Push parenLevel here and reset whenever inside '{x}'. */
  66. protected ArrayList parenLevelStack = new ArrayList();
  67. protected int lastSigTokenType = EOF; // last returned non-whitespace token
  68. public void setTokenObjectClass(String name) {/*ignore*/}
  69. protected Token makeToken(int t) {
  70. GroovySourceToken tok = new GroovySourceToken(t);
  71. tok.setColumn(inputState.getTokenStartColumn());
  72. tok.setLine(inputState.getTokenStartLine());
  73. tok.setColumnLast(inputState.getColumn());
  74. tok.setLineLast(inputState.getLine());
  75. return tok;
  76. }
  77. protected void pushParenLevel() {
  78. parenLevelStack.add(Integer.valueOf(parenLevel*SCS_LIMIT + stringCtorState));
  79. parenLevel = 0;
  80. stringCtorState = 0;
  81. }
  82. protected void popParenLevel() {
  83. int npl = parenLevelStack.size();
  84. if (npl == 0) return;
  85. int i = ((Integer) parenLevelStack.remove(--npl)).intValue();
  86. parenLevel = i / SCS_LIMIT;
  87. stringCtorState = i % SCS_LIMIT;
  88. }
  89. protected void restartStringCtor(boolean expectLiteral) {
  90. if (stringCtorState != 0) {
  91. stringCtorState = (expectLiteral? SCS_LIT: SCS_VAL) + (stringCtorState & SCS_TYPE);
  92. }
  93. }
  94. protected boolean allowRegexpLiteral() {
  95. return !isExpressionEndingToken(lastSigTokenType);
  96. }
  97. /** Return true for an operator or punctuation which can end an expression.
  98. * Return true for keywords, identifiers, and literals.
  99. * Return true for tokens which can end expressions (right brackets, ++, --).
  100. * Return false for EOF and all other operator and punctuation tokens.
  101. * Used to suppress the recognition of /foo/ as opposed to the simple division operator '/'.
  102. */
  103. // Cf. 'constant' and 'balancedBrackets' rules in the grammar.)
  104. protected static boolean isExpressionEndingToken(int ttype) {
  105. switch (ttype) {
  106. case INC: // x++ / y
  107. case DEC: // x-- / y
  108. case RPAREN: // (x) / y
  109. case RBRACK: // f[x] / y
  110. case RCURLY: // f{x} / y
  111. case STRING_LITERAL: // "x" / y
  112. case STRING_CTOR_END: // "$x" / y
  113. case NUM_INT: // 0 / y
  114. case NUM_FLOAT: // 0f / y
  115. case NUM_LONG: // 0l / y
  116. case NUM_DOUBLE: // 0.0 / y
  117. case NUM_BIG_INT: // 0g / y
  118. case NUM_BIG_DECIMAL: // 0.0g / y
  119. case IDENT: // x / y
  120. // and a bunch of keywords (all of them; no sense picking and choosing):
  121. case LITERAL_as:
  122. case LITERAL_assert:
  123. case LITERAL_boolean:
  124. case LITERAL_break:
  125. case LITERAL_byte:
  126. case LITERAL_case:
  127. case LITERAL_catch:
  128. case LITERAL_char:
  129. case LITERAL_class:
  130. case LITERAL_continue:
  131. case LITERAL_def:
  132. case LITERAL_default:
  133. case LITERAL_double:
  134. case LITERAL_else:
  135. case LITERAL_enum:
  136. case LITERAL_extends:
  137. case LITERAL_false:
  138. case LITERAL_finally:
  139. case LITERAL_float:
  140. case LITERAL_for:
  141. case LITERAL_if:
  142. case LITERAL_implements:
  143. case LITERAL_import:
  144. case LITERAL_in:
  145. case LITERAL_instanceof:
  146. case LITERAL_int:
  147. case LITERAL_interface:
  148. case LITERAL_long:
  149. case LITERAL_native:
  150. case LITERAL_new:
  151. case LITERAL_null:
  152. case LITERAL_package:
  153. case LITERAL_private:
  154. case LITERAL_protected:
  155. case LITERAL_public:
  156. case LITERAL_return:
  157. case LITERAL_short:
  158. case LITERAL_static:
  159. case LITERAL_super:
  160. case LITERAL_switch:
  161. case LITERAL_synchronized:
  162. case LITERAL_this:
  163. case LITERAL_threadsafe:
  164. case LITERAL_throw:
  165. case LITERAL_throws:
  166. case LITERAL_transient:
  167. case LITERAL_true:
  168. case LITERAL_try:
  169. case LITERAL_void:
  170. case LITERAL_volatile:
  171. case LITERAL_while:
  172. return true;
  173. default:
  174. return false;
  175. }
  176. }
  177. protected void newlineCheck(boolean check) throws RecognitionException {
  178. if (check && suppressNewline > 0) {
  179. require(suppressNewline == 0,
  180. "end of line reached within a simple string 'x' or \"x\" or /x/",
  181. "for multi-line literals, use triple quotes '''x''' or \"\"\"x\"\"\"");
  182. suppressNewline = 0; // shut down any flood of errors
  183. }
  184. newline();
  185. }
  186. protected boolean atValidDollarEscape() throws CharStreamException {
  187. // '$' (('*')? ('{' | LETTER)) =>
  188. int k = 1;
  189. char lc = LA(k++);
  190. if (lc != '$') return false;
  191. lc = LA(k++);
  192. if (lc == '*') lc = LA(k++);
  193. return (lc == '{' || (lc != '$' && Character.isJavaIdentifierStart(lc)));
  194. }
  195. /** This is a bit of plumbing which resumes collection of string constructor bodies,
  196. * after an embedded expression has been parsed.
  197. * Usage: new GroovyRecognizer(new GroovyLexer(in).plumb()).
  198. */
  199. public TokenStream plumb() {
  200. return new TokenStream() {
  201. public Token nextToken() throws TokenStreamException {
  202. if (stringCtorState >= SCS_LIT) {
  203. // This goo is modeled upon the ANTLR code for nextToken:
  204. int quoteType = (stringCtorState & SCS_TYPE);
  205. stringCtorState = 0; // get out of this mode, now
  206. resetText();
  207. try {
  208. switch (quoteType) {
  209. case SCS_SQ_TYPE:
  210. mSTRING_CTOR_END(true, /*fromStart:*/false, false); break;
  211. case SCS_TQ_TYPE:
  212. mSTRING_CTOR_END(true, /*fromStart:*/false, true); break;
  213. case SCS_RE_TYPE:
  214. mREGEXP_CTOR_END(true, /*fromStart:*/false); break;
  215. default: throw new AssertionError(false);
  216. }
  217. lastSigTokenType = _returnToken.getType();
  218. return _returnToken;
  219. } catch (RecognitionException e) {
  220. throw new TokenStreamRecognitionException(e);
  221. } catch (CharStreamException cse) {
  222. if ( cse instanceof CharStreamIOException ) {
  223. throw new TokenStreamIOException(((CharStreamIOException)cse).io);
  224. }
  225. else {
  226. throw new TokenStreamException(cse.getMessage());
  227. }
  228. }
  229. }
  230. Token token = GroovyLexer.this.nextToken();
  231. int lasttype = token.getType();
  232. if (whitespaceIncluded) {
  233. switch (lasttype) { // filter out insignificant types
  234. case WS:
  235. case ONE_NL:
  236. case SL_COMMENT:
  237. case ML_COMMENT:
  238. lasttype = lastSigTokenType; // back up!
  239. }
  240. }
  241. lastSigTokenType = lasttype;
  242. return token;
  243. }
  244. };
  245. }
  246. // stuff to adjust ANTLR's tracing machinery
  247. public static boolean tracing = false; // only effective if antlr.Tool is run with -traceLexer
  248. public void traceIn(String rname) throws CharStreamException {
  249. if (!GroovyLexer.tracing) return;
  250. super.traceIn(rname);
  251. }
  252. public void traceOut(String rname) throws CharStreamException {
  253. if (!GroovyLexer.tracing) return;
  254. if (_returnToken != null) rname += tokenStringOf(_returnToken);
  255. super.traceOut(rname);
  256. }
  257. private static java.util.HashMap ttypes;
  258. private static String tokenStringOf(Token t) {
  259. if (ttypes == null) {
  260. java.util.HashMap map = new java.util.HashMap();
  261. java.lang.reflect.Field[] fields = GroovyTokenTypes.class.getDeclaredFields();
  262. for (int i = 0; i < fields.length; i++) {
  263. if (fields[i].getType() != int.class) continue;
  264. try {
  265. map.put(fields[i].get(null), fields[i].getName());
  266. } catch (IllegalAccessException ee) {
  267. }
  268. }
  269. ttypes = map;
  270. }
  271. Integer tt = Integer.valueOf(t.getType());
  272. Object ttn = ttypes.get(tt);
  273. if (ttn == null) ttn = "<"+tt+">";
  274. return "["+ttn+",\""+t.getText()+"\"]";
  275. }
  276. protected GroovyRecognizer parser; // little-used link; TODO: get rid of
  277. private void require(boolean z, String problem, String solution) throws SemanticException {
  278. // TODO: Direct to a common error handler, rather than through the parser.
  279. if (!z) parser.requireFailed(problem, solution);
  280. }
  281. public GroovyLexer(InputStream in) {
  282. this(new ByteBuffer(in));
  283. }
  284. public GroovyLexer(Reader in) {
  285. this(new CharBuffer(in));
  286. }
  287. public GroovyLexer(InputBuffer ib) {
  288. this(new LexerSharedInputState(ib));
  289. }
  290. public GroovyLexer(LexerSharedInputState state) {
  291. super(state);
  292. caseSensitiveLiterals = true;
  293. setCaseSensitive(true);
  294. literals = new Hashtable();
  295. literals.put(new ANTLRHashString("byte", this), new Integer(102));
  296. literals.put(new ANTLRHashString("public", this), new Integer(112));
  297. literals.put(new ANTLRHashString("case", this), new Integer(146));
  298. literals.put(new ANTLRHashString("short", this), new Integer(104));
  299. literals.put(new ANTLRHashString("break", this), new Integer(140));
  300. literals.put(new ANTLRHashString("while", this), new Integer(135));
  301. literals.put(new ANTLRHashString("new", this), new Integer(155));
  302. literals.put(new ANTLRHashString("instanceof", this), new Integer(154));
  303. literals.put(new ANTLRHashString("implements", this), new Integer(128));
  304. literals.put(new ANTLRHashString("synchronized", this), new Integer(117));
  305. literals.put(new ANTLRHashString("const", this), new Integer(40));
  306. literals.put(new ANTLRHashString("float", this), new Integer(106));
  307. literals.put(new ANTLRHashString("package", this), new Integer(78));
  308. literals.put(new ANTLRHashString("return", this), new Integer(139));
  309. literals.put(new ANTLRHashString("throw", this), new Integer(142));
  310. literals.put(new ANTLRHashString("null", this), new Integer(156));
  311. literals.put(new ANTLRHashString("def", this), new Integer(81));
  312. literals.put(new ANTLRHashString("threadsafe", this), new Integer(116));
  313. literals.put(new ANTLRHashString("protected", this), new Integer(113));
  314. literals.put(new ANTLRHashString("class", this), new Integer(89));
  315. literals.put(new ANTLRHashString("throws", this), new Integer(127));
  316. literals.put(new ANTLRHashString("do", this), new Integer(41));
  317. literals.put(new ANTLRHashString("strictfp", this), new Integer(42));
  318. literals.put(new ANTLRHashString("super", this), new Integer(95));
  319. literals.put(new ANTLRHashString("transient", this), new Integer(114));
  320. literals.put(new ANTLRHashString("native", this), new Integer(115));
  321. literals.put(new ANTLRHashString("interface", this), new Integer(90));
  322. literals.put(new ANTLRHashString("final", this), new Integer(37));
  323. literals.put(new ANTLRHashString("if", this), new Integer(133));
  324. literals.put(new ANTLRHashString("double", this), new Integer(108));
  325. literals.put(new ANTLRHashString("volatile", this), new Integer(118));
  326. literals.put(new ANTLRHashString("as", this), new Integer(110));
  327. literals.put(new ANTLRHashString("assert", this), new Integer(143));
  328. literals.put(new ANTLRHashString("catch", this), new Integer(149));
  329. literals.put(new ANTLRHashString("try", this), new Integer(147));
  330. literals.put(new ANTLRHashString("goto", this), new Integer(39));
  331. literals.put(new ANTLRHashString("enum", this), new Integer(91));
  332. literals.put(new ANTLRHashString("int", this), new Integer(105));
  333. literals.put(new ANTLRHashString("for", this), new Integer(137));
  334. literals.put(new ANTLRHashString("extends", this), new Integer(94));
  335. literals.put(new ANTLRHashString("boolean", this), new Integer(101));
  336. literals.put(new ANTLRHashString("char", this), new Integer(103));
  337. literals.put(new ANTLRHashString("private", this), new Integer(111));
  338. literals.put(new ANTLRHashString("default", this), new Integer(126));
  339. literals.put(new ANTLRHashString("false", this), new Integer(153));
  340. literals.put(new ANTLRHashString("this", this), new Integer(129));
  341. literals.put(new ANTLRHashString("static", this), new Integer(80));
  342. literals.put(new ANTLRHashString("abstract", this), new Integer(38));
  343. literals.put(new ANTLRHashString("continue", this), new Integer(141));
  344. literals.put(new ANTLRHashString("finally", this), new Integer(148));
  345. literals.put(new ANTLRHashString("else", this), new Integer(134));
  346. literals.put(new ANTLRHashString("import", this), new Integer(79));
  347. literals.put(new ANTLRHashString("in", this), new Integer(138));
  348. literals.put(new ANTLRHashString("void", this), new Integer(100));
  349. literals.put(new ANTLRHashString("switch", this), new Integer(136));
  350. literals.put(new ANTLRHashString("true", this), new Integer(157));
  351. literals.put(new ANTLRHashString("long", this), new Integer(107));
  352. }
  353. public Token nextToken() throws TokenStreamException {
  354. Token theRetToken=null;
  355. tryAgain:
  356. for (;;) {
  357. Token _token = null;
  358. int _ttype = Token.INVALID_TYPE;
  359. resetText();
  360. try { // for char stream error handling
  361. try { // for lexical error handling
  362. switch ( LA(1)) {
  363. case '(':
  364. {
  365. mLPAREN(true);
  366. theRetToken=_returnToken;
  367. break;
  368. }
  369. case ')':
  370. {
  371. mRPAREN(true);
  372. theRetToken=_returnToken;
  373. break;
  374. }
  375. case '[':
  376. {
  377. mLBRACK(true);
  378. theRetToken=_returnToken;
  379. break;
  380. }
  381. case ']':
  382. {
  383. mRBRACK(true);
  384. theRetToken=_returnToken;
  385. break;
  386. }
  387. case '{':
  388. {
  389. mLCURLY(true);
  390. theRetToken=_returnToken;
  391. break;
  392. }
  393. case '}':
  394. {
  395. mRCURLY(true);
  396. theRetToken=_returnToken;
  397. break;
  398. }
  399. case ':':
  400. {
  401. mCOLON(true);
  402. theRetToken=_returnToken;
  403. break;
  404. }
  405. case ',':
  406. {
  407. mCOMMA(true);
  408. theRetToken=_returnToken;
  409. break;
  410. }
  411. case '~':
  412. {
  413. mBNOT(true);
  414. theRetToken=_returnToken;
  415. break;
  416. }
  417. case ';':
  418. {
  419. mSEMI(true);
  420. theRetToken=_returnToken;
  421. break;
  422. }
  423. case '\t': case '\u000c': case ' ': case '\\':
  424. {
  425. mWS(true);
  426. theRetToken=_returnToken;
  427. break;
  428. }
  429. case '\n': case '\r':
  430. {
  431. mNLS(true);
  432. theRetToken=_returnToken;
  433. break;
  434. }
  435. case '"': case '\'':
  436. {
  437. mSTRING_LITERAL(true);
  438. theRetToken=_returnToken;
  439. break;
  440. }
  441. case '0': case '1': case '2': case '3':
  442. case '4': case '5': case '6': case '7':
  443. case '8': case '9':
  444. {
  445. mNUM_INT(true);
  446. theRetToken=_returnToken;
  447. break;
  448. }
  449. case '@':
  450. {
  451. mAT(true);
  452. theRetToken=_returnToken;
  453. break;
  454. }
  455. default:
  456. if ((LA(1)=='>') && (LA(2)=='>') && (LA(3)=='>') && (LA(4)=='=')) {
  457. mBSR_ASSIGN(true);
  458. theRetToken=_returnToken;
  459. }
  460. else if ((LA(1)=='<') && (LA(2)=='=') && (LA(3)=='>')) {
  461. mCOMPARE_TO(true);
  462. theRetToken=_returnToken;
  463. }
  464. else if ((LA(1)=='>') && (LA(2)=='>') && (LA(3)=='=')) {
  465. mSR_ASSIGN(true);
  466. theRetToken=_returnToken;
  467. }
  468. else if ((LA(1)=='>') && (LA(2)=='>') && (LA(3)=='>') && (true)) {
  469. mBSR(true);
  470. theRetToken=_returnToken;
  471. }
  472. else if ((LA(1)=='<') && (LA(2)=='<') && (LA(3)=='=')) {
  473. mSL_ASSIGN(true);
  474. theRetToken=_returnToken;
  475. }
  476. else if ((LA(1)=='.') && (LA(2)=='.') && (LA(3)=='<')) {
  477. mRANGE_EXCLUSIVE(true);
  478. theRetToken=_returnToken;
  479. }
  480. else if ((LA(1)=='.') && (LA(2)=='.') && (LA(3)=='.')) {
  481. mTRIPLE_DOT(true);
  482. theRetToken=_returnToken;
  483. }
  484. else if ((LA(1)=='=') && (LA(2)=='=') && (LA(3)=='~')) {
  485. mREGEX_MATCH(true);
  486. theRetToken=_returnToken;
  487. }
  488. else if ((LA(1)=='*') && (LA(2)=='*') && (LA(3)=='=')) {
  489. mSTAR_STAR_ASSIGN(true);
  490. theRetToken=_returnToken;
  491. }
  492. else if ((LA(1)=='=') && (LA(2)=='=') && (true)) {
  493. mEQUAL(true);
  494. theRetToken=_returnToken;
  495. }
  496. else if ((LA(1)=='!') && (LA(2)=='=')) {
  497. mNOT_EQUAL(true);
  498. theRetToken=_returnToken;
  499. }
  500. else if ((LA(1)=='+') && (LA(2)=='=')) {
  501. mPLUS_ASSIGN(true);
  502. theRetToken=_returnToken;
  503. }
  504. else if ((LA(1)=='+') && (LA(2)=='+')) {
  505. mINC(true);
  506. theRetToken=_returnToken;
  507. }
  508. else if ((LA(1)=='-') && (LA(2)=='=')) {
  509. mMINUS_ASSIGN(true);
  510. theRetToken=_returnToken;
  511. }
  512. else if ((LA(1)=='-') && (LA(2)=='-')) {
  513. mDEC(true);
  514. theRetToken=_returnToken;
  515. }
  516. else if ((LA(1)=='*') && (LA(2)=='=')) {
  517. mSTAR_ASSIGN(true);
  518. theRetToken=_returnToken;
  519. }
  520. else if ((LA(1)=='%') && (LA(2)=='=')) {
  521. mMOD_ASSIGN(true);
  522. theRetToken=_returnToken;
  523. }
  524. else if ((LA(1)=='>') && (LA(2)=='>') && (true)) {
  525. mSR(true);
  526. theRetToken=_returnToken;
  527. }
  528. else if ((LA(1)=='>') && (LA(2)=='=')) {
  529. mGE(true);
  530. theRetToken=_returnToken;
  531. }
  532. else if ((LA(1)=='<') && (LA(2)=='<') && (true)) {
  533. mSL(true);
  534. theRetToken=_returnToken;
  535. }
  536. else if ((LA(1)=='<') && (LA(2)=='=') && (true)) {
  537. mLE(true);
  538. theRetToken=_returnToken;
  539. }
  540. else if ((LA(1)=='^') && (LA(2)=='=')) {
  541. mBXOR_ASSIGN(true);
  542. theRetToken=_returnToken;
  543. }
  544. else if ((LA(1)=='|') && (LA(2)=='=')) {
  545. mBOR_ASSIGN(true);
  546. theRetToken=_returnToken;
  547. }
  548. else if ((LA(1)=='|') && (LA(2)=='|')) {
  549. mLOR(true);
  550. theRetToken=_returnToken;
  551. }
  552. else if ((LA(1)=='&') && (LA(2)=='=')) {
  553. mBAND_ASSIGN(true);
  554. theRetToken=_returnToken;
  555. }
  556. else if ((LA(1)=='&') && (LA(2)=='&')) {
  557. mLAND(true);
  558. theRetToken=_returnToken;
  559. }
  560. else if ((LA(1)=='.') && (LA(2)=='.') && (true)) {
  561. mRANGE_INCLUSIVE(true);
  562. theRetToken=_returnToken;
  563. }
  564. else if ((LA(1)=='*') && (LA(2)=='.')) {
  565. mSPREAD_DOT(true);
  566. theRetToken=_returnToken;
  567. }
  568. else if ((LA(1)=='?') && (LA(2)=='.')) {
  569. mOPTIONAL_DOT(true);
  570. theRetToken=_returnToken;
  571. }
  572. else if ((LA(1)=='?') && (LA(2)==':')) {
  573. mELVIS_OPERATOR(true);
  574. theRetToken=_returnToken;
  575. }
  576. else if ((LA(1)=='.') && (LA(2)=='&')) {
  577. mMEMBER_POINTER(true);
  578. theRetToken=_returnToken;
  579. }
  580. else if ((LA(1)=='=') && (LA(2)=='~')) {
  581. mREGEX_FIND(true);
  582. theRetToken=_returnToken;
  583. }
  584. else if ((LA(1)=='*') && (LA(2)=='*') && (true)) {
  585. mSTAR_STAR(true);
  586. theRetToken=_returnToken;
  587. }
  588. else if ((LA(1)=='-') && (LA(2)=='>')) {
  589. mCLOSABLE_BLOCK_OP(true);
  590. theRetToken=_returnToken;
  591. }
  592. else if ((LA(1)=='/') && (LA(2)=='/')) {
  593. mSL_COMMENT(true);
  594. theRetToken=_returnToken;
  595. }
  596. else if ((LA(1)=='/') && (LA(2)=='*')) {
  597. mML_COMMENT(true);
  598. theRetToken=_returnToken;
  599. }
  600. else if ((LA(1)=='?') && (true)) {
  601. mQUESTION(true);
  602. theRetToken=_returnToken;
  603. }
  604. else if ((LA(1)=='.') && (true)) {
  605. mDOT(true);
  606. theRetToken=_returnToken;
  607. }
  608. else if ((LA(1)=='=') && (true)) {
  609. mASSIGN(true);
  610. theRetToken=_returnToken;
  611. }
  612. else if ((LA(1)=='!') && (true)) {
  613. mLNOT(true);
  614. theRetToken=_returnToken;
  615. }
  616. else if ((LA(1)=='+') && (true)) {
  617. mPLUS(true);
  618. theRetToken=_returnToken;
  619. }
  620. else if ((LA(1)=='-') && (true)) {
  621. mMINUS(true);
  622. theRetToken=_returnToken;
  623. }
  624. else if ((LA(1)=='*') && (true)) {
  625. mSTAR(true);
  626. theRetToken=_returnToken;
  627. }
  628. else if ((LA(1)=='%') && (true)) {
  629. mMOD(true);
  630. theRetToken=_returnToken;
  631. }
  632. else if ((LA(1)=='>') && (true)) {
  633. mGT(true);
  634. theRetToken=_returnToken;
  635. }
  636. else if ((LA(1)=='<') && (true)) {
  637. mLT(true);
  638. theRetToken=_returnToken;
  639. }
  640. else if ((LA(1)=='^') && (true)) {
  641. mBXOR(true);
  642. theRetToken=_returnToken;
  643. }
  644. else if ((LA(1)=='|') && (true)) {
  645. mBOR(true);
  646. theRetToken=_returnToken;
  647. }
  648. else if ((LA(1)=='&') && (true)) {
  649. mBAND(true);
  650. theRetToken=_returnToken;
  651. }
  652. else if (((LA(1)=='#'))&&(getLine() == 1 && getColumn() == 1)) {
  653. mSH_COMMENT(true);
  654. theRetToken=_returnToken;
  655. }
  656. else if ((LA(1)=='/') && (true)) {
  657. mREGEXP_LITERAL(true);
  658. theRetToken=_returnToken;
  659. }
  660. else if ((_tokenSet_0.member(LA(1)))) {
  661. mIDENT(true);
  662. theRetToken=_returnToken;
  663. }
  664. else {
  665. if (LA(1)==EOF_CHAR) {uponEOF(); _returnToken = makeToken(Token.EOF_TYPE);}
  666. else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
  667. }
  668. }
  669. if ( _returnToken==null ) continue tryAgain; // found SKIP token
  670. _ttype = _returnToken.getType();
  671. _returnToken.setType(_ttype);
  672. return _returnToken;
  673. }
  674. catch (RecognitionException e) {
  675. throw new TokenStreamRecognitionException(e);
  676. }
  677. }
  678. catch (CharStreamException cse) {
  679. if ( cse instanceof CharStreamIOException ) {
  680. throw new TokenStreamIOException(((CharStreamIOException)cse).io);
  681. }
  682. else {
  683. throw new TokenStreamException(cse.getMessage());
  684. }
  685. }
  686. }
  687. }
  688. public final void mQUESTION(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  689. int _ttype; Token _token=null; int _begin=text.length();
  690. _ttype = QUESTION;
  691. int _saveIndex;
  692. match('?');
  693. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  694. _token = makeToken(_ttype);
  695. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  696. }
  697. _returnToken = _token;
  698. }
  699. public final void mLPAREN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  700. int _ttype; Token _token=null; int _begin=text.length();
  701. _ttype = LPAREN;
  702. int _saveIndex;
  703. match('(');
  704. if ( inputState.guessing==0 ) {
  705. ++parenLevel;
  706. }
  707. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  708. _token = makeToken(_ttype);
  709. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  710. }
  711. _returnToken = _token;
  712. }
  713. public final void mRPAREN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  714. int _ttype; Token _token=null; int _begin=text.length();
  715. _ttype = RPAREN;
  716. int _saveIndex;
  717. match(')');
  718. if ( inputState.guessing==0 ) {
  719. --parenLevel;
  720. }
  721. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  722. _token = makeToken(_ttype);
  723. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  724. }
  725. _returnToken = _token;
  726. }
  727. public final void mLBRACK(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  728. int _ttype; Token _token=null; int _begin=text.length();
  729. _ttype = LBRACK;
  730. int _saveIndex;
  731. match('[');
  732. if ( inputState.guessing==0 ) {
  733. ++parenLevel;
  734. }
  735. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  736. _token = makeToken(_ttype);
  737. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  738. }
  739. _returnToken = _token;
  740. }
  741. public final void mRBRACK(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  742. int _ttype; Token _token=null; int _begin=text.length();
  743. _ttype = RBRACK;
  744. int _saveIndex;
  745. match(']');
  746. if ( inputState.guessing==0 ) {
  747. --parenLevel;
  748. }
  749. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  750. _token = makeToken(_ttype);
  751. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  752. }
  753. _returnToken = _token;
  754. }
  755. public final void mLCURLY(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  756. int _ttype; Token _token=null; int _begin=text.length();
  757. _ttype = LCURLY;
  758. int _saveIndex;
  759. match('{');
  760. if ( inputState.guessing==0 ) {
  761. pushParenLevel();
  762. }
  763. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  764. _token = makeToken(_ttype);
  765. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  766. }
  767. _returnToken = _token;
  768. }
  769. public final void mRCURLY(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  770. int _ttype; Token _token=null; int _begin=text.length();
  771. _ttype = RCURLY;
  772. int _saveIndex;
  773. match('}');
  774. if ( inputState.guessing==0 ) {
  775. popParenLevel(); if(stringCtorState!=0) restartStringCtor(true);
  776. }
  777. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  778. _token = makeToken(_ttype);
  779. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  780. }
  781. _returnToken = _token;
  782. }
  783. public final void mCOLON(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  784. int _ttype; Token _token=null; int _begin=text.length();
  785. _ttype = COLON;
  786. int _saveIndex;
  787. match(':');
  788. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  789. _token = makeToken(_ttype);
  790. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  791. }
  792. _returnToken = _token;
  793. }
  794. public final void mCOMMA(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  795. int _ttype; Token _token=null; int _begin=text.length();
  796. _ttype = COMMA;
  797. int _saveIndex;
  798. match(',');
  799. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  800. _token = makeToken(_ttype);
  801. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  802. }
  803. _returnToken = _token;
  804. }
  805. public final void mDOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  806. int _ttype; Token _token=null; int _begin=text.length();
  807. _ttype = DOT;
  808. int _saveIndex;
  809. match('.');
  810. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  811. _token = makeToken(_ttype);
  812. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  813. }
  814. _returnToken = _token;
  815. }
  816. public final void mASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  817. int _ttype; Token _token=null; int _begin=text.length();
  818. _ttype = ASSIGN;
  819. int _saveIndex;
  820. match('=');
  821. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  822. _token = makeToken(_ttype);
  823. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  824. }
  825. _returnToken = _token;
  826. }
  827. public final void mCOMPARE_TO(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  828. int _ttype; Token _token=null; int _begin=text.length();
  829. _ttype = COMPARE_TO;
  830. int _saveIndex;
  831. match("<=>");
  832. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  833. _token = makeToken(_ttype);
  834. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  835. }
  836. _returnToken = _token;
  837. }
  838. public final void mEQUAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  839. int _ttype; Token _token=null; int _begin=text.length();
  840. _ttype = EQUAL;
  841. int _saveIndex;
  842. match("==");
  843. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  844. _token = makeToken(_ttype);
  845. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  846. }
  847. _returnToken = _token;
  848. }
  849. public final void mLNOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  850. int _ttype; Token _token=null; int _begin=text.length();
  851. _ttype = LNOT;
  852. int _saveIndex;
  853. match('!');
  854. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  855. _token = makeToken(_ttype);
  856. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  857. }
  858. _returnToken = _token;
  859. }
  860. public final void mBNOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  861. int _ttype; Token _token=null; int _begin=text.length();
  862. _ttype = BNOT;
  863. int _saveIndex;
  864. match('~');
  865. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  866. _token = makeToken(_ttype);
  867. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  868. }
  869. _returnToken = _token;
  870. }
  871. public final void mNOT_EQUAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  872. int _ttype; Token _token=null; int _begin=text.length();
  873. _ttype = NOT_EQUAL;
  874. int _saveIndex;
  875. match("!=");
  876. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  877. _token = makeToken(_ttype);
  878. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  879. }
  880. _returnToken = _token;
  881. }
  882. protected final void mDIV(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  883. int _ttype; Token _token=null; int _begin=text.length();
  884. _ttype = DIV;
  885. int _saveIndex;
  886. match('/');
  887. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  888. _token = makeToken(_ttype);
  889. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  890. }
  891. _returnToken = _token;
  892. }
  893. protected final void mDIV_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  894. int _ttype; Token _token=null; int _begin=text.length();
  895. _ttype = DIV_ASSIGN;
  896. int _saveIndex;
  897. match("/=");
  898. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  899. _token = makeToken(_ttype);
  900. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  901. }
  902. _returnToken = _token;
  903. }
  904. public final void mPLUS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  905. int _ttype; Token _token=null; int _begin=text.length();
  906. _ttype = PLUS;
  907. int _saveIndex;
  908. match('+');
  909. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  910. _token = makeToken(_ttype);
  911. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  912. }
  913. _returnToken = _token;
  914. }
  915. public final void mPLUS_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  916. int _ttype; Token _token=null; int _begin=text.length();
  917. _ttype = PLUS_ASSIGN;
  918. int _saveIndex;
  919. match("+=");
  920. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  921. _token = makeToken(_ttype);
  922. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  923. }
  924. _returnToken = _token;
  925. }
  926. public final void mINC(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  927. int _ttype; Token _token=null; int _begin=text.length();
  928. _ttype = INC;
  929. int _saveIndex;
  930. match("++");
  931. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  932. _token = makeToken(_ttype);
  933. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  934. }
  935. _returnToken = _token;
  936. }
  937. public final void mMINUS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  938. int _ttype; Token _token=null; int _begin=text.length();
  939. _ttype = MINUS;
  940. int _saveIndex;
  941. match('-');
  942. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  943. _token = makeToken(_ttype);
  944. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  945. }
  946. _returnToken = _token;
  947. }
  948. public final void mMINUS_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  949. int _ttype; Token _token=null; int _begin=text.length();
  950. _ttype = MINUS_ASSIGN;
  951. int _saveIndex;
  952. match("-=");
  953. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  954. _token = makeToken(_ttype);
  955. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  956. }
  957. _returnToken = _token;
  958. }
  959. public final void mDEC(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  960. int _ttype; Token _token=null; int _begin=text.length();
  961. _ttype = DEC;
  962. int _saveIndex;
  963. match("--");
  964. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  965. _token = makeToken(_ttype);
  966. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  967. }
  968. _returnToken = _token;
  969. }
  970. public final void mSTAR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  971. int _ttype; Token _token=null; int _begin=text.length();
  972. _ttype = STAR;
  973. int _saveIndex;
  974. match('*');
  975. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  976. _token = makeToken(_ttype);
  977. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  978. }
  979. _returnToken = _token;
  980. }
  981. public final void mSTAR_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  982. int _ttype; Token _token=null; int _begin=text.length();
  983. _ttype = STAR_ASSIGN;
  984. int _saveIndex;
  985. match("*=");
  986. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  987. _token = makeToken(_ttype);
  988. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  989. }
  990. _returnToken = _token;
  991. }
  992. public final void mMOD(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  993. int _ttype; Token _token=null; int _begin=text.length();
  994. _ttype = MOD;
  995. int _saveIndex;
  996. match('%');
  997. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  998. _token = makeToken(_ttype);
  999. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  1000. }
  1001. _returnToken = _token;
  1002. }
  1003. public final void mMOD_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  1004. int _ttype; Token _token=null; int _begin=text.length();
  1005. _ttype = MOD_ASSIGN;
  1006. int _saveIndex;
  1007. match("%=");
  1008. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  1009. _token = makeToken(_ttype);
  1010. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  1011. }
  1012. _returnToken = _token;
  1013. }
  1014. public final void mSR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  1015. int _ttype; Token _token=null; int _begin=text.length();
  1016. _ttype = SR;
  1017. int _saveIndex;
  1018. match(">>");
  1019. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  1020. _token = makeToken(_ttype);
  1021. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  1022. }
  1023. _returnToken = _token;
  1024. }
  1025. public final void mSR_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  1026. int _ttype; Token _token=null; int _begin=text.length();
  1027. _ttype = SR_ASSIGN;
  1028. int _saveIndex;
  1029. match(">>=");
  1030. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  1031. _token = makeToken(_ttype);
  1032. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  1033. }
  1034. _returnToken = _token;
  1035. }
  1036. public final void mBSR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  1037. int _ttype; Token _token=null; int _begin=text.length();
  1038. _ttype = BSR;
  1039. int _saveIndex;
  1040. match(">>>");
  1041. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  1042. _token = makeToken(_ttype);
  1043. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  1044. }
  1045. _returnToken = _token;
  1046. }
  1047. public final void mBSR_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  1048. int _ttype; Token _token=null; int _begin=text.length();
  1049. _ttype = BSR_ASSIGN;
  1050. int _saveIndex;
  1051. match(">>>=");
  1052. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  1053. _token = makeToken(_ttype);
  1054. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  1055. }
  1056. _returnToken = _token;
  1057. }
  1058. public final void mGE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  1059. int _ttype; Token _token=null; int _begin=text.length();
  1060. _ttype = GE;
  1061. int _saveIndex;
  1062. match(">=");
  1063. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  1064. _token = makeToken(_ttype);
  1065. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  1066. }
  1067. _returnToken = _token;
  1068. }
  1069. public final void mGT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  1070. int _ttype; Token _token=null; int _begin=text.length();
  1071. _ttype = GT;
  1072. int _saveIndex;
  1073. match(">");
  1074. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  1075. _token = makeToken(_ttype);
  1076. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  1077. }
  1078. _returnToken = _token;
  1079. }
  1080. public final void mSL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  1081. int _ttype; Token _token=null; int _begin=text.length();
  1082. _ttype = SL;
  1083. int _saveIndex;
  1084. match("<<");
  1085. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  1086. _token = makeToken(_ttype);
  1087. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  1088. }
  1089. _returnToken = _token;
  1090. }
  1091. public final void mSL_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  1092. int _ttype; Token _token=null; int _begin=text.length();
  1093. _ttype = SL_ASSIGN;
  1094. int _saveIndex;
  1095. match("<<=");
  1096. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  1097. _token = makeToken(_ttype);
  1098. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  1099. }
  1100. _returnToken = _token;
  1101. }
  1102. public final void mLE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  1103. int _ttype; Token _token=null; int _begin=text.length();
  1104. _ttype = LE;
  1105. int _saveIndex;
  1106. match("<=");
  1107. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  1108. _token = makeToken(_ttype);
  1109. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  1110. }
  1111. _returnToken = _token;
  1112. }
  1113. public final void mLT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  1114. int _ttype; Token _token=null; int _begin=text.length();
  1115. _ttype = LT;
  1116. int _saveIndex;
  1117. match('<');
  1118. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  1119. _token = makeToken(_ttype);
  1120. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  1121. }
  1122. _returnToken = _token;
  1123. }
  1124. public final void mBXOR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  1125. int _ttype; Token _token=null; int _begin=text.length();
  1126. _ttype = BXOR;
  1127. int _saveIndex;
  1128. match('^');
  1129. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  1130. _token = makeToken(_ttype);
  1131. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  1132. }
  1133. _returnToken = _token;
  1134. }
  1135. public final void mBXOR_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  1136. int _ttype; Token _token=null; int _begin=text.length();
  1137. _ttype = BXOR_ASSIGN;
  1138. int _saveIndex;
  1139. match("^=");
  1140. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  1141. _token = makeToken(_ttype);
  1142. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  1143. }
  1144. _returnToken = _token;
  1145. }
  1146. public final void mBOR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  1147. int _ttype; Token _token=null; int _begin=text.length();
  1148. _ttype = BOR;
  1149. int _saveIndex;
  1150. match('|');
  1151. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  1152. _token = makeToken(_ttype);
  1153. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  1154. }
  1155. _returnToken = _token;
  1156. }
  1157. public final void mBOR_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  1158. int _ttype; Token _token=null; int _begin=text.length();
  1159. _ttype = BOR_ASSIGN;
  1160. int _saveIndex;
  1161. match("|=");
  1162. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  1163. _token = makeToken(_ttype);
  1164. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  1165. }
  1166. _returnToken = _token;
  1167. }
  1168. public final void mLOR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  1169. int _ttype; Token _token=null; int _begin=text.length();
  1170. _ttype = LOR;
  1171. int _saveIndex;
  1172. match("||");
  1173. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  1174. _token = makeToken(_ttype);
  1175. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  1176. }
  1177. _returnToken = _token;
  1178. }
  1179. public final void mBAND(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  1180. int _ttype; Token _token=null; int _begin=text.length();
  1181. _ttype = BAND;
  1182. int _saveIndex;
  1183. match('&');
  1184. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  1185. _token = makeToken(_ttype);
  1186. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  1187. }
  1188. _returnToken = _token;
  1189. }
  1190. public final void mBAND_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  1191. int _ttype; Token _token=null; int _begin=text.length();
  1192. _ttype = BAND_ASSIGN;
  1193. int _saveIndex;
  1194. match("&=");
  1195. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  1196. _token = makeToken(_ttype);
  1197. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  1198. }
  1199. _returnToken = _token;
  1200. }
  1201. public final void mLAND(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  1202. int _ttype; Token _token=null; int _begin=text.length();
  1203. _ttype = LAND;
  1204. int _saveIndex;
  1205. match("&&");
  1206. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  1207. _token = makeToken(_ttype);
  1208. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  1209. }
  1210. _returnToken = _token;
  1211. }
  1212. public final void mSEMI(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  1213. int _ttype; Token _token=null; int _begin=text.length();
  1214. _ttype = SEMI;
  1215. int _saveIndex;
  1216. match(';');
  1217. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  1218. _token = makeToken(_ttype);
  1219. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  1220. }
  1221. _returnToken = _token;
  1222. }
  1223. protected final void mDOLLAR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  1224. int _ttype; Token _token=null; int _begin=text.length();
  1225. _ttype = DOLLAR;
  1226. int _saveIndex;
  1227. match('$');
  1228. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  1229. _token = makeToken(_ttype);
  1230. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  1231. }
  1232. _returnToken = _token;
  1233. }
  1234. public final void mRANGE_INCLUSIVE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  1235. int _ttype; Token _token=null; int _begin=text.length();
  1236. _ttype = RANGE_INCLUSIVE;
  1237. int _saveIndex;
  1238. match("..");
  1239. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  1240. _token = makeToken(_ttype);
  1241. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  1242. }
  1243. _returnToken = _token;
  1244. }
  1245. public final void mRANGE_EXCLUSIVE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  1246. int _ttype; Token _token=null; int _begin=text.length();
  1247. _ttype = RANGE_EXCLUSIVE;
  1248. int _saveIndex;
  1249. match("..<");
  1250. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  1251. _token = makeToken(_ttype);
  1252. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  1253. }
  1254. _returnToken = _token;
  1255. }
  1256. public final void mTRIPLE_DOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  1257. int _ttype; Token _token=null; int _begin=text.length();
  1258. _ttype = TRIPLE_DOT;
  1259. int _saveIndex;
  1260. match("...");
  1261. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  1262. _token = makeToken(_ttype);
  1263. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  1264. }
  1265. _returnToken = _token;
  1266. }
  1267. public final void mSPREAD_DOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  1268. int _ttype; Token _token=null; int _begin=text.length();
  1269. _ttype = SPREAD_DOT;
  1270. int _saveIndex;
  1271. match("*.");
  1272. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  1273. _token = makeToken(_ttype);
  1274. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  1275. }
  1276. _returnToken = _token;
  1277. }
  1278. public final void mOPTIONAL_DOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  1279. int _ttype; Token _token=null; int _begin=text.length();
  1280. _ttype = OPTIONAL_DOT;
  1281. int _saveIndex;
  1282. match("?.");
  1283. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  1284. _token = makeToken(_ttype);
  1285. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  1286. }
  1287. _returnToken = _token;
  1288. }
  1289. public final void mELVIS_OPERATOR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
  1290. int _ttype; Token _token=null; int _begin=text.length();
  1291. _ttype = ELVIS_OPERATOR;
  1292. int _saveIndex;
  1293. match("?:");
  1294. if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
  1295. _token = makeToken(_ttype);
  1296. _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  1297. }
  1298. _returnToken = _token;
  1299. }
  1300. public final void mMEMBER_POINTER(boolean _createTok

Large files files are truncated, but you can click here to view the full file