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

📄 proparser.java.bak

📁 使用antlr实现c和pascal的转换
💻 BAK
📖 第 1 页 / 共 5 页
字号:
            do {                int alt37=2;                int LA37_0 = input.LA(1);                if ( (LA37_0==SEPARATOR) ) {                    alt37=1;                }                switch (alt37) {            	case 1 :            	    // PRO.g:0:0: SEPARATOR            	    {            	    match(input,SEPARATOR,FOLLOW_SEPARATOR_in_parameter_list446); if (failed) return place;            	    }            	    break;            	default :            	    break loop37;                }            } while (true);            match(input,48,FOLLOW_48_in_parameter_list449); if (failed) return place;            // PRO.g:83:37: ( SEPARATOR )*            loop38:            do {                int alt38=2;                int LA38_0 = input.LA(1);                if ( (LA38_0==SEPARATOR) ) {                    alt38=1;                }                switch (alt38) {            	case 1 :            	    // PRO.g:0:0: SEPARATOR            	    {            	    match(input,SEPARATOR,FOLLOW_SEPARATOR_in_parameter_list451); if (failed) return place;            	    }            	    break;            	default :            	    break loop38;                }            } while (true);            pushFollow(FOLLOW_type_in_parameter_list456);            g=type();            _fsp--;            if (failed) return place;            if ( backtracking==0 ) {              place =g+" "+e;            }            }            // PRO.g:83:87: ( ( SEPARATOR )* ';' ( SEPARATOR )* f= identifier_list ( SEPARATOR )* ':' ( SEPARATOR )* h= type )*            loop43:            do {                int alt43=2;                int LA43_0 = input.LA(1);                if ( (LA43_0==SEPARATOR) ) {                    int LA43_1 = input.LA(2);                    if ( (LA43_1==49) ) {                        alt43=1;                    }                    else if ( (LA43_1==SEPARATOR) ) {                        int LA43_5 = input.LA(3);                        if ( (LA43_5==49) ) {                            alt43=1;                        }                        else if ( (LA43_5==SEPARATOR) ) {                            int LA43_8 = input.LA(4);                            if ( (LA43_8==49) ) {                                alt43=1;                            }                            else if ( (LA43_8==SEPARATOR) ) {                                int LA43_11 = input.LA(5);                                if ( (LA43_11==49) ) {                                    alt43=1;                                }                                else if ( (LA43_11==SEPARATOR) ) {                                    int LA43_14 = input.LA(6);                                    if ( (LA43_14==49) ) {                                        alt43=1;                                    }                                    else if ( (LA43_14==SEPARATOR) ) {                                        int LA43_17 = input.LA(7);                                        if ( (LA43_17==49) ) {                                            alt43=1;                                        }                                        else if ( (LA43_17==SEPARATOR) ) {                                            int LA43_20 = input.LA(8);                                            if ( (LA43_20==49) ) {                                                alt43=1;                                            }                                            else if ( (LA43_20==SEPARATOR) ) {                                                int LA43_23 = input.LA(9);                                                if ( (LA43_23==49) ) {                                                    alt43=1;                                                }                                                else if ( (LA43_23==SEPARATOR) ) {                                                    int LA43_26 = input.LA(10);                                                    if ( (synpred43()) ) {                                                        alt43=1;                                                    }                                                }                                            }                                        }                                    }                                }                            }                        }                    }                }                else if ( (LA43_0==49) ) {                    alt43=1;                }                switch (alt43) {            	case 1 :            	    // PRO.g:83:88: ( SEPARATOR )* ';' ( SEPARATOR )* f= identifier_list ( SEPARATOR )* ':' ( SEPARATOR )* h= type            	    {            	    // PRO.g:83:88: ( SEPARATOR )*            	    loop39:            	    do {            	        int alt39=2;            	        int LA39_0 = input.LA(1);            	        if ( (LA39_0==SEPARATOR) ) {            	            alt39=1;            	        }            	        switch (alt39) {            	    	case 1 :            	    	    // PRO.g:0:0: SEPARATOR            	    	    {            	    	    match(input,SEPARATOR,FOLLOW_SEPARATOR_in_parameter_list461); if (failed) return place;            	    	    }            	    	    break;            	    	default :            	    	    break loop39;            	        }            	    } while (true);            	    match(input,49,FOLLOW_49_in_parameter_list464); if (failed) return place;            	    // PRO.g:83:103: ( SEPARATOR )*            	    loop40:            	    do {            	        int alt40=2;            	        int LA40_0 = input.LA(1);            	        if ( (LA40_0==SEPARATOR) ) {            	            alt40=1;            	        }            	        switch (alt40) {            	    	case 1 :            	    	    // PRO.g:0:0: SEPARATOR            	    	    {            	    	    match(input,SEPARATOR,FOLLOW_SEPARATOR_in_parameter_list466); if (failed) return place;            	    	    }            	    	    break;            	    	default :            	    	    break loop40;            	        }            	    } while (true);            	    pushFollow(FOLLOW_identifier_list_in_parameter_list471);            	    f=identifier_list();            	    _fsp--;            	    if (failed) return place;            	    // PRO.g:83:132: ( SEPARATOR )*            	    loop41:            	    do {            	        int alt41=2;            	        int LA41_0 = input.LA(1);            	        if ( (LA41_0==SEPARATOR) ) {            	            alt41=1;            	        }            	        switch (alt41) {            	    	case 1 :            	    	    // PRO.g:0:0: SEPARATOR            	    	    {            	    	    match(input,SEPARATOR,FOLLOW_SEPARATOR_in_parameter_list473); if (failed) return place;            	    	    }            	    	    break;            	    	default :            	    	    break loop41;            	        }            	    } while (true);            	    match(input,48,FOLLOW_48_in_parameter_list476); if (failed) return place;            	    // PRO.g:83:147: ( SEPARATOR )*            	    loop42:            	    do {            	        int alt42=2;            	        int LA42_0 = input.LA(1);            	        if ( (LA42_0==SEPARATOR) ) {            	            alt42=1;            	        }            	        switch (alt42) {            	    	case 1 :            	    	    // PRO.g:0:0: SEPARATOR            	    	    {            	    	    match(input,SEPARATOR,FOLLOW_SEPARATOR_in_parameter_list478); if (failed) return place;            	    	    }            	    	    break;            	    	default :            	    	    break loop42;            	        }            	    } while (true);            	    pushFollow(FOLLOW_type_in_parameter_list483);            	    h=type();            	    _fsp--;            	    if (failed) return place;            	    if ( backtracking==0 ) {            	      place+=","+h+" "+f;            	    }            	    }            	    break;            	default :            	    break loop43;                }            } while (true);            }        }        catch (RecognitionException re) {            reportError(re);            recover(input,re);        }        finally {        }        return place;    }    // $ANTLR end parameter_list    // $ANTLR start compound_statement    // PRO.g:87:1: compound_statement : BEGIN ( SEPARATOR )* optional_statements ( | ';' ) ( SEPARATOR )* END ( SEPARATOR )* ;    public final void compound_statement() throws RecognitionException {        try {            // PRO.g:88:3: ( BEGIN ( SEPARATOR )* optional_statements ( | ';' ) ( SEPARATOR )* END ( SEPARATOR )* )            // PRO.g:88:3: BEGIN ( SEPARATOR )* optional_statements ( | ';' ) ( SEPARATOR )* END ( SEPARATOR )*            {            match(input,BEGIN,FOLLOW_BEGIN_in_compound_statement497); if (failed) return ;            // PRO.g:88:9: ( SEPARATOR )*            loop44:            do {                int alt44=2;                int LA44_0 = input.LA(1);                if ( (LA44_0==SEPARATOR) ) {                    int LA44_5 = input.LA(2);                    if ( (synpred44()) ) {                        alt44=1;                    }                }                switch (alt44) {            	case 1 :            	    // PRO.g:0:0: SEPARATOR            	    {            	    match(input,SEPARATOR,FOLLOW_SEPARATOR_in_compound_statement499); if (failed) return ;            	    }            	    break;            	default :            	    break loop44;                }            } while (true);            if ( backtracking==0 ) {              emit("{\n");            }            pushFollow(FOLLOW_optional_statements_in_compound_statement504);            optional_statements();            _fsp--;            if (failed) return ;            // PRO.g:89:22: ( | ';' )            int alt45=2;            int LA45_0 = input.LA(1);            if ( (LA45_0==SEPARATOR||LA45_0==END) ) {                alt45=1;            }            else if ( (LA45_0==49) ) {                alt45=2;            }            else {                if (backtracking>0) {failed=true; return ;}                NoViableAltException nvae =                    new NoViableAltException("89:22: ( | ';' )", 45, 0, input);                throw nvae;            }            switch (alt45) {                case 1 :                    // PRO.g:89:23:                     {                    }                    break;                case 2 :                    // PRO.g:89:24: ';'                    {                    match(input,49,FOLLOW_49_in_compound_statement508); if (failed) return ;                    }                    break;            }            // PRO.g:89:28: ( SEPARATOR )*            loop46:            do {                int alt46=2;                int LA46_0 = input.LA(1);                if ( (LA46_0==SEPARATOR) ) {                    alt46=1;                }                switch (alt46) {            	case 1 :            	    // PRO.g:0:0: SEPARATOR            	    {            	    match(input,SEPARATOR,FOLLOW_SEPARATOR_in_compound_statement510); if (failed) return ;            	    }            	    break;            	default :            	    break loop46;                }            } while (true);            match(input,END,FOLLOW_END_in_compound_statement515); if (failed) return ;            // PRO.g:90:6: ( SEPARATOR )*            loop47:            do {                int alt47=2;                int LA47_0 = input.LA(1);                if ( (LA47_0==SEPARATOR) ) {                    int LA47_1 = input.LA(2);                    if ( (synpred47()) ) {                        alt47=1;                    }                }                switch (alt47) {            	case 1 :         

⌨️ 快捷键说明

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