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

📄 proparser.java.bak

📁 使用antlr实现c和pascal的转换
💻 BAK
📖 第 1 页 / 共 5 页
字号:
            do {                int alt19=2;                int LA19_0 = input.LA(1);                if ( (LA19_0==SEPARATOR) ) {                    int LA19_1 = input.LA(2);                    if ( (LA19_1==SEPARATOR) ) {                        int LA19_6 = input.LA(3);                        if ( (LA19_6==SEPARATOR) ) {                            int LA19_10 = input.LA(4);                            if ( (LA19_10==SEPARATOR) ) {                                int LA19_14 = input.LA(5);                                if ( (LA19_14==SEPARATOR) ) {                                    int LA19_18 = input.LA(6);                                    if ( (LA19_18==SEPARATOR) ) {                                        int LA19_22 = input.LA(7);                                        if ( (LA19_22==SEPARATOR) ) {                                            int LA19_26 = input.LA(8);                                            if ( (LA19_26==SEPARATOR) ) {                                                int LA19_30 = input.LA(9);                                                if ( (LA19_30==SEPARATOR) ) {                                                    int LA19_34 = input.LA(10);                                                    if ( (synpred19()) ) {                                                        alt19=1;                                                    }                                                }                                                else if ( ((LA19_30>=FUNCTION && LA19_30<=PROCEDURE)) ) {                                                    alt19=1;                                                }                                            }                                            else if ( ((LA19_26>=FUNCTION && LA19_26<=PROCEDURE)) ) {                                                alt19=1;                                            }                                        }                                        else if ( ((LA19_22>=FUNCTION && LA19_22<=PROCEDURE)) ) {                                            alt19=1;                                        }                                    }                                    else if ( ((LA19_18>=FUNCTION && LA19_18<=PROCEDURE)) ) {                                        alt19=1;                                    }                                }                                else if ( ((LA19_14>=FUNCTION && LA19_14<=PROCEDURE)) ) {                                    alt19=1;                                }                            }                            else if ( ((LA19_10>=FUNCTION && LA19_10<=PROCEDURE)) ) {                                alt19=1;                            }                        }                        else if ( ((LA19_6>=FUNCTION && LA19_6<=PROCEDURE)) ) {                            alt19=1;                        }                    }                    else if ( ((LA19_1>=FUNCTION && LA19_1<=PROCEDURE)) ) {                        alt19=1;                    }                }                else if ( ((LA19_0>=FUNCTION && LA19_0<=PROCEDURE)) ) {                    alt19=1;                }                switch (alt19) {            	case 1 :            	    // PRO.g:69:7: ( SEPARATOR )* subprogram__declaration ( SEPARATOR )* ';' ( SEPARATOR )*            	    {            	    // PRO.g:69:7: ( SEPARATOR )*            	    loop16:            	    do {            	        int alt16=2;            	        int LA16_0 = input.LA(1);            	        if ( (LA16_0==SEPARATOR) ) {            	            alt16=1;            	        }            	        switch (alt16) {            	    	case 1 :            	    	    // PRO.g:0:0: SEPARATOR            	    	    {            	    	    match(input,SEPARATOR,FOLLOW_SEPARATOR_in_subprogram_declarations288); if (failed) return ;            	    	    }            	    	    break;            	    	default :            	    	    break loop16;            	        }            	    } while (true);            	    pushFollow(FOLLOW_subprogram__declaration_in_subprogram_declarations291);            	    subprogram__declaration();            	    _fsp--;            	    if (failed) return ;            	    // PRO.g:69:42: ( SEPARATOR )*            	    loop17:            	    do {            	        int alt17=2;            	        int LA17_0 = input.LA(1);            	        if ( (LA17_0==SEPARATOR) ) {            	            alt17=1;            	        }            	        switch (alt17) {            	    	case 1 :            	    	    // PRO.g:0:0: SEPARATOR            	    	    {            	    	    match(input,SEPARATOR,FOLLOW_SEPARATOR_in_subprogram_declarations293); if (failed) return ;            	    	    }            	    	    break;            	    	default :            	    	    break loop17;            	        }            	    } while (true);            	    match(input,49,FOLLOW_49_in_subprogram_declarations296); if (failed) return ;            	    // PRO.g:69:57: ( SEPARATOR )*            	    loop18:            	    do {            	        int alt18=2;            	        int LA18_0 = input.LA(1);            	        if ( (LA18_0==SEPARATOR) ) {            	            int LA18_1 = input.LA(2);            	            if ( (synpred18()) ) {            	                alt18=1;            	            }            	        }            	        switch (alt18) {            	    	case 1 :            	    	    // PRO.g:0:0: SEPARATOR            	    	    {            	    	    match(input,SEPARATOR,FOLLOW_SEPARATOR_in_subprogram_declarations298); if (failed) return ;            	    	    }            	    	    break;            	    	default :            	    	    break loop18;            	        }            	    } while (true);            	    }            	    break;            	default :            	    break loop19;                }            } while (true);            }        }        catch (RecognitionException re) {            reportError(re);            recover(input,re);        }        finally {        }        return ;    }    // $ANTLR end subprogram_declarations    // $ANTLR start subprogram__declaration    // PRO.g:71:1: subprogram__declaration : subprogram_head ( SEPARATOR )* declarations ( SEPARATOR )* compound_statement ( SEPARATOR )* ;    public final void subprogram__declaration() throws RecognitionException {        String subprogram_head5 = null;        String declarations6 = null;        try {            // PRO.g:72:3: ( subprogram_head ( SEPARATOR )* declarations ( SEPARATOR )* compound_statement ( SEPARATOR )* )            // PRO.g:72:3: subprogram_head ( SEPARATOR )* declarations ( SEPARATOR )* compound_statement ( SEPARATOR )*            {            pushFollow(FOLLOW_subprogram_head_in_subprogram__declaration311);            subprogram_head5=subprogram_head();            _fsp--;            if (failed) return ;            // PRO.g:72:19: ( SEPARATOR )*            loop20:            do {                int alt20=2;                int LA20_0 = input.LA(1);                if ( (LA20_0==SEPARATOR) ) {                    int LA20_2 = input.LA(2);                    if ( (synpred20()) ) {                        alt20=1;                    }                }                switch (alt20) {            	case 1 :            	    // PRO.g:0:0: SEPARATOR            	    {            	    match(input,SEPARATOR,FOLLOW_SEPARATOR_in_subprogram__declaration313); if (failed) return ;            	    }            	    break;            	default :            	    break loop20;                }            } while (true);            if ( backtracking==0 ) {              emit(subprogram_head5+"\n");            }            pushFollow(FOLLOW_declarations_in_subprogram__declaration318);            declarations6=declarations();            _fsp--;            if (failed) return ;            // PRO.g:72:80: ( SEPARATOR )*            loop21:            do {                int alt21=2;                int LA21_0 = input.LA(1);                if ( (LA21_0==SEPARATOR) ) {                    alt21=1;                }                switch (alt21) {            	case 1 :            	    // PRO.g:0:0: SEPARATOR            	    {            	    match(input,SEPARATOR,FOLLOW_SEPARATOR_in_subprogram__declaration320); if (failed) return ;            	    }            	    break;            	default :            	    break loop21;                }            } while (true);            if ( backtracking==0 ) {              emit(declarations6+"\n");            }            pushFollow(FOLLOW_compound_statement_in_subprogram__declaration325);            compound_statement();            _fsp--;            if (failed) return ;            // PRO.g:72:144: ( SEPARATOR )*            loop22:            do {                int alt22=2;                int LA22_0 = input.LA(1);                if ( (LA22_0==SEPARATOR) ) {                    int LA22_1 = input.LA(2);                    if ( (synpred22()) ) {                        alt22=1;                    }                }                switch (alt22) {            	case 1 :            	    // PRO.g:0:0: SEPARATOR            	    {            	    match(input,SEPARATOR,FOLLOW_SEPARATOR_in_subprogram__declaration327); if (failed) return ;            	    }            	    break;            	default :            	    break loop22;                }            } while (true);            }        }        catch (RecognitionException re) {            reportError(re);            recover(input,re);        }        finally {        }        return ;    }    // $ANTLR end subprogram__declaration    // $ANTLR start subprogram_head    // PRO.g:74:1: subprogram_head returns [String place] : ( FUNCTION ( SEPARATOR )* ID ( SEPARATOR )* arguments ( SEPARATOR )* ':' ( SEPARATOR )* standard_type ( SEPARATOR )* ';' ( SEPARATOR )* | PROCEDURE ( SEPARATOR )* ID ( SEPARATOR )* arguments ( SEPARATOR )* ';' ( SEPARATOR )* );    public final String subprogram_head() throws RecognitionException {        String place = null;        Token ID8=null;        Token ID10=null;        String standard_type7 = null;        String arguments9 = null;        String arguments11 = null;        try {            // PRO.g:75:3: ( FUNCTION ( SEPARATOR )* ID ( SEPARATOR )* arguments ( SEPARATOR )* ':' ( SEPARATOR )* standard_type ( SEPARATOR )* ';' ( SEPARATOR )* | PROCEDURE ( SEPARATOR )* ID ( SEPARATOR )* arguments ( SEPARATOR )* ';' ( SEPARATOR )* )            int alt33=2;            int LA33_0 = input.LA(1);            if ( (LA33_0==FUNCTION) ) {                alt33=1;            }            else if ( (LA33_0==PROCEDURE) ) {                alt33=2;            }            else {                if (backtracking>0) {failed=true; return place;}                NoViableAltException nvae =                    new NoViableAltException("74:1: subprogram_head returns [String place] : ( FUNCTION ( SEPARATOR )* ID ( SEPARATOR )* arguments ( SEPARATOR )* ':' ( SEPARATOR )* standard_type ( SEPARATOR )* ';' ( SEPARATOR )* | PROCEDURE ( SEPARATOR )* ID ( SEPARATOR )* arguments ( SEPARATOR )* ';' ( SEPARATOR )* );", 33, 0, input);                throw nvae;            }            switch (alt33) {                case 1 :                    // PRO.g:75:3: FUNCTION ( SEPARATOR )* ID ( SEPARATOR )* arguments ( SEPARATOR )* ':' ( SEPARATOR )* standard_type ( SEPARATOR )* ';' ( SEPARATOR )*                    {                    match(input,FUNCTION,FOLLOW_FUNCTION_in_subprogram_head343); if (failed) return place;                    // PRO.g:75:12: ( SEPARATOR )*                    loop23:                    do {                        int alt23=2;                        int LA23_0 = input.LA(1);                        if ( (LA23_0==SEPARATOR) ) {                            alt23=1;                        }                        switch (alt23) {                    	case 1 :                    	    // PRO.g:0:0: SEPARATOR                    	    {                    	    match(input,SEPARATOR,FOLLOW_SEPARATOR_in_subprogram_head345); if (failed) return place;                    	    }                    	    break;                    	default :                    	    break loop23;                        }                    } while (true);                    ID8=(Token)input.LT(1);                    match(input,ID,FOLLOW_ID_in_subprogram_head348); if (failed) return place;                    // PRO.g:75:26: ( SEPARATOR )*                    loop24:                    do {                        int alt24=2;                        int LA24_0 = input.LA(1);                        if ( (LA24_0==SEPARATOR) ) {                            int LA24_2 = input.LA(2);                            if ( (synpred24()) ) {                                alt24=1;                            }                        }                        switch (alt24) {                    	case 1 :

⌨️ 快捷键说明

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