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

org.skife.jdbi.rewriter.printf.FormatterStatementLexer Maven / Gradle / Ivy

There is a newer version: 8.1.2
Show newest version
// $ANTLR 3.4 org/skife/jdbi/rewriter/printf/FormatterStatementLexer.g 2015-04-07 14:22:07

    package org.skife.jdbi.rewriter.printf;


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

@SuppressWarnings({"all", "warnings", "unchecked"})
public class FormatterStatementLexer extends Lexer {
    public static final int EOF=-1;
    public static final int INTEGER=4;
    public static final int LITERAL=5;
    public static final int QUOTED_TEXT=6;
    public static final int STRING=7;

      @Override
      public void reportError(RecognitionException e) {
        throw new IllegalArgumentException(e);
      }


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

    public FormatterStatementLexer() {} 
    public FormatterStatementLexer(CharStream input) {
        this(input, new RecognizerSharedState());
    }
    public FormatterStatementLexer(CharStream input, RecognizerSharedState state) {
        super(input,state);
    }
    public String getGrammarFileName() { return "org/skife/jdbi/rewriter/printf/FormatterStatementLexer.g"; }

    // $ANTLR start "LITERAL"
    public final void mLITERAL() throws RecognitionException {
        try {
            int _type = LITERAL;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // org/skife/jdbi/rewriter/printf/FormatterStatementLexer.g:14:8: ( ( 'a' .. 'z' | 'A' .. 'Z' | ' ' | '\\t' | '0' .. '9' | ',' | '*' | '=' | ';' | '(' | ')' | '[' | ']' | '+' | '-' | '/' | '>' | '<' )+ )
            // org/skife/jdbi/rewriter/printf/FormatterStatementLexer.g:14:10: ( 'a' .. 'z' | 'A' .. 'Z' | ' ' | '\\t' | '0' .. '9' | ',' | '*' | '=' | ';' | '(' | ')' | '[' | ']' | '+' | '-' | '/' | '>' | '<' )+
            {
            // org/skife/jdbi/rewriter/printf/FormatterStatementLexer.g:14:10: ( 'a' .. 'z' | 'A' .. 'Z' | ' ' | '\\t' | '0' .. '9' | ',' | '*' | '=' | ';' | '(' | ')' | '[' | ']' | '+' | '-' | '/' | '>' | '<' )+
            int cnt1=0;
            loop1:
            do {
                int alt1=2;
                switch ( input.LA(1) ) {
                case '\t':
                case ' ':
                case '(':
                case ')':
                case '*':
                case '+':
                case ',':
                case '-':
                case '/':
                case '0':
                case '1':
                case '2':
                case '3':
                case '4':
                case '5':
                case '6':
                case '7':
                case '8':
                case '9':
                case ';':
                case '<':
                case '=':
                case '>':
                case 'A':
                case 'B':
                case 'C':
                case 'D':
                case 'E':
                case 'F':
                case 'G':
                case 'H':
                case 'I':
                case 'J':
                case 'K':
                case 'L':
                case 'M':
                case 'N':
                case 'O':
                case 'P':
                case 'Q':
                case 'R':
                case 'S':
                case 'T':
                case 'U':
                case 'V':
                case 'W':
                case 'X':
                case 'Y':
                case 'Z':
                case '[':
                case ']':
                case 'a':
                case 'b':
                case 'c':
                case 'd':
                case 'e':
                case 'f':
                case 'g':
                case 'h':
                case 'i':
                case 'j':
                case 'k':
                case 'l':
                case 'm':
                case 'n':
                case 'o':
                case 'p':
                case 'q':
                case 'r':
                case 's':
                case 't':
                case 'u':
                case 'v':
                case 'w':
                case 'x':
                case 'y':
                case 'z':
                    {
                    alt1=1;
                    }
                    break;

                }

                switch (alt1) {
            	case 1 :
            	    // org/skife/jdbi/rewriter/printf/FormatterStatementLexer.g:
            	    {
            	    if ( input.LA(1)=='\t'||input.LA(1)==' '||(input.LA(1) >= '(' && input.LA(1) <= '-')||(input.LA(1) >= '/' && input.LA(1) <= '9')||(input.LA(1) >= ';' && input.LA(1) <= '>')||(input.LA(1) >= 'A' && input.LA(1) <= '[')||input.LA(1)==']'||(input.LA(1) >= 'a' && input.LA(1) <= 'z') ) {
            	        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 "LITERAL"

    // $ANTLR start "INTEGER"
    public final void mINTEGER() throws RecognitionException {
        try {
            int _type = INTEGER;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // org/skife/jdbi/rewriter/printf/FormatterStatementLexer.g:16:8: ( '%d' )
            // org/skife/jdbi/rewriter/printf/FormatterStatementLexer.g:16:10: '%d'
            {
            match("%d"); 



            }

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

    // $ANTLR start "STRING"
    public final void mSTRING() throws RecognitionException {
        try {
            int _type = STRING;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // org/skife/jdbi/rewriter/printf/FormatterStatementLexer.g:17:7: ( '%s' )
            // org/skife/jdbi/rewriter/printf/FormatterStatementLexer.g:17:9: '%s'
            {
            match("%s"); 



            }

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

    // $ANTLR start "QUOTED_TEXT"
    public final void mQUOTED_TEXT() throws RecognitionException {
        try {
            int _type = QUOTED_TEXT;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // org/skife/jdbi/rewriter/printf/FormatterStatementLexer.g:18:12: ( ( '\\'' (~ '\\'' )+ '\\'' ) )
            // org/skife/jdbi/rewriter/printf/FormatterStatementLexer.g:18:14: ( '\\'' (~ '\\'' )+ '\\'' )
            {
            // org/skife/jdbi/rewriter/printf/FormatterStatementLexer.g:18:14: ( '\\'' (~ '\\'' )+ '\\'' )
            // org/skife/jdbi/rewriter/printf/FormatterStatementLexer.g:18:15: '\\'' (~ '\\'' )+ '\\''
            {
            match('\''); 

            // org/skife/jdbi/rewriter/printf/FormatterStatementLexer.g:18:20: (~ '\\'' )+
            int cnt2=0;
            loop2:
            do {
                int alt2=2;
                int LA2_0 = input.LA(1);

                if ( ((LA2_0 >= '\u0000' && LA2_0 <= '&')||(LA2_0 >= '(' && LA2_0 <= '\uFFFF')) ) {
                    alt2=1;
                }


                switch (alt2) {
            	case 1 :
            	    // org/skife/jdbi/rewriter/printf/FormatterStatementLexer.g:
            	    {
            	    if ( (input.LA(1) >= '\u0000' && 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 ( cnt2 >= 1 ) break loop2;
                        EarlyExitException eee =
                            new EarlyExitException(2, input);
                        throw eee;
                }
                cnt2++;
            } while (true);


            match('\''); 

            }


            }

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

    public void mTokens() throws RecognitionException {
        // org/skife/jdbi/rewriter/printf/FormatterStatementLexer.g:1:8: ( LITERAL | INTEGER | STRING | QUOTED_TEXT )
        int alt3=4;
        switch ( input.LA(1) ) {
        case '\t':
        case ' ':
        case '(':
        case ')':
        case '*':
        case '+':
        case ',':
        case '-':
        case '/':
        case '0':
        case '1':
        case '2':
        case '3':
        case '4':
        case '5':
        case '6':
        case '7':
        case '8':
        case '9':
        case ';':
        case '<':
        case '=':
        case '>':
        case 'A':
        case 'B':
        case 'C':
        case 'D':
        case 'E':
        case 'F':
        case 'G':
        case 'H':
        case 'I':
        case 'J':
        case 'K':
        case 'L':
        case 'M':
        case 'N':
        case 'O':
        case 'P':
        case 'Q':
        case 'R':
        case 'S':
        case 'T':
        case 'U':
        case 'V':
        case 'W':
        case 'X':
        case 'Y':
        case 'Z':
        case '[':
        case ']':
        case 'a':
        case 'b':
        case 'c':
        case 'd':
        case 'e':
        case 'f':
        case 'g':
        case 'h':
        case 'i':
        case 'j':
        case 'k':
        case 'l':
        case 'm':
        case 'n':
        case 'o':
        case 'p':
        case 'q':
        case 'r':
        case 's':
        case 't':
        case 'u':
        case 'v':
        case 'w':
        case 'x':
        case 'y':
        case 'z':
            {
            alt3=1;
            }
            break;
        case '%':
            {
            switch ( input.LA(2) ) {
            case 'd':
                {
                alt3=2;
                }
                break;
            case 's':
                {
                alt3=3;
                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("", 3, 2, input);

                throw nvae;

            }

            }
            break;
        case '\'':
            {
            alt3=4;
            }
            break;
        default:
            NoViableAltException nvae =
                new NoViableAltException("", 3, 0, input);

            throw nvae;

        }

        switch (alt3) {
            case 1 :
                // org/skife/jdbi/rewriter/printf/FormatterStatementLexer.g:1:10: LITERAL
                {
                mLITERAL(); 


                }
                break;
            case 2 :
                // org/skife/jdbi/rewriter/printf/FormatterStatementLexer.g:1:18: INTEGER
                {
                mINTEGER(); 


                }
                break;
            case 3 :
                // org/skife/jdbi/rewriter/printf/FormatterStatementLexer.g:1:26: STRING
                {
                mSTRING(); 


                }
                break;
            case 4 :
                // org/skife/jdbi/rewriter/printf/FormatterStatementLexer.g:1:33: QUOTED_TEXT
                {
                mQUOTED_TEXT(); 


                }
                break;

        }

    }


 

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy