Package org.jostraca.comp.antlr

Examples of org.jostraca.comp.antlr.Token


    }
    _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 '\n':
    {
      match('\n');
      break;
    }
    case '\r':
    {
      match('\r');
      break;
    }
    default:
    {
      throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
    }
    }
    }
    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;
  }
View Full Code Here


  literals.put(new ANTLRHashString("tokens", this), new Integer(4));
  literals.put(new ANTLRHashString("exception", this), new Integer(39));
}

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)) {
View Full Code Here

    }
  }
}

  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 '\n':
    {
      match('\n');
      newline();
      break;
    }
    default:
      if ((LA(1)=='\r') && (LA(2)=='\n')) {
        match('\r');
        match('\n');
        newline();
      }
      else if ((LA(1)=='\r') && (true)) {
        match('\r');
        newline();
      }
    else {
      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;
  }
View Full Code Here

    }
    _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;
    Token t=null;
   
    {
    if ((LA(1)=='/') && (LA(2)=='/')) {
      mSL_COMMENT(false);
    }
    else if ((LA(1)=='/') && (LA(2)=='*')) {
      mML_COMMENT(true);
      t=_returnToken;
      _ttype = t.getType();
    }
    else {
      throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
    }
   
View Full Code Here

    }
    _returnToken = _token;
  }
 
  protected final void mSL_COMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = SL_COMMENT;
    int _saveIndex;
   
    match("//");
    {
    _loop153:
    do {
      if ((_tokenSet_0.member(LA(1)))) {
        {
        match(_tokenSet_0);
        }
      }
      else {
        break _loop153;
      }
     
    } while (true);
    }
    {
    if ((LA(1)=='\r') && (LA(2)=='\n')) {
      match('\r');
      match('\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();
    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
    }
    _returnToken = _token;
  }
View Full Code Here

    }
    _returnToken = _token;
  }
 
  protected final void mML_COMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = ML_COMMENT;
    int _saveIndex;
   
    match("/*");
    {
    if (((LA(1)=='*') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')))&&( LA(2)!='/' )) {
      match('*');
      _ttype = DOC_COMMENT;
    }
    else if (((LA(1) >= '\u0003' && LA(1) <= '\u00ff')) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff'))) {
    }
    else {
      throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
    }
   
    }
    {
    _loop159:
    do {
      // nongreedy exit test
      if ((LA(1)=='*') && (LA(2)=='/')) break _loop159;
      if ((LA(1)=='\r') && (LA(2)=='\n')) {
        match('\r');
        match('\n');
        newline();
      }
      else if ((LA(1)=='\r') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff'))) {
        match('\r');
        newline();
      }
      else if ((_tokenSet_0.member(LA(1))) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff'))) {
        {
        match(_tokenSet_0);
        }
      }
      else if ((LA(1)=='\n')) {
        match('\n');
        newline();
      }
      else {
        break _loop159;
      }
     
    } 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;
  }
View Full Code Here

    }
    _returnToken = _token;
  }
 
  public final void mOPEN_ELEMENT_OPTION(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = OPEN_ELEMENT_OPTION;
    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;
  }
View Full Code Here

    }
    _returnToken = _token;
  }
 
  public final void mCLOSE_ELEMENT_OPTION(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = CLOSE_ELEMENT_OPTION;
    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;
  }
View Full Code Here

    }
    _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;
  }
View Full Code Here

    }
    _returnToken = _token;
  }
 
  public final void mQUESTION(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = QUESTION;
    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;
  }
View Full Code Here

TOP

Related Classes of org.jostraca.comp.antlr.Token

Copyright © 2018 www.massapicom. 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.