|
From: Baptiste L. <bl...@us...> - 2004-08-08 15:55:11
|
Update of /cvsroot/cpptool/CppParser/src/cppparser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6127/src/cppparser Modified Files: cpp_grammar.txt Log Message: * enhanced wrapping of for, switch, case and default statements Index: cpp_grammar.txt =================================================================== RCS file: /cvsroot/cpptool/CppParser/src/cppparser/cpp_grammar.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** cpp_grammar.txt 7 Aug 2004 22:57:39 -0000 1.2 --- cpp_grammar.txt 8 Aug 2004 15:55:03 -0000 1.3 *************** *** 303,308 **** ; ! for_init_statement = expression_statement ! | simple_declaration ; --- 303,309 ---- ; ! for_init_statement = :node( 'for_init_statement', ! expression_statement ! | simple_declaration ) ; *************** *** 313,318 **** | :node('for_statement', 'for' '(' for_init_statement ! :node('for_condition', ?( condition ) ) ! ';' ?( expression ) ')' statement ) ; --- 314,320 ---- | :node('for_statement', 'for' '(' for_init_statement ! ?( :node('for_condition', condition ) ) ! ';' ?( expression ) ')' ! :node('for_loop_statement', statement) ) ; *************** *** 320,324 **** 'if' '(' condition ')' statement ?( 'else' statement ) ) | :node( 'switch_statement', ! 'switch' '(' condition ')' statement ) ; --- 322,327 ---- 'if' '(' condition ')' statement ?( 'else' statement ) ) | :node( 'switch_statement', ! 'switch' '(' :node('condition', condition) ')' ! :node('condition_statement', statement) ) ; *************** *** 331,335 **** labeled_statement = :node('label_statement', id ':' statement) ! | :node('case_statement', 'case' constant_expression ':' statement ) | :node('default_statement', 'default' ':' statement ); --- 334,339 ---- labeled_statement = :node('label_statement', id ':' statement) ! | :node('case_statement', 'case' constant_expression ':' ! :node('target_statement', statement ) ) | :node('default_statement', 'default' ':' statement ); *************** *** 735,740 **** throw_expression = 'throw' ?( assignment_expression ); ! exception_declaration = [ type_specifier ?( declarator | abstract_declarator ) ] ! | '...'; handler = :node('exception_handler', --- 739,745 ---- throw_expression = 'throw' ?( assignment_expression ); ! exception_declaration = :node( 'exception_declaration', ! [ type_specifier ?( declarator | abstract_declarator ) ] ) ! | :node( 'ellipsis_exception_handler', '...' ); handler = :node('exception_handler', |