Package com.gamalocus.jshop2rt

Source Code of com.gamalocus.jshop2rt.JSHOP2Lexer

// $ANTLR 2.7.3-20030430: "JSHOP2.g" -> "JSHOP2Lexer.java"$

  package com.gamalocus.jshop2rt;

  import java.io.IOException;
  import java.util.LinkedList;
  import java.util.Vector;

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 JSHOP2Lexer extends antlr.CharScanner implements JSHOP2TokenTypes, TokenStream
{
public JSHOP2Lexer(InputStream in) {
  this(new ByteBuffer(in));
}
public JSHOP2Lexer(Reader in) {
  this(new CharBuffer(in));
}
public JSHOP2Lexer(InputBuffer ib) {
  this(new LexerSharedInputState(ib));
}
public JSHOP2Lexer(LexerSharedInputState state) {
  super(state);
  caseSensitiveLiterals = false;
  setCaseSensitive(false);
  literals = new Hashtable();
  literals.put(new ANTLRHashString("imply", this), new Integer(24));
  literals.put(new ANTLRHashString("nil", this), new Integer(8));
  literals.put(new ANTLRHashString("call", this), new Integer(26));
  literals.put(new ANTLRHashString("member", this), new Integer(33));
  literals.put(new ANTLRHashString("stdlib", this), new Integer(42));
  literals.put(new ANTLRHashString("def-problem-set", this), new Integer(41));
  literals.put(new ANTLRHashString("or", this), new Integer(22));
  literals.put(new ANTLRHashString("defproblem", this), new Integer(5));
  literals.put(new ANTLRHashString("assign", this), new Integer(25));
  literals.put(new ANTLRHashString("forall", this), new Integer(15));
  literals.put(new ANTLRHashString("defdomain", this), new Integer(9));
  literals.put(new ANTLRHashString("not", this), new Integer(23));
  literals.put(new ANTLRHashString("and", this), new Integer(21));
}

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 '/':
        {
          mDIV(true);
          theRetToken=_returnToken;
          break;
        }
        case '.':
        {
          mDOT(true);
          theRetToken=_returnToken;
          break;
        }
        case '=':
        {
          mEQUAL(true);
          theRetToken=_returnToken;
          break;
        }
        case '(':
        {
          mLP(true);
          theRetToken=_returnToken;
          break;
        }
        case '\t'case '\n'case '\u000c'case '\r':
        case ' ':
        {
          mWS(true);
          theRetToken=_returnToken;
          break;
        }
        case '*':
        {
          mMULT(true);
          theRetToken=_returnToken;
          break;
        }
        case '^':
        {
          mPOWER(true);
          theRetToken=_returnToken;
          break;
        }
        case ')':
        {
          mRP(true);
          theRetToken=_returnToken;
          break;
        }
        case ';':
        {
          mCOMMENT(true);
          theRetToken=_returnToken;
          break;
        }
        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 '?':
        {
          mVARID(true);
          theRetToken=_returnToken;
          break;
        }
        default:
          if ((LA(1)==':') && (LA(2)=='-')) {
            mAXIOM(true);
            theRetToken=_returnToken;
          }
          else if ((LA(1)=='<') && (LA(2)=='=')) {
            mLESSEQ(true);
            theRetToken=_returnToken;
          }
          else if ((LA(1)=='-') && (_tokenSet_0.member(LA(2)))) {
            mMINUS(true);
            theRetToken=_returnToken;
          }
          else if ((LA(1)=='>') && (LA(2)=='=')) {
            mMOREEQ(true);
            theRetToken=_returnToken;
          }
          else if ((LA(1)=='!') && (LA(2)=='=')) {
            mNOTEQ(true);
            theRetToken=_returnToken;
          }
          else if ((LA(1)=='+') && (_tokenSet_0.member(LA(2)))) {
            mPLUS(true);
            theRetToken=_returnToken;
          }
          else if ((LA(1)==':') && (LA(2)=='f')) {
            mFIRST(true);
            theRetToken=_returnToken;
          }
          else if ((LA(1)==':') && (LA(2)=='i')) {
            mIMMEDIATE(true);
            theRetToken=_returnToken;
          }
          else if ((LA(1)==':') && (LA(2)=='m')) {
            mMETHOD(true);
            theRetToken=_returnToken;
          }
          else if ((LA(1)==':') && (LA(2)=='o')) {
            mOPERATOR(true);
            theRetToken=_returnToken;
          }
          else if ((LA(1)==':') && (LA(2)=='p')) {
            mPROTECTION(true);
            theRetToken=_returnToken;
          }
          else if ((LA(1)==':') && (LA(2)=='s')) {
            mSORT(true);
            theRetToken=_returnToken;
          }
          else if ((LA(1)==':') && (LA(2)=='u')) {
            mUNORDERED(true);
            theRetToken=_returnToken;
          }
          else if ((LA(1)=='<') && (true)) {
            mLESS(true);
            theRetToken=_returnToken;
          }
          else if ((LA(1)=='>') && (true)) {
            mMORE(true);
            theRetToken=_returnToken;
          }
          else if ((LA(1)=='!') && (true)) {
            mOPID(true);
            theRetToken=_returnToken;
          }
          else if ((_tokenSet_1.member(LA(1))) && (true)) {
            mNUM(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 mAXIOM(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = AXIOM;
    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 mDIV(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = DIV;
    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 mEQUAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = EQUAL;
    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 mLESS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = LESS;
    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 mLESSEQ(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = LESSEQ;
    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 mLP(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = LP;
    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 mMINUS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = MINUS;
    int _saveIndex;
   
    match('-');
    mWS(false);
    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;
   
    {
    switch ( LA(1)) {
    case ' ':
    {
      match(' ');
      break;
    }
    case '\t':
    {
      match('\t');
      break;
    }
    case '\u000c':
    {
      match('\f');
      break;
    }
    case '\n'case '\r':
    {
      {
      if ((LA(1)=='\r') && (LA(2)=='\n')) {
        match("\r\n");
      }
      else if ((LA(1)=='\r') && (true)) {
        match('\r');
      }
      else if ((LA(1)=='\n')) {
        match('\n');
      }
      else {
        throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
      }
     
      }
     
      newline();
     
      break;
    }
    default:
    {
      throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
    }
    }
    }
   
    _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;
  }
 
  public final void mMORE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = MORE;
    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 mMOREEQ(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = MOREEQ;
    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 mMULT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = MULT;
    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 mNOTEQ(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = NOTEQ;
    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('+');
    mWS(false);
    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 mPOWER(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = POWER;
    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 mRP(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = RP;
    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 mFIRST(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = FIRST;
    int _saveIndex;
   
    match(":first");
    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 mIMMEDIATE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = IMMEDIATE;
    int _saveIndex;
   
    match(":immediate");
    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 mMETHOD(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = METHOD;
    int _saveIndex;
   
    match(":method");
    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 mOPERATOR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = OPERATOR;
    int _saveIndex;
   
    match(":operator");
    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 mPROTECTION(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = PROTECTION;
    int _saveIndex;
   
    match(":protection");
    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 mSORT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = SORT;
    int _saveIndex;
   
    match(":sort-by");
    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 mUNORDERED(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = UNORDERED;
    int _saveIndex;
   
    match(":unordered");
    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 mCOMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = COMMENT;
    int _saveIndex;
   
    match(';');
    {
    _loop89:
    do {
      if ((_tokenSet_2.member(LA(1)))) {
        {
        match(_tokenSet_2);
        }
      }
      else {
        break _loop89;
      }
     
    } while (true);
    }
   
    _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;
  }
 
  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 '_':
    {
      match('_');
      break;
    }
    default:
    {
      throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
    }
    }
    }
    {
    _loop93:
    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 '-':
      {
        match('-');
        break;
      }
      case '_':
      {
        match('_');
        break;
      }
      case '?':
      {
        match('?');
        break;
      }
      case '!':
      {
        match('!');
        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;
      }
      default:
      {
        break _loop93;
      }
      }
    } 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 mOPID(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = OPID;
    int _saveIndex;
   
    match('!');
    {
    _loop96:
    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 '-':
      {
        match('-');
        break;
      }
      case '_':
      {
        match('_');
        break;
      }
      case '?':
      {
        match('?');
        break;
      }
      case '!':
      {
        match('!');
        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;
      }
      default:
      {
        break _loop96;
      }
      }
    } 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 mVARID(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = VARID;
    int _saveIndex;
   
    match('?');
    {
    _loop99:
    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 '-':
      {
        match('-');
        break;
      }
      case '_':
      {
        match('_');
        break;
      }
      case '?':
      {
        match('?');
        break;
      }
      case '!':
      {
        match('!');
        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;
      }
      default:
      {
        break _loop99;
      }
      }
    } 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 mNUM(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = NUM;
    int _saveIndex;
   
    {
    switch ( LA(1)) {
    case '-':
    {
      match('-');
      break;
    }
    case '+':
    {
      match('+');
      break;
    }
    case '0'case '1'case '2'case '3':
    case '4'case '5'case '6'case '7':
    case '8'case '9':
    {
      break;
    }
    default:
    {
      throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
    }
    }
    }
    {
    int _cnt103=0;
    _loop103:
    do {
      if (((LA(1) >= '0' && LA(1) <= '9'))) {
        matchRange('0','9');
      }
      else {
        if ( _cnt103>=1 ) { break _loop103; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
      }
     
      _cnt103++;
    } while (true);
    }
    {
    if ((LA(1)=='.')) {
      match('.');
      {
      int _cnt106=0;
      _loop106:
      do {
        if (((LA(1) >= '0' && LA(1) <= '9'))) {
          matchRange('0','9');
        }
        else {
          if ( _cnt106>=1 ) { break _loop106; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
        }
       
        _cnt106++;
      } while (true);
      }
    }
    else {
    }
   
    }
    {
    if ((LA(1)=='e')) {
      match('e');
      {
      switch ( LA(1)) {
      case '-':
      {
        match('-');
        break;
      }
      case '+':
      {
        match('+');
        break;
      }
      case '0'case '1'case '2'case '3':
      case '4'case '5'case '6'case '7':
      case '8'case '9':
      {
        break;
      }
      default:
      {
        throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
      }
      }
      }
      {
      int _cnt110=0;
      _loop110:
      do {
        if (((LA(1) >= '0' && LA(1) <= '9'))) {
          matchRange('0','9');
        }
        else {
          if ( _cnt110>=1 ) { break _loop110; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
        }
       
        _cnt110++;
      } while (true);
      }
    }
    else {
    }
   
    }
    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 = { 4294981120L, 0L, 0L, 0L, 0L};
    return data;
  }
  public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0());
  private static final long[] mk_tokenSet_1() {
    long[] data = { 287992881640112128L, 0L, 0L, 0L, 0L};
    return data;
  }
  public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1());
  private static final long[] mk_tokenSet_2() {
    long[] data = new long[8];
    data[0]=-9217L;
    for (int i = 1; i<=3; i++) { data[i]=-1L; }
    return data;
  }
  public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2());
 
  }
TOP

Related Classes of com.gamalocus.jshop2rt.JSHOP2Lexer

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.