⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 prolexer.java

📁 使用antlr实现c和pascal的转换
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
            int _type = DO;            // PRO.g:180:6: ( 'DO' | 'Do' | 'do' )            int alt13=3;            int LA13_0 = input.LA(1);            if ( (LA13_0=='D') ) {                int LA13_1 = input.LA(2);                if ( (LA13_1=='O') ) {                    alt13=1;                }                else if ( (LA13_1=='o') ) {                    alt13=2;                }                else {                    NoViableAltException nvae =                        new NoViableAltException("180:1: DO : ( 'DO' | 'Do' | 'do' );", 13, 1, input);                    throw nvae;                }            }            else if ( (LA13_0=='d') ) {                alt13=3;            }            else {                NoViableAltException nvae =                    new NoViableAltException("180:1: DO : ( 'DO' | 'Do' | 'do' );", 13, 0, input);                throw nvae;            }            switch (alt13) {                case 1 :                    // PRO.g:180:6: 'DO'                    {                    match("DO");                     }                    break;                case 2 :                    // PRO.g:180:11: 'Do'                    {                    match("Do");                     }                    break;                case 3 :                    // PRO.g:180:16: 'do'                    {                    match("do");                     }                    break;            }            this.type = _type;        }        finally {        }    }    // $ANTLR end DO    // $ANTLR start NOT    public final void mNOT() throws RecognitionException {        try {            int _type = NOT;            // PRO.g:181:7: ( 'NOT' | 'Not' | 'not' )            int alt14=3;            int LA14_0 = input.LA(1);            if ( (LA14_0=='N') ) {                int LA14_1 = input.LA(2);                if ( (LA14_1=='o') ) {                    alt14=2;                }                else if ( (LA14_1=='O') ) {                    alt14=1;                }                else {                    NoViableAltException nvae =                        new NoViableAltException("181:1: NOT : ( 'NOT' | 'Not' | 'not' );", 14, 1, input);                    throw nvae;                }            }            else if ( (LA14_0=='n') ) {                alt14=3;            }            else {                NoViableAltException nvae =                    new NoViableAltException("181:1: NOT : ( 'NOT' | 'Not' | 'not' );", 14, 0, input);                throw nvae;            }            switch (alt14) {                case 1 :                    // PRO.g:181:7: 'NOT'                    {                    match("NOT");                     }                    break;                case 2 :                    // PRO.g:181:13: 'Not'                    {                    match("Not");                     }                    break;                case 3 :                    // PRO.g:181:19: 'not'                    {                    match("not");                     }                    break;            }            this.type = _type;        }        finally {        }    }    // $ANTLR end NOT    // $ANTLR start EQUAL    public final void mEQUAL() throws RecognitionException {        try {            int _type = EQUAL;            // PRO.g:182:9: ( '=' )            // PRO.g:182:9: '='            {            match('=');             }            this.type = _type;        }        finally {        }    }    // $ANTLR end EQUAL    // $ANTLR start NEQ    public final void mNEQ() throws RecognitionException {        try {            int _type = NEQ;            // PRO.g:183:7: ( '<>' )            // PRO.g:183:7: '<>'            {            match("<>");             }            this.type = _type;        }        finally {        }    }    // $ANTLR end NEQ    // $ANTLR start SMALL    public final void mSMALL() throws RecognitionException {        try {            int _type = SMALL;            // PRO.g:184:9: ( '<' )            // PRO.g:184:9: '<'            {            match('<');             }            this.type = _type;        }        finally {        }    }    // $ANTLR end SMALL    // $ANTLR start GRAT    public final void mGRAT() throws RecognitionException {        try {            int _type = GRAT;            // PRO.g:185:8: ( '>' )            // PRO.g:185:8: '>'            {            match('>');             }            this.type = _type;        }        finally {        }    }    // $ANTLR end GRAT    // $ANTLR start NB    public final void mNB() throws RecognitionException {        try {            int _type = NB;            // PRO.g:186:6: ( '<=' )            // PRO.g:186:6: '<='            {            match("<=");             }            this.type = _type;        }        finally {        }    }    // $ANTLR end NB    // $ANTLR start NS    public final void mNS() throws RecognitionException {        try {            int _type = NS;            // PRO.g:187:6: ( '>=' )            // PRO.g:187:6: '>='            {            match(">=");             }            this.type = _type;        }        finally {        }    }    // $ANTLR end NS    // $ANTLR start ADDOPA    public final void mADDOPA() throws RecognitionException {        try {            int _type = ADDOPA;            // PRO.g:188:10: ( '+' )            // PRO.g:188:10: '+'            {            match('+');             }            this.type = _type;        }        finally {        }    }    // $ANTLR end ADDOPA    // $ANTLR start ADDOPB    public final void mADDOPB() throws RecognitionException {        try {            int _type = ADDOPB;            // PRO.g:189:10: ( '-' )            // PRO.g:189:10: '-'            {            match('-');             }            this.type = _type;        }        finally {        }    }    // $ANTLR end ADDOPB    // $ANTLR start OR    public final void mOR() throws RecognitionException {        try {            int _type = OR;            // PRO.g:190:6: ( 'OR' | 'Or' | 'or' )            int alt15=3;            int LA15_0 = input.LA(1);            if ( (LA15_0=='O') ) {                int LA15_1 = input.LA(2);                if ( (LA15_1=='r') ) {                    alt15=2;                }                else if ( (LA15_1=='R') ) {                    alt15=1;                }                else {                    NoViableAltException nvae =                        new NoViableAltException("190:1: OR : ( 'OR' | 'Or' | 'or' );", 15, 1, input);                    throw nvae;                }            }            else if ( (LA15_0=='o') ) {                alt15=3;            }            else {                NoViableAltException nvae =                    new NoViableAltException("190:1: OR : ( 'OR' | 'Or' | 'or' );", 15, 0, input);                throw nvae;            }            switch (alt15) {                case 1 :                    // PRO.g:190:6: 'OR'                    {                    match("OR");                     }                    break;                case 2 :                    // PRO.g:190:11: 'Or'                    {                    match("Or");                     }                    break;                case 3 :                    // PRO.g:190:16: 'or'                    {                    match("or");                     }                    break;            }            this.type = _type;        }        finally {        }    }    // $ANTLR end OR    // $ANTLR start MULOPA    public final void mMULOPA() throws RecognitionException {        try {            int _type = MULOPA;            // PRO.g:191:10: ( '*' )            // PRO.g:191:10: '*'            {            match('*');             }            this.type = _type;        }        finally {        }    }    // $ANTLR end MULOPA    // $ANTLR start MULOPB    public final void mMULOPB() throws RecognitionException {        try {            int _type = MULOPB;            // PRO.g:192:10: ( '/' )            // PRO.g:192:10: '/'            {            match('/');             }            this.type = _type;        }        finally {        }    }    // $ANTLR end MULOPB    // $ANTLR start DIV    public final void mDIV() throws RecognitionException {        try {            int _type = DIV;            // PRO.g:193:7: ( 'DIV' | 'Div' | 'div' )            int alt16=3;            int LA16_0 = input.LA(1);            if ( (LA16_0=='D') ) {                int LA16_1 = input.LA(2);                if ( (LA16_1=='i') ) {                    alt16=2;                }                else if ( (LA16_1=='I') ) {                    alt16=1;                }                else {                    NoViableAltException nvae =                        new NoViableAltException("193:1: DIV : ( 'DIV' | 'Div' | 'div' );", 16, 1, input);                    throw nvae;                }            }            else if ( (LA16_0=='d') ) {                alt16=3;            }            else {                NoViableAltException nvae =                    new NoViableAltException("193:1: DIV : ( 'DIV' | 'Div' | 'div' );", 16, 0, input);                throw nvae;            }            switch (alt16) {                case 1 :                    // PRO.g:193:7: 'DIV'                    {                    match("DIV");                     }                    break;                case 2 :                    // PRO.g:193:13: 'Div'                    {                    match("Div");                     }                    break;                case 3 :                    // PRO.g:193:19: 'div'                    {                    match("div");                     }                    break;            }            this.type = _type;        }        finally {        }    }    // $ANTLR end DIV    // $ANTLR start MOD    public final void mMOD() throws RecognitionException {        try {            int _type = MOD;            // PRO.g:194:7: ( 'mod' | 'MOD' | 'Mod' )            int alt17=3;            int LA17_0 = input.LA(1);            if ( (LA17_0=='m') ) {                alt17=1;            }            else if ( (LA17_0=='M') ) {                int LA17_2 = input.LA(2);                if ( (LA17_2=='o') ) {                    alt17=3;                }                else if ( (LA17_2=='O') ) {                    alt17=2;                }                else {                    NoViableAltException nvae =                        new NoViableAltException("194:1: MOD : ( 'mod' | 'MOD' | 'Mod' );", 17, 2, input);                    throw nvae;                }            }            else {                NoViableAltException nvae =                    new NoViableAltException("194:1: MOD : ( 'mod' | 'MOD' | 'Mod' );", 17, 0, input);                throw nvae;            }            switch (alt17) {                case 1 :                    // PRO.g:194:7: 'mod'                    {                    match("mod");                     }                    break;                case 2 :                    // PRO.g:194:13: 'MOD'                    {                    match("MOD");                     }                    break;                case 3 :                    // PRO.g:194:19: 'Mod'                    {                    match("Mod");                     }                    break;            }            this.type = _type;        }        finally {        }    }    // $ANTLR end MOD    // $ANTLR start AND    public final void mAND() throws RecognitionException {        try {            int _type = AND;            // PRO.g:195:7: ( 'AND' | 'And' | 'and' )            int alt18=3;            int LA18_0 = input.LA(1);            if ( (LA18_0=='A') ) {                int LA18_1 = input.LA(2);                if ( (LA18_1=='n') ) {                    alt18=2;                }                else if ( (LA18_1=='N') ) {                    alt18=1;                }                else {                    NoViableAltException nvae =                        new NoViableAltException("195:1: AND : ( 'AND' | 'And' | 'and' );", 18, 1, input);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -