mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
fixed qualified names signature, fixed parsing of template parameters (with a hack), fixed problem with scope not flushing properly when resolving ambiguous declarator node
This commit is contained in:
parent
be718ccf7c
commit
d9b287728b
15 changed files with 8116 additions and 8183 deletions
|
@ -1717,10 +1717,9 @@ template_parameter_list
|
|||
-- but it would be better to refactor the grammar to remove the conflict.
|
||||
|
||||
template_parameter
|
||||
::=? type_parameter
|
||||
|
||||
template_parameter
|
||||
::= parameter_declaration
|
||||
::= type_parameter
|
||||
| parameter_declaration
|
||||
/. $Build consumeTemplateParamterDeclaration(); $EndBuild ./
|
||||
|
||||
|
||||
type_parameter
|
||||
|
@ -1740,12 +1739,9 @@ type_parameter
|
|||
|
||||
|
||||
template_id_name
|
||||
::= template_identifier '<' <openscope-ast> template_argument_list_opt '>'
|
||||
::= identifier_name '<' <openscope-ast> template_argument_list_opt '>'
|
||||
/. $Build consumeTemplateId(); $EndBuild ./
|
||||
|
||||
template_identifier
|
||||
::= identifier_name
|
||||
|
||||
|
||||
template_argument_list
|
||||
::= template_argument
|
||||
|
|
|
@ -101,10 +101,10 @@ public abstract class BaseExtensibleLanguage extends AbstractLanguage implements
|
|||
@Override
|
||||
public IASTTranslationUnit getASTTranslationUnit(CodeReader reader, IScannerInfo scanInfo,
|
||||
ICodeReaderFactory fileCreator, IIndex index, int options, IParserLogService log) throws CoreException {
|
||||
|
||||
IASTTranslationUnit gtu = null;
|
||||
if(DEBUG_PRINT_GCC_AST) {
|
||||
ILanguage gppLanguage = GPPLanguage.getDefault();
|
||||
IASTTranslationUnit gtu = gppLanguage.getASTTranslationUnit(reader, scanInfo, fileCreator, index, log);
|
||||
gtu = gppLanguage.getASTTranslationUnit(reader, scanInfo, fileCreator, index, log);
|
||||
|
||||
System.out.println();
|
||||
System.out.println("********************************************************");
|
||||
|
|
|
@ -299,6 +299,8 @@ public abstract class BuildASTParserAction {
|
|||
/**
|
||||
* Allows simple pattern match testing of lists of tokens.
|
||||
*
|
||||
* TODO: need to take token mapping into account
|
||||
*
|
||||
* @throws NullPointerException if source or pattern is null
|
||||
*/
|
||||
public static boolean matchTokens(List<IToken> source, Integer ... pattern) {
|
||||
|
@ -314,6 +316,43 @@ public abstract class BuildASTParserAction {
|
|||
|
||||
|
||||
|
||||
/**
|
||||
* Converts the given token list to a char[] suitable for
|
||||
* creating a name node. Spaces are discarded.
|
||||
*/
|
||||
protected static char[] tokenListToNameCharArray(List<IToken> tokens) {
|
||||
StringBuilder sb = new StringBuilder(20); // longest operator name: operator delete[]
|
||||
|
||||
for(IToken t : tokens)
|
||||
sb.append(t.toString());
|
||||
|
||||
int n = sb.length();
|
||||
char[] cs = new char[n];
|
||||
sb.getChars(0, n, cs, 0);
|
||||
return cs;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Finds the tokens in the given list that are between startOffset and endOffset.
|
||||
* Note, the offsets have to be exact.
|
||||
*/
|
||||
public static List<IToken> tokenOffsetSubList(List<IToken> tokens, int startOffset, int endOffset) {
|
||||
int first = 0, last = 0;
|
||||
int i = 0;
|
||||
for(IToken t : tokens) {
|
||||
if(offset(t) == startOffset) {
|
||||
first = i;
|
||||
}
|
||||
if(endOffset(t) == endOffset) {
|
||||
last = i;
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return tokens.subList(first, last+1);
|
||||
}
|
||||
|
||||
|
||||
/*************************************************************************************************************
|
||||
* Start of actions.
|
||||
|
|
|
@ -65,9 +65,14 @@ public class CPPASTAmbiguousDeclarator extends CPPASTAmbiguity implements IASTDe
|
|||
}
|
||||
if(names.length > 0) {
|
||||
IScope scope = CPPVisitor.getContainingScope(names[0]);
|
||||
|
||||
if( scope != null ) {
|
||||
try {
|
||||
ASTInternal.flushCache(scope);
|
||||
IScope parentScope = scope.getParent(); // needed to fix bugs
|
||||
if(parentScope != null) {
|
||||
ASTInternal.flushCache(parentScope);
|
||||
}
|
||||
} catch (DOMException de) {}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -89,7 +89,6 @@ import org.eclipse.cdt.core.dom.lrparser.IParser;
|
|||
import org.eclipse.cdt.core.dom.lrparser.IParserActionTokenProvider;
|
||||
import org.eclipse.cdt.core.dom.lrparser.LPGTokenAdapter;
|
||||
import org.eclipse.cdt.core.dom.lrparser.action.BuildASTParserAction;
|
||||
import org.eclipse.cdt.core.parser.util.ASTPrinter;
|
||||
import org.eclipse.cdt.core.parser.util.DebugUtil;
|
||||
import org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPExpressionStatementParser;
|
||||
import org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPNoCastExpressionParser;
|
||||
|
@ -347,7 +346,7 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
|
|||
|
||||
/**
|
||||
* template_id
|
||||
* ::= template_name '<' <openscope-ast> template_argument_list_opt '>'
|
||||
* ::= identifier_token '<' <openscope-ast> template_argument_list_opt '>'
|
||||
*
|
||||
* operator_function_id
|
||||
* ::= operator_id '<' <openscope-ast> template_argument_list_opt '>'
|
||||
|
@ -357,6 +356,12 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
|
|||
|
||||
List<Object> templateArguments = astStack.closeScope();
|
||||
IASTName name = (IASTName) astStack.pop();
|
||||
|
||||
// char[] chars = tokenListToNameCharArray(parser.getRuleTokens());
|
||||
// IASTName name = nodeFactory.newName(chars);
|
||||
// setOffsetAndLength(name);
|
||||
|
||||
|
||||
ICPPASTTemplateId templateId = nodeFactory.newCPPTemplateId(name);
|
||||
|
||||
for(Object arg : templateArguments) {
|
||||
|
@ -423,11 +428,9 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
|
|||
public void consumeConversionName() {
|
||||
if(TRACE_ACTIONS) DebugUtil.printMethodTrace();
|
||||
|
||||
char[] chars = concatenateTokens(parser.getRuleTokens());
|
||||
char[] chars = tokenListToNameCharArray(parser.getRuleTokens());
|
||||
IASTTypeId typeId = (IASTTypeId) astStack.pop();
|
||||
|
||||
ICPPASTConversionName name = nodeFactory.newCPPConversionName(chars, typeId);
|
||||
|
||||
setOffsetAndLength(name);
|
||||
astStack.push(name);
|
||||
|
||||
|
@ -435,16 +438,7 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
|
|||
}
|
||||
|
||||
|
||||
private static char[] concatenateTokens(List<IToken> tokens) {
|
||||
StringBuilder sb = new StringBuilder(20); // longest operator name: operator delete[]
|
||||
|
||||
for(IToken t : tokens)
|
||||
sb.append(t);
|
||||
|
||||
char[] cs = new char[sb.length()];
|
||||
sb.getChars(0, sb.length(), cs, 0);
|
||||
return cs;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* unqualified_id
|
||||
|
@ -455,7 +449,7 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
|
|||
|
||||
astStack.pop(); // throw away the name node thats already on the stack
|
||||
|
||||
char[] chars = concatenateTokens(parser.getRuleTokens());
|
||||
char[] chars = tokenListToNameCharArray(parser.getRuleTokens());
|
||||
IASTName name = nodeFactory.newName(chars);
|
||||
setOffsetAndLength(name);
|
||||
astStack.push(name);
|
||||
|
@ -685,38 +679,61 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Creates a qualified name from a list of names (that must be in reverse order).
|
||||
*/
|
||||
@SuppressWarnings("restriction")
|
||||
private IASTName createQualifiedName(LinkedList<IASTName> nestedNames, boolean startsWithColonColon) {
|
||||
if(!startsWithColonColon && nestedNames.size() == 1) { // its actually an unqualified name
|
||||
if(!startsWithColonColon && nestedNames.size() == 1) // its actually an unqualified name
|
||||
return nestedNames.get(0);
|
||||
|
||||
int startOffset = offset(nestedNames.getLast());
|
||||
int endOffset = endOffset(nestedNames.getFirst());
|
||||
int length = endOffset - startOffset;
|
||||
|
||||
// find the tokens that make up the name
|
||||
List<IToken> nameTokens = tokenOffsetSubList(parser.getRuleTokens(), startOffset, endOffset);
|
||||
|
||||
StringBuilder signature = new StringBuilder(startsWithColonColon ? "::" : ""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
IToken prev = null;
|
||||
for(IToken t : nameTokens) {
|
||||
if(needSpaceBetween(prev, t))
|
||||
signature.append(' ');
|
||||
signature.append(t.toString());
|
||||
prev = t;
|
||||
}
|
||||
|
||||
ICPPASTQualifiedName qualifiedName = nodeFactory.newCPPQualifiedName();
|
||||
qualifiedName.setFullyQualified(startsWithColonColon);
|
||||
|
||||
StringBuilder signature = new StringBuilder(startsWithColonColon ? "::" : ""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
boolean first = true;
|
||||
for(IASTName name : reverseIterable(nestedNames)) {
|
||||
qualifiedName.addName(name);
|
||||
if(!first)
|
||||
signature.append("::"); //$NON-NLS-1$
|
||||
signature.append(name.toString());
|
||||
first = false;
|
||||
}
|
||||
|
||||
setOffsetAndLength(qualifiedName, startOffset, length);
|
||||
((CPPASTQualifiedName)qualifiedName).setSignature(signature.toString());
|
||||
|
||||
int startOffset = offset(nestedNames.getLast());
|
||||
int length = endOffset(nestedNames.getFirst()) - startOffset;
|
||||
setOffsetAndLength(qualifiedName, startOffset, length);
|
||||
|
||||
for(IASTName name : reverseIterable(nestedNames))
|
||||
qualifiedName.addName(name);
|
||||
|
||||
return qualifiedName;
|
||||
}
|
||||
|
||||
|
||||
private static boolean needSpaceBetween(IToken prev, IToken iter) {
|
||||
if(prev == null)
|
||||
return false;
|
||||
|
||||
int prevKind = prev.getKind();
|
||||
int iterKind = iter.getKind();
|
||||
|
||||
return prevKind != TK_ColonColon &&
|
||||
prevKind != TK_identifier &&
|
||||
prevKind != TK_LT &&
|
||||
prevKind != TK_Tilde &&
|
||||
iterKind != TK_GT &&
|
||||
prevKind != TK_LeftBracket &&
|
||||
iterKind != TK_RightBracket &&
|
||||
iterKind != TK_ColonColon;
|
||||
}
|
||||
|
||||
/**
|
||||
* Consumes grammar sub-rules of the following form:
|
||||
*
|
||||
|
@ -1396,9 +1413,11 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
|
|||
if(TRACE_ACTIONS) DebugUtil.printMethodTrace();
|
||||
|
||||
List<Object> qualifiers = astStack.closeScope();
|
||||
|
||||
LinkedList<IASTName> nestedNames = (LinkedList<IASTName>) astStack.pop();
|
||||
boolean hasDColon = astStack.pop() == PLACE_HOLDER;
|
||||
IASTName name = createQualifiedName(nestedNames, hasDColon);
|
||||
|
||||
ICPPASTPointerToMember pointer = nodeFactory.newPointerToMember(name);
|
||||
addCVQualifiersToPointer(pointer, qualifiers);
|
||||
setOffsetAndLength(pointer);
|
||||
|
@ -1626,6 +1645,34 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Simple type template parameters using the 'class' keyword are being parsed
|
||||
* wrong due to an ambiguity between type_parameter and parameter_declaration.
|
||||
*
|
||||
* eg) template <class T>
|
||||
*
|
||||
* The 'class T' part is being parsed as an elaborated type specifier instead
|
||||
* of a simple type template parameter.
|
||||
*
|
||||
* This method detects the incorrect parse, throws away the incorrect AST fragment,
|
||||
* and replaces it with the correct AST fragment.
|
||||
*/
|
||||
public void consumeTemplateParamterDeclaration() {
|
||||
if(TRACE_ACTIONS) DebugUtil.printMethodTrace();
|
||||
|
||||
if(matchTokens(parser.getRuleTokens(), TK_class, TK_identifier)) {
|
||||
astStack.pop(); // throw away the ICPPASTParameterDeclaration
|
||||
IASTName name = createName(parser.getRightIToken());
|
||||
astStack.push(name);
|
||||
consumeSimpleTypeTemplateParameter(false);
|
||||
}
|
||||
|
||||
if(TRACE_AST_STACK) System.out.println(astStack);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* type_parameter
|
||||
* ::= 'template' '<' <openscope-ast> template_parameter_list '>' 'class' identifier_name_opt
|
||||
|
|
|
@ -2001,6 +2001,13 @@ public CPPExpressionStatementParser(String[] mapFrom) { // constructor
|
|||
consumeEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 494: template_parameter ::= parameter_declaration
|
||||
//
|
||||
case 494: { action.builder.
|
||||
consumeTemplateParamterDeclaration(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 495: type_parameter ::= class identifier_name_opt
|
||||
//
|
||||
|
@ -2044,72 +2051,72 @@ public CPPExpressionStatementParser(String[] mapFrom) { // constructor
|
|||
}
|
||||
|
||||
//
|
||||
// Rule 501: template_id_name ::= template_identifier < <openscope-ast> template_argument_list_opt >
|
||||
// Rule 501: template_id_name ::= identifier_name < <openscope-ast> template_argument_list_opt >
|
||||
//
|
||||
case 501: { action.builder.
|
||||
consumeTemplateId(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 510: explicit_instantiation ::= template declaration
|
||||
// Rule 509: explicit_instantiation ::= template declaration
|
||||
//
|
||||
case 510: { action.builder.
|
||||
case 509: { action.builder.
|
||||
consumeTemplateExplicitInstantiation(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 511: explicit_specialization ::= template < > declaration
|
||||
// Rule 510: explicit_specialization ::= template < > declaration
|
||||
//
|
||||
case 511: { action.builder.
|
||||
case 510: { action.builder.
|
||||
consumeTemplateExplicitSpecialization(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 512: try_block ::= try compound_statement <openscope-ast> handler_seq
|
||||
// Rule 511: try_block ::= try compound_statement <openscope-ast> handler_seq
|
||||
//
|
||||
case 512: { action.builder.
|
||||
case 511: { action.builder.
|
||||
consumeStatementTryBlock(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 515: handler ::= catch ( exception_declaration ) compound_statement
|
||||
// Rule 514: handler ::= catch ( exception_declaration ) compound_statement
|
||||
//
|
||||
case 515: { action.builder.
|
||||
case 514: { action.builder.
|
||||
consumeStatementCatchHandler(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 516: handler ::= catch ( ... ) compound_statement
|
||||
// Rule 515: handler ::= catch ( ... ) compound_statement
|
||||
//
|
||||
case 516: { action.builder.
|
||||
case 515: { action.builder.
|
||||
consumeStatementCatchHandler(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 517: exception_declaration ::= type_specifier_seq <openscope-ast> declarator
|
||||
// Rule 516: exception_declaration ::= type_specifier_seq <openscope-ast> declarator
|
||||
//
|
||||
case 516: { action.builder.
|
||||
consumeDeclarationSimple(true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 517: exception_declaration ::= type_specifier_seq <openscope-ast> abstract_declarator
|
||||
//
|
||||
case 517: { action.builder.
|
||||
consumeDeclarationSimple(true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 518: exception_declaration ::= type_specifier_seq <openscope-ast> abstract_declarator
|
||||
// Rule 518: exception_declaration ::= type_specifier_seq
|
||||
//
|
||||
case 518: { action.builder.
|
||||
consumeDeclarationSimple(true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 519: exception_declaration ::= type_specifier_seq
|
||||
//
|
||||
case 519: { action.builder.
|
||||
consumeDeclarationSimple(false, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 527: expression_parser_start ::= ERROR_TOKEN
|
||||
// Rule 526: expression_parser_start ::= ERROR_TOKEN
|
||||
//
|
||||
case 527: { action.builder.
|
||||
case 526: { action.builder.
|
||||
consumeExpressionProblem(); break;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1994,6 +1994,13 @@ public CPPNoCastExpressionParser(String[] mapFrom) { // constructor
|
|||
consumeEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 493: template_parameter ::= parameter_declaration
|
||||
//
|
||||
case 493: { action.builder.
|
||||
consumeTemplateParamterDeclaration(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 494: type_parameter ::= class identifier_name_opt
|
||||
//
|
||||
|
@ -2037,72 +2044,72 @@ public CPPNoCastExpressionParser(String[] mapFrom) { // constructor
|
|||
}
|
||||
|
||||
//
|
||||
// Rule 500: template_id_name ::= template_identifier < <openscope-ast> template_argument_list_opt >
|
||||
// Rule 500: template_id_name ::= identifier_name < <openscope-ast> template_argument_list_opt >
|
||||
//
|
||||
case 500: { action.builder.
|
||||
consumeTemplateId(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 509: explicit_instantiation ::= template declaration
|
||||
// Rule 508: explicit_instantiation ::= template declaration
|
||||
//
|
||||
case 509: { action.builder.
|
||||
case 508: { action.builder.
|
||||
consumeTemplateExplicitInstantiation(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 510: explicit_specialization ::= template < > declaration
|
||||
// Rule 509: explicit_specialization ::= template < > declaration
|
||||
//
|
||||
case 510: { action.builder.
|
||||
case 509: { action.builder.
|
||||
consumeTemplateExplicitSpecialization(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 511: try_block ::= try compound_statement <openscope-ast> handler_seq
|
||||
// Rule 510: try_block ::= try compound_statement <openscope-ast> handler_seq
|
||||
//
|
||||
case 511: { action.builder.
|
||||
case 510: { action.builder.
|
||||
consumeStatementTryBlock(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 514: handler ::= catch ( exception_declaration ) compound_statement
|
||||
// Rule 513: handler ::= catch ( exception_declaration ) compound_statement
|
||||
//
|
||||
case 514: { action.builder.
|
||||
case 513: { action.builder.
|
||||
consumeStatementCatchHandler(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 515: handler ::= catch ( ... ) compound_statement
|
||||
// Rule 514: handler ::= catch ( ... ) compound_statement
|
||||
//
|
||||
case 515: { action.builder.
|
||||
case 514: { action.builder.
|
||||
consumeStatementCatchHandler(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 516: exception_declaration ::= type_specifier_seq <openscope-ast> declarator
|
||||
// Rule 515: exception_declaration ::= type_specifier_seq <openscope-ast> declarator
|
||||
//
|
||||
case 515: { action.builder.
|
||||
consumeDeclarationSimple(true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 516: exception_declaration ::= type_specifier_seq <openscope-ast> abstract_declarator
|
||||
//
|
||||
case 516: { action.builder.
|
||||
consumeDeclarationSimple(true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 517: exception_declaration ::= type_specifier_seq <openscope-ast> abstract_declarator
|
||||
// Rule 517: exception_declaration ::= type_specifier_seq
|
||||
//
|
||||
case 517: { action.builder.
|
||||
consumeDeclarationSimple(true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 518: exception_declaration ::= type_specifier_seq
|
||||
//
|
||||
case 518: { action.builder.
|
||||
consumeDeclarationSimple(false, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 526: no_cast_start ::= ERROR_TOKEN
|
||||
// Rule 525: no_cast_start ::= ERROR_TOKEN
|
||||
//
|
||||
case 526: { action.builder.
|
||||
case 525: { action.builder.
|
||||
consumeExpressionProblem(); break;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1994,6 +1994,13 @@ public CPPNoFunctionDeclaratorParser(String[] mapFrom) { // constructor
|
|||
consumeEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 492: template_parameter ::= parameter_declaration
|
||||
//
|
||||
case 492: { action.builder.
|
||||
consumeTemplateParamterDeclaration(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 493: type_parameter ::= class identifier_name_opt
|
||||
//
|
||||
|
@ -2037,72 +2044,72 @@ public CPPNoFunctionDeclaratorParser(String[] mapFrom) { // constructor
|
|||
}
|
||||
|
||||
//
|
||||
// Rule 499: template_id_name ::= template_identifier < <openscope-ast> template_argument_list_opt >
|
||||
// Rule 499: template_id_name ::= identifier_name < <openscope-ast> template_argument_list_opt >
|
||||
//
|
||||
case 499: { action.builder.
|
||||
consumeTemplateId(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 508: explicit_instantiation ::= template declaration
|
||||
// Rule 507: explicit_instantiation ::= template declaration
|
||||
//
|
||||
case 508: { action.builder.
|
||||
case 507: { action.builder.
|
||||
consumeTemplateExplicitInstantiation(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 509: explicit_specialization ::= template < > declaration
|
||||
// Rule 508: explicit_specialization ::= template < > declaration
|
||||
//
|
||||
case 509: { action.builder.
|
||||
case 508: { action.builder.
|
||||
consumeTemplateExplicitSpecialization(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 510: try_block ::= try compound_statement <openscope-ast> handler_seq
|
||||
// Rule 509: try_block ::= try compound_statement <openscope-ast> handler_seq
|
||||
//
|
||||
case 510: { action.builder.
|
||||
case 509: { action.builder.
|
||||
consumeStatementTryBlock(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 513: handler ::= catch ( exception_declaration ) compound_statement
|
||||
// Rule 512: handler ::= catch ( exception_declaration ) compound_statement
|
||||
//
|
||||
case 513: { action.builder.
|
||||
case 512: { action.builder.
|
||||
consumeStatementCatchHandler(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 514: handler ::= catch ( ... ) compound_statement
|
||||
// Rule 513: handler ::= catch ( ... ) compound_statement
|
||||
//
|
||||
case 514: { action.builder.
|
||||
case 513: { action.builder.
|
||||
consumeStatementCatchHandler(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 515: exception_declaration ::= type_specifier_seq <openscope-ast> declarator
|
||||
// Rule 514: exception_declaration ::= type_specifier_seq <openscope-ast> declarator
|
||||
//
|
||||
case 514: { action.builder.
|
||||
consumeDeclarationSimple(true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 515: exception_declaration ::= type_specifier_seq <openscope-ast> abstract_declarator
|
||||
//
|
||||
case 515: { action.builder.
|
||||
consumeDeclarationSimple(true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 516: exception_declaration ::= type_specifier_seq <openscope-ast> abstract_declarator
|
||||
// Rule 516: exception_declaration ::= type_specifier_seq
|
||||
//
|
||||
case 516: { action.builder.
|
||||
consumeDeclarationSimple(true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 517: exception_declaration ::= type_specifier_seq
|
||||
//
|
||||
case 517: { action.builder.
|
||||
consumeDeclarationSimple(false, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 525: no_function_declarator_start ::= ERROR_TOKEN
|
||||
// Rule 524: no_function_declarator_start ::= ERROR_TOKEN
|
||||
//
|
||||
case 525: { action.builder.
|
||||
case 524: { action.builder.
|
||||
consumeDeclarationProblem(); break;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -2001,6 +2001,13 @@ public CPPParser(String[] mapFrom) { // constructor
|
|||
consumeEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 494: template_parameter ::= parameter_declaration
|
||||
//
|
||||
case 494: { action.builder.
|
||||
consumeTemplateParamterDeclaration(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 495: type_parameter ::= class identifier_name_opt
|
||||
//
|
||||
|
@ -2044,65 +2051,65 @@ public CPPParser(String[] mapFrom) { // constructor
|
|||
}
|
||||
|
||||
//
|
||||
// Rule 501: template_id_name ::= template_identifier < <openscope-ast> template_argument_list_opt >
|
||||
// Rule 501: template_id_name ::= identifier_name < <openscope-ast> template_argument_list_opt >
|
||||
//
|
||||
case 501: { action.builder.
|
||||
consumeTemplateId(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 510: explicit_instantiation ::= template declaration
|
||||
// Rule 509: explicit_instantiation ::= template declaration
|
||||
//
|
||||
case 510: { action.builder.
|
||||
case 509: { action.builder.
|
||||
consumeTemplateExplicitInstantiation(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 511: explicit_specialization ::= template < > declaration
|
||||
// Rule 510: explicit_specialization ::= template < > declaration
|
||||
//
|
||||
case 511: { action.builder.
|
||||
case 510: { action.builder.
|
||||
consumeTemplateExplicitSpecialization(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 512: try_block ::= try compound_statement <openscope-ast> handler_seq
|
||||
// Rule 511: try_block ::= try compound_statement <openscope-ast> handler_seq
|
||||
//
|
||||
case 512: { action.builder.
|
||||
case 511: { action.builder.
|
||||
consumeStatementTryBlock(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 515: handler ::= catch ( exception_declaration ) compound_statement
|
||||
// Rule 514: handler ::= catch ( exception_declaration ) compound_statement
|
||||
//
|
||||
case 515: { action.builder.
|
||||
case 514: { action.builder.
|
||||
consumeStatementCatchHandler(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 516: handler ::= catch ( ... ) compound_statement
|
||||
// Rule 515: handler ::= catch ( ... ) compound_statement
|
||||
//
|
||||
case 516: { action.builder.
|
||||
case 515: { action.builder.
|
||||
consumeStatementCatchHandler(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 517: exception_declaration ::= type_specifier_seq <openscope-ast> declarator
|
||||
// Rule 516: exception_declaration ::= type_specifier_seq <openscope-ast> declarator
|
||||
//
|
||||
case 516: { action.builder.
|
||||
consumeDeclarationSimple(true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 517: exception_declaration ::= type_specifier_seq <openscope-ast> abstract_declarator
|
||||
//
|
||||
case 517: { action.builder.
|
||||
consumeDeclarationSimple(true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 518: exception_declaration ::= type_specifier_seq <openscope-ast> abstract_declarator
|
||||
// Rule 518: exception_declaration ::= type_specifier_seq
|
||||
//
|
||||
case 518: { action.builder.
|
||||
consumeDeclarationSimple(true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 519: exception_declaration ::= type_specifier_seq
|
||||
//
|
||||
case 519: { action.builder.
|
||||
consumeDeclarationSimple(false, false); break;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1987,6 +1987,13 @@ public CPPSizeofExpressionParser(String[] mapFrom) { // constructor
|
|||
consumeEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 492: template_parameter ::= parameter_declaration
|
||||
//
|
||||
case 492: { action.builder.
|
||||
consumeTemplateParamterDeclaration(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 493: type_parameter ::= class identifier_name_opt
|
||||
//
|
||||
|
@ -2030,72 +2037,72 @@ public CPPSizeofExpressionParser(String[] mapFrom) { // constructor
|
|||
}
|
||||
|
||||
//
|
||||
// Rule 499: template_id_name ::= template_identifier < <openscope-ast> template_argument_list_opt >
|
||||
// Rule 499: template_id_name ::= identifier_name < <openscope-ast> template_argument_list_opt >
|
||||
//
|
||||
case 499: { action.builder.
|
||||
consumeTemplateId(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 508: explicit_instantiation ::= template declaration
|
||||
// Rule 507: explicit_instantiation ::= template declaration
|
||||
//
|
||||
case 508: { action.builder.
|
||||
case 507: { action.builder.
|
||||
consumeTemplateExplicitInstantiation(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 509: explicit_specialization ::= template < > declaration
|
||||
// Rule 508: explicit_specialization ::= template < > declaration
|
||||
//
|
||||
case 509: { action.builder.
|
||||
case 508: { action.builder.
|
||||
consumeTemplateExplicitSpecialization(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 510: try_block ::= try compound_statement <openscope-ast> handler_seq
|
||||
// Rule 509: try_block ::= try compound_statement <openscope-ast> handler_seq
|
||||
//
|
||||
case 510: { action.builder.
|
||||
case 509: { action.builder.
|
||||
consumeStatementTryBlock(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 513: handler ::= catch ( exception_declaration ) compound_statement
|
||||
// Rule 512: handler ::= catch ( exception_declaration ) compound_statement
|
||||
//
|
||||
case 513: { action.builder.
|
||||
case 512: { action.builder.
|
||||
consumeStatementCatchHandler(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 514: handler ::= catch ( ... ) compound_statement
|
||||
// Rule 513: handler ::= catch ( ... ) compound_statement
|
||||
//
|
||||
case 514: { action.builder.
|
||||
case 513: { action.builder.
|
||||
consumeStatementCatchHandler(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 515: exception_declaration ::= type_specifier_seq <openscope-ast> declarator
|
||||
// Rule 514: exception_declaration ::= type_specifier_seq <openscope-ast> declarator
|
||||
//
|
||||
case 514: { action.builder.
|
||||
consumeDeclarationSimple(true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 515: exception_declaration ::= type_specifier_seq <openscope-ast> abstract_declarator
|
||||
//
|
||||
case 515: { action.builder.
|
||||
consumeDeclarationSimple(true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 516: exception_declaration ::= type_specifier_seq <openscope-ast> abstract_declarator
|
||||
// Rule 516: exception_declaration ::= type_specifier_seq
|
||||
//
|
||||
case 516: { action.builder.
|
||||
consumeDeclarationSimple(true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 517: exception_declaration ::= type_specifier_seq
|
||||
//
|
||||
case 517: { action.builder.
|
||||
consumeDeclarationSimple(false, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 525: no_sizeof_type_name_start ::= ERROR_TOKEN
|
||||
// Rule 524: no_sizeof_type_name_start ::= ERROR_TOKEN
|
||||
//
|
||||
case 525: { action.builder.
|
||||
case 524: { action.builder.
|
||||
consumeExpressionProblem(); break;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue