ActionLexer.cs :  » Template-Engines » StringTemplate.NET » Antlr » StringTemplate » Language » C# / CSharp Open Source

Home
C# / CSharp Open Source
1.2.6.4 mono .net core
2.2.6.4 mono core
3.Aspect Oriented Frameworks
4.Bloggers
5.Build Systems
6.Business Application
7.Charting Reporting Tools
8.Chat Servers
9.Code Coverage Tools
10.Content Management Systems CMS
11.CRM ERP
12.Database
13.Development
14.Email
15.Forum
16.Game
17.GIS
18.GUI
19.IDEs
20.Installers Generators
21.Inversion of Control Dependency Injection
22.Issue Tracking
23.Logging Tools
24.Message
25.Mobile
26.Network Clients
27.Network Servers
28.Office
29.PDF
30.Persistence Frameworks
31.Portals
32.Profilers
33.Project Management
34.RSS RDF
35.Rule Engines
36.Script
37.Search Engines
38.Sound Audio
39.Source Control
40.SQL Clients
41.Template Engines
42.Testing
43.UML
44.Web Frameworks
45.Web Service
46.Web Testing
47.Wiki Engines
48.Windows Presentation Foundation
49.Workflows
50.XML Parsers
C# / C Sharp
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source » Template Engines » StringTemplate.NET 
StringTemplate.NET » Antlr » StringTemplate » Language » ActionLexer.cs
// $ANTLR 2.7.6 (2005-12-22): "action.g" -> "ActionLexer.cs"$

/*
 [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.
*/
using System.Collections;

namespace Antlr.StringTemplate.Language{
  // Generate header specific to lexer CSharp file
  using System;
  using Stream                          = System.IO.Stream;
  using TextReader                      = System.IO.TextReader;
  using Hashtable                       = System.Collections.Hashtable;
  using Comparer                        = System.Collections.Comparer;
  
  using TokenStreamException            = antlr.TokenStreamException;
  using TokenStreamIOException          = antlr.TokenStreamIOException;
  using TokenStreamRecognitionException = antlr.TokenStreamRecognitionException;
  using CharStreamException             = antlr.CharStreamException;
  using CharStreamIOException           = antlr.CharStreamIOException;
  using ANTLRException                  = antlr.ANTLRException;
  using CharScanner                     = antlr.CharScanner;
  using InputBuffer                     = antlr.InputBuffer;
  using ByteBuffer                      = antlr.ByteBuffer;
  using CharBuffer                      = antlr.CharBuffer;
  using Token                           = antlr.Token;
  using IToken                          = antlr.IToken;
  using CommonToken                     = antlr.CommonToken;
  using SemanticException               = antlr.SemanticException;
  using RecognitionException            = antlr.RecognitionException;
  using NoViableAltForCharException     = antlr.NoViableAltForCharException;
  using MismatchedCharException         = antlr.MismatchedCharException;
  using TokenStream                     = antlr.TokenStream;
  using LexerSharedInputState           = antlr.LexerSharedInputState;
  using BitSet                          = antlr.collections.impl.BitSet;
  
  public   class ActionLexer : antlr.CharScanner  , TokenStream
   {
    public const int EOF = 1;
    public const int NULL_TREE_LOOKAHEAD = 3;
    public const int APPLY = 4;
    public const int MULTI_APPLY = 5;
    public const int ARGS = 6;
    public const int INCLUDE = 7;
    public const int CONDITIONAL = 8;
    public const int VALUE = 9;
    public const int TEMPLATE = 10;
    public const int FUNCTION = 11;
    public const int SINGLEVALUEARG = 12;
    public const int LIST = 13;
    public const int SEMI = 14;
    public const int LPAREN = 15;
    public const int RPAREN = 16;
    public const int COMMA = 17;
    public const int ID = 18;
    public const int ASSIGN = 19;
    public const int COLON = 20;
    public const int NOT = 21;
    public const int PLUS = 22;
    public const int LITERAL_super = 23;
    public const int DOT = 24;
    public const int LITERAL_first = 25;
    public const int LITERAL_rest = 26;
    public const int LITERAL_last = 27;
    public const int LITERAL_length = 28;
    public const int LITERAL_strip = 29;
    public const int LITERAL_trunc = 30;
    public const int ANONYMOUS_TEMPLATE = 31;
    public const int STRING = 32;
    public const int INT = 33;
    public const int LBRACK = 34;
    public const int RBRACK = 35;
    public const int DOTDOTDOT = 36;
    public const int TEMPLATE_ARGS = 37;
    public const int NESTED_ANONYMOUS_TEMPLATE = 38;
    public const int ESC_CHAR = 39;
    public const int WS = 40;
    public const int WS_CHAR = 41;
    
    public ActionLexer(Stream ins) : this(new ByteBuffer(ins))
    {
    }
    
    public ActionLexer(TextReader r) : this(new CharBuffer(r))
    {
    }
    
    public ActionLexer(InputBuffer ib)     : this(new LexerSharedInputState(ib))
    {
    }
    
    public ActionLexer(LexerSharedInputState state) : base(state)
    {
      initialize();
    }
    private void initialize()
    {
      caseSensitiveLiterals = true;
      setCaseSensitive(true);
      literals = new Hashtable(100, (float) 0.4, null, Comparer.Default);
      literals.Add("if", 8);
      literals.Add("rest", 26);
      literals.Add("last", 27);
      literals.Add("length", 28);
      literals.Add("strip", 29);
      literals.Add("trunc", 30);
      literals.Add("first", 25);
      literals.Add("super", 23);
    }
    
    override public IToken nextToken()      //throws TokenStreamException
    {
      IToken theRetToken = null;
tryAgain:
      for (;;)
      {
        IToken _token = null;
        int _ttype = Token.INVALID_TYPE;
        resetText();
        try     // for char stream error handling
        {
          try     // for lexical error handling
          {
            switch ( cached_LA1 )
            {
            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 ((cached_LA1=='.') && (cached_LA2=='.'))
              {
                mDOTDOTDOT(true);
                theRetToken = returnToken_;
              }
              else if ((cached_LA1=='.') && (true)) {
                mDOT(true);
                theRetToken = returnToken_;
              }
            else
            {
              if (cached_LA1==EOF_CHAR) { uponEOF(); returnToken_ = makeToken(Token.EOF_TYPE); }
        else {throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());}
            }
            break; }
            if ( null==returnToken_ ) goto tryAgain; // found SKIP token
            _ttype = returnToken_.Type;
            returnToken_.Type = _ttype;
            return returnToken_;
          }
          catch (RecognitionException e) {
              throw new TokenStreamRecognitionException(e);
          }
        }
        catch (CharStreamException cse) {
          if ( cse is CharStreamIOException ) {
            throw new TokenStreamIOException(((CharStreamIOException)cse).io);
          }
          else {
            throw new TokenStreamException(cse.Message);
          }
        }
      }
    }
    
  public void mID(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
{
    int _ttype; IToken _token=null; int _begin=text.Length;
    _ttype = ID;
    
    {
      switch ( cached_LA1 )
      {
      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(cached_LA1, getFilename(), getLine(), getColumn());
      }
       }
    }
    {    // ( ... )*
      for (;;)
      {
        switch ( cached_LA1 )
        {
        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:
        {
          goto _loop54_breakloop;
        }
         }
      }
_loop54_breakloop:      ;
    }    // ( ... )*
    _ttype = testLiteralsTable(_ttype);
    if (_createToken && (null == _token) && (_ttype != Token.SKIP))
    {
      _token = makeToken(_ttype);
      _token.setText(text.ToString(_begin, text.Length-_begin));
    }
    returnToken_ = _token;
  }
  
  public void mINT(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
{
    int _ttype; IToken _token=null; int _begin=text.Length;
    _ttype = INT;
    
    { // ( ... )+
      int _cnt57=0;
      for (;;)
      {
        if (((cached_LA1 >= '0' && cached_LA1 <= '9')))
        {
          matchRange('0','9');
        }
        else
        {
          if (_cnt57 >= 1) { goto _loop57_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
        }
        
        _cnt57++;
      }
_loop57_breakloop:      ;
    }    // ( ... )+
    if (_createToken && (null == _token) && (_ttype != Token.SKIP))
    {
      _token = makeToken(_ttype);
      _token.setText(text.ToString(_begin, text.Length-_begin));
    }
    returnToken_ = _token;
  }
  
  public void mSTRING(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
{
    int _ttype; IToken _token=null; int _begin=text.Length;
    _ttype = STRING;
    
    int _saveIndex = 0;
    _saveIndex = text.Length;
    match('"');
    text.Length = _saveIndex;
    {    // ( ... )*
      for (;;)
      {
        if ((cached_LA1=='\\'))
        {
          mESC_CHAR(false,true);
        }
        else if ((tokenSet_0_.member(cached_LA1))) {
          matchNot('"');
        }
        else
        {
          goto _loop60_breakloop;
        }
        
      }
_loop60_breakloop:      ;
    }    // ( ... )*
    _saveIndex = text.Length;
    match('"');
    text.Length = _saveIndex;
    if (_createToken && (null == _token) && (_ttype != Token.SKIP))
    {
      _token = makeToken(_ttype);
      _token.setText(text.ToString(_begin, text.Length-_begin));
    }
    returnToken_ = _token;
  }
  
/** Match escape sequences, optionally translating them for strings, but not
 *  for templates.  Do \} only when in {...} templates.
 */
  protected void mESC_CHAR(bool _createToken,
    bool doEscape
  ) //throws RecognitionException, CharStreamException, TokenStreamException
{
    int _ttype; IToken _token=null; int _begin=text.Length;
    _ttype = ESC_CHAR;
    char  c = '\0';
    
    match('\\');
    {
      if ((cached_LA1=='n') && ((cached_LA2 >= '\u0003' && cached_LA2 <= '\ufffe')))
      {
        match('n');
        if (0==inputState.guessing)
        {
          if (doEscape) { text.Length = _begin; text.Append("\n"); }
        }
      }
      else if ((cached_LA1=='r') && ((cached_LA2 >= '\u0003' && cached_LA2 <= '\ufffe'))) {
        match('r');
        if (0==inputState.guessing)
        {
          if (doEscape) { text.Length = _begin; text.Append("\r"); }
        }
      }
      else if ((cached_LA1=='t') && ((cached_LA2 >= '\u0003' && cached_LA2 <= '\ufffe'))) {
        match('t');
        if (0==inputState.guessing)
        {
          if (doEscape) { text.Length = _begin; text.Append("\t"); }
        }
      }
      else if ((cached_LA1=='b') && ((cached_LA2 >= '\u0003' && cached_LA2 <= '\ufffe'))) {
        match('b');
        if (0==inputState.guessing)
        {
          if (doEscape) { text.Length = _begin; text.Append("\b"); }
        }
      }
      else if ((cached_LA1=='f') && ((cached_LA2 >= '\u0003' && cached_LA2 <= '\ufffe'))) {
        match('f');
        if (0==inputState.guessing)
        {
          if (doEscape) { text.Length = _begin; text.Append("\f"); }
        }
      }
      else if (((cached_LA1 >= '\u0003' && cached_LA1 <= '\ufffe')) && ((cached_LA2 >= '\u0003' && cached_LA2 <= '\ufffe'))) {
        c = cached_LA1;
        matchNot(EOF/*_CHAR*/);
        if (0==inputState.guessing)
        {
          if (doEscape) {text.Length = _begin; text.Append(c);}
        }
      }
      else
      {
        throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
      }
      
    }
    if (_createToken && (null == _token) && (_ttype != Token.SKIP))
    {
      _token = makeToken(_ttype);
      _token.setText(text.ToString(_begin, text.Length-_begin));
    }
    returnToken_ = _token;
  }
  
  public void mANONYMOUS_TEMPLATE(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
{
    int _ttype; IToken _token=null; int _begin=text.Length;
    _ttype = ANONYMOUS_TEMPLATE;
    
    IList args=null;
    StringTemplateToken t = null;
    
    
    int _saveIndex = 0;
    _saveIndex = text.Length;
    match('{');
    text.Length = _saveIndex;
    {
      bool synPredMatched64 = false;
      if (((tokenSet_1_.member(cached_LA1)) && (tokenSet_2_.member(cached_LA2))))
      {
        int _m64 = mark();
        synPredMatched64 = true;
        inputState.guessing++;
        try {
          {
            mTEMPLATE_ARGS(false);
          }
        }
        catch (RecognitionException)
        {
          synPredMatched64 = false;
        }
        rewind(_m64);
        inputState.guessing--;
      }
      if ( synPredMatched64 )
      {
        args=mTEMPLATE_ARGS(false);
        {
          if ((tokenSet_3_.member(cached_LA1)) && ((cached_LA2 >= '\u0003' && cached_LA2 <= '\ufffe')))
          {
            _saveIndex = text.Length;
            mWS_CHAR(false);
            text.Length = _saveIndex;
          }
          else if (((cached_LA1 >= '\u0003' && cached_LA1 <= '\ufffe')) && (true)) {
          }
          else
          {
            throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
          }
          
        }
        if (0==inputState.guessing)
        {
          
                      // create a special token to track args
                      t = new StringTemplateToken(ANONYMOUS_TEMPLATE,text.ToString(_begin, text.Length-_begin),args);
                      _token = t;
            
        }
      }
      else if (((cached_LA1 >= '\u0003' && cached_LA1 <= '\ufffe')) && (true)) {
      }
      else
      {
        throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
      }
      
    }
    {    // ( ... )*
      for (;;)
      {
        if ((cached_LA1=='\\') && (cached_LA2=='{'))
        {
          _saveIndex = text.Length;
          match('\\');
          text.Length = _saveIndex;
          match('{');
        }
        else if ((cached_LA1=='\\') && (cached_LA2=='}')) {
          _saveIndex = text.Length;
          match('\\');
          text.Length = _saveIndex;
          match('}');
        }
        else if ((cached_LA1=='\\') && ((cached_LA2 >= '\u0003' && cached_LA2 <= '\ufffe'))) {
          mESC_CHAR(false,false);
        }
        else if ((cached_LA1=='{')) {
          mNESTED_ANONYMOUS_TEMPLATE(false);
        }
        else if ((tokenSet_4_.member(cached_LA1))) {
          matchNot('}');
        }
        else
        {
          goto _loop67_breakloop;
        }
        
      }
_loop67_breakloop:      ;
    }    // ( ... )*
    if (0==inputState.guessing)
    {
      
                if ( t!=null ) {
                  t.setText(text.ToString(_begin, text.Length-_begin));
                }
        
    }
    _saveIndex = text.Length;
    match('}');
    text.Length = _saveIndex;
    if (_createToken && (null == _token) && (_ttype != Token.SKIP))
    {
      _token = makeToken(_ttype);
      _token.setText(text.ToString(_begin, text.Length-_begin));
    }
    returnToken_ = _token;
  }
  
  protected IList  mTEMPLATE_ARGS(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
{
    IList args=new ArrayList();
    int _ttype; IToken _token=null; int _begin=text.Length;
    _ttype = TEMPLATE_ARGS;
    IToken a = null;
    IToken a2 = null;

    int _saveIndex = 0;
    {
      switch ( cached_LA1 )
      {
      case '\t':  case '\n':  case '\r':  case ' ':
      {
        _saveIndex = text.Length;
        mWS_CHAR(false);
        text.Length = _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(cached_LA1, getFilename(), getLine(), getColumn());
      }
       }
    }
    _saveIndex = text.Length;
    mID(true);
    text.Length = _saveIndex;
    a = returnToken_;
    if (0==inputState.guessing)
    {
      args.Add(a.getText());
    }
    {    // ( ... )*
      for (;;)
      {
        if ((tokenSet_5_.member(cached_LA1)) && (tokenSet_6_.member(cached_LA2)))
        {
          {
            switch ( cached_LA1 )
            {
            case '\t':  case '\n':  case '\r':  case ' ':
            {
              _saveIndex = text.Length;
              mWS_CHAR(false);
              text.Length = _saveIndex;
              break;
            }
            case ',':
            {
              break;
            }
            default:
            {
              throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
            }
             }
          }
          _saveIndex = text.Length;
          match(',');
          text.Length = _saveIndex;
          {
            switch ( cached_LA1 )
            {
            case '\t':  case '\n':  case '\r':  case ' ':
            {
              _saveIndex = text.Length;
              mWS_CHAR(false);
              text.Length = _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(cached_LA1, getFilename(), getLine(), getColumn());
            }
             }
          }
          _saveIndex = text.Length;
          mID(true);
          text.Length = _saveIndex;
          a2 = returnToken_;
          if (0==inputState.guessing)
          {
            args.Add(a2.getText());
          }
        }
        else
        {
          goto _loop73_breakloop;
        }
        
      }
_loop73_breakloop:      ;
    }    // ( ... )*
    {
      switch ( cached_LA1 )
      {
      case '\t':  case '\n':  case '\r':  case ' ':
      {
        _saveIndex = text.Length;
        mWS_CHAR(false);
        text.Length = _saveIndex;
        break;
      }
      case '|':
      {
        break;
      }
      default:
      {
        throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
      }
       }
    }
    _saveIndex = text.Length;
    match('|');
    text.Length = _saveIndex;
    if (_createToken && (null == _token) && (_ttype != Token.SKIP))
    {
      _token = makeToken(_ttype);
      _token.setText(text.ToString(_begin, text.Length-_begin));
    }
    returnToken_ = _token;
    return args;
  }
  
  protected void mWS_CHAR(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
{
    int _ttype; IToken _token=null; int _begin=text.Length;
    _ttype = WS_CHAR;
    
    switch ( cached_LA1 )
    {
    case ' ':
    {
      match(' ');
      break;
    }
    case '\t':
    {
      match('\t');
      break;
    }
    case '\r':
    {
      match('\r');
      break;
    }
    case '\n':
    {
      match('\n');
      if (0==inputState.guessing)
      {
        newline();
      }
      break;
    }
    default:
    {
      throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
    }
     }
    if (_createToken && (null == _token) && (_ttype != Token.SKIP))
    {
      _token = makeToken(_ttype);
      _token.setText(text.ToString(_begin, text.Length-_begin));
    }
    returnToken_ = _token;
  }
  
  protected void mNESTED_ANONYMOUS_TEMPLATE(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
{
    int _ttype; IToken _token=null; int _begin=text.Length;
    _ttype = NESTED_ANONYMOUS_TEMPLATE;
    
    match('{');
    {    // ( ... )*
      for (;;)
      {
        if ((cached_LA1=='\\') && (cached_LA2=='{'))
        {
          int _saveIndex = 0;
          _saveIndex = text.Length;
          match('\\');
          text.Length = _saveIndex;
          match('{');
        }
        else if ((cached_LA1=='\\') && (cached_LA2=='}')) {
          int _saveIndex = 0;
          _saveIndex = text.Length;
          match('\\');
          text.Length = _saveIndex;
          match('}');
        }
        else if ((cached_LA1=='\\') && ((cached_LA2 >= '\u0003' && cached_LA2 <= '\ufffe'))) {
          mESC_CHAR(false,false);
        }
        else if ((cached_LA1=='{')) {
          mNESTED_ANONYMOUS_TEMPLATE(false);
        }
        else if ((tokenSet_4_.member(cached_LA1))) {
          matchNot('}');
        }
        else
        {
          goto _loop77_breakloop;
        }
        
      }
_loop77_breakloop:      ;
    }    // ( ... )*
    match('}');
    if (_createToken && (null == _token) && (_ttype != Token.SKIP))
    {
      _token = makeToken(_ttype);
      _token.setText(text.ToString(_begin, text.Length-_begin));
    }
    returnToken_ = _token;
  }
  
  public void mLBRACK(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
{
    int _ttype; IToken _token=null; int _begin=text.Length;
    _ttype = LBRACK;
    
    match('[');
    if (_createToken && (null == _token) && (_ttype != Token.SKIP))
    {
      _token = makeToken(_ttype);
      _token.setText(text.ToString(_begin, text.Length-_begin));
    }
    returnToken_ = _token;
  }
  
  public void mRBRACK(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
{
    int _ttype; IToken _token=null; int _begin=text.Length;
    _ttype = RBRACK;
    
    match(']');
    if (_createToken && (null == _token) && (_ttype != Token.SKIP))
    {
      _token = makeToken(_ttype);
      _token.setText(text.ToString(_begin, text.Length-_begin));
    }
    returnToken_ = _token;
  }
  
  public void mLPAREN(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
{
    int _ttype; IToken _token=null; int _begin=text.Length;
    _ttype = LPAREN;
    
    match('(');
    if (_createToken && (null == _token) && (_ttype != Token.SKIP))
    {
      _token = makeToken(_ttype);
      _token.setText(text.ToString(_begin, text.Length-_begin));
    }
    returnToken_ = _token;
  }
  
  public void mRPAREN(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
{
    int _ttype; IToken _token=null; int _begin=text.Length;
    _ttype = RPAREN;
    
    match(')');
    if (_createToken && (null == _token) && (_ttype != Token.SKIP))
    {
      _token = makeToken(_ttype);
      _token.setText(text.ToString(_begin, text.Length-_begin));
    }
    returnToken_ = _token;
  }
  
  public void mCOMMA(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
{
    int _ttype; IToken _token=null; int _begin=text.Length;
    _ttype = COMMA;
    
    match(',');
    if (_createToken && (null == _token) && (_ttype != Token.SKIP))
    {
      _token = makeToken(_ttype);
      _token.setText(text.ToString(_begin, text.Length-_begin));
    }
    returnToken_ = _token;
  }
  
  public void mDOT(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
{
    int _ttype; IToken _token=null; int _begin=text.Length;
    _ttype = DOT;
    
    match('.');
    if (_createToken && (null == _token) && (_ttype != Token.SKIP))
    {
      _token = makeToken(_ttype);
      _token.setText(text.ToString(_begin, text.Length-_begin));
    }
    returnToken_ = _token;
  }
  
  public void mASSIGN(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
{
    int _ttype; IToken _token=null; int _begin=text.Length;
    _ttype = ASSIGN;
    
    match('=');
    if (_createToken && (null == _token) && (_ttype != Token.SKIP))
    {
      _token = makeToken(_ttype);
      _token.setText(text.ToString(_begin, text.Length-_begin));
    }
    returnToken_ = _token;
  }
  
  public void mCOLON(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
{
    int _ttype; IToken _token=null; int _begin=text.Length;
    _ttype = COLON;
    
    match(':');
    if (_createToken && (null == _token) && (_ttype != Token.SKIP))
    {
      _token = makeToken(_ttype);
      _token.setText(text.ToString(_begin, text.Length-_begin));
    }
    returnToken_ = _token;
  }
  
  public void mPLUS(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
{
    int _ttype; IToken _token=null; int _begin=text.Length;
    _ttype = PLUS;
    
    match('+');
    if (_createToken && (null == _token) && (_ttype != Token.SKIP))
    {
      _token = makeToken(_ttype);
      _token.setText(text.ToString(_begin, text.Length-_begin));
    }
    returnToken_ = _token;
  }
  
  public void mSEMI(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
{
    int _ttype; IToken _token=null; int _begin=text.Length;
    _ttype = SEMI;
    
    match(';');
    if (_createToken && (null == _token) && (_ttype != Token.SKIP))
    {
      _token = makeToken(_ttype);
      _token.setText(text.ToString(_begin, text.Length-_begin));
    }
    returnToken_ = _token;
  }
  
  public void mNOT(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
{
    int _ttype; IToken _token=null; int _begin=text.Length;
    _ttype = NOT;
    
    match('!');
    if (_createToken && (null == _token) && (_ttype != Token.SKIP))
    {
      _token = makeToken(_ttype);
      _token.setText(text.ToString(_begin, text.Length-_begin));
    }
    returnToken_ = _token;
  }
  
  public void mDOTDOTDOT(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
{
    int _ttype; IToken _token=null; int _begin=text.Length;
    _ttype = DOTDOTDOT;
    
    match("...");
    if (_createToken && (null == _token) && (_ttype != Token.SKIP))
    {
      _token = makeToken(_ttype);
      _token.setText(text.ToString(_begin, text.Length-_begin));
    }
    returnToken_ = _token;
  }
  
  public void mWS(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
{
    int _ttype; IToken _token=null; int _begin=text.Length;
    _ttype = WS;
    
    { // ( ... )+
      int _cnt94=0;
      for (;;)
      {
        switch ( cached_LA1 )
        {
        case ' ':
        {
          match(' ');
          break;
        }
        case '\t':
        {
          match('\t');
          break;
        }
        case '\r':
        {
          match('\r');
          break;
        }
        case '\n':
        {
          match('\n');
          if (0==inputState.guessing)
          {
            newline();
          }
          break;
        }
        default:
        {
          if (_cnt94 >= 1) { goto _loop94_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
        }
        break; }
        _cnt94++;
      }
_loop94_breakloop:      ;
    }    // ( ... )+
    if (0==inputState.guessing)
    {
      _ttype = Token.SKIP;
    }
    if (_createToken && (null == _token) && (_ttype != Token.SKIP))
    {
      _token = makeToken(_ttype);
      _token.setText(text.ToString(_begin, text.Length-_begin));
    }
    returnToken_ = _token;
  }
  
  
  private static 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;
    for (int i = 1024; i<=2047; i++) { data[i]=0L; }
    return data;
  }
  public static readonly BitSet tokenSet_0_ = new BitSet(mk_tokenSet_0_());
  private static long[] mk_tokenSet_1_()
  {
    long[] data = new long[1025];
    data[0]=4294977024L;
    data[1]=576460745995190270L;
    for (int i = 2; i<=1024; i++) { data[i]=0L; }
    return data;
  }
  public static readonly BitSet tokenSet_1_ = new BitSet(mk_tokenSet_1_());
  private static long[] mk_tokenSet_2_()
  {
    long[] data = new long[1025];
    data[0]=288107235144377856L;
    data[1]=1729382250602037246L;
    for (int i = 2; i<=1024; i++) { data[i]=0L; }
    return data;
  }
  public static readonly BitSet tokenSet_2_ = new BitSet(mk_tokenSet_2_());
  private static long[] mk_tokenSet_3_()
  {
    long[] data = new long[1025];
    data[0]=4294977024L;
    for (int i = 1; i<=1024; i++) { data[i]=0L; }
    return data;
  }
  public static readonly BitSet tokenSet_3_ = new BitSet(mk_tokenSet_3_());
  private static 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;
    for (int i = 1024; i<=2047; i++) { data[i]=0L; }
    return data;
  }
  public static readonly BitSet tokenSet_4_ = new BitSet(mk_tokenSet_4_());
  private static long[] mk_tokenSet_5_()
  {
    long[] data = new long[1025];
    data[0]=17596481021440L;
    for (int i = 1; i<=1024; i++) { data[i]=0L; }
    return data;
  }
  public static readonly BitSet tokenSet_5_ = new BitSet(mk_tokenSet_5_());
  private static long[] mk_tokenSet_6_()
  {
    long[] data = new long[1025];
    data[0]=17596481021440L;
    data[1]=576460745995190270L;
    for (int i = 2; i<=1024; i++) { data[i]=0L; }
    return data;
  }
  public static readonly BitSet tokenSet_6_ = new BitSet(mk_tokenSet_6_());
  
}
}
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.