Package org.antlr.stringtemplate.language

Source Code of org.antlr.stringtemplate.language.ActionLexer

// $ANTLR 2.7.7 (20060906): "action.g" -> "ActionLexer.java"$

/*
[The "BSD licence"]
Copyright (c) 2003-2004 Terence Parr
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
    derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.antlr.stringtemplate.language;
import org.antlr.stringtemplate.*;
import java.util.*;

import java.io.InputStream;
import antlr.TokenStreamException;
import antlr.TokenStreamIOException;
import antlr.TokenStreamRecognitionException;
import antlr.CharStreamException;
import antlr.CharStreamIOException;
import antlr.ANTLRException;
import java.io.Reader;
import java.util.Hashtable;
import antlr.CharScanner;
import antlr.InputBuffer;
import antlr.ByteBuffer;
import antlr.CharBuffer;
import antlr.Token;
import antlr.CommonToken;
import antlr.RecognitionException;
import antlr.NoViableAltForCharException;
import antlr.MismatchedCharException;
import antlr.TokenStream;
import antlr.ANTLRHashString;
import antlr.LexerSharedInputState;
import antlr.collections.impl.BitSet;
import antlr.SemanticException;

public class ActionLexer extends antlr.CharScanner implements ActionParserTokenTypes, TokenStream
{
public ActionLexer(InputStream in) {
  this(new ByteBuffer(in));
}
public ActionLexer(Reader in) {
  this(new CharBuffer(in));
}
public ActionLexer(InputBuffer ib) {
  this(new LexerSharedInputState(ib));
}
public ActionLexer(LexerSharedInputState state) {
  super(state);
  caseSensitiveLiterals = true;
  setCaseSensitive(true);
  literals = new Hashtable();
  literals.put(new ANTLRHashString("super", this), new Integer(32));
  literals.put(new ANTLRHashString("if", this), new Integer(8));
  literals.put(new ANTLRHashString("first", this), new Integer(26));
  literals.put(new ANTLRHashString("last", this), new Integer(28));
  literals.put(new ANTLRHashString("rest", this), new Integer(27));
  literals.put(new ANTLRHashString("trunc", this), new Integer(31));
  literals.put(new ANTLRHashString("strip", this), new Integer(30));
  literals.put(new ANTLRHashString("length", this), new Integer(29));
  literals.put(new ANTLRHashString("elseif", this), new Integer(18));
}

public Token nextToken() throws TokenStreamException {
  Token theRetToken=null;
tryAgain:
  for (;;) {
    Token _token = null;
    int _ttype = Token.INVALID_TYPE;
    resetText();
    try {   // for char stream error handling
      try {   // for lexical error handling
        switch ( LA(1)) {
        case 'A'case 'B'case 'C'case 'D':
        case 'E'case 'F'case 'G'case 'H':
        case 'I'case 'J'case 'K'case 'L':
        case 'M'case 'N'case 'O'case 'P':
        case 'Q'case 'R'case 'S'case 'T':
        case 'U'case 'V'case 'W'case 'X':
        case 'Y'case 'Z'case '_'case 'a':
        case 'b'case 'c'case 'd'case 'e':
        case 'f'case 'g'case 'h'case 'i':
        case 'j'case 'k'case 'l'case 'm':
        case 'n'case 'o'case 'p'case 'q':
        case 'r'case 's'case 't'case 'u':
        case 'v'case 'w'case 'x'case 'y':
        case 'z':
        {
          mID(true);
          theRetToken=_returnToken;
          break;
        }
        case '0'case '1'case '2'case '3':
        case '4'case '5'case '6'case '7':
        case '8'case '9':
        {
          mINT(true);
          theRetToken=_returnToken;
          break;
        }
        case '"':
        {
          mSTRING(true);
          theRetToken=_returnToken;
          break;
        }
        case '{':
        {
          mANONYMOUS_TEMPLATE(true);
          theRetToken=_returnToken;
          break;
        }
        case '[':
        {
          mLBRACK(true);
          theRetToken=_returnToken;
          break;
        }
        case ']':
        {
          mRBRACK(true);
          theRetToken=_returnToken;
          break;
        }
        case '(':
        {
          mLPAREN(true);
          theRetToken=_returnToken;
          break;
        }
        case ')':
        {
          mRPAREN(true);
          theRetToken=_returnToken;
          break;
        }
        case ',':
        {
          mCOMMA(true);
          theRetToken=_returnToken;
          break;
        }
        case '=':
        {
          mASSIGN(true);
          theRetToken=_returnToken;
          break;
        }
        case ':':
        {
          mCOLON(true);
          theRetToken=_returnToken;
          break;
        }
        case '+':
        {
          mPLUS(true);
          theRetToken=_returnToken;
          break;
        }
        case ';':
        {
          mSEMI(true);
          theRetToken=_returnToken;
          break;
        }
        case '!':
        {
          mNOT(true);
          theRetToken=_returnToken;
          break;
        }
        case '\t'case '\n'case '\r'case ' ':
        {
          mWS(true);
          theRetToken=_returnToken;
          break;
        }
        default:
          if ((LA(1)=='.') && (LA(2)=='.')) {
            mDOTDOTDOT(true);
            theRetToken=_returnToken;
          }
          else if ((LA(1)=='.') && (true)) {
            mDOT(true);
            theRetToken=_returnToken;
          }
        else {
          if (LA(1)==EOF_CHAR) {uponEOF(); _returnToken = makeToken(Token.EOF_TYPE);}
        else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
        }
        }
        if ( _returnToken==null ) continue tryAgain; // found SKIP token
        _ttype = _returnToken.getType();
        _returnToken.setType(_ttype);
        return _returnToken;
      }
      catch (RecognitionException e) {
        throw new TokenStreamRecognitionException(e);
      }
    }
    catch (CharStreamException cse) {
      if ( cse instanceof CharStreamIOException ) {
        throw new TokenStreamIOException(((CharStreamIOException)cse).io);
      }
      else {
        throw new TokenStreamException(cse.getMessage());
      }
    }
  }
}

  public final void mID(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = ID;
    int _saveIndex;
   
    {
    switch ( LA(1)) {
    case 'a'case 'b'case 'c'case 'd':
    case 'e'case 'f'case 'g'case 'h':
    case 'i'case 'j'case 'k'case 'l':
    case 'm'case 'n'case 'o'case 'p':
    case 'q'case 'r'case 's'case 't':
    case 'u'case 'v'case 'w'case 'x':
    case 'y'case 'z':
    {
      matchRange('a','z');
      break;
    }
    case 'A'case 'B'case 'C'case 'D':
    case 'E'case 'F'case 'G'case 'H':
    case 'I'case 'J'case 'K'case 'L':
    case 'M'case 'N'case 'O'case 'P':
    case 'Q'case 'R'case 'S'case 'T':
    case 'U'case 'V'case 'W'case 'X':
    case 'Y'case 'Z':
    {
      matchRange('A','Z');
      break;
    }
    case '_':
    {
      match('_');
      break;
    }
    default:
    {
      throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
    }
    }
    }
    {
    _loop60:
    do {
      switch ( LA(1)) {
      case 'a'case 'b'case 'c'case 'd':
      case 'e'case 'f'case 'g'case 'h':
      case 'i'case 'j'case 'k'case 'l':
      case 'm'case 'n'case 'o'case 'p':
      case 'q'case 'r'case 's'case 't':
      case 'u'case 'v'case 'w'case 'x':
      case 'y'case 'z':
      {
        matchRange('a','z');
        break;
      }
      case 'A'case 'B'case 'C'case 'D':
      case 'E'case 'F'case 'G'case 'H':
      case 'I'case 'J'case 'K'case 'L':
      case 'M'case 'N'case 'O'case 'P':
      case 'Q'case 'R'case 'S'case 'T':
      case 'U'case 'V'case 'W'case 'X':
      case 'Y'case 'Z':
      {
        matchRange('A','Z');
        break;
      }
      case '0'case '1'case '2'case '3':
      case '4'case '5'case '6'case '7':
      case '8'case '9':
      {
        matchRange('0','9');
        break;
      }
      case '_':
      {
        match('_');
        break;
      }
      case '/':
      {
        match('/');
        break;
      }
      default:
      {
        break _loop60;
      }
      }
    } while (true);
    }
    _ttype = testLiteralsTable(_ttype);
    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
    }
    _returnToken = _token;
  }
 
  public final void mINT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = INT;
    int _saveIndex;
   
    {
    int _cnt63=0;
    _loop63:
    do {
      if (((LA(1) >= '0' && LA(1) <= '9'))) {
        matchRange('0','9');
      }
      else {
        if ( _cnt63>=1 ) { break _loop63; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
      }
     
      _cnt63++;
    } while (true);
    }
    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
    }
    _returnToken = _token;
  }
 
  public final void mSTRING(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = STRING;
    int _saveIndex;
   
    _saveIndex=text.length();
    match('"');
    text.setLength(_saveIndex);
    {
    _loop66:
    do {
      if ((LA(1)=='\\')) {
        mESC_CHAR(false,true);
      }
      else if ((_tokenSet_0.member(LA(1)))) {
        matchNot('"');
      }
      else {
        break _loop66;
      }
     
    } while (true);
    }
    _saveIndex=text.length();
    match('"');
    text.setLength(_saveIndex);
    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
    }
    _returnToken = _token;
  }
 
/** Match escape sequences, optionally translating them for strings, but not
*  for templates.  Do \} only when in {...} templates.
*/
  protected final void mESC_CHAR(boolean _createToken,
    boolean doEscape
  ) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = ESC_CHAR;
    int _saveIndex;
    char  c = '\0';
   
    match('\\');
    {
    if ((LA(1)=='n') && ((LA(2) >= '\u0003' && LA(2) <= '\ufffe'))) {
      match('n');
      if ( inputState.guessing==0 ) {
        if (doEscape) { text.setLength(_begin); text.append("\n"); }
      }
    }
    else if ((LA(1)=='r') && ((LA(2) >= '\u0003' && LA(2) <= '\ufffe'))) {
      match('r');
      if ( inputState.guessing==0 ) {
        if (doEscape) { text.setLength(_begin); text.append("\r"); }
      }
    }
    else if ((LA(1)=='t') && ((LA(2) >= '\u0003' && LA(2) <= '\ufffe'))) {
      match('t');
      if ( inputState.guessing==0 ) {
        if (doEscape) { text.setLength(_begin); text.append("\t"); }
      }
    }
    else if ((LA(1)=='b') && ((LA(2) >= '\u0003' && LA(2) <= '\ufffe'))) {
      match('b');
      if ( inputState.guessing==0 ) {
        if (doEscape) { text.setLength(_begin); text.append("\b"); }
      }
    }
    else if ((LA(1)=='f') && ((LA(2) >= '\u0003' && LA(2) <= '\ufffe'))) {
      match('f');
      if ( inputState.guessing==0 ) {
        if (doEscape) { text.setLength(_begin); text.append("\f"); }
      }
    }
    else if (((LA(1) >= '\u0003' && LA(1) <= '\ufffe')) && ((LA(2) >= '\u0003' && LA(2) <= '\ufffe'))) {
      c = LA(1);
      matchNot(EOF_CHAR);
      if ( inputState.guessing==0 ) {
        if (doEscape) {text.setLength(_begin); text.append(String.valueOf(c));}
      }
    }
    else {
      throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
    }
   
    }
    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
    }
    _returnToken = _token;
  }
 
  public final void mANONYMOUS_TEMPLATE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = ANONYMOUS_TEMPLATE;
    int _saveIndex;
   
    List args=null;
    StringTemplateToken t = null;
   
   
    _saveIndex=text.length();
    match('{');
    text.setLength(_saveIndex);
    {
    boolean synPredMatched70 = false;
    if (((_tokenSet_1.member(LA(1))) && (_tokenSet_2.member(LA(2))))) {
      int _m70 = mark();
      synPredMatched70 = true;
      inputState.guessing++;
      try {
        {
        mTEMPLATE_ARGS(false);
        }
      }
      catch (RecognitionException pe) {
        synPredMatched70 = false;
      }
      rewind(_m70);
inputState.guessing--;
    }
    if ( synPredMatched70 ) {
      args=mTEMPLATE_ARGS(false);
      {
      if ((_tokenSet_3.member(LA(1))) && ((LA(2) >= '\u0003' && LA(2) <= '\ufffe'))) {
        _saveIndex=text.length();
        mWS_CHAR(false);
        text.setLength(_saveIndex);
      }
      else if (((LA(1) >= '\u0003' && LA(1) <= '\ufffe')) && (true)) {
      }
      else {
        throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
      }
     
      }
      if ( inputState.guessing==0 ) {
       
                    // create a special token to track args
                    t = new StringTemplateToken(ANONYMOUS_TEMPLATE,new String(text.getBuffer(),_begin,text.length()-_begin),args);
                    _token = t;
         
      }
    }
    else if (((LA(1) >= '\u0003' && LA(1) <= '\ufffe')) && (true)) {
    }
    else {
      throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
    }
   
    }
    {
    _loop73:
    do {
      if ((LA(1)=='\\') && (LA(2)=='{')) {
        _saveIndex=text.length();
        match('\\');
        text.setLength(_saveIndex);
        match('{');
      }
      else if ((LA(1)=='\\') && (LA(2)=='}')) {
        _saveIndex=text.length();
        match('\\');
        text.setLength(_saveIndex);
        match('}');
      }
      else if ((LA(1)=='\\') && ((LA(2) >= '\u0003' && LA(2) <= '\ufffe'))) {
        mESC_CHAR(false,false);
      }
      else if ((LA(1)=='{')) {
        mNESTED_ANONYMOUS_TEMPLATE(false);
      }
      else if ((_tokenSet_4.member(LA(1)))) {
        matchNot('}');
      }
      else {
        break _loop73;
      }
     
    } while (true);
    }
    if ( inputState.guessing==0 ) {
     
                if ( t!=null ) {
                  t.setText(new String(text.getBuffer(),_begin,text.length()-_begin));
                }
       
    }
    _saveIndex=text.length();
    match('}');
    text.setLength(_saveIndex);
    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
    }
    _returnToken = _token;
  }
 
  protected final List  mTEMPLATE_ARGS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    List args=new ArrayList();
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = TEMPLATE_ARGS;
    int _saveIndex;
    Token a=null;
    Token a2=null;
   
    {
    switch ( LA(1)) {
    case '\t'case '\n'case '\r'case ' ':
    {
      _saveIndex=text.length();
      mWS_CHAR(false);
      text.setLength(_saveIndex);
      break;
    }
    case 'A'case 'B'case 'C'case 'D':
    case 'E'case 'F'case 'G'case 'H':
    case 'I'case 'J'case 'K'case 'L':
    case 'M'case 'N'case 'O'case 'P':
    case 'Q'case 'R'case 'S'case 'T':
    case 'U'case 'V'case 'W'case 'X':
    case 'Y'case 'Z'case '_'case 'a':
    case 'b'case 'c'case 'd'case 'e':
    case 'f'case 'g'case 'h'case 'i':
    case 'j'case 'k'case 'l'case 'm':
    case 'n'case 'o'case 'p'case 'q':
    case 'r'case 's'case 't'case 'u':
    case 'v'case 'w'case 'x'case 'y':
    case 'z':
    {
      break;
    }
    default:
    {
      throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
    }
    }
    }
    _saveIndex=text.length();
    mID(true);
    text.setLength(_saveIndex);
    a=_returnToken;
    if ( inputState.guessing==0 ) {
      args.add(a.getText());
    }
    {
    _loop79:
    do {
      if ((_tokenSet_5.member(LA(1))) && (_tokenSet_6.member(LA(2)))) {
        {
        switch ( LA(1)) {
        case '\t'case '\n'case '\r'case ' ':
        {
          _saveIndex=text.length();
          mWS_CHAR(false);
          text.setLength(_saveIndex);
          break;
        }
        case ',':
        {
          break;
        }
        default:
        {
          throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
        }
        }
        }
        _saveIndex=text.length();
        match(',');
        text.setLength(_saveIndex);
        {
        switch ( LA(1)) {
        case '\t'case '\n'case '\r'case ' ':
        {
          _saveIndex=text.length();
          mWS_CHAR(false);
          text.setLength(_saveIndex);
          break;
        }
        case 'A'case 'B'case 'C'case 'D':
        case 'E'case 'F'case 'G'case 'H':
        case 'I'case 'J'case 'K'case 'L':
        case 'M'case 'N'case 'O'case 'P':
        case 'Q'case 'R'case 'S'case 'T':
        case 'U'case 'V'case 'W'case 'X':
        case 'Y'case 'Z'case '_'case 'a':
        case 'b'case 'c'case 'd'case 'e':
        case 'f'case 'g'case 'h'case 'i':
        case 'j'case 'k'case 'l'case 'm':
        case 'n'case 'o'case 'p'case 'q':
        case 'r'case 's'case 't'case 'u':
        case 'v'case 'w'case 'x'case 'y':
        case 'z':
        {
          break;
        }
        default:
        {
          throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
        }
        }
        }
        _saveIndex=text.length();
        mID(true);
        text.setLength(_saveIndex);
        a2=_returnToken;
        if ( inputState.guessing==0 ) {
          args.add(a2.getText());
        }
      }
      else {
        break _loop79;
      }
     
    } while (true);
    }
    {
    switch ( LA(1)) {
    case '\t'case '\n'case '\r'case ' ':
    {
      _saveIndex=text.length();
      mWS_CHAR(false);
      text.setLength(_saveIndex);
      break;
    }
    case '|':
    {
      break;
    }
    default:
    {
      throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
    }
    }
    }
    _saveIndex=text.length();
    match('|');
    text.setLength(_saveIndex);
    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
    }
    _returnToken = _token;
    return args;
  }
 
  protected final void mWS_CHAR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = WS_CHAR;
    int _saveIndex;
   
    switch ( LA(1)) {
    case ' ':
    {
      match(' ');
      break;
    }
    case '\t':
    {
      match('\t');
      break;
    }
    case '\r':
    {
      match('\r');
      break;
    }
    case '\n':
    {
      match('\n');
      if ( inputState.guessing==0 ) {
        newline();
      }
      break;
    }
    default:
    {
      throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
    }
    }
    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
    }
    _returnToken = _token;
  }
 
  protected final void mNESTED_ANONYMOUS_TEMPLATE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = NESTED_ANONYMOUS_TEMPLATE;
    int _saveIndex;
   
    match('{');
    {
    _loop83:
    do {
      if ((LA(1)=='\\') && (LA(2)=='{')) {
        _saveIndex=text.length();
        match('\\');
        text.setLength(_saveIndex);
        match('{');
      }
      else if ((LA(1)=='\\') && (LA(2)=='}')) {
        _saveIndex=text.length();
        match('\\');
        text.setLength(_saveIndex);
        match('}');
      }
      else if ((LA(1)=='\\') && ((LA(2) >= '\u0003' && LA(2) <= '\ufffe'))) {
        mESC_CHAR(false,false);
      }
      else if ((LA(1)=='{')) {
        mNESTED_ANONYMOUS_TEMPLATE(false);
      }
      else if ((_tokenSet_4.member(LA(1)))) {
        matchNot('}');
      }
      else {
        break _loop83;
      }
     
    } while (true);
    }
    match('}');
    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
    }
    _returnToken = _token;
  }
 
  public final void mLBRACK(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = LBRACK;
    int _saveIndex;
   
    match('[');
    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
    }
    _returnToken = _token;
  }
 
  public final void mRBRACK(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = RBRACK;
    int _saveIndex;
   
    match(']');
    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
    }
    _returnToken = _token;
  }
 
  public final void mLPAREN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = LPAREN;
    int _saveIndex;
   
    match('(');
    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
    }
    _returnToken = _token;
  }
 
  public final void mRPAREN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = RPAREN;
    int _saveIndex;
   
    match(')');
    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
    }
    _returnToken = _token;
  }
 
  public final void mCOMMA(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = COMMA;
    int _saveIndex;
   
    match(',');
    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
    }
    _returnToken = _token;
  }
 
  public final void mDOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = DOT;
    int _saveIndex;
   
    match('.');
    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
    }
    _returnToken = _token;
  }
 
  public final void mASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = ASSIGN;
    int _saveIndex;
   
    match('=');
    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
    }
    _returnToken = _token;
  }
 
  public final void mCOLON(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = COLON;
    int _saveIndex;
   
    match(':');
    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
    }
    _returnToken = _token;
  }
 
  public final void mPLUS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = PLUS;
    int _saveIndex;
   
    match('+');
    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
    }
    _returnToken = _token;
  }
 
  public final void mSEMI(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = SEMI;
    int _saveIndex;
   
    match(';');
    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
    }
    _returnToken = _token;
  }
 
  public final void mNOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = NOT;
    int _saveIndex;
   
    match('!');
    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
    }
    _returnToken = _token;
  }
 
  public final void mDOTDOTDOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = DOTDOTDOT;
    int _saveIndex;
   
    match("...");
    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
    }
    _returnToken = _token;
  }
 
  public final void mWS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = WS;
    int _saveIndex;
   
    {
    int _cnt100=0;
    _loop100:
    do {
      switch ( LA(1)) {
      case ' ':
      {
        match(' ');
        break;
      }
      case '\t':
      {
        match('\t');
        break;
      }
      case '\r':
      {
        match('\r');
        break;
      }
      case '\n':
      {
        match('\n');
        if ( inputState.guessing==0 ) {
          newline();
        }
        break;
      }
      default:
      {
        if ( _cnt100>=1 ) { break _loop100; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
      }
      }
      _cnt100++;
    } while (true);
    }
    if ( inputState.guessing==0 ) {
      _ttype = Token.SKIP;
    }
    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
    }
    _returnToken = _token;
  }
 
 
  private static final long[] mk_tokenSet_0() {
    long[] data = new long[2048];
    data[0]=-17179869192L;
    data[1]=-268435457L;
    for (int i = 2; i<=1022; i++) { data[i]=-1L; }
    data[1023]=9223372036854775807L;
    return data;
  }
  public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0());
  private static final long[] mk_tokenSet_1() {
    long[] data = new long[1025];
    data[0]=4294977024L;
    data[1]=576460745995190270L;
    return data;
  }
  public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1());
  private static final long[] mk_tokenSet_2() {
    long[] data = new long[1025];
    data[0]=288107235144377856L;
    data[1]=1729382250602037246L;
    return data;
  }
  public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2());
  private static final long[] mk_tokenSet_3() {
    long[] data = new long[1025];
    data[0]=4294977024L;
    return data;
  }
  public static final BitSet _tokenSet_3 = new BitSet(mk_tokenSet_3());
  private static final long[] mk_tokenSet_4() {
    long[] data = new long[2048];
    data[0]=-8L;
    data[1]=-2882303761785552897L;
    for (int i = 2; i<=1022; i++) { data[i]=-1L; }
    data[1023]=9223372036854775807L;
    return data;
  }
  public static final BitSet _tokenSet_4 = new BitSet(mk_tokenSet_4());
  private static final long[] mk_tokenSet_5() {
    long[] data = new long[1025];
    data[0]=17596481021440L;
    return data;
  }
  public static final BitSet _tokenSet_5 = new BitSet(mk_tokenSet_5());
  private static final long[] mk_tokenSet_6() {
    long[] data = new long[1025];
    data[0]=17596481021440L;
    data[1]=576460745995190270L;
    return data;
  }
  public static final BitSet _tokenSet_6 = new BitSet(mk_tokenSet_6());
 
  }
TOP

Related Classes of org.antlr.stringtemplate.language.ActionLexer

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.