All Downloads are FREE. Search and download functionalities are using the official Maven repository.

hudson.model.labels.LabelExpressionLexer Maven / Gradle / Ivy

The newest version!
// $ANTLR 3.4 hudson/model/labels/LabelExpression.g 2016-02-08 18:44:26

  package hudson.model.labels;
  import hudson.model.Label;


import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;

@SuppressWarnings({"all", "warnings", "unchecked"})
public class LabelExpressionLexer extends Lexer {
    public static final int EOF=-1;
    public static final int AND=4;
    public static final int ATOM=5;
    public static final int IDENTIFIER_PART=6;
    public static final int IFF=7;
    public static final int IMPLIES=8;
    public static final int LPAREN=9;
    public static final int NOT=10;
    public static final int OR=11;
    public static final int RPAREN=12;
    public static final int STRINGLITERAL=13;
    public static final int WS=14;

    // delegates
    // delegators
    public Lexer[] getDelegates() {
        return new Lexer[] {};
    }

    public LabelExpressionLexer() {} 
    public LabelExpressionLexer(CharStream input) {
        this(input, new RecognizerSharedState());
    }
    public LabelExpressionLexer(CharStream input, RecognizerSharedState state) {
        super(input,state);
    }
    public String getGrammarFileName() { return "hudson/model/labels/LabelExpression.g"; }

    // $ANTLR start "AND"
    public final void mAND() throws RecognitionException {
        try {
            int _type = AND;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // hudson/model/labels/LabelExpression.g:65:4: ( '&&' )
            // hudson/model/labels/LabelExpression.g:65:9: '&&'
            {
            match("&&"); 



            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        	// do for sure before leaving
        }
    }
    // $ANTLR end "AND"

    // $ANTLR start "OR"
    public final void mOR() throws RecognitionException {
        try {
            int _type = OR;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // hudson/model/labels/LabelExpression.g:66:3: ( '||' )
            // hudson/model/labels/LabelExpression.g:66:9: '||'
            {
            match("||"); 



            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        	// do for sure before leaving
        }
    }
    // $ANTLR end "OR"

    // $ANTLR start "NOT"
    public final void mNOT() throws RecognitionException {
        try {
            int _type = NOT;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // hudson/model/labels/LabelExpression.g:67:4: ( '!' )
            // hudson/model/labels/LabelExpression.g:67:9: '!'
            {
            match('!'); 

            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        	// do for sure before leaving
        }
    }
    // $ANTLR end "NOT"

    // $ANTLR start "IMPLIES"
    public final void mIMPLIES() throws RecognitionException {
        try {
            int _type = IMPLIES;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // hudson/model/labels/LabelExpression.g:68:8: ( '->' )
            // hudson/model/labels/LabelExpression.g:68:9: '->'
            {
            match("->"); 



            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        	// do for sure before leaving
        }
    }
    // $ANTLR end "IMPLIES"

    // $ANTLR start "IFF"
    public final void mIFF() throws RecognitionException {
        try {
            int _type = IFF;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // hudson/model/labels/LabelExpression.g:69:4: ( '<->' )
            // hudson/model/labels/LabelExpression.g:69:9: '<->'
            {
            match("<->"); 



            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        	// do for sure before leaving
        }
    }
    // $ANTLR end "IFF"

    // $ANTLR start "LPAREN"
    public final void mLPAREN() throws RecognitionException {
        try {
            int _type = LPAREN;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // hudson/model/labels/LabelExpression.g:70:7: ( '(' )
            // hudson/model/labels/LabelExpression.g:70:9: '('
            {
            match('('); 

            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        	// do for sure before leaving
        }
    }
    // $ANTLR end "LPAREN"

    // $ANTLR start "RPAREN"
    public final void mRPAREN() throws RecognitionException {
        try {
            int _type = RPAREN;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // hudson/model/labels/LabelExpression.g:71:7: ( ')' )
            // hudson/model/labels/LabelExpression.g:71:9: ')'
            {
            match(')'); 

            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        	// do for sure before leaving
        }
    }
    // $ANTLR end "RPAREN"

    // $ANTLR start "IDENTIFIER_PART"
    public final void mIDENTIFIER_PART() throws RecognitionException {
        try {
            // hudson/model/labels/LabelExpression.g:76:5: (~ ( '&' | '|' | '!' | '<' | '>' | '(' | ')' | ' ' | '\\t' | '\\\"' | '\\'' ) )
            // hudson/model/labels/LabelExpression.g:
            {
            if ( (input.LA(1) >= '\u0000' && input.LA(1) <= '\b')||(input.LA(1) >= '\n' && input.LA(1) <= '\u001F')||(input.LA(1) >= '#' && input.LA(1) <= '%')||(input.LA(1) >= '*' && input.LA(1) <= ';')||input.LA(1)=='='||(input.LA(1) >= '?' && input.LA(1) <= '{')||(input.LA(1) >= '}' && input.LA(1) <= '\uFFFF') ) {
                input.consume();
            }
            else {
                MismatchedSetException mse = new MismatchedSetException(null,input);
                recover(mse);
                throw mse;
            }


            }


        }
        finally {
        	// do for sure before leaving
        }
    }
    // $ANTLR end "IDENTIFIER_PART"

    // $ANTLR start "ATOM"
    public final void mATOM() throws RecognitionException {
        try {
            int _type = ATOM;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // hudson/model/labels/LabelExpression.g:80:5: ( ( IDENTIFIER_PART )+ )
            // hudson/model/labels/LabelExpression.g:80:9: ( IDENTIFIER_PART )+
            {
            // hudson/model/labels/LabelExpression.g:80:9: ( IDENTIFIER_PART )+
            int cnt1=0;
            loop1:
            do {
                int alt1=2;
                int LA1_0 = input.LA(1);

                if ( ((LA1_0 >= '\u0000' && LA1_0 <= '\b')||(LA1_0 >= '\n' && LA1_0 <= '\u001F')||(LA1_0 >= '#' && LA1_0 <= '%')||(LA1_0 >= '*' && LA1_0 <= ';')||LA1_0=='='||(LA1_0 >= '?' && LA1_0 <= '{')||(LA1_0 >= '}' && LA1_0 <= '\uFFFF')) ) {
                    alt1=1;
                }


                switch (alt1) {
            	case 1 :
            	    // hudson/model/labels/LabelExpression.g:
            	    {
            	    if ( (input.LA(1) >= '\u0000' && input.LA(1) <= '\b')||(input.LA(1) >= '\n' && input.LA(1) <= '\u001F')||(input.LA(1) >= '#' && input.LA(1) <= '%')||(input.LA(1) >= '*' && input.LA(1) <= ';')||input.LA(1)=='='||(input.LA(1) >= '?' && input.LA(1) <= '{')||(input.LA(1) >= '}' && input.LA(1) <= '\uFFFF') ) {
            	        input.consume();
            	    }
            	    else {
            	        MismatchedSetException mse = new MismatchedSetException(null,input);
            	        recover(mse);
            	        throw mse;
            	    }


            	    }
            	    break;

            	default :
            	    if ( cnt1 >= 1 ) break loop1;
                        EarlyExitException eee =
                            new EarlyExitException(1, input);
                        throw eee;
                }
                cnt1++;
            } while (true);


            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        	// do for sure before leaving
        }
    }
    // $ANTLR end "ATOM"

    // $ANTLR start "WS"
    public final void mWS() throws RecognitionException {
        try {
            int _type = WS;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // hudson/model/labels/LabelExpression.g:84:3: ( ( ' ' | '\\t' )+ )
            // hudson/model/labels/LabelExpression.g:84:5: ( ' ' | '\\t' )+
            {
            // hudson/model/labels/LabelExpression.g:84:5: ( ' ' | '\\t' )+
            int cnt2=0;
            loop2:
            do {
                int alt2=2;
                switch ( input.LA(1) ) {
                case '\t':
                case ' ':
                    {
                    alt2=1;
                    }
                    break;

                }

                switch (alt2) {
            	case 1 :
            	    // hudson/model/labels/LabelExpression.g:
            	    {
            	    if ( input.LA(1)=='\t'||input.LA(1)==' ' ) {
            	        input.consume();
            	    }
            	    else {
            	        MismatchedSetException mse = new MismatchedSetException(null,input);
            	        recover(mse);
            	        throw mse;
            	    }


            	    }
            	    break;

            	default :
            	    if ( cnt2 >= 1 ) break loop2;
                        EarlyExitException eee =
                            new EarlyExitException(2, input);
                        throw eee;
                }
                cnt2++;
            } while (true);


             _channel=HIDDEN; 

            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        	// do for sure before leaving
        }
    }
    // $ANTLR end "WS"

    // $ANTLR start "STRINGLITERAL"
    public final void mSTRINGLITERAL() throws RecognitionException {
        try {
            int _type = STRINGLITERAL;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // hudson/model/labels/LabelExpression.g:89:5: ( '\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) |~ ( '\\\\' | '\"' | '\\r' | '\\n' ) )* '\"' )
            // hudson/model/labels/LabelExpression.g:89:9: '\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) |~ ( '\\\\' | '\"' | '\\r' | '\\n' ) )* '\"'
            {
            match('\"'); 

            // hudson/model/labels/LabelExpression.g:90:9: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) |~ ( '\\\\' | '\"' | '\\r' | '\\n' ) )*
            loop3:
            do {
                int alt3=3;
                int LA3_0 = input.LA(1);

                if ( (LA3_0=='\\') ) {
                    alt3=1;
                }
                else if ( ((LA3_0 >= '\u0000' && LA3_0 <= '\t')||(LA3_0 >= '\u000B' && LA3_0 <= '\f')||(LA3_0 >= '\u000E' && LA3_0 <= '!')||(LA3_0 >= '#' && LA3_0 <= '[')||(LA3_0 >= ']' && LA3_0 <= '\uFFFF')) ) {
                    alt3=2;
                }


                switch (alt3) {
            	case 1 :
            	    // hudson/model/labels/LabelExpression.g:90:11: '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' )
            	    {
            	    match('\\'); 

            	    if ( input.LA(1)=='\"'||input.LA(1)=='\''||input.LA(1)=='\\'||input.LA(1)=='b'||input.LA(1)=='f'||input.LA(1)=='n'||input.LA(1)=='r'||input.LA(1)=='t' ) {
            	        input.consume();
            	    }
            	    else {
            	        MismatchedSetException mse = new MismatchedSetException(null,input);
            	        recover(mse);
            	        throw mse;
            	    }


            	    }
            	    break;
            	case 2 :
            	    // hudson/model/labels/LabelExpression.g:91:12: ~ ( '\\\\' | '\"' | '\\r' | '\\n' )
            	    {
            	    if ( (input.LA(1) >= '\u0000' && input.LA(1) <= '\t')||(input.LA(1) >= '\u000B' && input.LA(1) <= '\f')||(input.LA(1) >= '\u000E' && input.LA(1) <= '!')||(input.LA(1) >= '#' && input.LA(1) <= '[')||(input.LA(1) >= ']' && input.LA(1) <= '\uFFFF') ) {
            	        input.consume();
            	    }
            	    else {
            	        MismatchedSetException mse = new MismatchedSetException(null,input);
            	        recover(mse);
            	        throw mse;
            	    }


            	    }
            	    break;

            	default :
            	    break loop3;
                }
            } while (true);


            match('\"'); 

            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        	// do for sure before leaving
        }
    }
    // $ANTLR end "STRINGLITERAL"

    public void mTokens() throws RecognitionException {
        // hudson/model/labels/LabelExpression.g:1:8: ( AND | OR | NOT | IMPLIES | IFF | LPAREN | RPAREN | ATOM | WS | STRINGLITERAL )
        int alt4=10;
        int LA4_0 = input.LA(1);

        if ( (LA4_0=='&') ) {
            alt4=1;
        }
        else if ( (LA4_0=='|') ) {
            alt4=2;
        }
        else if ( (LA4_0=='!') ) {
            alt4=3;
        }
        else if ( (LA4_0=='-') ) {
            switch ( input.LA(2) ) {
            case '>':
                {
                alt4=4;
                }
                break;
            default:
                alt4=8;
            }

        }
        else if ( (LA4_0=='<') ) {
            alt4=5;
        }
        else if ( (LA4_0=='(') ) {
            alt4=6;
        }
        else if ( (LA4_0==')') ) {
            alt4=7;
        }
        else if ( ((LA4_0 >= '\u0000' && LA4_0 <= '\b')||(LA4_0 >= '\n' && LA4_0 <= '\u001F')||(LA4_0 >= '#' && LA4_0 <= '%')||(LA4_0 >= '*' && LA4_0 <= ',')||(LA4_0 >= '.' && LA4_0 <= ';')||LA4_0=='='||(LA4_0 >= '?' && LA4_0 <= '{')||(LA4_0 >= '}' && LA4_0 <= '\uFFFF')) ) {
            alt4=8;
        }
        else if ( (LA4_0=='\t'||LA4_0==' ') ) {
            alt4=9;
        }
        else if ( (LA4_0=='\"') ) {
            alt4=10;
        }
        else {
            NoViableAltException nvae =
                new NoViableAltException("", 4, 0, input);

            throw nvae;

        }
        switch (alt4) {
            case 1 :
                // hudson/model/labels/LabelExpression.g:1:10: AND
                {
                mAND(); 


                }
                break;
            case 2 :
                // hudson/model/labels/LabelExpression.g:1:14: OR
                {
                mOR(); 


                }
                break;
            case 3 :
                // hudson/model/labels/LabelExpression.g:1:17: NOT
                {
                mNOT(); 


                }
                break;
            case 4 :
                // hudson/model/labels/LabelExpression.g:1:21: IMPLIES
                {
                mIMPLIES(); 


                }
                break;
            case 5 :
                // hudson/model/labels/LabelExpression.g:1:29: IFF
                {
                mIFF(); 


                }
                break;
            case 6 :
                // hudson/model/labels/LabelExpression.g:1:33: LPAREN
                {
                mLPAREN(); 


                }
                break;
            case 7 :
                // hudson/model/labels/LabelExpression.g:1:40: RPAREN
                {
                mRPAREN(); 


                }
                break;
            case 8 :
                // hudson/model/labels/LabelExpression.g:1:47: ATOM
                {
                mATOM(); 


                }
                break;
            case 9 :
                // hudson/model/labels/LabelExpression.g:1:52: WS
                {
                mWS(); 


                }
                break;
            case 10 :
                // hudson/model/labels/LabelExpression.g:1:55: STRINGLITERAL
                {
                mSTRINGLITERAL(); 


                }
                break;

        }

    }


 

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy