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:
parent
cfa1a4f42e
commit
b6d210918b
8 changed files with 51 additions and 2 deletions
|
@ -1798,6 +1798,7 @@ exception_declaration
|
|||
exception_specification
|
||||
::= 'throw' '(' type_id_list ')'
|
||||
| 'throw' '(' ')'
|
||||
/. $Build consumePlaceHolder(); $EndBuild ./
|
||||
|
||||
|
||||
exception_specification_opt
|
||||
|
|
|
@ -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()) {
|
||||
|
|
|
@ -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
|
||||
//
|
||||
|
|
|
@ -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
|
||||
//
|
||||
|
|
|
@ -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
|
||||
//
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
//
|
||||
|
|
|
@ -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
|
||||
//
|
||||
|
|
Loading…
Add table
Reference in a new issue