Author: kjs Date: Sat Sep 22 04:41:54 2007 New Revision: 21484 Modified: trunk/compilers/pirc/src/pirlexer.c trunk/compilers/pirc/src/pirlexer.h trunk/compilers/pirc/src/pirparser.c trunk/compilers/pirc/t/stmts.pir
Log: compilers/pirc: * remove unused tokens * remove unnecessary comments * remove unnecessary grammar rules all based on PIR language updates recently. Modified: trunk/compilers/pirc/src/pirlexer.c ============================================================================== --- trunk/compilers/pirc/src/pirlexer.c (original) +++ trunk/compilers/pirc/src/pirlexer.c Sat Sep 22 04:41:54 2007 @@ -84,12 +84,12 @@ The following are PIR directives. .arg .const .constant .emit .end - .endnamespace .endm .eom .get_results .global + .endnamespace .endm .eom .get_results .globalconst .HLL .HLL_map .include .invocant .lex .loadlib .local .macro .meth_call .namespace .nci_call .param .pcc_begin .pcc_begin_return .pcc_begin_yield .pcc_call .pcc_end .pcc_end_return .pcc_end_yield - .pcc_sub .pragma .result .return .sub + .pragma .result .return .sub .sym .yield @@ -149,7 +149,6 @@ ".endm", /* T_ENDM, */ ".eom", /* T_EOM, */ ".get_results", /* T_GET_RESULTS */ - ".global", /* T_GLOBAL_DECL, */ ".globalconst", /* T_GLOBALCONST */ ".HLL", /* T_HLL */ ".HLL_map", /* T_HLL_MAP */ @@ -170,7 +169,6 @@ ".pcc_end", /* T_PCC_END */ ".pcc_end_return", /* T_PCC_END_RETURN */ ".pcc_end_yield", /* T_PCC_END_YIELD */ - ".pcc_sub", /* T_PCC_SUB */ ".pragma", /* T_PRAGMA */ ".result", /* T_RESULT, */ ".return", /* T_RETURN, */ Modified: trunk/compilers/pirc/src/pirlexer.h ============================================================================== --- trunk/compilers/pirc/src/pirlexer.h (original) +++ trunk/compilers/pirc/src/pirlexer.h Sat Sep 22 04:41:54 2007 @@ -27,7 +27,6 @@ T_ENDM, /* ".endm", */ T_EOM, /* ".eom", */ T_GET_RESULTS, /* ".get_results", */ - T_GLOBAL_DECL, /* ".global", */ T_GLOBALCONST, /* ".globalconst", */ T_HLL, /* ".HLL", */ T_HLL_MAP, /* ".HLL_map", */ @@ -48,7 +47,6 @@ T_PCC_END, /* ".pcc_end", */ T_PCC_END_RETURN, /* ".pcc_end_return", */ T_PCC_END_YIELD, /* ".pcc_end_yield", */ - T_PCC_SUB, /* ".pcc_sub", */ T_PRAGMA, /* ".pragma", */ T_RESULT, /* ".result", */ T_RETURN, /* ".return", */ Modified: trunk/compilers/pirc/src/pirparser.c ============================================================================== --- trunk/compilers/pirc/src/pirparser.c (original) +++ trunk/compilers/pirc/src/pirparser.c Sat Sep 22 04:41:54 2007 @@ -1867,21 +1867,6 @@ =item * - global_definition -> '.global' IDENTIFIER - -=cut - -*/ -static void -global_definition(parser_state *p) { - match(p, T_GLOBAL_DECL); - match(p, T_IDENTIFIER); -} - -/* - -=item * - multi-type-list -> '(' [multi-type {',' multi-type } ] ')' multi-type -> IDENTIFIER | STRINGC | keylist | type @@ -2092,7 +2077,7 @@ sub_definition(parser_state *p) { /* call emit method */ emit_sub_start(p); - next(p); /* skip '.sub' or '.pcc_sub' */ + next(p); /* skip '.sub' */ switch (p->curtoken) { /* subname -> IDENTIFIER | STRINGC */ case T_IDENTIFIER: @@ -2319,8 +2304,7 @@ =item * - compilation_unit -> global_definition - | sub_definition + compilation_unit -> sub_definition | '.const' const_definition | emit_block | include @@ -2337,11 +2321,7 @@ static void compilation_unit(parser_state *p) { switch (p->curtoken) { - case T_GLOBAL_DECL: /* compilation_unit -> global_definition */ - global_definition(p); - break; case T_SUB: /* compilation_unit -> sub_definition */ - case T_PCC_SUB: sub_definition(p); break; case T_CONST: /* compilation_unit -> '.const' const_definition */ Modified: trunk/compilers/pirc/t/stmts.pir ============================================================================== --- trunk/compilers/pirc/t/stmts.pir (original) +++ trunk/compilers/pirc/t/stmts.pir Sat Sep 22 04:41:54 2007 @@ -4,7 +4,7 @@ # test .HLL statement .HLL "PIRC", "pircgroup" .pragma n_operators 1 -.global x + .sub main # test local declarations