Package persistence.antlr

Examples of persistence.antlr.Token


 
/** Match a.b.c.d qualified ids; WILDCARD here is overloaded as
*  id separator; that is, I need a reference to the '.' token.
*/
  public final Token  qualifiedID() throws RecognitionException, TokenStreamException {
    Token qidTok=null;
   
   
      StringBuffer buf = new StringBuffer(30);
      Token a;
   
   
    a=id();
    if ( inputState.guessing==0 ) {
      buf.append(a.getText());
    }
    {
    _loop144:
    do {
      if ((LA(1)==WILDCARD)) {
        match(WILDCARD);
        a=id();
        if ( inputState.guessing==0 ) {
          buf.append('.'); buf.append(a.getText());
        }
      }
      else {
        break _loop144;
      }
     
    } while (true);
    }
    if ( inputState.guessing==0 ) {
     
           // can use either TOKEN_REF or RULE_REF; should
           // really create a QID or something instead.
           qidTok = new CommonToken(TOKEN_REF, buf.toString());
           qidTok.setLine(a.getLine());
         
    }
    return qidTok;
  }
View Full Code Here


  }
 
  public final  BitSet  setBlockElement() throws RecognitionException, TokenStreamException {
     BitSet b ;
   
    Token  c1 = null;
    Token  c2 = null;
   
      b = null;
      int rangeMin = 0;
   
   
    c1 = LT(1);
    match(CHAR_LITERAL);
    if ( inputState.guessing==0 ) {
     
          rangeMin = ANTLRLexer.tokenTypeForCharLiteral(c1.getText());
          b = BitSet.of(rangeMin);
       
    }
    {
    switch ( LA(1)) {
    case RANGE:
    {
      match(RANGE);
      c2 = LT(1);
      match(CHAR_LITERAL);
      if ( inputState.guessing==0 ) {
       
              int rangeMax = ANTLRLexer.tokenTypeForCharLiteral(c2.getText());
              if (rangeMax < rangeMin) {
                antlrTool.error("Malformed range line ", getFilename(), c1.getLine(), c1.getColumn());
              }
              for (int i = rangeMin+1; i <= rangeMax; i++) {
                b.add(i);
View Full Code Here

    return b ;
  }
 
  public final void tokensSpec() throws RecognitionException, TokenStreamException {
   
    Token  t1 = null;
    Token  s1 = null;
    Token  s3 = null;
   
    match(TOKENS);
    {
    int _cnt43=0;
    _loop43:
View Full Code Here

  public final void tokensSpecOptions(
    Token t
  ) throws RecognitionException, TokenStreamException {
   
   
      Token o=null, v=null;
   
   
    match(OPEN_ELEMENT_OPTION);
    o=id();
    match(ASSIGN);
View Full Code Here

    return sup;
  }
 
  public final void rule() throws RecognitionException, TokenStreamException {
   
    Token  d = null;
    Token  p1 = null;
    Token  p2 = null;
    Token  p3 = null;
    Token  aa = null;
    Token  rt = null;
    Token  a = null;
   
      String access="public";
      Token idTok;
      String doc=null;
      boolean ruleAutoGen = true;
      blockNesting = -1// block increments, so -1 to make rule at level 0
   
   
    {
    switch ( LA(1)) {
    case DOC_COMMENT:
    {
      d = LT(1);
      match(DOC_COMMENT);
      if ( inputState.guessing==0 ) {
        doc=d.getText();
      }
      break;
    }
    case TOKEN_REF:
    case LITERAL_protected:
    case LITERAL_public:
    case LITERAL_private:
    case RULE_REF:
    {
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    }
    {
    switch ( LA(1)) {
    case LITERAL_protected:
    {
      p1 = LT(1);
      match(LITERAL_protected);
      if ( inputState.guessing==0 ) {
        access=p1.getText();
      }
      break;
    }
    case LITERAL_public:
    {
      p2 = LT(1);
      match(LITERAL_public);
      if ( inputState.guessing==0 ) {
        access=p2.getText();
      }
      break;
    }
    case LITERAL_private:
    {
      p3 = LT(1);
      match(LITERAL_private);
      if ( inputState.guessing==0 ) {
        access=p3.getText();
      }
      break;
    }
    case TOKEN_REF:
    case RULE_REF:
    {
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    }
    idTok=id();
    {
    switch ( LA(1)) {
    case BANG:
    {
      match(BANG);
      if ( inputState.guessing==0 ) {
        ruleAutoGen = false;
      }
      break;
    }
    case ACTION:
    case OPTIONS:
    case ARG_ACTION:
    case LITERAL_returns:
    case COLON:
    case LITERAL_throws:
    {
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    }
    if ( inputState.guessing==0 ) {
     
          behavior.defineRuleName(idTok, access, ruleAutoGen, doc);
       
    }
    {
    switch ( LA(1)) {
    case ARG_ACTION:
    {
      aa = LT(1);
      match(ARG_ACTION);
      if ( inputState.guessing==0 ) {
        behavior.refArgAction(aa);
      }
      break;
    }
    case ACTION:
    case OPTIONS:
    case LITERAL_returns:
    case COLON:
    case LITERAL_throws:
    {
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    }
    {
    switch ( LA(1)) {
    case LITERAL_returns:
    {
      match(LITERAL_returns);
      rt = LT(1);
      match(ARG_ACTION);
      if ( inputState.guessing==0 ) {
        behavior.refReturnAction(rt);
      }
      break;
    }
    case ACTION:
    case OPTIONS:
    case COLON:
    case LITERAL_throws:
    {
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    }
    {
    switch ( LA(1)) {
    case LITERAL_throws:
    {
      throwsSpec();
      break;
    }
    case ACTION:
    case OPTIONS:
    case COLON:
    {
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    }
    {
    switch ( LA(1)) {
    case OPTIONS:
    {
      ruleOptionsSpec();
      break;
    }
    case ACTION:
    case COLON:
    {
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    }
    {
    switch ( LA(1)) {
    case ACTION:
    {
      a = LT(1);
      match(ACTION);
      if ( inputState.guessing==0 ) {
        behavior.refInitAction(a);
      }
      break;
    }
    case COLON:
    {
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    }
    match(COLON);
    block();
    match(SEMI);
    {
    switch ( LA(1)) {
    case LITERAL_exception:
    {
      exceptionGroup();
      break;
    }
    case EOF:
    case ACTION:
    case DOC_COMMENT:
    case LITERAL_lexclass:
    case LITERAL_class:
    case TOKEN_REF:
    case LITERAL_protected:
    case LITERAL_public:
    case LITERAL_private:
    case RULE_REF:
    {
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    }
    if ( inputState.guessing==0 ) {
      behavior.endRule(idTok.getText());
    }
  }
View Full Code Here

 
  public final void throwsSpec() throws RecognitionException, TokenStreamException {
   
   
      String t=null;
      Token a,b;
   
   
    match(LITERAL_throws);
    a=id();
    if ( inputState.guessing==0 ) {
      t=a.getText();
    }
    {
    _loop84:
    do {
      if ((LA(1)==COMMA)) {
View Full Code Here

    }
  }
 
  public final void ruleOptionsSpec() throws RecognitionException, TokenStreamException {
   
    Token idTok; Token value;
   
    match(OPTIONS);
    {
    _loop81:
    do {
View Full Code Here

    }
  }
 
  public final void exceptionSpec() throws RecognitionException, TokenStreamException {
   
    Token  aa = null;
    Token labelAction = null;
   
    match(LITERAL_exception);
    {
    switch ( LA(1)) {
    case ARG_ACTION:
View Full Code Here

    }
  }
 
  public final void exceptionHandler() throws RecognitionException, TokenStreamException {
   
    Token  a1 = null;
    Token  a2 = null;
    Token exType; Token exName;
   
    match(LITERAL_catch);
    a1 = LT(1);
    match(ARG_ACTION);
    a2 = LT(1);
View Full Code Here

    }
  }
 
  public final void elementNoOptionSpec() throws RecognitionException, TokenStreamException {
   
    Token  rr = null;
    Token  aa = null;
    Token  tr = null;
    Token  aa2 = null;
    Token  r2 = null;
    Token  aa3 = null;
    Token  a = null;
    Token  p = null;
   
      Token label = null;
      Token assignId = null;
      Token args = null;
      int autoGen = GrammarElement.AUTO_GEN_NONE;
   
   
    switch ( LA(1)) {
    case ACTION:
View Full Code Here

TOP

Related Classes of persistence.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.