1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

added actions for class member declarators

This commit is contained in:
Mike Kucera 2008-01-24 21:39:11 +00:00
parent 477c0b147d
commit c98379b752
12 changed files with 2074 additions and 1975 deletions

View file

@ -35,6 +35,7 @@ import org.eclipse.cdt.core.dom.ast.IASTEnumerationSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTExpression;
import org.eclipse.cdt.core.dom.ast.IASTExpressionList;
import org.eclipse.cdt.core.dom.ast.IASTExpressionStatement;
import org.eclipse.cdt.core.dom.ast.IASTFieldDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTForStatement;
import org.eclipse.cdt.core.dom.ast.IASTFunctionCallExpression;
import org.eclipse.cdt.core.dom.ast.IASTFunctionDeclarator;
@ -1130,6 +1131,31 @@ public abstract class BuildASTParserAction {
/**
* struct_declarator
* ::= ':' constant_expression
* | declarator ':' constant_expression
*/
public void consumeBitField(boolean hasDeclarator) {
if(TRACE_ACTIONS) DebugUtil.printMethodTrace();
IASTExpression expr = (IASTExpression)astStack.pop();
IASTName name;
if(hasDeclarator) // it should have been parsed into a regular declarator
name = ((IASTDeclarator) astStack.pop()).getName();
else
name = nodeFactory.newName();
IASTFieldDeclarator fieldDecl = nodeFactory.newFieldDeclarator(name, expr);
setOffsetAndLength(fieldDecl);
astStack.push(fieldDecl);
if(TRACE_AST_STACK) System.out.println(astStack);
}
/**
* statement ::= ERROR_TOKEN

View file

@ -32,6 +32,7 @@ import org.eclipse.cdt.core.dom.ast.IASTEnumerationSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTExpression;
import org.eclipse.cdt.core.dom.ast.IASTExpressionList;
import org.eclipse.cdt.core.dom.ast.IASTExpressionStatement;
import org.eclipse.cdt.core.dom.ast.IASTFieldDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTForStatement;
import org.eclipse.cdt.core.dom.ast.IASTFunctionCallExpression;
import org.eclipse.cdt.core.dom.ast.IASTFunctionDeclarator;
@ -168,4 +169,7 @@ public interface IASTNodeFactory {
public IASTArrayDeclarator newArrayDeclarator(IASTName name);
public IASTParameterDeclaration newParameterDeclaration(IASTDeclSpecifier declSpec, IASTDeclarator declarator);
public IASTFieldDeclarator newFieldDeclarator(IASTName name, IASTExpression bitFieldSize);
}

View file

@ -38,8 +38,6 @@ import java.util.List;
import lpg.lpgjavaruntime.IToken;
import org.eclipse.cdt.core.dom.ast.IASTArrayDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTArrayModifier;
import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement;
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
@ -48,7 +46,6 @@ import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTElaboratedTypeSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTExpression;
import org.eclipse.cdt.core.dom.ast.IASTExpressionStatement;
import org.eclipse.cdt.core.dom.ast.IASTFieldDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTFieldReference;
import org.eclipse.cdt.core.dom.ast.IASTFunctionDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition;
@ -577,30 +574,6 @@ public class C99BuildASTParserAction extends BuildASTParserAction {
}
/**
* struct_declarator
* ::= ':' constant_expression
* | declarator ':' constant_expression
*/
public void consumeStructBitField(boolean hasDeclarator) {
if(TRACE_ACTIONS) DebugUtil.printMethodTrace();
IASTExpression expr = (IASTExpression)astStack.pop();
IASTName name;
if(hasDeclarator) // it should have been parsed into a regular declarator
name = ((IASTDeclarator) astStack.pop()).getName();
else
name = nodeFactory.newName();
IASTFieldDeclarator fieldDecl = nodeFactory.newFieldDeclarator(name, expr);
setOffsetAndLength(fieldDecl);
astStack.push(fieldDecl);
if(TRACE_AST_STACK) System.out.println(astStack);
}
/**
* struct_or_union_specifier
* ::= 'struct' '{' <openscope> struct_declaration_list_opt '}'

View file

@ -60,8 +60,6 @@ public interface IC99ASTNodeFactory extends IASTNodeFactory {
public ICASTTypedefNameSpecifier newCTypedefNameSpecifier();
public IASTFieldDeclarator newFieldDeclarator(IASTName name, IASTExpression bitFieldSize);
public ICASTCompositeTypeSpecifier newCCompositeTypeSpecifier(int key, IASTName name);

View file

@ -32,6 +32,7 @@ import org.eclipse.cdt.core.dom.ast.IASTEnumerationSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTExpression;
import org.eclipse.cdt.core.dom.ast.IASTExpressionList;
import org.eclipse.cdt.core.dom.ast.IASTExpressionStatement;
import org.eclipse.cdt.core.dom.ast.IASTFieldDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTFieldReference;
import org.eclipse.cdt.core.dom.ast.IASTForStatement;
import org.eclipse.cdt.core.dom.ast.IASTFunctionCallExpression;
@ -121,6 +122,7 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTEnumerator;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTExplicitTemplateInstantiation;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTExpressionList;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTExpressionStatement;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFieldDeclarator;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFieldReference;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTForStatement;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionCallExpression;
@ -515,4 +517,8 @@ public class CPPASTNodeFactory implements ICPPASTNodeFactory {
return new CPPASTFunctionTryBlockDeclarator(name);
}
public IASTFieldDeclarator newFieldDeclarator(IASTName name, IASTExpression bitFieldSize) {
return new CPPASTFieldDeclarator(name, bitFieldSize);
}
}

View file

@ -34,6 +34,7 @@ import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition;
import org.eclipse.cdt.core.dom.ast.IASTIfStatement;
import org.eclipse.cdt.core.dom.ast.IASTInitializer;
import org.eclipse.cdt.core.dom.ast.IASTInitializerExpression;
import org.eclipse.cdt.core.dom.ast.IASTLiteralExpression;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTParameterDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTPointer;
@ -1385,6 +1386,50 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
if(TRACE_AST_STACK) System.out.println(astStack);
}
/**
* member_declaration
* ::= dcolon_opt nested_name_specifier template_opt unqualified_id_name ';'
*/
public void consumeMemberDeclarationQualifiedId() {
if(TRACE_ACTIONS) DebugUtil.printMethodTrace();
IASTName qualifiedId = subRuleQualifiedName(true);
IASTDeclarator declarator = nodeFactory.newDeclarator(qualifiedId);
setOffsetAndLength(declarator);
IASTSimpleDeclaration declaration = nodeFactory.newSimpleDeclaration(null); // no decl spec
setOffsetAndLength(declaration);
declaration.addDeclarator(declarator);
astStack.push(declaration);
if(TRACE_AST_STACK) System.out.println(astStack);
}
/**
* member_declarator
* ::= declarator constant_initializer
*/
public void consumeMemberDeclaratorWithInitializer() {
if(TRACE_ACTIONS) DebugUtil.printMethodTrace();
IASTInitializerExpression initializer = (IASTInitializerExpression) astStack.pop();
IASTDeclarator declarator = (IASTDeclarator) astStack.peek();
setOffsetAndLength(declarator);
if(declarator instanceof ICPPASTFunctionDeclarator) {
IASTExpression expr = initializer.getExpression();
if(expr instanceof IASTLiteralExpression && "0".equals(expr.toString())) { //$NON-NLS-1$
((ICPPASTFunctionDeclarator)declarator).setPureVirtual(true);
return;
}
}
declarator.setInitializer(initializer);
}
}

View file

@ -830,9 +830,9 @@ complete_struct_declarator
struct_declarator
::= declarator
| ':' constant_expression
/. $Build consumeStructBitField(false); $EndBuild ./
/. $Build consumeBitField(false); $EndBuild ./
| declarator ':' constant_expression
/. $Build consumeStructBitField(true); $EndBuild ./
/. $Build consumeBitField(true); $EndBuild ./
enum_specifier

View file

@ -1601,7 +1601,7 @@ public int getKind(int i) {
static final class Action204 extends DeclaredAction< C99ParserAction , Object > {
public void doFinal(ITrialUndoActionProvider< Object > provider, C99ParserAction action) { action.builder.
consumeStructBitField(false); /* action.builder.getASTStack().print();*/
consumeBitField(false); /* action.builder.getASTStack().print();*/
}
}
@ -1611,7 +1611,7 @@ public int getKind(int i) {
static final class Action205 extends DeclaredAction< C99ParserAction , Object > {
public void doFinal(ITrialUndoActionProvider< Object > provider, C99ParserAction action) { action.builder.
consumeStructBitField(true); /* action.builder.getASTStack().print();*/
consumeBitField(true); /* action.builder.getASTStack().print();*/
}
}

View file

@ -53,7 +53,7 @@ $Terminals
integer floating charconst stringlit
zero -- this is a special token used to disambiguate the the grammar rule for pure virtual functions
-- zero -- this is a special token used to disambiguate the the grammar rule for pure virtual functions
-- TODO is this really necessary? because it adds overhead in getKind()
-- identifiers
@ -230,9 +230,14 @@ $Headers
public int getKind(int i) {
int kind = super.getKind(i);
if(kind == CPPParsersym.TK_integer && "0".equals(getTokenText(i))) { //$NON-NLS-1$
kind = CPPParsersym.TK_zero;
}
// There used to be a special token kind for zero used to parser pure virtual function declarations.
// But it turned out to be easier to just parse them as an init_declarator and programaticaly check
// for pure virtual, see consumeMemberDeclaratorWithInitializer().
//if(kind == CPPParsersym.TK_integer && "0".equals(getTokenText(i))) { //$NON-NLS-1$
// kind = CPPParsersym.TK_zero;
//}
// lexer feedback hack!
//else if(kind == C99Parsersym.TK_identifier && action.resolver.isTypedef(getTokenText(i))) {
@ -865,7 +870,7 @@ declaration_statement
declaration
::= block_declaration
| function_definition
| function_definition -- done
| template_declaration -- done
| explicit_instantiation -- done
| explicit_specialization -- done
@ -874,7 +879,7 @@ declaration
block_declaration
::= simple_declaration
::= simple_declaration -- done
| asm_definition -- done
| namespace_alias_definition -- done
| using_declaration -- done
@ -1377,9 +1382,9 @@ parameter_initializer
function_definition
::= declaration_specifiers_opt function_direct_declarator <openscope-ast> ctor_initializer_list_opt function_body
/. $Build consumeFunctionDefinition(false); $EndBuild ./
| declaration_specifiers_opt function_direct_declarator 'try' <openscope-ast> ctor_initializer_list_opt function_body <openscope-ast> handler_seq
/. $Build consumeFunctionDefinition(true); $EndBuild ./
function_body
@ -1459,14 +1464,19 @@ visibility_label
member_declaration
::= declaration_specifiers_opt member_declarator_list ';'
::= declaration_specifiers_opt <openscope-ast> member_declarator_list ';'
/. $Build consumeDeclarationSimple(true); $EndBuild ./
| declaration_specifiers_opt ';'
| function_definition ';'
| function_definition
/. $Build consumeDeclarationSimple(false); $EndBuild ./
| function_definition ';' -- done
| function_definition -- done
| dcolon_opt nested_name_specifier template_opt unqualified_id_name ';'
| using_declaration
/. $Build consumeMemberDeclarationQualifiedId(); $EndBuild ./
| using_declaration -- done
| template_declaration
| visibility_label
| visibility_label -- done
member_declaration_list
@ -1486,13 +1496,22 @@ member_declarator_list
member_declarator
::= declarator
| declarator pure_specifier
-- | declarator pure_specifier -- parse this as a constant initializer
| declarator constant_initializer
| identifier_opt ':' constant_expression
/. $Build consumeMemberDeclaratorWithInitializer(); $EndBuild ./
| bit_field_declarator ':' constant_expression
/. $Build consumeBitField(true); $EndBuild ./
| ':' constant_expression
/. $Build consumeBitField(false); $EndBuild ./
pure_specifier
::= '=' '0'
bit_field_declarator
::= identifier_name
/. $Build consumeDirectDeclaratorIdentifier(); $EndBuild ./
--pure_specifier -- this leads to ambiguities
-- ::= '=' '0'
constant_initializer

View file

@ -175,9 +175,14 @@ public IASTCompletionNode parse(IASTTranslationUnit tu) {
public int getKind(int i) {
int kind = super.getKind(i);
if(kind == CPPParsersym.TK_integer && "0".equals(getTokenText(i))) { //$NON-NLS-1$
kind = CPPParsersym.TK_zero;
}
// There used to be a special token kind for zero used to parser pure virtual function declarations.
// But it turned out to be easier to just parse them as an init_declarator and programaticaly check
// for pure virtual, see consumeMemberDeclaratorWithInitializer().
//if(kind == CPPParsersym.TK_integer && "0".equals(getTokenText(i))) { //$NON-NLS-1$
// kind = CPPParsersym.TK_zero;
//}
// lexer feedback hack!
//else if(kind == C99Parsersym.TK_identifier && action.resolver.isTypedef(getTokenText(i))) {
@ -200,7 +205,7 @@ public int getKind(int i) {
// Initialize ruleAction array.
//
static {
RULE_ACTIONS = new Action[525 + 1];
RULE_ACTIONS = new Action[523 + 1];
RULE_ACTIONS[0] = null;
RULE_ACTIONS[1] = new Action1();
@ -404,6 +409,8 @@ public int getKind(int i) {
RULE_ACTIONS[367] = new Action367();
RULE_ACTIONS[368] = new Action368();
RULE_ACTIONS[369] = new Action369();
RULE_ACTIONS[370] = new Action370();
RULE_ACTIONS[371] = new Action371();
RULE_ACTIONS[374] = new Action374();
RULE_ACTIONS[375] = new Action375();
RULE_ACTIONS[376] = new Action376();
@ -416,24 +423,28 @@ public int getKind(int i) {
RULE_ACTIONS[387] = new Action387();
RULE_ACTIONS[391] = new Action391();
RULE_ACTIONS[395] = new Action395();
RULE_ACTIONS[396] = new Action396();
RULE_ACTIONS[397] = new Action397();
RULE_ACTIONS[400] = new Action400();
RULE_ACTIONS[411] = new Action411();
RULE_ACTIONS[419] = new Action419();
RULE_ACTIONS[420] = new Action420();
RULE_ACTIONS[421] = new Action421();
RULE_ACTIONS[422] = new Action422();
RULE_ACTIONS[423] = new Action423();
RULE_ACTIONS[424] = new Action424();
RULE_ACTIONS[430] = new Action430();
RULE_ACTIONS[440] = new Action440();
RULE_ACTIONS[441] = new Action441();
RULE_ACTIONS[444] = new Action444();
RULE_ACTIONS[445] = new Action445();
RULE_ACTIONS[428] = new Action428();
RULE_ACTIONS[438] = new Action438();
RULE_ACTIONS[439] = new Action439();
RULE_ACTIONS[442] = new Action442();
RULE_ACTIONS[443] = new Action443();
RULE_ACTIONS[486] = new Action486();
RULE_ACTIONS[487] = new Action487();
RULE_ACTIONS[488] = new Action488();
RULE_ACTIONS[489] = new Action489();
RULE_ACTIONS[490] = new Action490();
RULE_ACTIONS[501] = new Action501();
RULE_ACTIONS[499] = new Action499();
RULE_ACTIONS[508] = new Action508();
RULE_ACTIONS[509] = new Action509();
RULE_ACTIONS[510] = new Action510();
RULE_ACTIONS[511] = new Action511();
RULE_ACTIONS[512] = new Action512();
RULE_ACTIONS[515] = new Action515();
RULE_ACTIONS[516] = new Action516();
RULE_ACTIONS[513] = new Action513();
RULE_ACTIONS[514] = new Action514();
//
@ -2456,6 +2467,26 @@ public int getKind(int i) {
}
}
//
// Rule 370: function_definition ::= declaration_specifiers_opt function_direct_declarator <openscope-ast> ctor_initializer_list_opt function_body
//
static final class Action370 extends DeclaredAction< CPPParserAction , Object > {
public void doFinal(ITrialUndoActionProvider< Object > provider, CPPParserAction action) { action.builder.
consumeFunctionDefinition(false);
}
}
//
// Rule 371: function_definition ::= declaration_specifiers_opt function_direct_declarator try <openscope-ast> ctor_initializer_list_opt function_body <openscope-ast> handler_seq
//
static final class Action371 extends DeclaredAction< CPPParserAction , Object > {
public void doFinal(ITrialUndoActionProvider< Object > provider, CPPParserAction action) { action.builder.
consumeFunctionDefinition(true);
}
}
//
// Rule 374: initializer ::= ( expression_list )
//
@ -2577,9 +2608,49 @@ public int getKind(int i) {
}
//
// Rule 421: base_specifier ::= dcolon_opt nested_name_specifier_opt class_name
// Rule 396: member_declaration ::= declaration_specifiers_opt <openscope-ast> member_declarator_list ;
//
static final class Action421 extends DeclaredAction< CPPParserAction , Object > {
static final class Action396 extends DeclaredAction< CPPParserAction , Object > {
public void doFinal(ITrialUndoActionProvider< Object > provider, CPPParserAction action) { action.builder.
consumeDeclarationSimple(true);
}
}
//
// Rule 397: member_declaration ::= declaration_specifiers_opt ;
//
static final class Action397 extends DeclaredAction< CPPParserAction , Object > {
public void doFinal(ITrialUndoActionProvider< Object > provider, CPPParserAction action) { action.builder.
consumeDeclarationSimple(false);
}
}
//
// Rule 400: member_declaration ::= dcolon_opt nested_name_specifier template_opt unqualified_id_name ;
//
static final class Action400 extends DeclaredAction< CPPParserAction , Object > {
public void doFinal(ITrialUndoActionProvider< Object > provider, CPPParserAction action) { action.builder.
consumeMemberDeclarationQualifiedId();
}
}
//
// Rule 411: member_declarator ::= declarator constant_initializer
//
static final class Action411 extends DeclaredAction< CPPParserAction , Object > {
public void doFinal(ITrialUndoActionProvider< Object > provider, CPPParserAction action) { action.builder.
consumeMemberDeclaratorWithInitializer();
}
}
//
// Rule 419: base_specifier ::= dcolon_opt nested_name_specifier_opt class_name
//
static final class Action419 extends DeclaredAction< CPPParserAction , Object > {
public void doFinal(ITrialUndoActionProvider< Object > provider, CPPParserAction action) { action.builder.
consumeBaseSpecifier(false);
@ -2587,9 +2658,9 @@ public int getKind(int i) {
}
//
// Rule 422: base_specifier ::= virtual_opt access_specifier_keyword virtual_opt dcolon_opt nested_name_specifier_opt class_name
// Rule 420: base_specifier ::= virtual_opt access_specifier_keyword virtual_opt dcolon_opt nested_name_specifier_opt class_name
//
static final class Action422 extends DeclaredAction< CPPParserAction , Object > {
static final class Action420 extends DeclaredAction< CPPParserAction , Object > {
public void doFinal(ITrialUndoActionProvider< Object > provider, CPPParserAction action) { action.builder.
consumeBaseSpecifier(true);
@ -2597,9 +2668,9 @@ public int getKind(int i) {
}
//
// Rule 423: virtual_opt ::= virtual
// Rule 421: virtual_opt ::= virtual
//
static final class Action423 extends DeclaredAction< CPPParserAction , Object > {
static final class Action421 extends DeclaredAction< CPPParserAction , Object > {
public void doFinal(ITrialUndoActionProvider< Object > provider, CPPParserAction action) { action.builder.
consumePlaceHolder();
@ -2607,9 +2678,9 @@ public int getKind(int i) {
}
//
// Rule 424: virtual_opt ::= $Empty
// Rule 422: virtual_opt ::= $Empty
//
static final class Action424 extends DeclaredAction< CPPParserAction , Object > {
static final class Action422 extends DeclaredAction< CPPParserAction , Object > {
public void doFinal(ITrialUndoActionProvider< Object > provider, CPPParserAction action) { action.builder.
consumeEmpty();
@ -2617,9 +2688,9 @@ public int getKind(int i) {
}
//
// Rule 430: conversion_function_id_name ::= operator conversion_type_id
// Rule 428: conversion_function_id_name ::= operator conversion_type_id
//
static final class Action430 extends DeclaredAction< CPPParserAction , Object > {
static final class Action428 extends DeclaredAction< CPPParserAction , Object > {
public void doFinal(ITrialUndoActionProvider< Object > provider, CPPParserAction action) { action.builder.
consumeConversionName();
@ -2627,9 +2698,9 @@ public int getKind(int i) {
}
//
// Rule 440: mem_initializer ::= mem_initializer_name ( expression_list_opt )
// Rule 438: mem_initializer ::= mem_initializer_name ( expression_list_opt )
//
static final class Action440 extends DeclaredAction< CPPParserAction , Object > {
static final class Action438 extends DeclaredAction< CPPParserAction , Object > {
public void doFinal(ITrialUndoActionProvider< Object > provider, CPPParserAction action) { action.builder.
consumeConstructorChainInitializer();
@ -2637,9 +2708,9 @@ public int getKind(int i) {
}
//
// Rule 441: mem_initializer_name ::= dcolon_opt nested_name_specifier_opt class_name
// Rule 439: mem_initializer_name ::= dcolon_opt nested_name_specifier_opt class_name
//
static final class Action441 extends DeclaredAction< CPPParserAction , Object > {
static final class Action439 extends DeclaredAction< CPPParserAction , Object > {
public void doFinal(ITrialUndoActionProvider< Object > provider, CPPParserAction action) { action.builder.
consumeQualifiedId(false);
@ -2647,9 +2718,9 @@ public int getKind(int i) {
}
//
// Rule 444: operator_function_id_name ::= operator_id_name < <openscope-ast> template_argument_list_opt >
// Rule 442: operator_function_id_name ::= operator_id_name < <openscope-ast> template_argument_list_opt >
//
static final class Action444 extends DeclaredAction< CPPParserAction , Object > {
static final class Action442 extends DeclaredAction< CPPParserAction , Object > {
public void doFinal(ITrialUndoActionProvider< Object > provider, CPPParserAction action) { action.builder.
consumeTemplateId();
@ -2657,9 +2728,9 @@ public int getKind(int i) {
}
//
// Rule 445: operator_id_name ::= operator overloadable_operator
// Rule 443: operator_id_name ::= operator overloadable_operator
//
static final class Action445 extends DeclaredAction< CPPParserAction , Object > {
static final class Action443 extends DeclaredAction< CPPParserAction , Object > {
public void doFinal(ITrialUndoActionProvider< Object > provider, CPPParserAction action) { action.builder.
consumeOperatorName();
@ -2667,9 +2738,9 @@ public int getKind(int i) {
}
//
// Rule 488: template_declaration ::= export_opt template < template_parameter_list > declaration
// Rule 486: template_declaration ::= export_opt template < template_parameter_list > declaration
//
static final class Action488 extends DeclaredAction< CPPParserAction , Object > {
static final class Action486 extends DeclaredAction< CPPParserAction , Object > {
public void doFinal(ITrialUndoActionProvider< Object > provider, CPPParserAction action) { action.builder.
consumeTemplateDeclaration();
@ -2677,9 +2748,9 @@ public int getKind(int i) {
}
//
// Rule 489: export_opt ::= export
// Rule 487: export_opt ::= export
//
static final class Action489 extends DeclaredAction< CPPParserAction , Object > {
static final class Action487 extends DeclaredAction< CPPParserAction , Object > {
public void doFinal(ITrialUndoActionProvider< Object > provider, CPPParserAction action) { action.builder.
consumePlaceHolder();
@ -2687,9 +2758,9 @@ public int getKind(int i) {
}
//
// Rule 490: export_opt ::= $Empty
// Rule 488: export_opt ::= $Empty
//
static final class Action490 extends DeclaredAction< CPPParserAction , Object > {
static final class Action488 extends DeclaredAction< CPPParserAction , Object > {
public void doFinal(ITrialUndoActionProvider< Object > provider, CPPParserAction action) { action.builder.
consumeEmpty();
@ -2697,9 +2768,9 @@ public int getKind(int i) {
}
//
// Rule 501: template_id_name ::= template_identifier < <openscope-ast> template_argument_list_opt >
// Rule 499: template_id_name ::= template_identifier < <openscope-ast> template_argument_list_opt >
//
static final class Action501 extends DeclaredAction< CPPParserAction , Object > {
static final class Action499 extends DeclaredAction< CPPParserAction , Object > {
public void doFinal(ITrialUndoActionProvider< Object > provider, CPPParserAction action) { action.builder.
consumeTemplateId();
@ -2707,9 +2778,9 @@ public int getKind(int i) {
}
//
// Rule 510: explicit_instantiation ::= template declaration
// Rule 508: explicit_instantiation ::= template declaration
//
static final class Action510 extends DeclaredAction< CPPParserAction , Object > {
static final class Action508 extends DeclaredAction< CPPParserAction , Object > {
public void doFinal(ITrialUndoActionProvider< Object > provider, CPPParserAction action) { action.builder.
consumeTemplateExplicitInstantiation();
@ -2717,9 +2788,9 @@ public int getKind(int i) {
}
//
// Rule 511: explicit_specialization ::= template < > declaration
// Rule 509: explicit_specialization ::= template < > declaration
//
static final class Action511 extends DeclaredAction< CPPParserAction , Object > {
static final class Action509 extends DeclaredAction< CPPParserAction , Object > {
public void doFinal(ITrialUndoActionProvider< Object > provider, CPPParserAction action) { action.builder.
consumeTemplateExplicitSpecialization();
@ -2727,9 +2798,9 @@ public int getKind(int i) {
}
//
// Rule 512: try_block ::= try compound_statement <openscope-ast> handler_seq
// Rule 510: try_block ::= try compound_statement <openscope-ast> handler_seq
//
static final class Action512 extends DeclaredAction< CPPParserAction , Object > {
static final class Action510 extends DeclaredAction< CPPParserAction , Object > {
public void doFinal(ITrialUndoActionProvider< Object > provider, CPPParserAction action) { action.builder.
consumeStatementTryBlock();
@ -2737,9 +2808,9 @@ public int getKind(int i) {
}
//
// Rule 515: handler ::= catch ( exception_declaration ) compound_statement
// Rule 513: handler ::= catch ( exception_declaration ) compound_statement
//
static final class Action515 extends DeclaredAction< CPPParserAction , Object > {
static final class Action513 extends DeclaredAction< CPPParserAction , Object > {
public void doFinal(ITrialUndoActionProvider< Object > provider, CPPParserAction action) { action.builder.
consumeStatementCatchHandler(false);
@ -2747,9 +2818,9 @@ public int getKind(int i) {
}
//
// Rule 516: handler ::= catch ( ... ) compound_statement
// Rule 514: handler ::= catch ( ... ) compound_statement
//
static final class Action516 extends DeclaredAction< CPPParserAction , Object > {
static final class Action514 extends DeclaredAction< CPPParserAction , Object > {
public void doFinal(ITrialUndoActionProvider< Object > provider, CPPParserAction action) { action.builder.
consumeStatementCatchHandler(true);

View file

@ -22,12 +22,12 @@ public interface CPPParsersym {
TK_case = 77,
TK_catch = 115,
TK_char = 14,
TK_class = 58,
TK_class = 57,
TK_const = 47,
TK_const_cast = 26,
TK_continue = 78,
TK_default = 79,
TK_delete = 41,
TK_delete = 40,
TK_do = 80,
TK_double = 15,
TK_dynamic_cast = 27,
@ -35,7 +35,7 @@ public interface CPPParsersym {
TK_enum = 64,
TK_explicit = 50,
TK_export = 72,
TK_extern = 42,
TK_extern = 41,
TK_false = 28,
TK_float = 16,
TK_for = 81,
@ -47,8 +47,8 @@ public interface CPPParsersym {
TK_long = 18,
TK_mutable = 53,
TK_namespace = 60,
TK_new = 43,
TK_operator = 6,
TK_new = 42,
TK_operator = 5,
TK_private = 116,
TK_protected = 117,
TK_public = 118,
@ -72,7 +72,7 @@ public interface CPPParsersym {
TK_typename = 10,
TK_union = 66,
TK_unsigned = 21,
TK_using = 59,
TK_using = 58,
TK_virtual = 46,
TK_void = 22,
TK_volatile = 48,
@ -82,7 +82,6 @@ public interface CPPParsersym {
TK_floating = 36,
TK_charconst = 37,
TK_stringlit = 24,
TK_zero = 38,
TK_identifier = 1,
TK_TypedefName = 121,
TK_Completion = 122,
@ -90,7 +89,7 @@ public interface CPPParsersym {
TK_Invalid = 124,
TK_LeftBracket = 61,
TK_LeftParen = 2,
TK_LeftBrace = 57,
TK_LeftBrace = 59,
TK_Dot = 114,
TK_DotStar = 94,
TK_Arrow = 101,
@ -98,7 +97,7 @@ public interface CPPParsersym {
TK_PlusPlus = 11,
TK_MinusMinus = 12,
TK_And = 7,
TK_Star = 5,
TK_Star = 6,
TK_Plus = 8,
TK_Minus = 9,
TK_Tilde = 4,
@ -133,10 +132,11 @@ public interface CPPParsersym {
TK_CaretAssign = 110,
TK_OrAssign = 111,
TK_Comma = 68,
TK_zero = 38,
TK_RightBracket = 113,
TK_RightParen = 73,
TK_RightBrace = 71,
TK_SemiColon = 40,
TK_SemiColon = 43,
TK_ERROR_TOKEN = 45,
TK_EOF_TOKEN = 119;
@ -146,8 +146,8 @@ public interface CPPParsersym {
"LeftParen",
"ColonColon",
"Tilde",
"Star",
"operator",
"Star",
"And",
"Plus",
"Minus",
@ -181,10 +181,10 @@ public interface CPPParsersym {
"charconst",
"zero",
"throw",
"SemiColon",
"delete",
"extern",
"new",
"SemiColon",
"template",
"ERROR_TOKEN",
"virtual",
@ -198,9 +198,9 @@ public interface CPPParsersym {
"register",
"static",
"typedef",
"LeftBrace",
"class",
"using",
"LeftBrace",
"namespace",
"LeftBracket",
"LT",