1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

fix for bug 86943 for the LR parsers

This commit is contained in:
Mike Kucera 2009-01-02 15:59:42 +00:00
parent cfa1a4f42e
commit b6d210918b
8 changed files with 51 additions and 2 deletions

View file

@ -1798,6 +1798,7 @@ exception_declaration
exception_specification
::= 'throw' '(' type_id_list ')'
| 'throw' '(' ')'
/. $Build consumePlaceHolder(); $EndBuild ./
exception_specification_opt

View file

@ -1675,8 +1675,14 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
IASTName name = nodeFactory.newName();
ICPPASTFunctionDeclarator declarator = nodeFactory.newFunctionDeclarator(name);
for(Object typeId : astStack.closeScope()) {
declarator.addExceptionSpecificationTypeId((IASTTypeId) typeId);
List<Object> typeIds = astStack.closeScope();
if(typeIds.size() == 1 && typeIds.get(0) == PLACE_HOLDER) { // fix for bug 86943
declarator.setEmptyExceptionSpecification();
}
else {
for(Object typeId : typeIds) {
declarator.addExceptionSpecificationTypeId((IASTTypeId) typeId);
}
}
for(Object token : astStack.closeScope()) {

View file

@ -2270,6 +2270,13 @@ public CPPExpressionParser(String[] mapFrom) { // constructor
consumeDeclarationSimple(false); break;
}
//
// Rule 530: exception_specification ::= throw ( )
//
case 530: { action.builder.
consumePlaceHolder(); break;
}
//
// Rule 536: expression_parser_start ::= ERROR_TOKEN
//

View file

@ -2263,6 +2263,13 @@ public CPPNoCastExpressionParser(String[] mapFrom) { // constructor
consumeDeclarationSimple(false); break;
}
//
// Rule 529: exception_specification ::= throw ( )
//
case 529: { action.builder.
consumePlaceHolder(); break;
}
//
// Rule 535: no_cast_start ::= ERROR_TOKEN
//

View file

@ -2263,6 +2263,13 @@ public CPPNoFunctionDeclaratorParser(String[] mapFrom) { // constructor
consumeDeclarationSimple(false); break;
}
//
// Rule 528: exception_specification ::= throw ( )
//
case 528: { action.builder.
consumePlaceHolder(); break;
}
//
// Rule 534: no_function_declarator_start ::= ERROR_TOKEN
//

View file

@ -2269,6 +2269,13 @@ public CPPParser(String[] mapFrom) { // constructor
case 528: { action.builder.
consumeDeclarationSimple(false); break;
}
//
// Rule 530: exception_specification ::= throw ( )
//
case 530: { action.builder.
consumePlaceHolder(); break;
}
default:

View file

@ -2256,6 +2256,13 @@ public CPPSizeofExpressionParser(String[] mapFrom) { // constructor
consumeDeclarationSimple(false); break;
}
//
// Rule 528: exception_specification ::= throw ( )
//
case 528: { action.builder.
consumePlaceHolder(); break;
}
//
// Rule 534: no_sizeof_type_name_start ::= ERROR_TOKEN
//

View file

@ -2270,6 +2270,13 @@ public CPPTemplateTypeParameterParser(String[] mapFrom) { // constructor
consumeDeclarationSimple(false); break;
}
//
// Rule 530: exception_specification ::= throw ( )
//
case 530: { action.builder.
consumePlaceHolder(); break;
}
//
// Rule 536: type_parameter_start ::= ERROR_TOKEN
//