Ejemplo n.º 1
0
        public void Generated_DEDENT_token_is_correct()
        {
            var eofToken = new CommonToken
            {
                Type = Constant.Eof,
                Text = "EOF",
                CharPositionInLine = anyPosition,
                Line = anyLine,
                StartIndex = anyIndex,
                TokenIndex = anyIndex,
                StopIndex = anyIndex,
                Channel = anyChannel,
            };

            this.emitter.Process(this.GetToken(whitespace, " "));
            this.emitter.NextToken();
            this.emitter.NextToken();
            this.emitter.Process(eofToken);
            var token = this.emitter.NextToken();

            Assert.AreEqual(dedent, token.Type);
            Assert.AreEqual("DEDENT", token.Text);
            Assert.AreEqual(channel, token.Channel);
            Assert.AreEqual(anyPosition, token.CharPositionInLine);
            Assert.AreEqual(anyLine, token.Line);
            Assert.AreEqual(anyIndex, token.StartIndex);
            Assert.AreEqual(anyIndex, token.StopIndex);
            Assert.AreEqual(anyIndex, token.TokenIndex);
        }
Ejemplo n.º 2
0
        public void Generated_INDENT_token_is_correct()
        {
            var leadingWhitespaceToken = new CommonToken
            {
                Type = whitespace,
                Text = " ",
                CharPositionInLine = leadingPosition,
                Line = anyLine,
                StartIndex = anyIndex,
                TokenIndex = anyIndex,
                StopIndex = anyIndex,
                Channel = anyChannel,
            };

            this.emitter.Process(leadingWhitespaceToken);
            var token = this.emitter.NextToken();

            Assert.AreEqual(indent, token.Type);
            Assert.AreEqual("INDENT", token.Text);
            Assert.AreEqual(channel, token.Channel);
            Assert.AreEqual(leadingPosition, token.CharPositionInLine);
            Assert.AreEqual(anyLine, token.Line);
            Assert.AreEqual(anyIndex, token.StartIndex);
            Assert.AreEqual(anyIndex, token.StopIndex);
            Assert.AreEqual(anyIndex, token.TokenIndex);
        }
 private AutomationTree Node(string text, params ITree[] children)
 {
     var token = new CommonToken(anyType, text);
     var node = new AutomationTree(token);
     node.AddChildren(children);
     return node;
 }
        public void Static_properties_can_be_accessed_with_case_sensitive_names_from_csharp()
        {
            var child = new AutomationTree(new CommonToken());
            var token = new CommonToken
            {
                Type = anyType,
                Text = anyText,
                CharPositionInLine = anyPosition,
                Line = anyLine,
                TokenIndex = anyTokenIndex,
            };
            var node = new AutomationTree(token);
            node.AddChild(child);
            dynamic tree = node;

            // Case sensitive
            Assert.AreEqual(anyType, tree.Type);
            Assert.AreEqual(anyPosition, tree.CharPositionInLine);
            Assert.AreEqual(1, tree.ChildCount);
            Assert.AreEqual(-1, tree.ChildIndex);
            Assert.AreEqual(anyLine, tree.Line);
            Assert.AreEqual(anyText, tree.Text);
            Assert.AreEqual(anyTokenIndex, tree.TokenStartIndex);
            Assert.AreEqual(anyTokenIndex, tree.TokenStopIndex);
            Assert.AreSame(child, tree.Children[0]);
            Assert.AreSame(token, tree.Token);
            Assert.IsFalse(tree.IsNil);
            Assert.IsNull(tree.Parent);
        }
Ejemplo n.º 5
0
 public void AddToken( CommonToken t, int type, int channel)
 {
    ((CommonToken)t).Type = type;
    ((CommonToken)t).Channel = channel;
    t.Line = lastLine;
    lastLine=input.Line;
    t.CharPositionInLine = lastCharPos;
    lastCharPos=input.CharPositionInLine;
    mRawTokens.Add((CommonToken)t);
 }
Ejemplo n.º 6
0
 public virtual IToken Emit()
 {
     IToken token = new CommonToken(this.input, base.state.type, base.state.channel, base.state.tokenStartCharIndex, this.CharIndex - 1) {
         Line = base.state.tokenStartLine,
         Text = base.state.text,
         CharPositionInLine = base.state.tokenStartCharPositionInLine
     };
     this.Emit(token);
     return token;
 }
Ejemplo n.º 7
0
		protected override object GetMissingSymbol(IIntStream input,
										  RecognitionException e,
										  int expectedTokenType,
										  BitSet follow)
		{
			String tokenText = null;
			if ( expectedTokenType==Token.EOF ) tokenText = "<missing EOF>";
			else tokenText = "<missing " + TokenNames[expectedTokenType] + ">";
			CommonToken t = new CommonToken(expectedTokenType, tokenText);
			IToken current = ((ITokenStream)input).LT(1);
			if (current.Type == Token.EOF) {
				current = ((ITokenStream)input).LT(-1);
			}
			t.line = current.Line;
			t.CharPositionInLine = current.CharPositionInLine;
			t.Channel = DEFAULT_TOKEN_CHANNEL;
			return t;
		}
Ejemplo n.º 8
0
 /** <summary>Return a token from this source; i.e., match a token on the char stream.</summary> */
 public virtual IToken NextToken()
 {
     for ( ; ;)
     {
         state.token                        = null;
         state.channel                      = TokenChannels.Default;
         state.tokenStartCharIndex          = input.Index;
         state.tokenStartCharPositionInLine = input.CharPositionInLine;
         state.tokenStartLine               = input.Line;
         state.text = null;
         if (input.LA(1) == CharStreamConstants.EndOfFile)
         {
             IToken eof = new CommonToken((ICharStream)input, CharStreamConstants.EndOfFile, TokenChannels.Default, input.Index, input.Index);
             eof.Line = Line;
             eof.CharPositionInLine = CharPositionInLine;
             return(eof);
         }
         try
         {
             mTokens();
             if (state.token == null)
             {
                 Emit();
             }
             else if (state.token == Tokens.Skip)
             {
                 continue;
             }
             return(state.token);
         }
         catch (NoViableAltException nva)
         {
             ReportError(nva);
             Recover(nva);   // throw out current char and try again
         }
         catch (RecognitionException re)
         {
             ReportError(re);
             // match() routine has already called recover()
         }
     }
 }
Ejemplo n.º 9
0
 protected override object GetMissingSymbol(IIntStream input, RecognitionException e, int expectedTokenType, BitSet follow)
 {
     string text = null;
     if (expectedTokenType == -1)
     {
         text = "<missing EOF>";
     }
     else
     {
         text = "<missing " + this.TokenNames[expectedTokenType] + ">";
     }
     CommonToken token = new CommonToken(expectedTokenType, text);
     IToken token2 = ((ITokenStream) input).LT(1);
     if (token2.Type == -1)
     {
         token2 = ((ITokenStream) input).LT(-1);
     }
     token.Line = token2.Line;
     token.CharPositionInLine = token2.CharPositionInLine;
     token.Channel = 0;
     return token;
 }
Ejemplo n.º 10
0
 protected override object GetMissingSymbol( IIntStream input,
                                   RecognitionException e,
                                   int expectedTokenType,
                                   BitSet follow )
 {
     string tokenText = null;
     if ( expectedTokenType == TokenTypes.EndOfFile )
         tokenText = "<missing EOF>";
     else
         tokenText = "<missing " + TokenNames[expectedTokenType] + ">";
     CommonToken t = new CommonToken( expectedTokenType, tokenText );
     IToken current = ( (ITokenStream)input ).LT( 1 );
     if ( current.Type == TokenTypes.EndOfFile )
     {
         current = ( (ITokenStream)input ).LT( -1 );
     }
     t.Line = current.Line;
     t.CharPositionInLine = current.CharPositionInLine;
     t.Channel = DefaultTokenChannel;
     t.InputStream = current.InputStream;
     return t;
 }
Ejemplo n.º 11
0
    // $ANTLR end "WS"

    // $ANTLR start "NUM_INT"
    public void mNUM_INT() // throws RecognitionException [2]
    {
    		try
    		{
            int _type = NUM_INT;
    	int _channel = DEFAULT_TOKEN_CHANNEL;
            IToken f1 = null;
            IToken f2 = null;
            IToken f3 = null;
            IToken f4 = null;

            bool isDecimal=false; IToken t=null;
            // Hql.g:742:2: ( '.' ( ( '0' .. '9' )+ ( EXPONENT )? (f1= FLOAT_SUFFIX )? )? | ( '0' ( ( 'x' ) ( HEX_DIGIT )+ | ( '0' .. '7' )+ )? | ( '1' .. '9' ) ( '0' .. '9' )* ) ( ( 'l' ) | {...}? ( '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? | EXPONENT (f3= FLOAT_SUFFIX )? | f4= FLOAT_SUFFIX ) )? )
            int alt20 = 2;
            int LA20_0 = input.LA(1);

            if ( (LA20_0 == '.') )
            {
                alt20 = 1;
            }
            else if ( ((LA20_0 >= '0' && LA20_0 <= '9')) )
            {
                alt20 = 2;
            }
            else 
            {
                if ( state.backtracking > 0 ) {state.failed = true; return ;}
                NoViableAltException nvae_d20s0 =
                    new NoViableAltException("", 20, 0, input);

                throw nvae_d20s0;
            }
            switch (alt20) 
            {
                case 1 :
                    // Hql.g:742:6: '.' ( ( '0' .. '9' )+ ( EXPONENT )? (f1= FLOAT_SUFFIX )? )?
                    {
                    	Match('.'); if (state.failed) return ;
                    	if ( (state.backtracking==0) )
                    	{
                    	  _type = DOT;
                    	}
                    	// Hql.g:743:4: ( ( '0' .. '9' )+ ( EXPONENT )? (f1= FLOAT_SUFFIX )? )?
                    	int alt8 = 2;
                    	int LA8_0 = input.LA(1);

                    	if ( ((LA8_0 >= '0' && LA8_0 <= '9')) )
                    	{
                    	    alt8 = 1;
                    	}
                    	switch (alt8) 
                    	{
                    	    case 1 :
                    	        // Hql.g:743:6: ( '0' .. '9' )+ ( EXPONENT )? (f1= FLOAT_SUFFIX )?
                    	        {
                    	        	// Hql.g:743:6: ( '0' .. '9' )+
                    	        	int cnt5 = 0;
                    	        	do 
                    	        	{
                    	        	    int alt5 = 2;
                    	        	    int LA5_0 = input.LA(1);

                    	        	    if ( ((LA5_0 >= '0' && LA5_0 <= '9')) )
                    	        	    {
                    	        	        alt5 = 1;
                    	        	    }


                    	        	    switch (alt5) 
                    	        		{
                    	        			case 1 :
                    	        			    // Hql.g:743:7: '0' .. '9'
                    	        			    {
                    	        			    	MatchRange('0','9'); if (state.failed) return ;

                    	        			    }
                    	        			    break;

                    	        			default:
                    	        			    if ( cnt5 >= 1 ) goto loop5;
                    	        			    if ( state.backtracking > 0 ) {state.failed = true; return ;}
                    	        		            EarlyExitException eee5 =
                    	        		                new EarlyExitException(5, input);
                    	        		            throw eee5;
                    	        	    }
                    	        	    cnt5++;
                    	        	} while (true);

                    	        	loop5:
                    	        		;	// Stops C# compiler whining that label 'loop5' has no statements

                    	        	// Hql.g:743:18: ( EXPONENT )?
                    	        	int alt6 = 2;
                    	        	int LA6_0 = input.LA(1);

                    	        	if ( (LA6_0 == 'e') )
                    	        	{
                    	        	    alt6 = 1;
                    	        	}
                    	        	switch (alt6) 
                    	        	{
                    	        	    case 1 :
                    	        	        // Hql.g:743:19: EXPONENT
                    	        	        {
                    	        	        	mEXPONENT(); if (state.failed) return ;

                    	        	        }
                    	        	        break;

                    	        	}

                    	        	// Hql.g:743:30: (f1= FLOAT_SUFFIX )?
                    	        	int alt7 = 2;
                    	        	int LA7_0 = input.LA(1);

                    	        	if ( (LA7_0 == 'd' || LA7_0 == 'f' || LA7_0 == 'm') )
                    	        	{
                    	        	    alt7 = 1;
                    	        	}
                    	        	switch (alt7) 
                    	        	{
                    	        	    case 1 :
                    	        	        // Hql.g:743:31: f1= FLOAT_SUFFIX
                    	        	        {
                    	        	        	int f1Start1018 = CharIndex;
                    	        	        	mFLOAT_SUFFIX(); if (state.failed) return ;
                    	        	        	f1 = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, f1Start1018, CharIndex-1);
                    	        	        	if ( (state.backtracking==0) )
                    	        	        	{
                    	        	        	  t=f1;
                    	        	        	}

                    	        	        }
                    	        	        break;

                    	        	}

                    	        	if ( (state.backtracking==0) )
                    	        	{

                    	        	  					if (t != null && t.Text.ToUpperInvariant().IndexOf('F')>=0)
                    	        	  					{
                    	        	  						_type = NUM_FLOAT;
                    	        	  					}
                    	        	  					else if (t != null && t.Text.ToUpperInvariant().IndexOf('M')>=0)
                    	        	  					{
                    	        	  						_type = NUM_DECIMAL;
                    	        	  					}
                    	        	  					else
                    	        	  					{
                    	        	  						_type = NUM_DOUBLE; // assume double
                    	        	  					}
                    	        	  				
                    	        	}

                    	        }
                    	        break;

                    	}


                    }
                    break;
                case 2 :
                    // Hql.g:759:4: ( '0' ( ( 'x' ) ( HEX_DIGIT )+ | ( '0' .. '7' )+ )? | ( '1' .. '9' ) ( '0' .. '9' )* ) ( ( 'l' ) | {...}? ( '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? | EXPONENT (f3= FLOAT_SUFFIX )? | f4= FLOAT_SUFFIX ) )?
                    {
                    	// Hql.g:759:4: ( '0' ( ( 'x' ) ( HEX_DIGIT )+ | ( '0' .. '7' )+ )? | ( '1' .. '9' ) ( '0' .. '9' )* )
                    	int alt13 = 2;
                    	int LA13_0 = input.LA(1);

                    	if ( (LA13_0 == '0') )
                    	{
                    	    alt13 = 1;
                    	}
                    	else if ( ((LA13_0 >= '1' && LA13_0 <= '9')) )
                    	{
                    	    alt13 = 2;
                    	}
                    	else 
                    	{
                    	    if ( state.backtracking > 0 ) {state.failed = true; return ;}
                    	    NoViableAltException nvae_d13s0 =
                    	        new NoViableAltException("", 13, 0, input);

                    	    throw nvae_d13s0;
                    	}
                    	switch (alt13) 
                    	{
                    	    case 1 :
                    	        // Hql.g:759:6: '0' ( ( 'x' ) ( HEX_DIGIT )+ | ( '0' .. '7' )+ )?
                    	        {
                    	        	Match('0'); if (state.failed) return ;
                    	        	if ( (state.backtracking==0) )
                    	        	{
                    	        	  isDecimal = true;
                    	        	}
                    	        	// Hql.g:760:4: ( ( 'x' ) ( HEX_DIGIT )+ | ( '0' .. '7' )+ )?
                    	        	int alt11 = 3;
                    	        	int LA11_0 = input.LA(1);

                    	        	if ( (LA11_0 == 'x') )
                    	        	{
                    	        	    alt11 = 1;
                    	        	}
                    	        	else if ( ((LA11_0 >= '0' && LA11_0 <= '7')) )
                    	        	{
                    	        	    alt11 = 2;
                    	        	}
                    	        	switch (alt11) 
                    	        	{
                    	        	    case 1 :
                    	        	        // Hql.g:760:6: ( 'x' ) ( HEX_DIGIT )+
                    	        	        {
                    	        	        	// Hql.g:760:6: ( 'x' )
                    	        	        	// Hql.g:760:7: 'x'
                    	        	        	{
                    	        	        		Match('x'); if (state.failed) return ;

                    	        	        	}

                    	        	        	// Hql.g:761:5: ( HEX_DIGIT )+
                    	        	        	int cnt9 = 0;
                    	        	        	do 
                    	        	        	{
                    	        	        	    int alt9 = 2;
                    	        	        	    switch ( input.LA(1) ) 
                    	        	        	    {
                    	        	        	    case 'e':
                    	        	        	    	{
                    	        	        	        int LA9_2 = input.LA(2);

                    	        	        	        if ( ((LA9_2 >= '0' && LA9_2 <= '9')) )
                    	        	        	        {
                    	        	        	            int LA9_5 = input.LA(3);

                    	        	        	            if ( (!(((isDecimal)))) )
                    	        	        	            {
                    	        	        	                alt9 = 1;
                    	        	        	            }


                    	        	        	        }

                    	        	        	        else 
                    	        	        	        {
                    	        	        	            alt9 = 1;
                    	        	        	        }

                    	        	        	        }
                    	        	        	        break;
                    	        	        	    case 'd':
                    	        	        	    case 'f':
                    	        	        	    	{
                    	        	        	        int LA9_3 = input.LA(2);

                    	        	        	        if ( (!(((isDecimal)))) )
                    	        	        	        {
                    	        	        	            alt9 = 1;
                    	        	        	        }


                    	        	        	        }
                    	        	        	        break;
                    	        	        	    case '0':
                    	        	        	    case '1':
                    	        	        	    case '2':
                    	        	        	    case '3':
                    	        	        	    case '4':
                    	        	        	    case '5':
                    	        	        	    case '6':
                    	        	        	    case '7':
                    	        	        	    case '8':
                    	        	        	    case '9':
                    	        	        	    case 'a':
                    	        	        	    case 'b':
                    	        	        	    case 'c':
                    	        	        	    	{
                    	        	        	        alt9 = 1;
                    	        	        	        }
                    	        	        	        break;

                    	        	        	    }

                    	        	        	    switch (alt9) 
                    	        	        		{
                    	        	        			case 1 :
                    	        	        			    // Hql.g:768:7: HEX_DIGIT
                    	        	        			    {
                    	        	        			    	mHEX_DIGIT(); if (state.failed) return ;

                    	        	        			    }
                    	        	        			    break;

                    	        	        			default:
                    	        	        			    if ( cnt9 >= 1 ) goto loop9;
                    	        	        			    if ( state.backtracking > 0 ) {state.failed = true; return ;}
                    	        	        		            EarlyExitException eee9 =
                    	        	        		                new EarlyExitException(9, input);
                    	        	        		            throw eee9;
                    	        	        	    }
                    	        	        	    cnt9++;
                    	        	        	} while (true);

                    	        	        	loop9:
                    	        	        		;	// Stops C# compiler whining that label 'loop9' has no statements


                    	        	        }
                    	        	        break;
                    	        	    case 2 :
                    	        	        // Hql.g:770:6: ( '0' .. '7' )+
                    	        	        {
                    	        	        	// Hql.g:770:6: ( '0' .. '7' )+
                    	        	        	int cnt10 = 0;
                    	        	        	do 
                    	        	        	{
                    	        	        	    int alt10 = 2;
                    	        	        	    int LA10_0 = input.LA(1);

                    	        	        	    if ( ((LA10_0 >= '0' && LA10_0 <= '7')) )
                    	        	        	    {
                    	        	        	        alt10 = 1;
                    	        	        	    }


                    	        	        	    switch (alt10) 
                    	        	        		{
                    	        	        			case 1 :
                    	        	        			    // Hql.g:770:7: '0' .. '7'
                    	        	        			    {
                    	        	        			    	MatchRange('0','7'); if (state.failed) return ;

                    	        	        			    }
                    	        	        			    break;

                    	        	        			default:
                    	        	        			    if ( cnt10 >= 1 ) goto loop10;
                    	        	        			    if ( state.backtracking > 0 ) {state.failed = true; return ;}
                    	        	        		            EarlyExitException eee10 =
                    	        	        		                new EarlyExitException(10, input);
                    	        	        		            throw eee10;
                    	        	        	    }
                    	        	        	    cnt10++;
                    	        	        	} while (true);

                    	        	        	loop10:
                    	        	        		;	// Stops C# compiler whining that label 'loop10' has no statements


                    	        	        }
                    	        	        break;

                    	        	}


                    	        }
                    	        break;
                    	    case 2 :
                    	        // Hql.g:772:5: ( '1' .. '9' ) ( '0' .. '9' )*
                    	        {
                    	        	// Hql.g:772:5: ( '1' .. '9' )
                    	        	// Hql.g:772:6: '1' .. '9'
                    	        	{
                    	        		MatchRange('1','9'); if (state.failed) return ;

                    	        	}

                    	        	// Hql.g:772:16: ( '0' .. '9' )*
                    	        	do 
                    	        	{
                    	        	    int alt12 = 2;
                    	        	    int LA12_0 = input.LA(1);

                    	        	    if ( ((LA12_0 >= '0' && LA12_0 <= '9')) )
                    	        	    {
                    	        	        alt12 = 1;
                    	        	    }


                    	        	    switch (alt12) 
                    	        		{
                    	        			case 1 :
                    	        			    // Hql.g:772:17: '0' .. '9'
                    	        			    {
                    	        			    	MatchRange('0','9'); if (state.failed) return ;

                    	        			    }
                    	        			    break;

                    	        			default:
                    	        			    goto loop12;
                    	        	    }
                    	        	} while (true);

                    	        	loop12:
                    	        		;	// Stops C# compiler whining that label 'loop12' has no statements

                    	        	if ( (state.backtracking==0) )
                    	        	{
                    	        	  isDecimal=true;
                    	        	}

                    	        }
                    	        break;

                    	}

                    	// Hql.g:774:3: ( ( 'l' ) | {...}? ( '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? | EXPONENT (f3= FLOAT_SUFFIX )? | f4= FLOAT_SUFFIX ) )?
                    	int alt19 = 3;
                    	int LA19_0 = input.LA(1);

                    	if ( (LA19_0 == 'l') )
                    	{
                    	    alt19 = 1;
                    	}
                    	else if ( (LA19_0 == '.' || (LA19_0 >= 'd' && LA19_0 <= 'f') || LA19_0 == 'm') )
                    	{
                    	    alt19 = 2;
                    	}
                    	switch (alt19) 
                    	{
                    	    case 1 :
                    	        // Hql.g:774:5: ( 'l' )
                    	        {
                    	        	// Hql.g:774:5: ( 'l' )
                    	        	// Hql.g:774:6: 'l'
                    	        	{
                    	        		Match('l'); if (state.failed) return ;

                    	        	}

                    	        	if ( (state.backtracking==0) )
                    	        	{
                    	        	   _type = NUM_LONG; 
                    	        	}

                    	        }
                    	        break;
                    	    case 2 :
                    	        // Hql.g:777:5: {...}? ( '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? | EXPONENT (f3= FLOAT_SUFFIX )? | f4= FLOAT_SUFFIX )
                    	        {
                    	        	if ( !((isDecimal)) ) 
                    	        	{
                    	        	    if ( state.backtracking > 0 ) {state.failed = true; return ;}
                    	        	    throw new FailedPredicateException(input, "NUM_INT", "isDecimal");
                    	        	}
                    	        	// Hql.g:778:4: ( '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? | EXPONENT (f3= FLOAT_SUFFIX )? | f4= FLOAT_SUFFIX )
                    	        	int alt18 = 3;
                    	        	switch ( input.LA(1) ) 
                    	        	{
                    	        	case '.':
                    	        		{
                    	        	    alt18 = 1;
                    	        	    }
                    	        	    break;
                    	        	case 'e':
                    	        		{
                    	        	    alt18 = 2;
                    	        	    }
                    	        	    break;
                    	        	case 'd':
                    	        	case 'f':
                    	        	case 'm':
                    	        		{
                    	        	    alt18 = 3;
                    	        	    }
                    	        	    break;
                    	        		default:
                    	        		    if ( state.backtracking > 0 ) {state.failed = true; return ;}
                    	        		    NoViableAltException nvae_d18s0 =
                    	        		        new NoViableAltException("", 18, 0, input);

                    	        		    throw nvae_d18s0;
                    	        	}

                    	        	switch (alt18) 
                    	        	{
                    	        	    case 1 :
                    	        	        // Hql.g:778:8: '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )?
                    	        	        {
                    	        	        	Match('.'); if (state.failed) return ;
                    	        	        	// Hql.g:778:12: ( '0' .. '9' )*
                    	        	        	do 
                    	        	        	{
                    	        	        	    int alt14 = 2;
                    	        	        	    int LA14_0 = input.LA(1);

                    	        	        	    if ( ((LA14_0 >= '0' && LA14_0 <= '9')) )
                    	        	        	    {
                    	        	        	        alt14 = 1;
                    	        	        	    }


                    	        	        	    switch (alt14) 
                    	        	        		{
                    	        	        			case 1 :
                    	        	        			    // Hql.g:778:13: '0' .. '9'
                    	        	        			    {
                    	        	        			    	MatchRange('0','9'); if (state.failed) return ;

                    	        	        			    }
                    	        	        			    break;

                    	        	        			default:
                    	        	        			    goto loop14;
                    	        	        	    }
                    	        	        	} while (true);

                    	        	        	loop14:
                    	        	        		;	// Stops C# compiler whining that label 'loop14' has no statements

                    	        	        	// Hql.g:778:24: ( EXPONENT )?
                    	        	        	int alt15 = 2;
                    	        	        	int LA15_0 = input.LA(1);

                    	        	        	if ( (LA15_0 == 'e') )
                    	        	        	{
                    	        	        	    alt15 = 1;
                    	        	        	}
                    	        	        	switch (alt15) 
                    	        	        	{
                    	        	        	    case 1 :
                    	        	        	        // Hql.g:778:25: EXPONENT
                    	        	        	        {
                    	        	        	        	mEXPONENT(); if (state.failed) return ;

                    	        	        	        }
                    	        	        	        break;

                    	        	        	}

                    	        	        	// Hql.g:778:36: (f2= FLOAT_SUFFIX )?
                    	        	        	int alt16 = 2;
                    	        	        	int LA16_0 = input.LA(1);

                    	        	        	if ( (LA16_0 == 'd' || LA16_0 == 'f' || LA16_0 == 'm') )
                    	        	        	{
                    	        	        	    alt16 = 1;
                    	        	        	}
                    	        	        	switch (alt16) 
                    	        	        	{
                    	        	        	    case 1 :
                    	        	        	        // Hql.g:778:37: f2= FLOAT_SUFFIX
                    	        	        	        {
                    	        	        	        	int f2Start1220 = CharIndex;
                    	        	        	        	mFLOAT_SUFFIX(); if (state.failed) return ;
                    	        	        	        	f2 = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, f2Start1220, CharIndex-1);
                    	        	        	        	if ( (state.backtracking==0) )
                    	        	        	        	{
                    	        	        	        	  t=f2;
                    	        	        	        	}

                    	        	        	        }
                    	        	        	        break;

                    	        	        	}


                    	        	        }
                    	        	        break;
                    	        	    case 2 :
                    	        	        // Hql.g:779:8: EXPONENT (f3= FLOAT_SUFFIX )?
                    	        	        {
                    	        	        	mEXPONENT(); if (state.failed) return ;
                    	        	        	// Hql.g:779:17: (f3= FLOAT_SUFFIX )?
                    	        	        	int alt17 = 2;
                    	        	        	int LA17_0 = input.LA(1);

                    	        	        	if ( (LA17_0 == 'd' || LA17_0 == 'f' || LA17_0 == 'm') )
                    	        	        	{
                    	        	        	    alt17 = 1;
                    	        	        	}
                    	        	        	switch (alt17) 
                    	        	        	{
                    	        	        	    case 1 :
                    	        	        	        // Hql.g:779:18: f3= FLOAT_SUFFIX
                    	        	        	        {
                    	        	        	        	int f3Start1238 = CharIndex;
                    	        	        	        	mFLOAT_SUFFIX(); if (state.failed) return ;
                    	        	        	        	f3 = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, f3Start1238, CharIndex-1);
                    	        	        	        	if ( (state.backtracking==0) )
                    	        	        	        	{
                    	        	        	        	  t=f3;
                    	        	        	        	}

                    	        	        	        }
                    	        	        	        break;

                    	        	        	}


                    	        	        }
                    	        	        break;
                    	        	    case 3 :
                    	        	        // Hql.g:780:8: f4= FLOAT_SUFFIX
                    	        	        {
                    	        	        	int f4Start1253 = CharIndex;
                    	        	        	mFLOAT_SUFFIX(); if (state.failed) return ;
                    	        	        	f4 = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, f4Start1253, CharIndex-1);
                    	        	        	if ( (state.backtracking==0) )
                    	        	        	{
                    	        	        	  t=f4;
                    	        	        	}

                    	        	        }
                    	        	        break;

                    	        	}

                    	        	if ( (state.backtracking==0) )
                    	        	{

                    	        	  				if (t != null && t.Text.ToUpperInvariant().IndexOf('F') >= 0)
                    	        	  				{
                    	        	  					_type = NUM_FLOAT;
                    	        	  				}
                    	        	  				else if (t != null && t.Text.ToUpperInvariant().IndexOf('M')>=0)
                    	        	  				{
                    	        	  					_type = NUM_DECIMAL;
                    	        	  				}
                    	        	  				else
                    	        	  				{
                    	        	  					_type = NUM_DOUBLE; // assume double
                    	        	  				}
                    	        	  			
                    	        	}

                    	        }
                    	        break;

                    	}


                    }
                    break;

            }
            state.type = _type;
            state.channel = _channel;
        }
        finally 
    	{
        }
    }
Ejemplo n.º 12
0
    // $ANTLR end "DECL_STOP"

    // $ANTLR start "ELEMENT"
    public void mELEMENT() // throws RecognitionException [2]
    {
    		try
    		{
            IToken t = null;
            IToken pi = null;

            // MXMLLexer.g3:108:5: ( ( START_TAG ( ELEMENT | EOL | t= PCDATA | t= CDATA | t= COMMENT | pi= PI )* END_TAG | EMPTY_ELEMENT ) )
            // MXMLLexer.g3:108:7: ( START_TAG ( ELEMENT | EOL | t= PCDATA | t= CDATA | t= COMMENT | pi= PI )* END_TAG | EMPTY_ELEMENT )
            {
            	// MXMLLexer.g3:108:7: ( START_TAG ( ELEMENT | EOL | t= PCDATA | t= CDATA | t= COMMENT | pi= PI )* END_TAG | EMPTY_ELEMENT )
            	int alt14 = 2;
            	alt14 = dfa14.Predict(input);
            	switch (alt14) 
            	{
            	    case 1 :
            	        // MXMLLexer.g3:108:9: START_TAG ( ELEMENT | EOL | t= PCDATA | t= CDATA | t= COMMENT | pi= PI )* END_TAG
            	        {
            	        	mSTART_TAG(); 
            	        	// MXMLLexer.g3:109:13: ( ELEMENT | EOL | t= PCDATA | t= CDATA | t= COMMENT | pi= PI )*
            	        	do 
            	        	{
            	        	    int alt13 = 7;
            	        	    alt13 = dfa13.Predict(input);
            	        	    switch (alt13) 
            	        		{
            	        			case 1 :
            	        			    // MXMLLexer.g3:109:14: ELEMENT
            	        			    {
            	        			    	mELEMENT(); 

            	        			    }
            	        			    break;
            	        			case 2 :
            	        			    // MXMLLexer.g3:110:15: EOL
            	        			    {
            	        			    	mEOL(); 

            	        			    }
            	        			    break;
            	        			case 3 :
            	        			    // MXMLLexer.g3:111:15: t= PCDATA
            	        			    {
            	        			    	int tStart607 = CharIndex;
            	        			    	mPCDATA(); 
            	        			    	t = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, tStart607, CharIndex-1);
            	        			    	 AddToken( (CommonToken)t, PCDATA, 0);

            	        			    }
            	        			    break;
            	        			case 4 :
            	        			    // MXMLLexer.g3:113:15: t= CDATA
            	        			    {
            	        			    	int tStart643 = CharIndex;
            	        			    	mCDATA(); 
            	        			    	t = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, tStart643, CharIndex-1);
            	        			    	 AddToken( (CommonToken)t, CDATA, 0);

            	        			    }
            	        			    break;
            	        			case 5 :
            	        			    // MXMLLexer.g3:115:15: t= COMMENT
            	        			    {
            	        			    	int tStart679 = CharIndex;
            	        			    	mCOMMENT(); 
            	        			    	t = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, tStart679, CharIndex-1);

            	        			    }
            	        			    break;
            	        			case 6 :
            	        			    // MXMLLexer.g3:116:15: pi= PI
            	        			    {
            	        			    	int piStart697 = CharIndex;
            	        			    	mPI(); 
            	        			    	pi = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, piStart697, CharIndex-1);

            	        			    }
            	        			    break;

            	        			default:
            	        			    goto loop13;
            	        	    }
            	        	} while (true);

            	        	loop13:
            	        		;	// Stops C# compiler whining that label 'loop13' has no statements

            	        	mEND_TAG(); 

            	        }
            	        break;
            	    case 2 :
            	        // MXMLLexer.g3:119:11: EMPTY_ELEMENT
            	        {
            	        	mEMPTY_ELEMENT(); 

            	        }
            	        break;

            	}


            }

        }
        finally 
    	{
        }
    }
Ejemplo n.º 13
0
    // $ANTLR end "DOCUMENT"

    // $ANTLR start "DOCTYPE"
    public void mDOCTYPE() // throws RecognitionException [2]
    {
    		try
    		{
            IToken dt = null;
            IToken rootElementName = null;
            IToken sys = null;
            IToken sys1 = null;
            IToken pub = null;
            IToken sys2 = null;
            IToken dtd = null;
            IToken close = null;

            // MXMLLexer.g3:60:5: (dt= DOCTYPE_tag WS rootElementName= GENERIC_ID WS ( (sys= SYSTEM_tag WS sys1= VALUE | pub= PUBLIC_tag WS pub= VALUE WS sys2= VALUE ) ( WS )? )? (dtd= INTERNAL_DTD )? close= TAG_CLOSE )
            // MXMLLexer.g3:61:9: dt= DOCTYPE_tag WS rootElementName= GENERIC_ID WS ( (sys= SYSTEM_tag WS sys1= VALUE | pub= PUBLIC_tag WS pub= VALUE WS sys2= VALUE ) ( WS )? )? (dtd= INTERNAL_DTD )? close= TAG_CLOSE
            {
            	int dtStart120 = CharIndex;
            	mDOCTYPE_tag(); 
            	dt = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, dtStart120, CharIndex-1);
            	AddToken( (CommonToken)dt, DOCTYPE_tag, 0);
            	mWS(); 
            	int rootElementNameStart128 = CharIndex;
            	mGENERIC_ID(); 
            	rootElementName = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, rootElementNameStart128, CharIndex-1);
            	 
            	mWS(); 
            	// MXMLLexer.g3:64:9: ( (sys= SYSTEM_tag WS sys1= VALUE | pub= PUBLIC_tag WS pub= VALUE WS sys2= VALUE ) ( WS )? )?
            	int alt4 = 2;
            	int LA4_0 = input.LA(1);

            	if ( (LA4_0 == 'P' || LA4_0 == 'S') )
            	{
            	    alt4 = 1;
            	}
            	switch (alt4) 
            	{
            	    case 1 :
            	        // MXMLLexer.g3:65:13: (sys= SYSTEM_tag WS sys1= VALUE | pub= PUBLIC_tag WS pub= VALUE WS sys2= VALUE ) ( WS )?
            	        {
            	        	// MXMLLexer.g3:65:13: (sys= SYSTEM_tag WS sys1= VALUE | pub= PUBLIC_tag WS pub= VALUE WS sys2= VALUE )
            	        	int alt2 = 2;
            	        	int LA2_0 = input.LA(1);

            	        	if ( (LA2_0 == 'S') )
            	        	{
            	        	    alt2 = 1;
            	        	}
            	        	else if ( (LA2_0 == 'P') )
            	        	{
            	        	    alt2 = 2;
            	        	}
            	        	else 
            	        	{
            	        	    NoViableAltException nvae_d2s0 =
            	        	        new NoViableAltException("", 2, 0, input);

            	        	    throw nvae_d2s0;
            	        	}
            	        	switch (alt2) 
            	        	{
            	        	    case 1 :
            	        	        // MXMLLexer.g3:65:15: sys= SYSTEM_tag WS sys1= VALUE
            	        	        {
            	        	        	int sysStart181 = CharIndex;
            	        	        	mSYSTEM_tag(); 
            	        	        	sys = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, sysStart181, CharIndex-1);
            	        	        	AddToken( (CommonToken)sys, SYSTEM_tag, 0);
            	        	        	mWS(); 
            	        	        	int sys1Start189 = CharIndex;
            	        	        	mVALUE(); 
            	        	        	sys1 = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, sys1Start189, CharIndex-1);

            	        	        }
            	        	        break;
            	        	    case 2 :
            	        	        // MXMLLexer.g3:66:15: pub= PUBLIC_tag WS pub= VALUE WS sys2= VALUE
            	        	        {
            	        	        	int pubStart207 = CharIndex;
            	        	        	mPUBLIC_tag(); 
            	        	        	pub = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, pubStart207, CharIndex-1);
            	        	        	AddToken( (CommonToken)pub, PUBLIC_tag, 0);
            	        	        	mWS(); 
            	        	        	int pubStart215 = CharIndex;
            	        	        	mVALUE(); 
            	        	        	pub = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, pubStart215, CharIndex-1);
            	        	        	mWS(); 
            	        	        	int sys2Start221 = CharIndex;
            	        	        	mVALUE(); 
            	        	        	sys2 = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, sys2Start221, CharIndex-1);

            	        	        }
            	        	        break;

            	        	}

            	        	// MXMLLexer.g3:68:13: ( WS )?
            	        	int alt3 = 2;
            	        	int LA3_0 = input.LA(1);

            	        	if ( ((LA3_0 >= '\t' && LA3_0 <= '\n') || LA3_0 == '\r' || LA3_0 == ' ') )
            	        	{
            	        	    alt3 = 1;
            	        	}
            	        	switch (alt3) 
            	        	{
            	        	    case 1 :
            	        	        // MXMLLexer.g3:68:15: WS
            	        	        {
            	        	        	mWS(); 

            	        	        }
            	        	        break;

            	        	}


            	        }
            	        break;

            	}

            	// MXMLLexer.g3:70:9: (dtd= INTERNAL_DTD )?
            	int alt5 = 2;
            	int LA5_0 = input.LA(1);

            	if ( (LA5_0 == '[') )
            	{
            	    alt5 = 1;
            	}
            	switch (alt5) 
            	{
            	    case 1 :
            	        // MXMLLexer.g3:70:11: dtd= INTERNAL_DTD
            	        {
            	        	int dtdStart279 = CharIndex;
            	        	mINTERNAL_DTD(); 
            	        	dtd = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, dtdStart279, CharIndex-1);

            	        }
            	        break;

            	}

            	int closeStart298 = CharIndex;
            	mTAG_CLOSE(); 
            	close = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, closeStart298, CharIndex-1);
            	AddToken( (CommonToken)close, TAG_CLOSE, 0);

            }

        }
        finally 
    	{
        }
    }
Ejemplo n.º 14
0
    // $ANTLR end "LETTER"

    // $ANTLR start "WS"
    public void mWS() // throws RecognitionException [2]
    {
    		try
    		{
            IToken ws = null;

            // MXMLLexer.g3:206:14: ( (ws= OTHERWS | EOL )+ )
            // MXMLLexer.g3:207:9: (ws= OTHERWS | EOL )+
            {
            	// MXMLLexer.g3:207:9: (ws= OTHERWS | EOL )+
            	int cnt34 = 0;
            	do 
            	{
            	    int alt34 = 3;
            	    int LA34_0 = input.LA(1);

            	    if ( (LA34_0 == '\t' || LA34_0 == ' ') )
            	    {
            	        alt34 = 1;
            	    }
            	    else if ( (LA34_0 == '\n' || LA34_0 == '\r') )
            	    {
            	        alt34 = 2;
            	    }


            	    switch (alt34) 
            		{
            			case 1 :
            			    // MXMLLexer.g3:207:10: ws= OTHERWS
            			    {
            			    	int wsStart1367 = CharIndex;
            			    	mOTHERWS(); 
            			    	ws = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, wsStart1367, CharIndex-1);
            			    	AddToken( (CommonToken)ws, WS, 0);

            			    }
            			    break;
            			case 2 :
            			    // MXMLLexer.g3:208:11: EOL
            			    {
            			    	mEOL(); 

            			    }
            			    break;

            			default:
            			    if ( cnt34 >= 1 ) goto loop34;
            		            EarlyExitException eee =
            		                new EarlyExitException(34, input);
            		            throw eee;
            	    }
            	    cnt34++;
            	} while (true);

            	loop34:
            		;	// Stops C# compiler whinging that label 'loop34' has no statements


            }

        }
        finally 
    	{
        }
    }
Ejemplo n.º 15
0
    // $ANTLR end "PCDATA"

    // $ANTLR start "VALUE"
    public void mVALUE() // throws RecognitionException [2]
    {
    		try
    		{
            IToken v = null;

            // MXMLLexer.g3:181:16: (v= VALUE_int )
            // MXMLLexer.g3:182:3: v= VALUE_int
            {
            	int vStart1160 = CharIndex;
            	mVALUE_int(); 
            	v = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, vStart1160, CharIndex-1);
            	AddToken( (CommonToken)v, VALUE, 0);

            }

        }
        finally 
    	{
        }
    }
Ejemplo n.º 16
0
    // $ANTLR end "TAG_CLOSE"

    // $ANTLR start "END_TAG"
    public void mEND_TAG() // throws RecognitionException [2]
    {
    		try
    		{
            IToken open = null;
            IToken name = null;
            IToken close = null;

            // MXMLLexer.g3:162:5: (open= END_TAG_OPEN ( WS )? name= GENERIC_ID ( WS )? close= TAG_CLOSE )
            // MXMLLexer.g3:162:7: open= END_TAG_OPEN ( WS )? name= GENERIC_ID ( WS )? close= TAG_CLOSE
            {
            	int openStart1017 = CharIndex;
            	mEND_TAG_OPEN(); 
            	open = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, openStart1017, CharIndex-1);
            	AddToken( (CommonToken)open, END_TAG_OPEN, 0);
            	// MXMLLexer.g3:162:75: ( WS )?
            	int alt25 = 2;
            	int LA25_0 = input.LA(1);

            	if ( ((LA25_0 >= '\t' && LA25_0 <= '\n') || LA25_0 == '\r' || LA25_0 == ' ') )
            	{
            	    alt25 = 1;
            	}
            	switch (alt25) 
            	{
            	    case 1 :
            	        // MXMLLexer.g3:162:75: WS
            	        {
            	        	mWS(); 

            	        }
            	        break;

            	}

            	int nameStart1026 = CharIndex;
            	mGENERIC_ID(); 
            	name = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, nameStart1026, CharIndex-1);
            	// MXMLLexer.g3:162:95: ( WS )?
            	int alt26 = 2;
            	int LA26_0 = input.LA(1);

            	if ( ((LA26_0 >= '\t' && LA26_0 <= '\n') || LA26_0 == '\r' || LA26_0 == ' ') )
            	{
            	    alt26 = 1;
            	}
            	switch (alt26) 
            	{
            	    case 1 :
            	        // MXMLLexer.g3:162:95: WS
            	        {
            	        	mWS(); 

            	        }
            	        break;

            	}

            	int closeStart1033 = CharIndex;
            	mTAG_CLOSE(); 
            	close = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, closeStart1033, CharIndex-1);
            	AddToken( (CommonToken)close, TAG_CLOSE, 0);

            }

        }
        finally 
    	{
        }
    }
Ejemplo n.º 17
0
    // $ANTLR end "EQ_int"

    // $ANTLR start "ATTRIBUTE"
    public void mATTRIBUTE() // throws RecognitionException [2]
    {
    		try
    		{
            IToken name = null;
            IToken value = null;

            // MXMLLexer.g3:152:5: (name= GENERIC_ID ( WS )? EQ ( WS )? value= VALUE )
            // MXMLLexer.g3:152:7: name= GENERIC_ID ( WS )? EQ ( WS )? value= VALUE
            {
            	int nameStart957 = CharIndex;
            	mGENERIC_ID(); 
            	name = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, nameStart957, CharIndex-1);
            	// MXMLLexer.g3:152:23: ( WS )?
            	int alt23 = 2;
            	int LA23_0 = input.LA(1);

            	if ( ((LA23_0 >= '\t' && LA23_0 <= '\n') || LA23_0 == '\r' || LA23_0 == ' ') )
            	{
            	    alt23 = 1;
            	}
            	switch (alt23) 
            	{
            	    case 1 :
            	        // MXMLLexer.g3:152:23: WS
            	        {
            	        	mWS(); 

            	        }
            	        break;

            	}

            	mEQ(); 
            	// MXMLLexer.g3:152:30: ( WS )?
            	int alt24 = 2;
            	int LA24_0 = input.LA(1);

            	if ( ((LA24_0 >= '\t' && LA24_0 <= '\n') || LA24_0 == '\r' || LA24_0 == ' ') )
            	{
            	    alt24 = 1;
            	}
            	switch (alt24) 
            	{
            	    case 1 :
            	        // MXMLLexer.g3:152:30: WS
            	        {
            	        	mWS(); 

            	        }
            	        break;

            	}

            	int valueStart969 = CharIndex;
            	mVALUE(); 
            	value = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, valueStart969, CharIndex-1);

            }

        }
        finally 
    	{
        }
    }
Ejemplo n.º 18
0
	private void mUNDEF_TOKEN()
	{
		Enter_UNDEF_TOKEN();
		EnterRule("UNDEF_TOKEN", 178);
		TraceIn("UNDEF_TOKEN", 178);
		try
		{
			CommonToken define=null;

			// cs.g:1168:12: ( '#' ( TS )* 'undef' ( TS )+ define= IDENTIFIER )
			DebugEnterAlt(1);
			// cs.g:1169:2: '#' ( TS )* 'undef' ( TS )+ define= IDENTIFIER
			{
			DebugLocation(1169, 2);
			Match('#'); 
			DebugLocation(1169, 8);
			// cs.g:1169:8: ( TS )*
			try { DebugEnterSubRule(32);
			while (true)
			{
				int alt32=2;
				try { DebugEnterDecision(32, decisionCanBacktrack[32]);
				int LA32_0 = input.LA(1);

				if ((LA32_0=='\t'||LA32_0==' '))
				{
					alt32=1;
				}


				} finally { DebugExitDecision(32); }
				switch ( alt32 )
				{
				case 1:
					DebugEnterAlt(1);
					// cs.g:1169:8: TS
					{
					DebugLocation(1169, 8);
					mTS(); 

					}
					break;

				default:
					goto loop32;
				}
			}

			loop32:
				;

			} finally { DebugExitSubRule(32); }

			DebugLocation(1169, 14);
			Match("undef"); 

			DebugLocation(1169, 24);
			// cs.g:1169:24: ( TS )+
			int cnt33=0;
			try { DebugEnterSubRule(33);
			while (true)
			{
				int alt33=2;
				try { DebugEnterDecision(33, decisionCanBacktrack[33]);
				int LA33_0 = input.LA(1);

				if ((LA33_0=='\t'||LA33_0==' '))
				{
					alt33=1;
				}


				} finally { DebugExitDecision(33); }
				switch (alt33)
				{
				case 1:
					DebugEnterAlt(1);
					// cs.g:1169:24: TS
					{
					DebugLocation(1169, 24);
					mTS(); 

					}
					break;

				default:
					if (cnt33 >= 1)
						goto loop33;

					EarlyExitException eee33 = new EarlyExitException( 33, input );
					DebugRecognitionException(eee33);
					throw eee33;
				}
				cnt33++;
			}
			loop33:
				;

			} finally { DebugExitSubRule(33); }

			DebugLocation(1169, 37);
			int defineStart2119 = CharIndex;
			int defineStartLine2119 = Line;
			int defineStartCharPos2119 = CharPositionInLine;
			mIDENTIFIER(); 
			define = new CommonToken(input, TokenTypes.Invalid, TokenChannels.Default, defineStart2119, CharIndex-1);
			define.Line = defineStartLine2119;
			define.CharPositionInLine = defineStartCharPos2119;
			DebugLocation(1170, 2);

					if (MacroDefines.ContainsKey(define.Text))
						MacroDefines.Remove(define.Text);
				

			}

		}
		finally
		{
			TraceOut("UNDEF_TOKEN", 178);
			LeaveRule("UNDEF_TOKEN", 178);
			Leave_UNDEF_TOKEN();
		}
	}
Ejemplo n.º 19
0
    // $ANTLR end "END_TAG"

    // $ANTLR start "COMMENT"
    public void mCOMMENT() // throws RecognitionException [2]
    {
    		try
    		{
            IToken c = null;

            // MXMLLexer.g3:165:17: (c= COMMENT_int )
            // MXMLLexer.g3:166:2: c= COMMENT_int
            {
            	int cStart1052 = CharIndex;
            	mCOMMENT_int(); 
            	c = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, cStart1052, CharIndex-1);
            	AddToken( (CommonToken)c, COMMENT, 0);

            }

        }
        finally 
    	{
        }
    }
Ejemplo n.º 20
0
	private void mELSE_TOKEN()
	{
		Enter_ELSE_TOKEN();
		EnterRule("ELSE_TOKEN", 179);
		TraceIn("ELSE_TOKEN", 179);
		try
		{
			CommonToken e=null;

			// cs.g:1175:11: ( ( '#' ( TS )* e= 'else' | '#' ( TS )* 'elif' ( TS )+ PP_EXPRESSION ) )
			DebugEnterAlt(1);
			// cs.g:1176:2: ( '#' ( TS )* e= 'else' | '#' ( TS )* 'elif' ( TS )+ PP_EXPRESSION )
			{
			DebugLocation(1176, 2);
			// cs.g:1176:2: ( '#' ( TS )* e= 'else' | '#' ( TS )* 'elif' ( TS )+ PP_EXPRESSION )
			int alt37=2;
			try { DebugEnterSubRule(37);
			try { DebugEnterDecision(37, decisionCanBacktrack[37]);
			try
			{
				alt37 = dfa37.Predict(input);
			}
			catch (NoViableAltException nvae)
			{
				DebugRecognitionException(nvae);
				throw;
			}
			} finally { DebugExitDecision(37); }
			switch (alt37)
			{
			case 1:
				DebugEnterAlt(1);
				// cs.g:1176:4: '#' ( TS )* e= 'else'
				{
				DebugLocation(1176, 4);
				Match('#'); 
				DebugLocation(1176, 10);
				// cs.g:1176:10: ( TS )*
				try { DebugEnterSubRule(34);
				while (true)
				{
					int alt34=2;
					try { DebugEnterDecision(34, decisionCanBacktrack[34]);
					int LA34_0 = input.LA(1);

					if ((LA34_0=='\t'||LA34_0==' '))
					{
						alt34=1;
					}


					} finally { DebugExitDecision(34); }
					switch ( alt34 )
					{
					case 1:
						DebugEnterAlt(1);
						// cs.g:1176:10: TS
						{
						DebugLocation(1176, 10);
						mTS(); 

						}
						break;

					default:
						goto loop34;
					}
				}

				loop34:
					;

				} finally { DebugExitSubRule(34); }

				DebugLocation(1176, 18);
				int eStart = CharIndex;
				Match("else"); 
				int eStartLine2148 = Line;
				int eStartCharPos2148 = CharPositionInLine;
				e = new CommonToken(input, TokenTypes.Invalid, TokenChannels.Default, eStart, CharIndex-1);
				e.Line = eStartLine2148;
				e.CharPositionInLine = eStartCharPos2148;

				}
				break;
			case 2:
				DebugEnterAlt(2);
				// cs.g:1177:4: '#' ( TS )* 'elif' ( TS )+ PP_EXPRESSION
				{
				DebugLocation(1177, 4);
				Match('#'); 
				DebugLocation(1177, 10);
				// cs.g:1177:10: ( TS )*
				try { DebugEnterSubRule(35);
				while (true)
				{
					int alt35=2;
					try { DebugEnterDecision(35, decisionCanBacktrack[35]);
					int LA35_0 = input.LA(1);

					if ((LA35_0=='\t'||LA35_0==' '))
					{
						alt35=1;
					}


					} finally { DebugExitDecision(35); }
					switch ( alt35 )
					{
					case 1:
						DebugEnterAlt(1);
						// cs.g:1177:10: TS
						{
						DebugLocation(1177, 10);
						mTS(); 

						}
						break;

					default:
						goto loop35;
					}
				}

				loop35:
					;

				} finally { DebugExitSubRule(35); }

				DebugLocation(1177, 16);
				Match("elif"); 

				DebugLocation(1177, 25);
				// cs.g:1177:25: ( TS )+
				int cnt36=0;
				try { DebugEnterSubRule(36);
				while (true)
				{
					int alt36=2;
					try { DebugEnterDecision(36, decisionCanBacktrack[36]);
					int LA36_0 = input.LA(1);

					if ((LA36_0=='\t'||LA36_0==' '))
					{
						alt36=1;
					}


					} finally { DebugExitDecision(36); }
					switch (alt36)
					{
					case 1:
						DebugEnterAlt(1);
						// cs.g:1177:25: TS
						{
						DebugLocation(1177, 25);
						mTS(); 

						}
						break;

					default:
						if (cnt36 >= 1)
							goto loop36;

						EarlyExitException eee36 = new EarlyExitException( 36, input );
						DebugRecognitionException(eee36);
						throw eee36;
					}
					cnt36++;
				}
				loop36:
					;

				} finally { DebugExitSubRule(36); }

				DebugLocation(1177, 31);
				mPP_EXPRESSION(); 

				}
				break;

			}
			} finally { DebugExitSubRule(37); }

			DebugLocation(1178, 2);

					// We are in an elif
			       	if (e == null)
					{
					    Debug.Assert(Processing.Count > 0, "Stack underflow preprocessing.  ELIF_TOKEN");
						if (Processing.Count > 0 && Processing.Peek() == false)
						{
							Processing.Pop();
							// if our parent was processing, do else logic
						    Debug.Assert(Processing.Count > 0, "Stack underflow preprocessing.  ELIF_TOKEN2");
							if (Processing.Count > 0 && Processing.Peek())
								Processing.Push(Returns.Pop());
							else
								Processing.Push(false);
						}
						else
						{
							Processing.Pop();
							Processing.Push(false);
						}
					}
					else
					{
						// we are in a else
						if (Processing.Count > 0)
						{
							bool bDoElse = !Processing.Pop();

							// if our parent was processing				
						    Debug.Assert(Processing.Count > 0, "Stack underflow preprocessing, ELSE_TOKEN");
							if (Processing.Count > 0 && Processing.Peek())
								Processing.Push(bDoElse);
							else
								Processing.Push(false);
						}
					}
					Skip();
				

			}

		}
		finally
		{
			TraceOut("ELSE_TOKEN", 179);
			LeaveRule("ELSE_TOKEN", 179);
			Leave_ELSE_TOKEN();
		}
	}
Ejemplo n.º 21
0
    // $ANTLR end "VALUE_int"

    // $ANTLR start "GENERIC_ID"
    public void mGENERIC_ID() // throws RecognitionException [2]
    {
    		try
    		{
            IToken id = null;

            // MXMLLexer.g3:192:2: (id= GENERIC_ID_int )
            // MXMLLexer.g3:193:2: id= GENERIC_ID_int
            {
            	int idStart1243 = CharIndex;
            	mGENERIC_ID_int(); 
            	id = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, idStart1243, CharIndex-1);
            	AddToken( (CommonToken)id, GENERIC_ID, 0);

            }

        }
        finally 
    	{
        }
    }
Ejemplo n.º 22
0
	private void mPP_EQUALITY_EXPRESSION()
	{
		Enter_PP_EQUALITY_EXPRESSION();
		EnterRule("PP_EQUALITY_EXPRESSION", 184);
		TraceIn("PP_EQUALITY_EXPRESSION", 184);
		try
		{
			CommonToken ne=null;

			// cs.g:1238:23: ( PP_UNARY_EXPRESSION ( TS )* ( ( '==' | ne= '!=' ) ( TS )* PP_UNARY_EXPRESSION ( TS )* )* )
			DebugEnterAlt(1);
			// cs.g:1239:2: PP_UNARY_EXPRESSION ( TS )* ( ( '==' | ne= '!=' ) ( TS )* PP_UNARY_EXPRESSION ( TS )* )*
			{
			DebugLocation(1239, 2);
			mPP_UNARY_EXPRESSION(); 
			DebugLocation(1239, 24);
			// cs.g:1239:24: ( TS )*
			try { DebugEnterSubRule(47);
			while (true)
			{
				int alt47=2;
				try { DebugEnterDecision(47, decisionCanBacktrack[47]);
				int LA47_0 = input.LA(1);

				if ((LA47_0=='\t'||LA47_0==' '))
				{
					alt47=1;
				}


				} finally { DebugExitDecision(47); }
				switch ( alt47 )
				{
				case 1:
					DebugEnterAlt(1);
					// cs.g:1239:24: TS
					{
					DebugLocation(1239, 24);
					mTS(); 

					}
					break;

				default:
					goto loop47;
				}
			}

			loop47:
				;

			} finally { DebugExitSubRule(47); }

			DebugLocation(1239, 30);
			// cs.g:1239:30: ( ( '==' | ne= '!=' ) ( TS )* PP_UNARY_EXPRESSION ( TS )* )*
			try { DebugEnterSubRule(51);
			while (true)
			{
				int alt51=2;
				try { DebugEnterDecision(51, decisionCanBacktrack[51]);
				int LA51_0 = input.LA(1);

				if ((LA51_0=='!'||LA51_0=='='))
				{
					alt51=1;
				}


				} finally { DebugExitDecision(51); }
				switch ( alt51 )
				{
				case 1:
					DebugEnterAlt(1);
					// cs.g:1239:31: ( '==' | ne= '!=' ) ( TS )* PP_UNARY_EXPRESSION ( TS )*
					{
					DebugLocation(1239, 31);
					// cs.g:1239:31: ( '==' | ne= '!=' )
					int alt48=2;
					try { DebugEnterSubRule(48);
					try { DebugEnterDecision(48, decisionCanBacktrack[48]);
					int LA48_0 = input.LA(1);

					if ((LA48_0=='='))
					{
						alt48=1;
					}
					else if ((LA48_0=='!'))
					{
						alt48=2;
					}
					else
					{
						NoViableAltException nvae = new NoViableAltException("", 48, 0, input);

						DebugRecognitionException(nvae);
						throw nvae;
					}
					} finally { DebugExitDecision(48); }
					switch (alt48)
					{
					case 1:
						DebugEnterAlt(1);
						// cs.g:1239:32: '=='
						{
						DebugLocation(1239, 32);
						Match("=="); 


						}
						break;
					case 2:
						DebugEnterAlt(2);
						// cs.g:1239:38: ne= '!='
						{
						DebugLocation(1239, 41);
						int neStart = CharIndex;
						Match("!="); 
						int neStartLine2321 = Line;
						int neStartCharPos2321 = CharPositionInLine;
						ne = new CommonToken(input, TokenTypes.Invalid, TokenChannels.Default, neStart, CharIndex-1);
						ne.Line = neStartLine2321;
						ne.CharPositionInLine = neStartCharPos2321;

						}
						break;

					}
					} finally { DebugExitSubRule(48); }

					DebugLocation(1239, 51);
					// cs.g:1239:51: ( TS )*
					try { DebugEnterSubRule(49);
					while (true)
					{
						int alt49=2;
						try { DebugEnterDecision(49, decisionCanBacktrack[49]);
						int LA49_0 = input.LA(1);

						if ((LA49_0=='\t'||LA49_0==' '))
						{
							alt49=1;
						}


						} finally { DebugExitDecision(49); }
						switch ( alt49 )
						{
						case 1:
							DebugEnterAlt(1);
							// cs.g:1239:51: TS
							{
							DebugLocation(1239, 51);
							mTS(); 

							}
							break;

						default:
							goto loop49;
						}
					}

					loop49:
						;

					} finally { DebugExitSubRule(49); }

					DebugLocation(1239, 57);
					mPP_UNARY_EXPRESSION(); 
					DebugLocation(1240, 3);
					 
								bool rt1 = Returns.Pop(), rt2 = Returns.Pop();
								Returns.Push(rt1 == rt2 == (ne == null));
							
					DebugLocation(1244, 3);
					// cs.g:1244:3: ( TS )*
					try { DebugEnterSubRule(50);
					while (true)
					{
						int alt50=2;
						try { DebugEnterDecision(50, decisionCanBacktrack[50]);
						int LA50_0 = input.LA(1);

						if ((LA50_0=='\t'||LA50_0==' '))
						{
							alt50=1;
						}


						} finally { DebugExitDecision(50); }
						switch ( alt50 )
						{
						case 1:
							DebugEnterAlt(1);
							// cs.g:1244:3: TS
							{
							DebugLocation(1244, 3);
							mTS(); 

							}
							break;

						default:
							goto loop50;
						}
					}

					loop50:
						;

					} finally { DebugExitSubRule(50); }


					}
					break;

				default:
					goto loop51;
				}
			}

			loop51:
				;

			} finally { DebugExitSubRule(51); }


			}

		}
		finally
		{
			TraceOut("PP_EQUALITY_EXPRESSION", 184);
			LeaveRule("PP_EQUALITY_EXPRESSION", 184);
			Leave_PP_EQUALITY_EXPRESSION();
		}
	}
Ejemplo n.º 23
0
    // $ANTLR end "OTHERWS"

    // $ANTLR start "EOL"
    public void mEOL() // throws RecognitionException [2]
    {
    		try
    		{
            IToken ws = null;

            // MXMLLexer.g3:223:14: (ws= EOL_HELPER )
            // MXMLLexer.g3:224:10: ws= EOL_HELPER
            {
            	int wsStart1472 = CharIndex;
            	mEOL_HELPER(); 
            	ws = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, wsStart1472, CharIndex-1);
            	AddToken( (CommonToken)ws, EOL, 0);

            }

        }
        finally 
    	{
        }
    }
Ejemplo n.º 24
0
	private void mPP_UNARY_EXPRESSION()
	{
		Enter_PP_UNARY_EXPRESSION();
		EnterRule("PP_UNARY_EXPRESSION", 185);
		TraceIn("PP_UNARY_EXPRESSION", 185);
		try
		{
			CommonToken pe=null;
			CommonToken ue=null;

			// cs.g:1247:20: (pe= PP_PRIMARY_EXPRESSION | '!' ( TS )* ue= PP_UNARY_EXPRESSION )
			int alt53=2;
			try { DebugEnterDecision(53, decisionCanBacktrack[53]);
			int LA53_0 = input.LA(1);

			if ((LA53_0=='('||(LA53_0>='@' && LA53_0<='Z')||LA53_0=='_'||(LA53_0>='a' && LA53_0<='z')))
			{
				alt53=1;
			}
			else if ((LA53_0=='!'))
			{
				alt53=2;
			}
			else
			{
				NoViableAltException nvae = new NoViableAltException("", 53, 0, input);

				DebugRecognitionException(nvae);
				throw nvae;
			}
			} finally { DebugExitDecision(53); }
			switch (alt53)
			{
			case 1:
				DebugEnterAlt(1);
				// cs.g:1248:2: pe= PP_PRIMARY_EXPRESSION
				{
				DebugLocation(1248, 5);
				int peStart2359 = CharIndex;
				int peStartLine2359 = Line;
				int peStartCharPos2359 = CharPositionInLine;
				mPP_PRIMARY_EXPRESSION(); 
				pe = new CommonToken(input, TokenTypes.Invalid, TokenChannels.Default, peStart2359, CharIndex-1);
				pe.Line = peStartLine2359;
				pe.CharPositionInLine = peStartCharPos2359;

				}
				break;
			case 2:
				DebugEnterAlt(2);
				// cs.g:1249:4: '!' ( TS )* ue= PP_UNARY_EXPRESSION
				{
				DebugLocation(1249, 4);
				Match('!'); 
				DebugLocation(1249, 10);
				// cs.g:1249:10: ( TS )*
				try { DebugEnterSubRule(52);
				while (true)
				{
					int alt52=2;
					try { DebugEnterDecision(52, decisionCanBacktrack[52]);
					int LA52_0 = input.LA(1);

					if ((LA52_0=='\t'||LA52_0==' '))
					{
						alt52=1;
					}


					} finally { DebugExitDecision(52); }
					switch ( alt52 )
					{
					case 1:
						DebugEnterAlt(1);
						// cs.g:1249:10: TS
						{
						DebugLocation(1249, 10);
						mTS(); 

						}
						break;

					default:
						goto loop52;
					}
				}

				loop52:
					;

				} finally { DebugExitSubRule(52); }

				DebugLocation(1249, 19);
				int ueStart2377 = CharIndex;
				int ueStartLine2377 = Line;
				int ueStartCharPos2377 = CharPositionInLine;
				mPP_UNARY_EXPRESSION(); 
				ue = new CommonToken(input, TokenTypes.Invalid, TokenChannels.Default, ueStart2377, CharIndex-1);
				ue.Line = ueStartLine2377;
				ue.CharPositionInLine = ueStartCharPos2377;
				DebugLocation(1249, 42);
				 Returns.Push(!Returns.Pop()); 

				}
				break;

			}
		}
		finally
		{
			TraceOut("PP_UNARY_EXPRESSION", 185);
			LeaveRule("PP_UNARY_EXPRESSION", 185);
			Leave_PP_UNARY_EXPRESSION();
		}
	}
Ejemplo n.º 25
0
    // $ANTLR end "INTERNAL_DTD"

    // $ANTLR start "PI"
    public void mPI() // throws RecognitionException [2]
    {
    		try
    		{
            IToken ds = null;
            IToken target = null;
            IToken de = null;

            // MXMLLexer.g3:87:13: (ds= DECL_START target= GENERIC_ID ( WS )? ( ATTRIBUTE ( WS )? )* de= DECL_STOP )
            // MXMLLexer.g3:88:9: ds= DECL_START target= GENERIC_ID ( WS )? ( ATTRIBUTE ( WS )? )* de= DECL_STOP
            {
            	int dsStart389 = CharIndex;
            	mDECL_START(); 
            	ds = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, dsStart389, CharIndex-1);
            	int targetStart393 = CharIndex;
            	mGENERIC_ID(); 
            	target = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, targetStart393, CharIndex-1);
            	// MXMLLexer.g3:88:41: ( WS )?
            	int alt7 = 2;
            	int LA7_0 = input.LA(1);

            	if ( ((LA7_0 >= '\t' && LA7_0 <= '\n') || LA7_0 == '\r' || LA7_0 == ' ') )
            	{
            	    alt7 = 1;
            	}
            	switch (alt7) 
            	{
            	    case 1 :
            	        // MXMLLexer.g3:88:41: WS
            	        {
            	        	mWS(); 

            	        }
            	        break;

            	}

            	// MXMLLexer.g3:89:9: ( ATTRIBUTE ( WS )? )*
            	do 
            	{
            	    int alt9 = 2;
            	    int LA9_0 = input.LA(1);

            	    if ( (LA9_0 == ':' || (LA9_0 >= 'A' && LA9_0 <= 'Z') || LA9_0 == '_' || (LA9_0 >= 'a' && LA9_0 <= 'z')) )
            	    {
            	        alt9 = 1;
            	    }


            	    switch (alt9) 
            		{
            			case 1 :
            			    // MXMLLexer.g3:89:11: ATTRIBUTE ( WS )?
            			    {
            			    	mATTRIBUTE(); 
            			    	// MXMLLexer.g3:89:21: ( WS )?
            			    	int alt8 = 2;
            			    	int LA8_0 = input.LA(1);

            			    	if ( ((LA8_0 >= '\t' && LA8_0 <= '\n') || LA8_0 == '\r' || LA8_0 == ' ') )
            			    	{
            			    	    alt8 = 1;
            			    	}
            			    	switch (alt8) 
            			    	{
            			    	    case 1 :
            			    	        // MXMLLexer.g3:89:21: WS
            			    	        {
            			    	        	mWS(); 

            			    	        }
            			    	        break;

            			    	}


            			    }
            			    break;

            			default:
            			    goto loop9;
            	    }
            	} while (true);

            	loop9:
            		;	// Stops C# compiler whining that label 'loop9' has no statements

            	int deStart420 = CharIndex;
            	mDECL_STOP(); 
            	de = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, deStart420, CharIndex-1);
            	AddToken( (CommonToken)de, DECL_STOP, 0);

            }

        }
        finally 
    	{
        }
    }
Ejemplo n.º 26
0
	private void mPP_PRIMARY_EXPRESSION()
	{
		Enter_PP_PRIMARY_EXPRESSION();
		EnterRule("PP_PRIMARY_EXPRESSION", 186);
		TraceIn("PP_PRIMARY_EXPRESSION", 186);
		try
		{
			CommonToken IDENTIFIER1=null;

			// cs.g:1252:22: ( IDENTIFIER | '(' PP_EXPRESSION ')' )
			int alt54=2;
			try { DebugEnterDecision(54, decisionCanBacktrack[54]);
			int LA54_0 = input.LA(1);

			if (((LA54_0>='@' && LA54_0<='Z')||LA54_0=='_'||(LA54_0>='a' && LA54_0<='z')))
			{
				alt54=1;
			}
			else if ((LA54_0=='('))
			{
				alt54=2;
			}
			else
			{
				NoViableAltException nvae = new NoViableAltException("", 54, 0, input);

				DebugRecognitionException(nvae);
				throw nvae;
			}
			} finally { DebugExitDecision(54); }
			switch (alt54)
			{
			case 1:
				DebugEnterAlt(1);
				// cs.g:1253:2: IDENTIFIER
				{
				DebugLocation(1253, 2);
				int IDENTIFIER1Start2393 = CharIndex;
				int IDENTIFIER1StartLine2393 = Line;
				int IDENTIFIER1StartCharPos2393 = CharPositionInLine;
				mIDENTIFIER(); 
				IDENTIFIER1 = new CommonToken(input, TokenTypes.Invalid, TokenChannels.Default, IDENTIFIER1Start2393, CharIndex-1);
				IDENTIFIER1.Line = IDENTIFIER1StartLine2393;
				IDENTIFIER1.CharPositionInLine = IDENTIFIER1StartCharPos2393;
				DebugLocation(1254, 2);
				 
						Returns.Push(MacroDefines.ContainsKey(IDENTIFIER1.Text));
					

				}
				break;
			case 2:
				DebugEnterAlt(2);
				// cs.g:1257:4: '(' PP_EXPRESSION ')'
				{
				DebugLocation(1257, 4);
				Match('('); 
				DebugLocation(1257, 10);
				mPP_EXPRESSION(); 
				DebugLocation(1257, 26);
				Match(')'); 

				}
				break;

			}
		}
		finally
		{
			TraceOut("PP_PRIMARY_EXPRESSION", 186);
			LeaveRule("PP_PRIMARY_EXPRESSION", 186);
			Leave_PP_PRIMARY_EXPRESSION();
		}
	}
Ejemplo n.º 27
0
    // $ANTLR end "PI"

    // $ANTLR start "XMLDECL"
    public void mXMLDECL() // throws RecognitionException [2]
    {
    		try
    		{
            IToken ds = null;
            IToken xml = null;
            IToken de = null;

            // MXMLLexer.g3:92:18: (ds= DECL_START xml= XML ( WS )? ( ATTRIBUTE ( WS )? )* de= DECL_STOP )
            // MXMLLexer.g3:93:9: ds= DECL_START xml= XML ( WS )? ( ATTRIBUTE ( WS )? )* de= DECL_STOP
            {
            	int dsStart444 = CharIndex;
            	mDECL_START(); 
            	ds = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, dsStart444, CharIndex-1);
            	AddToken( (CommonToken)ds, DECL_START, 0);
            	int xmlStart450 = CharIndex;
            	mXML(); 
            	xml = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, xmlStart450, CharIndex-1);
            	AddToken( (CommonToken)xml, XML, 0);
            	// MXMLLexer.g3:93:117: ( WS )?
            	int alt10 = 2;
            	int LA10_0 = input.LA(1);

            	if ( ((LA10_0 >= '\t' && LA10_0 <= '\n') || LA10_0 == '\r' || LA10_0 == ' ') )
            	{
            	    alt10 = 1;
            	}
            	switch (alt10) 
            	{
            	    case 1 :
            	        // MXMLLexer.g3:93:117: WS
            	        {
            	        	mWS(); 

            	        }
            	        break;

            	}

            	// MXMLLexer.g3:94:9: ( ATTRIBUTE ( WS )? )*
            	do 
            	{
            	    int alt12 = 2;
            	    int LA12_0 = input.LA(1);

            	    if ( (LA12_0 == ':' || (LA12_0 >= 'A' && LA12_0 <= 'Z') || LA12_0 == '_' || (LA12_0 >= 'a' && LA12_0 <= 'z')) )
            	    {
            	        alt12 = 1;
            	    }


            	    switch (alt12) 
            		{
            			case 1 :
            			    // MXMLLexer.g3:94:11: ATTRIBUTE ( WS )?
            			    {
            			    	mATTRIBUTE(); 
            			    	// MXMLLexer.g3:94:21: ( WS )?
            			    	int alt11 = 2;
            			    	int LA11_0 = input.LA(1);

            			    	if ( ((LA11_0 >= '\t' && LA11_0 <= '\n') || LA11_0 == '\r' || LA11_0 == ' ') )
            			    	{
            			    	    alt11 = 1;
            			    	}
            			    	switch (alt11) 
            			    	{
            			    	    case 1 :
            			    	        // MXMLLexer.g3:94:21: WS
            			    	        {
            			    	        	mWS(); 

            			    	        }
            			    	        break;

            			    	}


            			    }
            			    break;

            			default:
            			    goto loop12;
            	    }
            	} while (true);

            	loop12:
            		;	// Stops C# compiler whining that label 'loop12' has no statements

            	int deStart479 = CharIndex;
            	mDECL_STOP(); 
            	de = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, deStart479, CharIndex-1);
            	AddToken( (CommonToken)de, DECL_STOP, 0);

            }

        }
        finally 
    	{
        }
    }
Ejemplo n.º 28
0
 public GrammarToken(Grammar g, IToken oldToken)
 {
     this.g = g;
     _token = new CommonToken(oldToken);
 }
Ejemplo n.º 29
0
    // $ANTLR end "ELEMENT"

    // $ANTLR start "START_TAG"
    public void mSTART_TAG() // throws RecognitionException [2]
    {
    		try
    		{
            IToken open = null;
            IToken name = null;
            IToken close = null;

            // MXMLLexer.g3:124:5: (open= TAG_OPEN ( WS )? name= GENERIC_ID ( WS )? ( ATTRIBUTE ( WS )? )* close= TAG_CLOSE )
            // MXMLLexer.g3:124:7: open= TAG_OPEN ( WS )? name= GENERIC_ID ( WS )? ( ATTRIBUTE ( WS )? )* close= TAG_CLOSE
            {
            	int openStart770 = CharIndex;
            	mTAG_OPEN(); 
            	open = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, openStart770, CharIndex-1);
            	AddToken( (CommonToken)open, TAG_OPEN, 0);
            	// MXMLLexer.g3:124:67: ( WS )?
            	int alt15 = 2;
            	int LA15_0 = input.LA(1);

            	if ( ((LA15_0 >= '\t' && LA15_0 <= '\n') || LA15_0 == '\r' || LA15_0 == ' ') )
            	{
            	    alt15 = 1;
            	}
            	switch (alt15) 
            	{
            	    case 1 :
            	        // MXMLLexer.g3:124:67: WS
            	        {
            	        	mWS(); 

            	        }
            	        break;

            	}

            	int nameStart779 = CharIndex;
            	mGENERIC_ID(); 
            	name = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, nameStart779, CharIndex-1);
            	// MXMLLexer.g3:124:87: ( WS )?
            	int alt16 = 2;
            	int LA16_0 = input.LA(1);

            	if ( ((LA16_0 >= '\t' && LA16_0 <= '\n') || LA16_0 == '\r' || LA16_0 == ' ') )
            	{
            	    alt16 = 1;
            	}
            	switch (alt16) 
            	{
            	    case 1 :
            	        // MXMLLexer.g3:124:87: WS
            	        {
            	        	mWS(); 

            	        }
            	        break;

            	}

            	// MXMLLexer.g3:125:9: ( ATTRIBUTE ( WS )? )*
            	do 
            	{
            	    int alt18 = 2;
            	    int LA18_0 = input.LA(1);

            	    if ( (LA18_0 == ':' || (LA18_0 >= 'A' && LA18_0 <= 'Z') || LA18_0 == '_' || (LA18_0 >= 'a' && LA18_0 <= 'z')) )
            	    {
            	        alt18 = 1;
            	    }


            	    switch (alt18) 
            		{
            			case 1 :
            			    // MXMLLexer.g3:125:11: ATTRIBUTE ( WS )?
            			    {
            			    	mATTRIBUTE(); 
            			    	// MXMLLexer.g3:125:21: ( WS )?
            			    	int alt17 = 2;
            			    	int LA17_0 = input.LA(1);

            			    	if ( ((LA17_0 >= '\t' && LA17_0 <= '\n') || LA17_0 == '\r' || LA17_0 == ' ') )
            			    	{
            			    	    alt17 = 1;
            			    	}
            			    	switch (alt17) 
            			    	{
            			    	    case 1 :
            			    	        // MXMLLexer.g3:125:21: WS
            			    	        {
            			    	        	mWS(); 

            			    	        }
            			    	        break;

            			    	}


            			    }
            			    break;

            			default:
            			    goto loop18;
            	    }
            	} while (true);

            	loop18:
            		;	// Stops C# compiler whining that label 'loop18' has no statements

            	int closeStart804 = CharIndex;
            	mTAG_CLOSE(); 
            	close = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, closeStart804, CharIndex-1);
            	AddToken( (CommonToken)close, TAG_CLOSE, 0);

            }

        }
        finally 
    	{
        }
    }
Ejemplo n.º 30
0
    // $ANTLR end "START_TAG"

    // $ANTLR start "EMPTY_ELEMENT"
    public void mEMPTY_ELEMENT() // throws RecognitionException [2]
    {
    		try
    		{
            IToken open = null;
            IToken name = null;
            IToken close = null;

            // MXMLLexer.g3:129:5: (open= TAG_OPEN ( WS )? name= GENERIC_ID ( WS )? ( ATTRIBUTE ( WS )? )* close= EMPTYTAG_CLOSE )
            // MXMLLexer.g3:129:7: open= TAG_OPEN ( WS )? name= GENERIC_ID ( WS )? ( ATTRIBUTE ( WS )? )* close= EMPTYTAG_CLOSE
            {
            	int openStart828 = CharIndex;
            	mTAG_OPEN(); 
            	open = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, openStart828, CharIndex-1);
            	AddToken( (CommonToken)open, EMPTY_TAG_OPEN, 0);
            	// MXMLLexer.g3:129:73: ( WS )?
            	int alt19 = 2;
            	int LA19_0 = input.LA(1);

            	if ( ((LA19_0 >= '\t' && LA19_0 <= '\n') || LA19_0 == '\r' || LA19_0 == ' ') )
            	{
            	    alt19 = 1;
            	}
            	switch (alt19) 
            	{
            	    case 1 :
            	        // MXMLLexer.g3:129:73: WS
            	        {
            	        	mWS(); 

            	        }
            	        break;

            	}

            	int nameStart837 = CharIndex;
            	mGENERIC_ID(); 
            	name = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, nameStart837, CharIndex-1);
            	// MXMLLexer.g3:129:93: ( WS )?
            	int alt20 = 2;
            	int LA20_0 = input.LA(1);

            	if ( ((LA20_0 >= '\t' && LA20_0 <= '\n') || LA20_0 == '\r' || LA20_0 == ' ') )
            	{
            	    alt20 = 1;
            	}
            	switch (alt20) 
            	{
            	    case 1 :
            	        // MXMLLexer.g3:129:93: WS
            	        {
            	        	mWS(); 

            	        }
            	        break;

            	}

            	// MXMLLexer.g3:130:9: ( ATTRIBUTE ( WS )? )*
            	do 
            	{
            	    int alt22 = 2;
            	    int LA22_0 = input.LA(1);

            	    if ( (LA22_0 == ':' || (LA22_0 >= 'A' && LA22_0 <= 'Z') || LA22_0 == '_' || (LA22_0 >= 'a' && LA22_0 <= 'z')) )
            	    {
            	        alt22 = 1;
            	    }


            	    switch (alt22) 
            		{
            			case 1 :
            			    // MXMLLexer.g3:130:11: ATTRIBUTE ( WS )?
            			    {
            			    	mATTRIBUTE(); 
            			    	// MXMLLexer.g3:130:21: ( WS )?
            			    	int alt21 = 2;
            			    	int LA21_0 = input.LA(1);

            			    	if ( ((LA21_0 >= '\t' && LA21_0 <= '\n') || LA21_0 == '\r' || LA21_0 == ' ') )
            			    	{
            			    	    alt21 = 1;
            			    	}
            			    	switch (alt21) 
            			    	{
            			    	    case 1 :
            			    	        // MXMLLexer.g3:130:21: WS
            			    	        {
            			    	        	mWS(); 

            			    	        }
            			    	        break;

            			    	}


            			    }
            			    break;

            			default:
            			    goto loop22;
            	    }
            	} while (true);

            	loop22:
            		;	// Stops C# compiler whining that label 'loop22' has no statements

            	int closeStart862 = CharIndex;
            	mEMPTYTAG_CLOSE(); 
            	close = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, closeStart862, CharIndex-1);
            	AddToken( (CommonToken)close, EMPTYTAG_CLOSE, 0);

            }

        }
        finally 
    	{
        }
    }
Ejemplo n.º 31
0
	private void mSTRING_CONST()
	{
		Enter_STRING_CONST();
		EnterRule("STRING_CONST", 44);
		TraceIn("STRING_CONST", 44);
		try
		{
			int _type = STRING_CONST;
			int _channel = DefaultTokenChannel;
			CommonToken CHAR1=null;
			CommonToken SPACE2=null;
			CommonToken ESC3=null;

			// C:\\Users\\Oscar\\Documents\\Visual Studio 2010\\Projects\\TigerNET\\Grammar\\Tiger.g:78:14: ( Quotes ( CHAR | SPACE | ESC )* Quotes )
			DebugEnterAlt(1);
			// C:\\Users\\Oscar\\Documents\\Visual Studio 2010\\Projects\\TigerNET\\Grammar\\Tiger.g:78:16: Quotes ( CHAR | SPACE | ESC )* Quotes
			{
			DebugLocation(78, 16);
			mQuotes(); 
			DebugLocation(78, 23);
			Text = "";
			DebugLocation(79, 1);
			// C:\\Users\\Oscar\\Documents\\Visual Studio 2010\\Projects\\TigerNET\\Grammar\\Tiger.g:79:1: ( CHAR | SPACE | ESC )*
			try { DebugEnterSubRule(2);
			while (true)
			{
				int alt2=4;
				try { DebugEnterDecision(2, decisionCanBacktrack[2]);
				int LA2_0 = input.LA(1);

				if (((LA2_0>='\u0000' && LA2_0<='\b')||(LA2_0>='\u000B' && LA2_0<='\u001F')||LA2_0=='!'||(LA2_0>='#' && LA2_0<='[')||(LA2_0>=']' && LA2_0<='\uFFFF')))
				{
					alt2=1;
				}
				else if (((LA2_0>='\t' && LA2_0<='\n')||LA2_0==' '))
				{
					alt2=2;
				}
				else if ((LA2_0=='\\'))
				{
					alt2=3;
				}


				} finally { DebugExitDecision(2); }
				switch ( alt2 )
				{
				case 1:
					DebugEnterAlt(1);
					// C:\\Users\\Oscar\\Documents\\Visual Studio 2010\\Projects\\TigerNET\\Grammar\\Tiger.g:80:1: CHAR
					{
					DebugLocation(80, 1);
					int CHAR1Start386 = CharIndex;
					int CHAR1StartLine386 = Line;
					int CHAR1StartCharPos386 = CharPositionInLine;
					mCHAR(); 
					CHAR1 = new CommonToken(input, TokenTypes.Invalid, TokenChannels.Default, CHAR1Start386, CharIndex-1);
					CHAR1.Line = CHAR1StartLine386;
					CHAR1.CharPositionInLine = CHAR1StartCharPos386;
					DebugLocation(80, 6);
					Text += CHAR1.Text; 

					}
					break;
				case 2:
					DebugEnterAlt(2);
					// C:\\Users\\Oscar\\Documents\\Visual Studio 2010\\Projects\\TigerNET\\Grammar\\Tiger.g:81:1: SPACE
					{
					DebugLocation(81, 1);
					int SPACE2Start391 = CharIndex;
					int SPACE2StartLine391 = Line;
					int SPACE2StartCharPos391 = CharPositionInLine;
					mSPACE(); 
					SPACE2 = new CommonToken(input, TokenTypes.Invalid, TokenChannels.Default, SPACE2Start391, CharIndex-1);
					SPACE2.Line = SPACE2StartLine391;
					SPACE2.CharPositionInLine = SPACE2StartCharPos391;
					DebugLocation(81, 7);
					Text += SPACE2.Text; 

					}
					break;
				case 3:
					DebugEnterAlt(3);
					// C:\\Users\\Oscar\\Documents\\Visual Studio 2010\\Projects\\TigerNET\\Grammar\\Tiger.g:82:1: ESC
					{
					DebugLocation(82, 1);
					int ESC3Start396 = CharIndex;
					int ESC3StartLine396 = Line;
					int ESC3StartCharPos396 = CharPositionInLine;
					mESC(); 
					ESC3 = new CommonToken(input, TokenTypes.Invalid, TokenChannels.Default, ESC3Start396, CharIndex-1);
					ESC3.Line = ESC3StartLine396;
					ESC3.CharPositionInLine = ESC3StartCharPos396;
					DebugLocation(82, 5);
					Text += ESC3.Text; 

					}
					break;

				default:
					goto loop2;
				}
			}

			loop2:
				;

			} finally { DebugExitSubRule(2); }

			DebugLocation(83, 4);
			mQuotes(); 

			}

			state.type = _type;
			state.channel = _channel;
		}
		finally
		{
			TraceOut("STRING_CONST", 44);
			LeaveRule("STRING_CONST", 44);
			Leave_STRING_CONST();
		}
	}
Ejemplo n.º 32
0
    // $ANTLR end "TAG_OPEN"

    // $ANTLR start "EQ"
    public void mEQ() // throws RecognitionException [2]
    {
    		try
    		{
            IToken eq = null;

            // MXMLLexer.g3:142:2: (eq= EQ_int )
            // MXMLLexer.g3:143:2: eq= EQ_int
            {
            	int eqStart919 = CharIndex;
            	mEQ_int(); 
            	eq = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, eqStart919, CharIndex-1);
            	AddToken( (CommonToken)eq, EQ, 0);

            }

        }
        finally 
    	{
        }
    }