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

📄 proparser.java.bak

📁 使用antlr实现c和pascal的转换
💻 BAK
📖 第 1 页 / 共 5 页
字号:
                    	    // PRO.g:0:0: SEPARATOR                    	    {                    	    match(input,SEPARATOR,FOLLOW_SEPARATOR_in_subprogram_head350); if (failed) return place;                    	    }                    	    break;                    	default :                    	    break loop24;                        }                    } while (true);                    pushFollow(FOLLOW_arguments_in_subprogram_head353);                    arguments9=arguments();                    _fsp--;                    if (failed) return place;                    // PRO.g:75:47: ( SEPARATOR )*                    loop25:                    do {                        int alt25=2;                        int LA25_0 = input.LA(1);                        if ( (LA25_0==SEPARATOR) ) {                            alt25=1;                        }                        switch (alt25) {                    	case 1 :                    	    // PRO.g:0:0: SEPARATOR                    	    {                    	    match(input,SEPARATOR,FOLLOW_SEPARATOR_in_subprogram_head355); if (failed) return place;                    	    }                    	    break;                    	default :                    	    break loop25;                        }                    } while (true);                    match(input,48,FOLLOW_48_in_subprogram_head358); if (failed) return place;                    // PRO.g:75:62: ( SEPARATOR )*                    loop26:                    do {                        int alt26=2;                        int LA26_0 = input.LA(1);                        if ( (LA26_0==SEPARATOR) ) {                            alt26=1;                        }                        switch (alt26) {                    	case 1 :                    	    // PRO.g:0:0: SEPARATOR                    	    {                    	    match(input,SEPARATOR,FOLLOW_SEPARATOR_in_subprogram_head360); if (failed) return place;                    	    }                    	    break;                    	default :                    	    break loop26;                        }                    } while (true);                    pushFollow(FOLLOW_standard_type_in_subprogram_head363);                    standard_type7=standard_type();                    _fsp--;                    if (failed) return place;                    // PRO.g:75:87: ( SEPARATOR )*                    loop27:                    do {                        int alt27=2;                        int LA27_0 = input.LA(1);                        if ( (LA27_0==SEPARATOR) ) {                            alt27=1;                        }                        switch (alt27) {                    	case 1 :                    	    // PRO.g:0:0: SEPARATOR                    	    {                    	    match(input,SEPARATOR,FOLLOW_SEPARATOR_in_subprogram_head365); if (failed) return place;                    	    }                    	    break;                    	default :                    	    break loop27;                        }                    } while (true);                    match(input,49,FOLLOW_49_in_subprogram_head368); if (failed) return place;                    // PRO.g:75:102: ( SEPARATOR )*                    loop28:                    do {                        int alt28=2;                        int LA28_0 = input.LA(1);                        if ( (LA28_0==SEPARATOR) ) {                            int LA28_1 = input.LA(2);                            if ( (synpred28()) ) {                                alt28=1;                            }                        }                        switch (alt28) {                    	case 1 :                    	    // PRO.g:0:0: SEPARATOR                    	    {                    	    match(input,SEPARATOR,FOLLOW_SEPARATOR_in_subprogram_head370); if (failed) return place;                    	    }                    	    break;                    	default :                    	    break loop28;                        }                    } while (true);                    if ( backtracking==0 ) {                      place =standard_type7+" "+ID8.getText()+arguments9;                    }                    }                    break;                case 2 :                    // PRO.g:76:3: PROCEDURE ( SEPARATOR )* ID ( SEPARATOR )* arguments ( SEPARATOR )* ';' ( SEPARATOR )*                    {                    match(input,PROCEDURE,FOLLOW_PROCEDURE_in_subprogram_head377); if (failed) return place;                    // PRO.g:76:13: ( SEPARATOR )*                    loop29:                    do {                        int alt29=2;                        int LA29_0 = input.LA(1);                        if ( (LA29_0==SEPARATOR) ) {                            alt29=1;                        }                        switch (alt29) {                    	case 1 :                    	    // PRO.g:0:0: SEPARATOR                    	    {                    	    match(input,SEPARATOR,FOLLOW_SEPARATOR_in_subprogram_head379); if (failed) return place;                    	    }                    	    break;                    	default :                    	    break loop29;                        }                    } while (true);                    ID10=(Token)input.LT(1);                    match(input,ID,FOLLOW_ID_in_subprogram_head382); if (failed) return place;                    // PRO.g:76:27: ( SEPARATOR )*                    loop30:                    do {                        int alt30=2;                        int LA30_0 = input.LA(1);                        if ( (LA30_0==SEPARATOR) ) {                            int LA30_2 = input.LA(2);                            if ( (synpred31()) ) {                                alt30=1;                            }                        }                        switch (alt30) {                    	case 1 :                    	    // PRO.g:0:0: SEPARATOR                    	    {                    	    match(input,SEPARATOR,FOLLOW_SEPARATOR_in_subprogram_head384); if (failed) return place;                    	    }                    	    break;                    	default :                    	    break loop30;                        }                    } while (true);                    pushFollow(FOLLOW_arguments_in_subprogram_head387);                    arguments11=arguments();                    _fsp--;                    if (failed) return place;                    // PRO.g:76:48: ( SEPARATOR )*                    loop31:                    do {                        int alt31=2;                        int LA31_0 = input.LA(1);                        if ( (LA31_0==SEPARATOR) ) {                            alt31=1;                        }                        switch (alt31) {                    	case 1 :                    	    // PRO.g:0:0: SEPARATOR                    	    {                    	    match(input,SEPARATOR,FOLLOW_SEPARATOR_in_subprogram_head389); if (failed) return place;                    	    }                    	    break;                    	default :                    	    break loop31;                        }                    } while (true);                    match(input,49,FOLLOW_49_in_subprogram_head392); if (failed) return place;                    // PRO.g:76:63: ( SEPARATOR )*                    loop32:                    do {                        int alt32=2;                        int LA32_0 = input.LA(1);                        if ( (LA32_0==SEPARATOR) ) {                            int LA32_1 = input.LA(2);                            if ( (synpred33()) ) {                                alt32=1;                            }                        }                        switch (alt32) {                    	case 1 :                    	    // PRO.g:0:0: SEPARATOR                    	    {                    	    match(input,SEPARATOR,FOLLOW_SEPARATOR_in_subprogram_head394); if (failed) return place;                    	    }                    	    break;                    	default :                    	    break loop32;                        }                    } while (true);                    if ( backtracking==0 ) {                      place ="void "+ID10.getText()+arguments11;                    }                    }                    break;            }        }        catch (RecognitionException re) {            reportError(re);            recover(input,re);        }        finally {        }        return place;    }    // $ANTLR end subprogram_head    // $ANTLR start arguments    // PRO.g:78:1: arguments returns [String place] : ( '(' ( SEPARATOR )* parameter_list ( SEPARATOR )* ')' | );    public final String arguments() throws RecognitionException {        String place = null;        String parameter_list12 = null;        try {            // PRO.g:79:3: ( '(' ( SEPARATOR )* parameter_list ( SEPARATOR )* ')' | )            int alt36=2;            int LA36_0 = input.LA(1);            if ( (LA36_0==45) ) {                alt36=1;            }            else if ( (LA36_0==SEPARATOR||(LA36_0>=48 && LA36_0<=49)) ) {                alt36=2;            }            else {                if (backtracking>0) {failed=true; return place;}                NoViableAltException nvae =                    new NoViableAltException("78:1: arguments returns [String place] : ( '(' ( SEPARATOR )* parameter_list ( SEPARATOR )* ')' | );", 36, 0, input);                throw nvae;            }            switch (alt36) {                case 1 :                    // PRO.g:79:3: '(' ( SEPARATOR )* parameter_list ( SEPARATOR )* ')'                    {                    match(input,45,FOLLOW_45_in_arguments412); if (failed) return place;                    // PRO.g:79:7: ( SEPARATOR )*                    loop34:                    do {                        int alt34=2;                        int LA34_0 = input.LA(1);                        if ( (LA34_0==SEPARATOR) ) {                            alt34=1;                        }                        switch (alt34) {                    	case 1 :                    	    // PRO.g:0:0: SEPARATOR                    	    {                    	    match(input,SEPARATOR,FOLLOW_SEPARATOR_in_arguments414); if (failed) return place;                    	    }                    	    break;                    	default :                    	    break loop34;                        }                    } while (true);                    pushFollow(FOLLOW_parameter_list_in_arguments417);                    parameter_list12=parameter_list();                    _fsp--;                    if (failed) return place;                    // PRO.g:79:33: ( SEPARATOR )*                    loop35:                    do {                        int alt35=2;                        int LA35_0 = input.LA(1);                        if ( (LA35_0==SEPARATOR) ) {                            alt35=1;                        }                        switch (alt35) {                    	case 1 :                    	    // PRO.g:0:0: SEPARATOR                    	    {                    	    match(input,SEPARATOR,FOLLOW_SEPARATOR_in_arguments419); if (failed) return place;                    	    }                    	    break;                    	default :                    	    break loop35;                        }                    } while (true);                    match(input,46,FOLLOW_46_in_arguments422); if (failed) return place;                    if ( backtracking==0 ) {                      place ="("+parameter_list12+")";                    }                    }                    break;                case 2 :                    // PRO.g:80:4:                     {                    if ( backtracking==0 ) {                      place ="()";                    }                    }                    break;            }        }        catch (RecognitionException re) {            reportError(re);            recover(input,re);        }        finally {        }        return place;    }    // $ANTLR end arguments    // $ANTLR start parameter_list    // PRO.g:82:1: parameter_list returns [String place] : (e= identifier_list ( SEPARATOR )* ':' ( SEPARATOR )* g= type ) ( ( SEPARATOR )* ';' ( SEPARATOR )* f= identifier_list ( SEPARATOR )* ':' ( SEPARATOR )* h= type )* ;    public final String parameter_list() throws RecognitionException {        String place = null;        String e = null;        String g = null;        String f = null;        String h = null;        try {            // PRO.g:83:3: ( (e= identifier_list ( SEPARATOR )* ':' ( SEPARATOR )* g= type ) ( ( SEPARATOR )* ';' ( SEPARATOR )* f= identifier_list ( SEPARATOR )* ':' ( SEPARATOR )* h= type )* )            // PRO.g:83:3: (e= identifier_list ( SEPARATOR )* ':' ( SEPARATOR )* g= type ) ( ( SEPARATOR )* ';' ( SEPARATOR )* f= identifier_list ( SEPARATOR )* ':' ( SEPARATOR )* h= type )*            {            // PRO.g:83:3: (e= identifier_list ( SEPARATOR )* ':' ( SEPARATOR )* g= type )            // PRO.g:83:4: e= identifier_list ( SEPARATOR )* ':' ( SEPARATOR )* g= type            {            pushFollow(FOLLOW_identifier_list_in_parameter_list444);            e=identifier_list();            _fsp--;            if (failed) return place;            // PRO.g:83:22: ( SEPARATOR )*            loop37:

⌨️ 快捷键说明

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