1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 17:26:01 +02:00

several fixes to parsing of declarations in LR C++ parser

This commit is contained in:
Mike Kucera 2009-01-07 16:08:35 +00:00
parent e0cd7f1c94
commit dd2b180f1e
24 changed files with 16339 additions and 16707 deletions

View file

@ -12,46 +12,26 @@ package org.eclipse.cdt.core.parser.util;
import java.io.PrintStream; import java.io.PrintStream;
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
import org.eclipse.cdt.core.dom.ast.DOMException; import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTArrayDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTArrayModifier;
import org.eclipse.cdt.core.dom.ast.IASTComment; import org.eclipse.cdt.core.dom.ast.IASTComment;
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTExpression;
import org.eclipse.cdt.core.dom.ast.IASTInitializer;
import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTNode; import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IASTParameterDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTPointerOperator;
import org.eclipse.cdt.core.dom.ast.IASTPreprocessorStatement; import org.eclipse.cdt.core.dom.ast.IASTPreprocessorStatement;
import org.eclipse.cdt.core.dom.ast.IASTProblem; import org.eclipse.cdt.core.dom.ast.IASTProblem;
import org.eclipse.cdt.core.dom.ast.IASTProblemDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTProblemExpression;
import org.eclipse.cdt.core.dom.ast.IASTProblemStatement;
import org.eclipse.cdt.core.dom.ast.IASTStatement;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
import org.eclipse.cdt.core.dom.ast.IBinding; import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IProblemBinding; import org.eclipse.cdt.core.dom.ast.IProblemBinding;
import org.eclipse.cdt.core.dom.ast.IType; import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.IVariable; import org.eclipse.cdt.core.dom.ast.IVariable;
import org.eclipse.cdt.core.dom.ast.IASTEnumerationSpecifier.IASTEnumerator;
import org.eclipse.cdt.core.dom.ast.c.ICASTArrayModifier; import org.eclipse.cdt.core.dom.ast.c.ICASTArrayModifier;
import org.eclipse.cdt.core.dom.ast.c.ICASTPointer; import org.eclipse.cdt.core.dom.ast.c.ICASTPointer;
import org.eclipse.cdt.core.dom.ast.c.ICArrayType; import org.eclipse.cdt.core.dom.ast.c.ICArrayType;
import org.eclipse.cdt.core.dom.ast.c.ICPointerType; import org.eclipse.cdt.core.dom.ast.c.ICPointerType;
import org.eclipse.cdt.core.dom.ast.cpp.CPPASTVisitor;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamespaceDefinition;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateParameter;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier;
import org.eclipse.cdt.internal.core.dom.parser.ASTNode; import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
import org.eclipse.cdt.internal.core.dom.parser.ITypeContainer; import org.eclipse.cdt.internal.core.dom.parser.ITypeContainer;
/** /**
* A utility that prints an AST to the console, useful for debugging purposes. * A utility that prints an AST to the console or any print stream, useful for debugging purposes.
* *
* @author Mike Kucera * @author Mike Kucera
*/ */
@ -67,30 +47,30 @@ public class ASTPrinter {
* @return Always returns false, boolean return type allows this method * @return Always returns false, boolean return type allows this method
* to be called from a conditional breakpoint during debugging. * to be called from a conditional breakpoint during debugging.
*/ */
public static boolean print(IASTNode root, PrintStream out) { public static boolean print(IASTNode node, PrintStream out) {
if (root == null) { if (node == null) {
out.println("null"); out.println("null");
return false; return false;
} }
if (root instanceof IASTTranslationUnit) { if (node instanceof IASTTranslationUnit) {
IASTPreprocessorStatement[] preStats = ((IASTTranslationUnit)root).getAllPreprocessorStatements(); IASTPreprocessorStatement[] preStats = ((IASTTranslationUnit)node).getAllPreprocessorStatements();
if (preStats != null) { if (preStats != null) {
for (IASTPreprocessorStatement stat : preStats) for (IASTPreprocessorStatement stat : preStats)
print(out, 0, stat); print(out, 0, stat);
} }
} }
root.accept(new PrintVisitor(out)); printAST(out, 0, node);
if (root instanceof IASTTranslationUnit) { if (node instanceof IASTTranslationUnit) {
IASTProblem[] problems = ((IASTTranslationUnit)root).getPreprocessorProblems(); IASTProblem[] problems = ((IASTTranslationUnit)node).getPreprocessorProblems();
if (problems != null) { if (problems != null) {
for (IASTProblem problem : problems) for (IASTProblem problem : problems)
print(out, 0, problem); print(out, 0, problem);
} }
IASTComment[] comments = ((IASTTranslationUnit)root).getComments(); IASTComment[] comments = ((IASTTranslationUnit)node).getComments();
if (comments != null) { if (comments != null) {
for (IASTComment comment : comments) for (IASTComment comment : comments)
print(out, 0, comment); print(out, 0, comment);
@ -109,22 +89,23 @@ public class ASTPrinter {
return print(root, System.out); return print(root, System.out);
} }
/** /**
* Prints problem nodes in the AST to the given printstream. * Prints problem nodes in the AST to the given printstream.
* *
* @return Always returns false, boolean return type allows this method * @return Always returns false, boolean return type allows this method
* to be called from a conditional breakpoint during debugging. * to be called from a conditional breakpoint during debugging.
*/ */
public static boolean printProblems(IASTNode root, PrintStream out) { public static boolean printProblems(IASTNode node, PrintStream out) {
if (root == null) { if (node == null) {
out.println("null"); out.println("null");
return false; return false;
} }
root.accept(new ProblemVisitor(out)); printASTProblems(out, 0, node);
if (root instanceof IASTTranslationUnit) { if (node instanceof IASTTranslationUnit) {
IASTProblem[] problems = ((IASTTranslationUnit)root).getPreprocessorProblems(); IASTProblem[] problems = ((IASTTranslationUnit)node).getPreprocessorProblems();
if (problems != null) { if (problems != null) {
for (IASTProblem problem : problems) { for (IASTProblem problem : problems) {
print(out, 0, problem); print(out, 0, problem);
@ -145,6 +126,31 @@ public class ASTPrinter {
return printProblems(root, System.out); return printProblems(root, System.out);
} }
private static void printAST(PrintStream out, int indent, IASTNode node) {
print(out, indent, node);
indent++;
for(IASTNode child : node.getChildren()) {
printAST(out, indent, child);
}
}
private static void printASTProblems(PrintStream out, int indent, IASTNode node) {
if(node instanceof IASTProblem)
print(out, indent, node);
indent++;
for(IASTNode child : node.getChildren()) {
printASTProblems(out, indent, child);
}
}
private static void print(PrintStream out, int indentLevel, Object n) { private static void print(PrintStream out, int indentLevel, Object n) {
for (int i = 0; i < indentLevel; i++) for (int i = 0; i < indentLevel; i++)
out.print(" "); out.print(" ");
@ -179,7 +185,16 @@ public class ASTPrinter {
} }
if (n instanceof IASTName) { if (n instanceof IASTName) {
IASTName name = (IASTName)n;
out.print(" " + ((IASTName)n).toString()); out.print(" " + ((IASTName)n).toString());
if (RESOLVE_BINDINGS) {
try {
IBinding binding = name.resolveBinding();
print(out, indentLevel, binding);
} catch(Exception e) {
System.out.println("Exception while resolving binding: " + name);
}
}
} else if (n instanceof ICASTPointer) { } else if (n instanceof ICASTPointer) {
ICASTPointer pointer = (ICASTPointer) n; ICASTPointer pointer = (ICASTPointer) n;
if (pointer.isConst()) if (pointer.isConst())
@ -243,308 +258,4 @@ public class ASTPrinter {
out.println(); out.println();
} }
private static class ProblemVisitor extends ASTVisitor {
private PrintStream out;
ProblemVisitor(PrintStream out) {
this.out = out;
shouldVisitProblems =
shouldVisitDeclarations =
shouldVisitStatements =
shouldVisitExpressions = true;
}
@Override
public int visit(IASTProblem problem) {
print(out, 1, problem);
return PROCESS_CONTINUE;
}
@Override
public int visit(IASTDeclaration declaration) {
if (declaration instanceof IASTProblemDeclaration)
print(out, 0, declaration);
return PROCESS_CONTINUE;
}
@Override
public int visit(IASTExpression expression) {
if (expression instanceof IASTProblemExpression)
print(out, 0, expression);
return PROCESS_CONTINUE;
}
@Override
public int visit(IASTStatement statement) {
if (statement instanceof IASTProblemStatement)
print(out, 0, statement);
return PROCESS_CONTINUE;
}
}
/**
* This visitor extends from CPPASTVisitor but you can still
* apply it to a plain C AST and it will print everything
* except designators.
*/
private static class PrintVisitor extends CPPASTVisitor {
private PrintStream out;
private int indentLevel = 0;
PrintVisitor(PrintStream out) {
this.out = out;
shouldVisitNames =
shouldVisitDeclarations =
shouldVisitInitializers =
shouldVisitParameterDeclarations =
shouldVisitDeclarators =
shouldVisitDeclSpecifiers =
shouldVisitExpressions =
shouldVisitStatements =
shouldVisitTypeIds =
shouldVisitEnumerators =
shouldVisitTranslationUnit =
shouldVisitProblems =
shouldVisitDesignators =
shouldVisitBaseSpecifiers =
shouldVisitNamespaces =
shouldVisitTemplateParameters = true;
}
private void print(IASTNode node) {
ASTPrinter.print(out, indentLevel, node);
}
private void print(IBinding binding) {
ASTPrinter.print(out, indentLevel, binding);
}
// @Override
// public int visit(ICASTDesignator designator) {
// print(designator);
// indentLevel++;
// return super.visit(designator);
// }
@Override
public int visit(IASTDeclaration declaration) {
print(declaration);
indentLevel++;
return super.visit(declaration);
}
@Override
public int visit(IASTDeclarator declarator) {
print(declarator);
indentLevel++;
IASTPointerOperator[] pointers = declarator.getPointerOperators();
for (IASTPointerOperator pointer : pointers) {
print(pointer);
}
if (declarator instanceof IASTArrayDeclarator) {
IASTArrayDeclarator decl = (IASTArrayDeclarator)declarator;
org.eclipse.cdt.core.dom.ast.IASTArrayModifier[] modifiers = decl.getArrayModifiers();
for (IASTArrayModifier modifier : modifiers) {
print(modifier);
}
}
return super.visit(declarator);
}
@Override
public int visit(IASTDeclSpecifier declSpec) {
print(declSpec);
indentLevel++;
return super.visit(declSpec);
}
@Override
public int visit(IASTEnumerator enumerator) {
print(enumerator);
indentLevel++;
return super.visit(enumerator);
}
@Override
public int visit(IASTExpression expression) {
print(expression);
indentLevel++;
return super.visit(expression);
}
@Override
public int visit(IASTInitializer initializer) {
print(initializer);
indentLevel++;
return super.visit(initializer);
}
@Override
public int visit(IASTName name) {
print(name);
if (RESOLVE_BINDINGS) {
try {
IBinding binding = name.resolveBinding();
print(binding);
} catch(Exception e) {
System.out.println("Exception while resolving binding: " + name);
}
}
indentLevel++;
return super.visit(name);
}
@Override
public int visit(IASTParameterDeclaration parameterDeclaration) {
print(parameterDeclaration);
indentLevel++;
return super.visit(parameterDeclaration);
}
@Override
public int visit(IASTProblem problem) {
print(problem);
indentLevel++;
return super.visit(problem);
}
@Override
public int visit(IASTStatement statement) {
print(statement);
indentLevel++;
return super.visit(statement);
}
@Override
public int visit(IASTTranslationUnit tu) {
print(tu);
indentLevel++;
return super.visit(tu);
}
@Override
public int visit(IASTTypeId typeId) {
print(typeId);
indentLevel++;
return super.visit(typeId);
}
@Override
public int visit(ICPPASTBaseSpecifier baseSpecifier) {
print(baseSpecifier);
indentLevel++;
return super.visit(baseSpecifier);
}
@Override
public int visit(ICPPASTNamespaceDefinition namespaceDefinition) {
print(namespaceDefinition);
indentLevel++;
return super.visit(namespaceDefinition);
}
@Override
public int visit(ICPPASTTemplateParameter templateParameter) {
print(templateParameter);
indentLevel++;
return super.visit(templateParameter);
}
// @Override
// public int leave(ICASTDesignator designator) {
// indentLevel--;
// return super.leave(designator);
// }
@Override
public int leave(IASTDeclaration declaration) {
indentLevel--;
return super.leave(declaration);
}
@Override
public int leave(IASTDeclarator declarator) {
indentLevel--;
return super.leave(declarator);
}
@Override
public int leave(IASTDeclSpecifier declSpec) {
indentLevel--;
return super.leave(declSpec);
}
@Override
public int leave(IASTEnumerator enumerator) {
indentLevel--;
return super.leave(enumerator);
}
@Override
public int leave(IASTExpression expression) {
indentLevel--;
return super.leave(expression);
}
@Override
public int leave(IASTInitializer initializer) {
indentLevel--;
return super.leave(initializer);
}
@Override
public int leave(IASTName name) {
indentLevel--;
return super.leave(name);
}
@Override
public int leave(IASTParameterDeclaration parameterDeclaration) {
indentLevel--;
return super.leave(parameterDeclaration);
}
@Override
public int leave(IASTProblem problem) {
indentLevel--;
return super.leave(problem);
}
@Override
public int leave(IASTStatement statement) {
indentLevel--;
return super.leave(statement);
}
@Override
public int leave(IASTTranslationUnit tu) {
indentLevel--;
return super.leave(tu);
}
@Override
public int leave(IASTTypeId typeId) {
indentLevel--;
return super.leave(typeId);
}
@Override
public int leave(ICPPASTBaseSpecifier baseSpecifier) {
indentLevel--;
return super.leave(baseSpecifier);
}
@Override
public int leave(ICPPASTNamespaceDefinition namespaceDefinition) {
indentLevel--;
return super.leave(namespaceDefinition);
}
@Override
public int leave(ICPPASTTemplateParameter templateParameter) {
indentLevel--;
return super.leave(templateParameter);
}
}
} }

View file

@ -422,12 +422,15 @@ dcolon_opt
qualified_id_name qualified_id_name
::= dcolon_opt nested_name_specifier template_opt unqualified_id_name ::= dcolon_opt nested_name_specifier template_opt unqualified_id_name
/. $Build consumeQualifiedId(true); $EndBuild ./ /. $Build consumeQualifiedId(true); $EndBuild ./
| '::' identifier_name | '::' unqualified_id_name
/. $Build consumeGlobalQualifiedId(); $EndBuild ./
| '::' operator_function_id_name
/. $Build consumeGlobalQualifiedId(); $EndBuild ./
| '::' template_id_name
/. $Build consumeGlobalQualifiedId(); $EndBuild ./ /. $Build consumeGlobalQualifiedId(); $EndBuild ./
--| '::' identifier_name
-- /. $Build consumeGlobalQualifiedId(); $EndBuild ./
--| '::' operator_function_id_name
-- /. $Build consumeGlobalQualifiedId(); $EndBuild ./
--| '::' template_id_name
-- /. $Build consumeGlobalQualifiedId(); $EndBuild ./
@ -959,9 +962,9 @@ declaration_specifiers
declaration_specifiers_opt declaration_specifiers_opt
::=? $empty -- this option must come first for constructors to parse correctly ::= declaration_specifiers
| $empty
/. $Build consumeEmpty(); $EndBuild ./ /. $Build consumeEmpty(); $EndBuild ./
| declaration_specifiers
@ -1189,6 +1192,7 @@ namespace_alias_definition
-- | 'using' '::' unqualified_id_name ';' -- | 'using' '::' unqualified_id_name ';'
-- TODO why not just check if the second token is 'typename'?
using_declaration using_declaration
::= 'using' typename_opt dcolon_opt nested_name_specifier_opt unqualified_id_name ';' ::= 'using' typename_opt dcolon_opt nested_name_specifier_opt unqualified_id_name ';'
/. $Build consumeUsingDeclaration(); $EndBuild ./ /. $Build consumeUsingDeclaration(); $EndBuild ./
@ -1317,15 +1321,15 @@ cv_qualifier
/. $Build consumeDeclSpecToken(); $EndBuild ./ /. $Build consumeDeclSpecToken(); $EndBuild ./
--declarator_id_name
-- ::= qualified_or_unqualified_name
-- | dcolon_opt nested_name_specifier_opt type_name
-- /. $Build consumeQualifiedId(false); $EndBuild ./
declarator_id_name declarator_id_name
::= unqualified_id_name ::= qualified_or_unqualified_name
| <empty> nested_name_specifier template_opt unqualified_id_name | dcolon_opt nested_name_specifier_opt type_name
/. $Build consumeQualifiedId(true); $EndBuild ./ /. $Build consumeQualifiedId(false); $EndBuild ./
--declarator_id_name
-- ::= unqualified_id_name
-- | <empty> nested_name_specifier template_opt unqualified_id_name
-- /. $Build consumeQualifiedId(true); $EndBuild ./
type_id type_id
@ -1749,11 +1753,11 @@ template_argument_list_opt
template_argument template_argument
::= assignment_expression ::= assignment_expression
/. $Build consumeTemplateArgumentExpression(); $EndBuild ./
| type_id | type_id
/. $Build consumeTemplateArgumentTypeId(); $EndBuild ./ /. $Build consumeTemplateArgumentTypeId(); $EndBuild ./
--| qualified_or_unqualified_name -- accessible through assignment_expression --| qualified_or_unqualified_name -- accessible through assignment_expression
explicit_instantiation explicit_instantiation
::= 'template' declaration ::= 'template' declaration
/. $Build consumeTemplateExplicitInstantiation(); $EndBuild ./ /. $Build consumeTemplateExplicitInstantiation(); $EndBuild ./

View file

@ -46,8 +46,8 @@ import org.eclipse.core.runtime.CoreException;
public abstract class BaseExtensibleLanguage extends AbstractLanguage { public abstract class BaseExtensibleLanguage extends AbstractLanguage {
private static final boolean DEBUG_PRINT_GCC_AST = true; private static final boolean DEBUG_PRINT_GCC_AST = false;
private static final boolean DEBUG_PRINT_AST = true; private static final boolean DEBUG_PRINT_AST = false;
/** /**
@ -101,13 +101,14 @@ public abstract class BaseExtensibleLanguage extends AbstractLanguage {
IASTTranslationUnit gtu = null; IASTTranslationUnit gtu = null;
if(DEBUG_PRINT_GCC_AST) { if(DEBUG_PRINT_GCC_AST) {
ILanguage gppLanguage = getParserLanguage() == ParserLanguage.CPP ? GPPLanguage.getDefault() : GCCLanguage.getDefault();
gtu = gppLanguage.getASTTranslationUnit(reader, scanInfo, fileCreator, index, options, log);
System.out.println(); System.out.println();
System.out.println("********************************************************"); System.out.println("********************************************************");
System.out.println("Parsing"); System.out.println("Parsing");
System.out.println("Options: " + options); System.out.println("Options: " + options);
ILanguage gppLanguage = getParserLanguage() == ParserLanguage.CPP ? GPPLanguage.getDefault() : GCCLanguage.getDefault();
gtu = gppLanguage.getASTTranslationUnit(reader, scanInfo, fileCreator, index, options, log);
System.out.println("GPP AST:"); System.out.println("GPP AST:");
ASTPrinter.print(gtu); ASTPrinter.print(gtu);
System.out.println(); System.out.println();

View file

@ -10,6 +10,7 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.dom.lrparser.action; package org.eclipse.cdt.core.dom.lrparser.action;
import java.util.Arrays;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
@ -266,8 +267,16 @@ public abstract class BuildASTParserAction {
protected static void setOffsetAndLength(IASTNode node, int offset, int length) { protected static void setOffsetAndLength(IASTNode node, int offset, int length) {
((ASTNode)node).setOffsetAndLength(offset, length); ((ASTNode)node).setOffsetAndLength(offset, length);
} }
protected static void setOffsetAndLength(IASTNode node, IASTNode from) {
setOffsetAndLength(node, offset(from), length(from));
}
protected static boolean isSameName(IASTName name1, IASTName name2) {
return Arrays.equals(name1.getLookupKey(), name2.getLookupKey());
}
/** /**
* Creates a IASTName node from an identifier token. * Creates a IASTName node from an identifier token.
* If the token is a completion token then it is added to the completion node. * If the token is a completion token then it is added to the completion node.
@ -519,8 +528,10 @@ public abstract class BuildASTParserAction {
List<IToken> tokens = parser.getRuleTokens(); List<IToken> tokens = parser.getRuleTokens();
IASTNode result; IASTNode result;
if(expressionStatement == null) if(expressionStatement == null)
result = declarationStatement; result = declarationStatement;
else if(expressionStatement.getExpression() instanceof IASTFunctionCallExpression)
result = expressionStatement;
else if(tokens.size() == 2 && (isCompletionToken(tokens.get(0)) || isIdentifierToken(tokens.get(0)))) // identifier followed by semicolon else if(tokens.size() == 2 && (isCompletionToken(tokens.get(0)) || isIdentifierToken(tokens.get(0)))) // identifier followed by semicolon
result = expressionStatement; result = expressionStatement;
else if(isImplicitInt(decl)) else if(isImplicitInt(decl))
@ -535,6 +546,7 @@ public abstract class BuildASTParserAction {
if(TRACE_AST_STACK) System.out.println(astStack); if(TRACE_AST_STACK) System.out.println(astStack);
} }
protected abstract IASTAmbiguousStatement createAmbiguousStatement(IASTStatement ... statements); protected abstract IASTAmbiguousStatement createAmbiguousStatement(IASTStatement ... statements);
@ -657,9 +669,12 @@ public abstract class BuildASTParserAction {
} }
else { else {
IASTExpressionList exprList = nodeFactory.newExpressionList(); IASTExpressionList exprList = nodeFactory.newExpressionList();
for(Object o : expressions) { for(Object o : expressions) {
exprList.addExpression((IASTExpression)o); exprList.addExpression((IASTExpression)o);
} }
setOffsetAndLength(exprList);
astStack.push(exprList); astStack.push(exprList);
} }

View file

@ -1,101 +0,0 @@
/*******************************************************************************
* Copyright (c) 2006, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.dom.lrparser.action.cpp;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTInitializer;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IASTPointerOperator;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTAmbiguity;
/**
* TODO delete this class and use the one from the core instead
*
* @author Mike Kucera
*
*/
@SuppressWarnings("restriction")
public class CPPASTAmbiguousDeclarator extends CPPASTAmbiguity implements IASTDeclarator {
private List<IASTDeclarator> declarators = new ArrayList<IASTDeclarator>(2);
private int defaultDeclarator = 0;
public CPPASTAmbiguousDeclarator(IASTDeclarator ... ds) {
for(IASTDeclarator declarator : ds)
addDeclarator(declarator);
}
@Override
protected IASTNode[] getNodes() {
return declarators.toArray(new IASTDeclarator[declarators.size()]);
}
public void addDeclarator(IASTDeclarator declarator) {
if(declarator != null) {
declarators.add(declarator);
declarator.setParent(this);
declarator.setPropertyInParent(null); // it really doesn't matter
}
}
private IASTDeclarator getDefaultDeclarator() {
return declarators.get(defaultDeclarator);
}
public void addPointerOperator(IASTPointerOperator operator) {
getDefaultDeclarator().addPointerOperator(operator);
}
public void setInitializer(IASTInitializer initializer) {
getDefaultDeclarator().setInitializer(initializer);
}
public void setName(IASTName name) {
getDefaultDeclarator().setName(name);
}
public void setNestedDeclarator(IASTDeclarator nested) {
getDefaultDeclarator().setNestedDeclarator(nested);
}
public IASTInitializer getInitializer() {
return getDefaultDeclarator().getInitializer();
}
public IASTName getName() {
return getDefaultDeclarator().getName();
}
public IASTDeclarator getNestedDeclarator() {
return getDefaultDeclarator().getNestedDeclarator();
}
public IASTPointerOperator[] getPointerOperators() {
return getDefaultDeclarator().getPointerOperators();
}
public int getRoleForName(IASTName n) {
return getDefaultDeclarator().getRoleForName(n);
}
public IASTDeclarator copy() {
throw new UnsupportedOperationException();
}
}

View file

@ -12,52 +12,9 @@ package org.eclipse.cdt.core.dom.lrparser.action.cpp;
import static org.eclipse.cdt.core.parser.util.CollectionUtils.findFirstAndRemove; import static org.eclipse.cdt.core.parser.util.CollectionUtils.findFirstAndRemove;
import static org.eclipse.cdt.core.parser.util.CollectionUtils.reverseIterable; import static org.eclipse.cdt.core.parser.util.CollectionUtils.reverseIterable;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_ColonColon; import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.*;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_Completion;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_EndOfCompletion;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_GT;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_LT;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_LeftBracket;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_LeftParen;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_RightBracket;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_RightParen;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_Tilde;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_auto;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_bool;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_char;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_class;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_const;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_delete;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_double;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_enum;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_explicit;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_extern;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_float;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_for;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_friend;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_identifier;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_inline;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_int;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_long;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_mutable;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_new;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_private;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_protected;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_public;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_register;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_short;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_signed;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_static;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_struct;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_typedef;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_typename;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_union;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_unsigned;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_virtual;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_void;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_volatile;
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.TK_wchar_t;
import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
@ -79,6 +36,7 @@ import org.eclipse.cdt.core.dom.ast.IASTIfStatement;
import org.eclipse.cdt.core.dom.ast.IASTInitializerExpression; import org.eclipse.cdt.core.dom.ast.IASTInitializerExpression;
import org.eclipse.cdt.core.dom.ast.IASTLiteralExpression; import org.eclipse.cdt.core.dom.ast.IASTLiteralExpression;
import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTNamedTypeSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTNode; import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IASTParameterDeclaration; import org.eclipse.cdt.core.dom.ast.IASTParameterDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTPointer; import org.eclipse.cdt.core.dom.ast.IASTPointer;
@ -112,6 +70,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamespaceAlias;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamespaceDefinition; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamespaceDefinition;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNewExpression; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNewExpression;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTOperatorName; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTOperatorName;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTParameterDeclaration;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTPointerToMember; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTPointerToMember;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTReferenceOperator; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTReferenceOperator;
@ -147,6 +106,7 @@ import org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPTemplateTypeParameterPa
import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent; import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent;
import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguousExpression; import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguousExpression;
import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguousStatement; import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguousStatement;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTAmbiguousDeclarator;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTAmbiguousExpression; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTAmbiguousExpression;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTAmbiguousStatement; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTAmbiguousStatement;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTAmbiguousTemplateArgument; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTAmbiguousTemplateArgument;
@ -169,6 +129,10 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
/** Used to create the AST node objects */ /** Used to create the AST node objects */
protected final ICPPNodeFactory nodeFactory; protected final ICPPNodeFactory nodeFactory;
/** Stack that provides easy access to the current class name, used to disambiguate declarators. */
protected final LinkedList<IASTName> classNames = new LinkedList<IASTName>();
/** /**
* @param parser * @param parser
* @param orderedTerminalSymbols When an instance of this class is created for a parser * @param orderedTerminalSymbols When an instance of this class is created for a parser
@ -463,6 +427,7 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
public void consumeTemplateArgumentTypeId() { public void consumeTemplateArgumentTypeId() {
if(TRACE_ACTIONS) DebugUtil.printMethodTrace(); if(TRACE_ACTIONS) DebugUtil.printMethodTrace();
// TODO is this necessary? It should be able to tell if it looks like an id expression
IParser secondaryParser = getExpressionParser(); IParser secondaryParser = getExpressionParser();
IASTNode result = runSecondaryParser(secondaryParser); IASTNode result = runSecondaryParser(secondaryParser);
@ -472,9 +437,9 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
return; return;
IASTTypeId typeId = (IASTTypeId) astStack.pop(); IASTTypeId typeId = (IASTTypeId) astStack.pop();
IASTIdExpression idExpression = (IASTIdExpression) result; IASTIdExpression expr = (IASTIdExpression) result;
ICPPASTAmbiguousTemplateArgument ambiguityNode = new CPPASTAmbiguousTemplateArgument(typeId, idExpression); ICPPASTAmbiguousTemplateArgument ambiguityNode = new CPPASTAmbiguousTemplateArgument(typeId, expr);
//setOffsetAndLength(ambiguityNode); //setOffsetAndLength(ambiguityNode);
astStack.push(ambiguityNode); astStack.push(ambiguityNode);
@ -483,6 +448,38 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
} }
/**
* Disambiguates template arguments.
* Qualified names parse as an expression, so generate the corresponding
* typeId and create an ambiguity node.
*/
public void consumeTemplateArgumentExpression() {
if(TRACE_ACTIONS) DebugUtil.printMethodTrace();
IASTExpression expr = (IASTExpression) astStack.peek();
if(expr instanceof IASTIdExpression) {
IASTName name = ((IASTIdExpression)expr).getName().copy();
IASTNamedTypeSpecifier declSpec = nodeFactory.newTypedefNameSpecifier(name);
setOffsetAndLength(declSpec, name);
IASTDeclarator declarator = nodeFactory.newDeclarator(nodeFactory.newName());
setOffsetAndLength(declarator, endOffset(declSpec), 0);
IASTTypeId typeId = nodeFactory.newTypeId(declSpec, declarator);
setOffsetAndLength(typeId);
ICPPASTAmbiguousTemplateArgument ambiguityNode = new CPPASTAmbiguousTemplateArgument(typeId, expr);
astStack.pop();
astStack.push(ambiguityNode);
}
if(TRACE_AST_STACK) System.out.println(astStack);
}
/** /**
* operator_id * operator_id
* ::= 'operator' overloadable_operator * ::= 'operator' overloadable_operator
@ -1133,7 +1130,7 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
if(declarator instanceof CPPASTAmbiguousDeclarator) { if(declarator instanceof CPPASTAmbiguousDeclarator) {
IASTAmbiguityParent owner = (IASTAmbiguityParent) declaration; IASTAmbiguityParent owner = (IASTAmbiguityParent) declaration;
CPPASTAmbiguousDeclarator ambiguity = (CPPASTAmbiguousDeclarator)declarator; CPPASTAmbiguousDeclarator ambiguity = (CPPASTAmbiguousDeclarator)declarator;
owner.replace(ambiguity, ambiguity.getNodes()[0]); owner.replace(ambiguity, ambiguity.getDeclarators()[0]);
} }
} }
} }
@ -1216,7 +1213,6 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
case TK_short: n.setShort(true); return; case TK_short: n.setShort(true); return;
} }
} }
} }
@ -1273,8 +1269,17 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
ICPPASTNamedTypeSpecifier declSpec = nodeFactory.newTypedefNameSpecifier(typeName); ICPPASTNamedTypeSpecifier declSpec = nodeFactory.newTypedefNameSpecifier(typeName);
// now apply the rest of the specifiers // now apply the rest of the specifiers
for(Object token : topScope) for(Object token : topScope) {
setSpecifier(declSpec, (IToken)token); setSpecifier(declSpec, (IToken)token);
}
// the only way there could be a typename token
for(IToken token : parser.getRuleTokens()) {
if(token.getKind() == TK_typename) {
declSpec.setIsTypename(true);
break;
}
}
setOffsetAndLength(declSpec); setOffsetAndLength(declSpec);
astStack.push(declSpec); astStack.push(declSpec);
@ -1325,7 +1330,8 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
if(TRACE_ACTIONS) DebugUtil.printMethodTrace(); if(TRACE_ACTIONS) DebugUtil.printMethodTrace();
List<Object> declarators = hasDeclaratorList ? astStack.closeScope() : Collections.emptyList(); List<Object> declarators = hasDeclaratorList ? astStack.closeScope() : Collections.emptyList();
ICPPASTDeclSpecifier declSpecifier = (ICPPASTDeclSpecifier) astStack.pop(); // may be null ICPPASTDeclSpecifier declSpec = (ICPPASTDeclSpecifier) astStack.pop(); // may be null
List<IToken> ruleTokens = parser.getRuleTokens(); List<IToken> ruleTokens = parser.getRuleTokens();
IToken nameToken = null; IToken nameToken = null;
@ -1339,45 +1345,49 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
// to be interpreted as a named type specifier for content assist to work. // to be interpreted as a named type specifier for content assist to work.
else if(matchTokens(ruleTokens, tokenMap, TK_Completion, TK_EndOfCompletion)) { else if(matchTokens(ruleTokens, tokenMap, TK_Completion, TK_EndOfCompletion)) {
IASTName name = createName(parser.getLeftIToken()); IASTName name = createName(parser.getLeftIToken());
declSpecifier = nodeFactory.newTypedefNameSpecifier(name); declSpec = nodeFactory.newTypedefNameSpecifier(name);
setOffsetAndLength(declSpecifier, offset(name), length(name)); setOffsetAndLength(declSpec, offset(name), length(name));
declarators = Collections.emptyList(); // throw away the bogus declarator declarators = Collections.emptyList(); // throw away the bogus declarator
} }
// can happen if implicit int is used // can happen if implicit int is used
else if(declSpecifier == null) { else if(declSpec == null) {
declSpecifier = nodeFactory.newSimpleDeclSpecifier(); declSpec = nodeFactory.newSimpleDeclSpecifier();
setOffsetAndLength(declSpecifier, parser.getLeftIToken().getStartOffset(), 0); setOffsetAndLength(declSpec, parser.getLeftIToken().getStartOffset(), 0);
}
else if(declarators.size() == 1 && disambiguateToConstructor(declSpec, (IASTDeclarator)declarators.get(0))) { // puts results of disambiguation onto stack
declSpec = (ICPPASTDeclSpecifier) astStack.pop();
declarators = Arrays.asList(astStack.pop());
} }
// bug 80171, check for situation similar to: static var; // bug 80171, check for situation similar to: static var;
// this will get parsed wrong, the following is a hack to rebuild the AST as it should have been parsed // this will get parsed wrong, the following is a hack to rebuild the AST as it should have been parsed
else if(declarators.isEmpty() && else if(declarators.isEmpty() &&
declSpecifier instanceof ICPPASTNamedTypeSpecifier && declSpec instanceof ICPPASTNamedTypeSpecifier &&
ruleTokens.size() >= 2 && ruleTokens.size() >= 2 &&
baseKind(nameToken = ruleTokens.get(ruleTokens.size() - 2)) == TK_identifier) { baseKind(nameToken = ruleTokens.get(ruleTokens.size() - 2)) == TK_identifier) {
declSpecifier = nodeFactory.newSimpleDeclSpecifier(); declSpec = nodeFactory.newSimpleDeclSpecifier();
for(IToken t : ruleTokens.subList(0, ruleTokens.size()-1)) for(IToken t : ruleTokens.subList(0, ruleTokens.size()-1))
setSpecifier(declSpecifier, t); setSpecifier(declSpec, t);
int offset = offset(parser.getLeftIToken()); int offset = offset(parser.getLeftIToken());
int length = endOffset(ruleTokens.get(ruleTokens.size()-2)) - offset; int length = endOffset(ruleTokens.get(ruleTokens.size()-2)) - offset;
setOffsetAndLength(declSpecifier, offset, length); setOffsetAndLength(declSpec, offset, length);
IASTName name = createName(nameToken); IASTName name = createName(nameToken);
IASTDeclarator declarator = nodeFactory.newDeclarator(name); IASTDeclarator declarator = nodeFactory.newDeclarator(name);
setOffsetAndLength(declarator, nameToken); setOffsetAndLength(declarator, nameToken);
declarators.add(declarator); declarators.add(declarator);
} }
IASTSimpleDeclaration declaration = nodeFactory.newSimpleDeclaration(declSpecifier); IASTSimpleDeclaration declaration = nodeFactory.newSimpleDeclaration(declSpec);
setOffsetAndLength(declaration); setOffsetAndLength(declaration);
for(Object declarator : declarators) for(Object declarator : declarators)
declaration.addDeclarator((IASTDeclarator)declarator); declaration.addDeclarator((IASTDeclarator)declarator);
// simple ambiguity resolutions // simple ambiguity resolutions
// if(declSpecifier.isFriend()) // if(declSpecifier.isFriend())
// resolveAmbiguousDeclaratorsToFunction(declaration); // resolveAmbiguousDeclaratorsToFunction(declaration);
@ -1389,17 +1399,82 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
// //
// } // }
astStack.push(declaration); astStack.push(declaration);
if(TRACE_AST_STACK) System.out.println(astStack); if(TRACE_AST_STACK) System.out.println(astStack);
} }
/**
* org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTSimpleDeclaration (58,9)
org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTNamedTypeSpecifier (58,1)
org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTName (58,1) A
org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTDeclarator (60,6)
org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTDeclarator (61,4)
org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTName (61,4)
* @return
*/
private boolean disambiguateToConstructor(IASTDeclSpecifier declSpec, IASTDeclarator declarator) {
if(!(declSpec instanceof IASTNamedTypeSpecifier))
return false;
IASTNamedTypeSpecifier namedTypeSpecifier = (IASTNamedTypeSpecifier) declSpec;
IASTName name = namedTypeSpecifier.getName();
IASTDeclarator nested = declarator.getNestedDeclarator();
ICPPASTSimpleDeclSpecifier simpleDeclSpec = nodeFactory.newSimpleDeclSpecifier(); // empty
setOffsetAndLength(simpleDeclSpec, parser.getLeftIToken().getStartOffset(), 0);
if(!classNames.isEmpty() && nested != null && isSameName(name, classNames.getLast())) {
IASTName paramTypeName = nested.getName(); // reuse the parameter name node
IASTNamedTypeSpecifier paramName = nodeFactory.newTypedefNameSpecifier(paramTypeName);
setOffsetAndLength(paramName, paramTypeName);
IASTDeclarator paramDeclarator = nodeFactory.newDeclarator(nodeFactory.newName());
setOffsetAndLength(paramDeclarator, offset(paramName) + length(paramName), 0);
ICPPASTParameterDeclaration parameter = nodeFactory.newParameterDeclaration(paramName, paramDeclarator);
setOffsetAndLength(parameter, paramName);
ICPPASTFunctionDeclarator constructorDeclarator = nodeFactory.newFunctionDeclarator(name); // reuse the name node
constructorDeclarator.addParameterDeclaration(parameter);
setOffsetAndLength(constructorDeclarator, offset(simpleDeclSpec), endOffset(paramDeclarator) - offset(simpleDeclSpec) + 1);
astStack.push(constructorDeclarator);
astStack.push(simpleDeclSpec);
return true;
}
if(declarator instanceof IASTFunctionDeclarator && declarator.getName() instanceof ICPPASTQualifiedName) {
ICPPASTQualifiedName qualifiedName = (ICPPASTQualifiedName) declarator.getName();
IASTName lastName = qualifiedName.getLastName();
if(qualifiedName.isFullyQualified() && (lastName.getLookupKey()[0] == '~' || isSameName(name, lastName))) {
ICPPASTQualifiedName newQualifiedName = nodeFactory.newQualifiedName();
newQualifiedName.addName(name);
for(IASTName n : qualifiedName.getNames())
newQualifiedName.addName(n);
setOffsetAndLength(newQualifiedName, offset(name), endOffset(qualifiedName.getLastName()) - offset(name));
declarator.setName(newQualifiedName);
setOffsetAndLength(declarator, offset(name), length(declarator) + offset(declarator) - offset(name));
astStack.push(declarator);
astStack.push(simpleDeclSpec);
return true;
}
}
return false;
}
public void consumeInitDeclaratorComplete() { public void consumeInitDeclaratorComplete() {
if(TRACE_ACTIONS) DebugUtil.printMethodTrace(); if(TRACE_ACTIONS) DebugUtil.printMethodTrace();
@ -1413,14 +1488,14 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
return; return;
IParser secondaryParser = getNoFunctionDeclaratorParser(); IParser secondaryParser = getNoFunctionDeclaratorParser();
IASTNode alternateDeclarator = runSecondaryParser(secondaryParser); IASTNode notFunctionDeclarator = runSecondaryParser(secondaryParser);
if(alternateDeclarator == null || alternateDeclarator instanceof IASTProblemDeclaration) if(notFunctionDeclarator == null || notFunctionDeclarator instanceof IASTProblemDeclaration)
return; return;
astStack.pop(); astStack.pop();
// TODO create node factory method for this
IASTNode ambiguityNode = new CPPASTAmbiguousDeclarator(declarator, (IASTDeclarator)alternateDeclarator); IASTNode ambiguityNode = new CPPASTAmbiguousDeclarator(declarator, (IASTDeclarator)notFunctionDeclarator);
setOffsetAndLength(ambiguityNode); setOffsetAndLength(ambiguityNode);
astStack.push(ambiguityNode); astStack.push(ambiguityNode);
@ -1507,14 +1582,14 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
List<Object> declarations = astStack.closeScope(); List<Object> declarations = astStack.closeScope();
// the class specifier is created by the rule for class_head // the class specifier is created by the rule for class_head
IASTCompositeTypeSpecifier classSpecifier = (IASTCompositeTypeSpecifier) astStack.pop(); IASTCompositeTypeSpecifier classSpecifier = (IASTCompositeTypeSpecifier) astStack.peek();
for(Object declaration : declarations) { for(Object declaration : declarations)
classSpecifier.addMemberDeclaration((IASTDeclaration)declaration); classSpecifier.addMemberDeclaration((IASTDeclaration)declaration);
}
setOffsetAndLength(classSpecifier); setOffsetAndLength(classSpecifier);
astStack.push(classSpecifier);
classNames.removeLast(); // pop the stack of class names
if(TRACE_AST_STACK) System.out.println(astStack); if(TRACE_AST_STACK) System.out.println(astStack);
} }
@ -1553,6 +1628,7 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
// the offset and length are set in consumeClassSpecifier() // the offset and length are set in consumeClassSpecifier()
astStack.push(classSpecifier); astStack.push(classSpecifier);
classNames.add(className); // push
if(TRACE_AST_STACK) System.out.println(astStack); if(TRACE_AST_STACK) System.out.println(astStack);
} }
@ -1761,13 +1837,17 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
List<Object> handlers = isTryBlockDeclarator ? astStack.closeScope() : Collections.emptyList(); List<Object> handlers = isTryBlockDeclarator ? astStack.closeScope() : Collections.emptyList();
IASTCompoundStatement body = (IASTCompoundStatement) astStack.pop(); IASTCompoundStatement body = (IASTCompoundStatement) astStack.pop();
List<Object> initializers = astStack.closeScope(); List<Object> initializers = astStack.closeScope();
ICPPASTFunctionDeclarator declarator = (ICPPASTFunctionDeclarator) astStack.pop(); IASTFunctionDeclarator declarator = (IASTFunctionDeclarator) astStack.pop();
IASTDeclSpecifier declSpec = (IASTDeclSpecifier) astStack.pop(); // may be null IASTDeclSpecifier declSpec = (IASTDeclSpecifier) astStack.pop(); // may be null
if(declSpec == null) { // can happen if implicit int is used if(declSpec == null) { // can happen if implicit int is used
declSpec = nodeFactory.newSimpleDeclSpecifier(); declSpec = nodeFactory.newSimpleDeclSpecifier();
setOffsetAndLength(declSpec, parser.getLeftIToken().getStartOffset(), 0); setOffsetAndLength(declSpec, parser.getLeftIToken().getStartOffset(), 0);
} }
else if(disambiguateToConstructor(declSpec, declarator)) {
declSpec = (IASTDeclSpecifier) astStack.pop();
declarator = (IASTFunctionDeclarator) astStack.pop();
}
ICPPASTFunctionDefinition definition; ICPPASTFunctionDefinition definition;
if (isTryBlockDeclarator) { if (isTryBlockDeclarator) {

View file

@ -16,71 +16,71 @@ package org.eclipse.cdt.internal.core.dom.lrparser.cpp;
public interface CPPExpressionParsersym { public interface CPPExpressionParsersym {
public final static int public final static int
TK_asm = 60, TK_asm = 60,
TK_auto = 47, TK_auto = 48,
TK_bool = 14, TK_bool = 14,
TK_break = 77, TK_break = 77,
TK_case = 78, TK_case = 78,
TK_catch = 119, TK_catch = 119,
TK_char = 15, TK_char = 15,
TK_class = 61, TK_class = 61,
TK_const = 45, TK_const = 46,
TK_const_cast = 31, TK_const_cast = 30,
TK_continue = 79, TK_continue = 79,
TK_default = 80, TK_default = 80,
TK_delete = 62, TK_delete = 62,
TK_do = 81, TK_do = 81,
TK_double = 16, TK_double = 16,
TK_dynamic_cast = 32, TK_dynamic_cast = 31,
TK_else = 122, TK_else = 122,
TK_enum = 66, TK_enum = 65,
TK_explicit = 48, TK_explicit = 49,
TK_export = 87, TK_export = 87,
TK_extern = 17, TK_extern = 17,
TK_false = 33, TK_false = 32,
TK_float = 18, TK_float = 18,
TK_for = 82, TK_for = 82,
TK_friend = 49, TK_friend = 50,
TK_goto = 83, TK_goto = 83,
TK_if = 84, TK_if = 84,
TK_inline = 50, TK_inline = 51,
TK_int = 19, TK_int = 19,
TK_long = 20, TK_long = 20,
TK_mutable = 51, TK_mutable = 52,
TK_namespace = 56, TK_namespace = 56,
TK_new = 63, TK_new = 63,
TK_operator = 7, TK_operator = 7,
TK_private = 114, TK_private = 103,
TK_protected = 115, TK_protected = 104,
TK_public = 116, TK_public = 105,
TK_register = 52, TK_register = 53,
TK_reinterpret_cast = 34, TK_reinterpret_cast = 33,
TK_return = 85, TK_return = 85,
TK_short = 21, TK_short = 21,
TK_signed = 22, TK_signed = 22,
TK_sizeof = 35, TK_sizeof = 34,
TK_static = 53, TK_static = 54,
TK_static_cast = 36, TK_static_cast = 35,
TK_struct = 67, TK_struct = 66,
TK_switch = 86, TK_switch = 86,
TK_template = 54, TK_template = 43,
TK_this = 37, TK_this = 36,
TK_throw = 57, TK_throw = 57,
TK_try = 75, TK_try = 75,
TK_true = 38, TK_true = 37,
TK_typedef = 55, TK_typedef = 55,
TK_typeid = 39, TK_typeid = 38,
TK_typename = 10, TK_typename = 10,
TK_union = 68, TK_union = 67,
TK_unsigned = 23, TK_unsigned = 23,
TK_using = 58, TK_using = 58,
TK_virtual = 44, TK_virtual = 44,
TK_void = 24, TK_void = 24,
TK_volatile = 46, TK_volatile = 47,
TK_wchar_t = 25, TK_wchar_t = 25,
TK_while = 76, TK_while = 76,
TK_integer = 40, TK_integer = 39,
TK_floating = 41, TK_floating = 40,
TK_charconst = 42, TK_charconst = 41,
TK_stringlit = 28, TK_stringlit = 28,
TK_identifier = 1, TK_identifier = 1,
TK_Completion = 2, TK_Completion = 2,
@ -89,8 +89,8 @@ public interface CPPExpressionParsersym {
TK_LeftBracket = 59, TK_LeftBracket = 59,
TK_LeftParen = 3, TK_LeftParen = 3,
TK_Dot = 120, TK_Dot = 120,
TK_DotStar = 96, TK_DotStar = 92,
TK_Arrow = 103, TK_Arrow = 106,
TK_ArrowStar = 90, TK_ArrowStar = 90,
TK_PlusPlus = 26, TK_PlusPlus = 26,
TK_MinusMinus = 27, TK_MinusMinus = 27,
@ -100,35 +100,35 @@ public interface CPPExpressionParsersym {
TK_Minus = 12, TK_Minus = 12,
TK_Tilde = 5, TK_Tilde = 5,
TK_Bang = 29, TK_Bang = 29,
TK_Slash = 91, TK_Slash = 93,
TK_Percent = 92, TK_Percent = 94,
TK_RightShift = 88, TK_RightShift = 88,
TK_LeftShift = 89, TK_LeftShift = 89,
TK_LT = 30, TK_LT = 45,
TK_GT = 65, TK_GT = 68,
TK_LE = 93, TK_LE = 95,
TK_GE = 94, TK_GE = 96,
TK_EQ = 97, TK_EQ = 97,
TK_NE = 98, TK_NE = 98,
TK_Caret = 99, TK_Caret = 99,
TK_Or = 100, TK_Or = 100,
TK_AndAnd = 101, TK_AndAnd = 101,
TK_OrOr = 102, TK_OrOr = 102,
TK_Question = 117, TK_Question = 107,
TK_Colon = 73, TK_Colon = 73,
TK_ColonColon = 4, TK_ColonColon = 4,
TK_DotDotDot = 95, TK_DotDotDot = 91,
TK_Assign = 69, TK_Assign = 69,
TK_StarAssign = 104, TK_StarAssign = 108,
TK_SlashAssign = 105, TK_SlashAssign = 109,
TK_PercentAssign = 106, TK_PercentAssign = 110,
TK_PlusAssign = 107, TK_PlusAssign = 111,
TK_MinusAssign = 108, TK_MinusAssign = 112,
TK_RightShiftAssign = 109, TK_RightShiftAssign = 113,
TK_LeftShiftAssign = 110, TK_LeftShiftAssign = 114,
TK_AndAssign = 111, TK_AndAssign = 115,
TK_CaretAssign = 112, TK_CaretAssign = 116,
TK_OrAssign = 113, TK_OrAssign = 117,
TK_Comma = 70, TK_Comma = 70,
TK_RightBracket = 118, TK_RightBracket = 118,
TK_RightParen = 74, TK_RightParen = 74,
@ -136,7 +136,7 @@ public interface CPPExpressionParsersym {
TK_SemiColon = 13, TK_SemiColon = 13,
TK_LeftBrace = 64, TK_LeftBrace = 64,
TK_ERROR_TOKEN = 72, TK_ERROR_TOKEN = 72,
TK_0 = 43, TK_0 = 42,
TK_EOF_TOKEN = 121; TK_EOF_TOKEN = 121;
public final static String orderedTerminalSymbols[] = { public final static String orderedTerminalSymbols[] = {
@ -170,7 +170,6 @@ public interface CPPExpressionParsersym {
"MinusMinus", "MinusMinus",
"stringlit", "stringlit",
"Bang", "Bang",
"LT",
"const_cast", "const_cast",
"dynamic_cast", "dynamic_cast",
"false", "false",
@ -184,7 +183,9 @@ public interface CPPExpressionParsersym {
"floating", "floating",
"charconst", "charconst",
"0", "0",
"template",
"virtual", "virtual",
"LT",
"const", "const",
"volatile", "volatile",
"auto", "auto",
@ -194,7 +195,6 @@ public interface CPPExpressionParsersym {
"mutable", "mutable",
"register", "register",
"static", "static",
"template",
"typedef", "typedef",
"namespace", "namespace",
"throw", "throw",
@ -205,10 +205,10 @@ public interface CPPExpressionParsersym {
"delete", "delete",
"new", "new",
"LeftBrace", "LeftBrace",
"GT",
"enum", "enum",
"struct", "struct",
"union", "union",
"GT",
"Assign", "Assign",
"Comma", "Comma",
"RightBrace", "RightBrace",
@ -231,19 +231,23 @@ public interface CPPExpressionParsersym {
"RightShift", "RightShift",
"LeftShift", "LeftShift",
"ArrowStar", "ArrowStar",
"DotDotDot",
"DotStar",
"Slash", "Slash",
"Percent", "Percent",
"LE", "LE",
"GE", "GE",
"DotDotDot",
"DotStar",
"EQ", "EQ",
"NE", "NE",
"Caret", "Caret",
"Or", "Or",
"AndAnd", "AndAnd",
"OrOr", "OrOr",
"private",
"protected",
"public",
"Arrow", "Arrow",
"Question",
"StarAssign", "StarAssign",
"SlashAssign", "SlashAssign",
"PercentAssign", "PercentAssign",
@ -254,10 +258,6 @@ public interface CPPExpressionParsersym {
"AndAssign", "AndAssign",
"CaretAssign", "CaretAssign",
"OrAssign", "OrAssign",
"private",
"protected",
"public",
"Question",
"RightBracket", "RightBracket",
"catch", "catch",
"Dot", "Dot",

View file

@ -16,71 +16,71 @@ package org.eclipse.cdt.internal.core.dom.lrparser.cpp;
public interface CPPNoCastExpressionParsersym { public interface CPPNoCastExpressionParsersym {
public final static int public final static int
TK_asm = 60, TK_asm = 60,
TK_auto = 47, TK_auto = 48,
TK_bool = 14, TK_bool = 14,
TK_break = 77, TK_break = 77,
TK_case = 78, TK_case = 78,
TK_catch = 119, TK_catch = 119,
TK_char = 15, TK_char = 15,
TK_class = 61, TK_class = 61,
TK_const = 45, TK_const = 46,
TK_const_cast = 31, TK_const_cast = 30,
TK_continue = 79, TK_continue = 79,
TK_default = 80, TK_default = 80,
TK_delete = 62, TK_delete = 62,
TK_do = 81, TK_do = 81,
TK_double = 16, TK_double = 16,
TK_dynamic_cast = 32, TK_dynamic_cast = 31,
TK_else = 122, TK_else = 122,
TK_enum = 66, TK_enum = 65,
TK_explicit = 48, TK_explicit = 49,
TK_export = 87, TK_export = 87,
TK_extern = 17, TK_extern = 17,
TK_false = 33, TK_false = 32,
TK_float = 18, TK_float = 18,
TK_for = 82, TK_for = 82,
TK_friend = 49, TK_friend = 50,
TK_goto = 83, TK_goto = 83,
TK_if = 84, TK_if = 84,
TK_inline = 50, TK_inline = 51,
TK_int = 19, TK_int = 19,
TK_long = 20, TK_long = 20,
TK_mutable = 51, TK_mutable = 52,
TK_namespace = 56, TK_namespace = 56,
TK_new = 63, TK_new = 63,
TK_operator = 7, TK_operator = 7,
TK_private = 114, TK_private = 103,
TK_protected = 115, TK_protected = 104,
TK_public = 116, TK_public = 105,
TK_register = 52, TK_register = 53,
TK_reinterpret_cast = 34, TK_reinterpret_cast = 33,
TK_return = 85, TK_return = 85,
TK_short = 21, TK_short = 21,
TK_signed = 22, TK_signed = 22,
TK_sizeof = 35, TK_sizeof = 34,
TK_static = 53, TK_static = 54,
TK_static_cast = 36, TK_static_cast = 35,
TK_struct = 67, TK_struct = 66,
TK_switch = 86, TK_switch = 86,
TK_template = 54, TK_template = 43,
TK_this = 37, TK_this = 36,
TK_throw = 57, TK_throw = 57,
TK_try = 75, TK_try = 75,
TK_true = 38, TK_true = 37,
TK_typedef = 55, TK_typedef = 55,
TK_typeid = 39, TK_typeid = 38,
TK_typename = 10, TK_typename = 10,
TK_union = 68, TK_union = 67,
TK_unsigned = 23, TK_unsigned = 23,
TK_using = 58, TK_using = 58,
TK_virtual = 44, TK_virtual = 44,
TK_void = 24, TK_void = 24,
TK_volatile = 46, TK_volatile = 47,
TK_wchar_t = 25, TK_wchar_t = 25,
TK_while = 76, TK_while = 76,
TK_integer = 40, TK_integer = 39,
TK_floating = 41, TK_floating = 40,
TK_charconst = 42, TK_charconst = 41,
TK_stringlit = 28, TK_stringlit = 28,
TK_identifier = 1, TK_identifier = 1,
TK_Completion = 2, TK_Completion = 2,
@ -89,8 +89,8 @@ public interface CPPNoCastExpressionParsersym {
TK_LeftBracket = 59, TK_LeftBracket = 59,
TK_LeftParen = 3, TK_LeftParen = 3,
TK_Dot = 120, TK_Dot = 120,
TK_DotStar = 96, TK_DotStar = 92,
TK_Arrow = 103, TK_Arrow = 106,
TK_ArrowStar = 90, TK_ArrowStar = 90,
TK_PlusPlus = 26, TK_PlusPlus = 26,
TK_MinusMinus = 27, TK_MinusMinus = 27,
@ -100,35 +100,35 @@ public interface CPPNoCastExpressionParsersym {
TK_Minus = 12, TK_Minus = 12,
TK_Tilde = 5, TK_Tilde = 5,
TK_Bang = 29, TK_Bang = 29,
TK_Slash = 91, TK_Slash = 93,
TK_Percent = 92, TK_Percent = 94,
TK_RightShift = 88, TK_RightShift = 88,
TK_LeftShift = 89, TK_LeftShift = 89,
TK_LT = 30, TK_LT = 45,
TK_GT = 65, TK_GT = 68,
TK_LE = 93, TK_LE = 95,
TK_GE = 94, TK_GE = 96,
TK_EQ = 97, TK_EQ = 97,
TK_NE = 98, TK_NE = 98,
TK_Caret = 99, TK_Caret = 99,
TK_Or = 100, TK_Or = 100,
TK_AndAnd = 101, TK_AndAnd = 101,
TK_OrOr = 102, TK_OrOr = 102,
TK_Question = 117, TK_Question = 107,
TK_Colon = 73, TK_Colon = 73,
TK_ColonColon = 4, TK_ColonColon = 4,
TK_DotDotDot = 95, TK_DotDotDot = 91,
TK_Assign = 69, TK_Assign = 69,
TK_StarAssign = 104, TK_StarAssign = 108,
TK_SlashAssign = 105, TK_SlashAssign = 109,
TK_PercentAssign = 106, TK_PercentAssign = 110,
TK_PlusAssign = 107, TK_PlusAssign = 111,
TK_MinusAssign = 108, TK_MinusAssign = 112,
TK_RightShiftAssign = 109, TK_RightShiftAssign = 113,
TK_LeftShiftAssign = 110, TK_LeftShiftAssign = 114,
TK_AndAssign = 111, TK_AndAssign = 115,
TK_CaretAssign = 112, TK_CaretAssign = 116,
TK_OrAssign = 113, TK_OrAssign = 117,
TK_Comma = 70, TK_Comma = 70,
TK_RightBracket = 118, TK_RightBracket = 118,
TK_RightParen = 74, TK_RightParen = 74,
@ -136,7 +136,7 @@ public interface CPPNoCastExpressionParsersym {
TK_SemiColon = 13, TK_SemiColon = 13,
TK_LeftBrace = 64, TK_LeftBrace = 64,
TK_ERROR_TOKEN = 72, TK_ERROR_TOKEN = 72,
TK_0 = 43, TK_0 = 42,
TK_EOF_TOKEN = 121; TK_EOF_TOKEN = 121;
public final static String orderedTerminalSymbols[] = { public final static String orderedTerminalSymbols[] = {
@ -170,7 +170,6 @@ public interface CPPNoCastExpressionParsersym {
"MinusMinus", "MinusMinus",
"stringlit", "stringlit",
"Bang", "Bang",
"LT",
"const_cast", "const_cast",
"dynamic_cast", "dynamic_cast",
"false", "false",
@ -184,7 +183,9 @@ public interface CPPNoCastExpressionParsersym {
"floating", "floating",
"charconst", "charconst",
"0", "0",
"template",
"virtual", "virtual",
"LT",
"const", "const",
"volatile", "volatile",
"auto", "auto",
@ -194,7 +195,6 @@ public interface CPPNoCastExpressionParsersym {
"mutable", "mutable",
"register", "register",
"static", "static",
"template",
"typedef", "typedef",
"namespace", "namespace",
"throw", "throw",
@ -205,10 +205,10 @@ public interface CPPNoCastExpressionParsersym {
"delete", "delete",
"new", "new",
"LeftBrace", "LeftBrace",
"GT",
"enum", "enum",
"struct", "struct",
"union", "union",
"GT",
"Assign", "Assign",
"Comma", "Comma",
"RightBrace", "RightBrace",
@ -231,19 +231,23 @@ public interface CPPNoCastExpressionParsersym {
"RightShift", "RightShift",
"LeftShift", "LeftShift",
"ArrowStar", "ArrowStar",
"DotDotDot",
"DotStar",
"Slash", "Slash",
"Percent", "Percent",
"LE", "LE",
"GE", "GE",
"DotDotDot",
"DotStar",
"EQ", "EQ",
"NE", "NE",
"Caret", "Caret",
"Or", "Or",
"AndAnd", "AndAnd",
"OrOr", "OrOr",
"private",
"protected",
"public",
"Arrow", "Arrow",
"Question",
"StarAssign", "StarAssign",
"SlashAssign", "SlashAssign",
"PercentAssign", "PercentAssign",
@ -254,10 +258,6 @@ public interface CPPNoCastExpressionParsersym {
"AndAssign", "AndAssign",
"CaretAssign", "CaretAssign",
"OrAssign", "OrAssign",
"private",
"protected",
"public",
"Question",
"RightBracket", "RightBracket",
"catch", "catch",
"Dot", "Dot",

View file

@ -16,53 +16,53 @@ package org.eclipse.cdt.internal.core.dom.lrparser.cpp;
public interface CPPNoFunctionDeclaratorParsersym { public interface CPPNoFunctionDeclaratorParsersym {
public final static int public final static int
TK_asm = 60, TK_asm = 60,
TK_auto = 47, TK_auto = 48,
TK_bool = 15, TK_bool = 15,
TK_break = 77, TK_break = 77,
TK_case = 78, TK_case = 78,
TK_catch = 119, TK_catch = 119,
TK_char = 16, TK_char = 16,
TK_class = 61, TK_class = 61,
TK_const = 45, TK_const = 46,
TK_const_cast = 31, TK_const_cast = 30,
TK_continue = 79, TK_continue = 79,
TK_default = 80, TK_default = 80,
TK_delete = 62, TK_delete = 63,
TK_do = 81, TK_do = 81,
TK_double = 17, TK_double = 17,
TK_dynamic_cast = 32, TK_dynamic_cast = 31,
TK_else = 122, TK_else = 122,
TK_enum = 66, TK_enum = 65,
TK_explicit = 48, TK_explicit = 49,
TK_export = 87, TK_export = 87,
TK_extern = 14, TK_extern = 12,
TK_false = 33, TK_false = 32,
TK_float = 18, TK_float = 18,
TK_for = 82, TK_for = 82,
TK_friend = 49, TK_friend = 50,
TK_goto = 83, TK_goto = 83,
TK_if = 84, TK_if = 84,
TK_inline = 50, TK_inline = 51,
TK_int = 19, TK_int = 19,
TK_long = 20, TK_long = 20,
TK_mutable = 51, TK_mutable = 52,
TK_namespace = 56, TK_namespace = 56,
TK_new = 63, TK_new = 64,
TK_operator = 7, TK_operator = 7,
TK_private = 114, TK_private = 103,
TK_protected = 115, TK_protected = 104,
TK_public = 116, TK_public = 105,
TK_register = 52, TK_register = 53,
TK_reinterpret_cast = 34, TK_reinterpret_cast = 33,
TK_return = 85, TK_return = 85,
TK_short = 21, TK_short = 21,
TK_signed = 22, TK_signed = 22,
TK_sizeof = 35, TK_sizeof = 34,
TK_static = 53, TK_static = 54,
TK_static_cast = 36, TK_static_cast = 35,
TK_struct = 67, TK_struct = 66,
TK_switch = 86, TK_switch = 86,
TK_template = 54, TK_template = 36,
TK_this = 37, TK_this = 37,
TK_throw = 57, TK_throw = 57,
TK_try = 75, TK_try = 75,
@ -70,12 +70,12 @@ public interface CPPNoFunctionDeclaratorParsersym {
TK_typedef = 55, TK_typedef = 55,
TK_typeid = 39, TK_typeid = 39,
TK_typename = 10, TK_typename = 10,
TK_union = 68, TK_union = 67,
TK_unsigned = 23, TK_unsigned = 23,
TK_using = 58, TK_using = 58,
TK_virtual = 40, TK_virtual = 40,
TK_void = 24, TK_void = 24,
TK_volatile = 46, TK_volatile = 47,
TK_wchar_t = 25, TK_wchar_t = 25,
TK_while = 76, TK_while = 76,
TK_integer = 41, TK_integer = 41,
@ -89,54 +89,54 @@ public interface CPPNoFunctionDeclaratorParsersym {
TK_LeftBracket = 59, TK_LeftBracket = 59,
TK_LeftParen = 3, TK_LeftParen = 3,
TK_Dot = 120, TK_Dot = 120,
TK_DotStar = 96, TK_DotStar = 92,
TK_Arrow = 103, TK_Arrow = 106,
TK_ArrowStar = 90, TK_ArrowStar = 90,
TK_PlusPlus = 26, TK_PlusPlus = 26,
TK_MinusMinus = 27, TK_MinusMinus = 27,
TK_And = 9, TK_And = 9,
TK_Star = 6, TK_Star = 6,
TK_Plus = 11, TK_Plus = 13,
TK_Minus = 12, TK_Minus = 14,
TK_Tilde = 5, TK_Tilde = 5,
TK_Bang = 29, TK_Bang = 29,
TK_Slash = 91, TK_Slash = 93,
TK_Percent = 92, TK_Percent = 94,
TK_RightShift = 88, TK_RightShift = 88,
TK_LeftShift = 89, TK_LeftShift = 89,
TK_LT = 30, TK_LT = 44,
TK_GT = 65, TK_GT = 68,
TK_LE = 93, TK_LE = 95,
TK_GE = 94, TK_GE = 96,
TK_EQ = 97, TK_EQ = 97,
TK_NE = 98, TK_NE = 98,
TK_Caret = 99, TK_Caret = 99,
TK_Or = 100, TK_Or = 100,
TK_AndAnd = 101, TK_AndAnd = 101,
TK_OrOr = 102, TK_OrOr = 102,
TK_Question = 117, TK_Question = 107,
TK_Colon = 73, TK_Colon = 73,
TK_ColonColon = 4, TK_ColonColon = 4,
TK_DotDotDot = 95, TK_DotDotDot = 91,
TK_Assign = 69, TK_Assign = 69,
TK_StarAssign = 104, TK_StarAssign = 108,
TK_SlashAssign = 105, TK_SlashAssign = 109,
TK_PercentAssign = 106, TK_PercentAssign = 110,
TK_PlusAssign = 107, TK_PlusAssign = 111,
TK_MinusAssign = 108, TK_MinusAssign = 112,
TK_RightShiftAssign = 109, TK_RightShiftAssign = 113,
TK_LeftShiftAssign = 110, TK_LeftShiftAssign = 114,
TK_AndAssign = 111, TK_AndAssign = 115,
TK_CaretAssign = 112, TK_CaretAssign = 116,
TK_OrAssign = 113, TK_OrAssign = 117,
TK_Comma = 70, TK_Comma = 70,
TK_RightBracket = 118, TK_RightBracket = 118,
TK_RightParen = 74, TK_RightParen = 74,
TK_RightBrace = 71, TK_RightBrace = 71,
TK_SemiColon = 13, TK_SemiColon = 11,
TK_LeftBrace = 64, TK_LeftBrace = 62,
TK_ERROR_TOKEN = 72, TK_ERROR_TOKEN = 72,
TK_0 = 44, TK_0 = 45,
TK_EOF_TOKEN = 121; TK_EOF_TOKEN = 121;
public final static String orderedTerminalSymbols[] = { public final static String orderedTerminalSymbols[] = {
@ -151,10 +151,10 @@ public interface CPPNoFunctionDeclaratorParsersym {
"EndOfCompletion", "EndOfCompletion",
"And", "And",
"typename", "typename",
"Plus",
"Minus",
"SemiColon", "SemiColon",
"extern", "extern",
"Plus",
"Minus",
"bool", "bool",
"char", "char",
"double", "double",
@ -170,13 +170,13 @@ public interface CPPNoFunctionDeclaratorParsersym {
"MinusMinus", "MinusMinus",
"stringlit", "stringlit",
"Bang", "Bang",
"LT",
"const_cast", "const_cast",
"dynamic_cast", "dynamic_cast",
"false", "false",
"reinterpret_cast", "reinterpret_cast",
"sizeof", "sizeof",
"static_cast", "static_cast",
"template",
"this", "this",
"true", "true",
"typeid", "typeid",
@ -184,6 +184,7 @@ public interface CPPNoFunctionDeclaratorParsersym {
"integer", "integer",
"floating", "floating",
"charconst", "charconst",
"LT",
"0", "0",
"const", "const",
"volatile", "volatile",
@ -194,7 +195,6 @@ public interface CPPNoFunctionDeclaratorParsersym {
"mutable", "mutable",
"register", "register",
"static", "static",
"template",
"typedef", "typedef",
"namespace", "namespace",
"throw", "throw",
@ -202,13 +202,13 @@ public interface CPPNoFunctionDeclaratorParsersym {
"LeftBracket", "LeftBracket",
"asm", "asm",
"class", "class",
"LeftBrace",
"delete", "delete",
"new", "new",
"LeftBrace",
"GT",
"enum", "enum",
"struct", "struct",
"union", "union",
"GT",
"Assign", "Assign",
"Comma", "Comma",
"RightBrace", "RightBrace",
@ -231,19 +231,23 @@ public interface CPPNoFunctionDeclaratorParsersym {
"RightShift", "RightShift",
"LeftShift", "LeftShift",
"ArrowStar", "ArrowStar",
"DotDotDot",
"DotStar",
"Slash", "Slash",
"Percent", "Percent",
"LE", "LE",
"GE", "GE",
"DotDotDot",
"DotStar",
"EQ", "EQ",
"NE", "NE",
"Caret", "Caret",
"Or", "Or",
"AndAnd", "AndAnd",
"OrOr", "OrOr",
"private",
"protected",
"public",
"Arrow", "Arrow",
"Question",
"StarAssign", "StarAssign",
"SlashAssign", "SlashAssign",
"PercentAssign", "PercentAssign",
@ -254,10 +258,6 @@ public interface CPPNoFunctionDeclaratorParsersym {
"AndAssign", "AndAssign",
"CaretAssign", "CaretAssign",
"OrAssign", "OrAssign",
"private",
"protected",
"public",
"Question",
"RightBracket", "RightBracket",
"catch", "catch",
"Dot", "Dot",

View file

@ -23,16 +23,16 @@ public interface CPPParsersym {
TK_catch = 119, TK_catch = 119,
TK_char = 14, TK_char = 14,
TK_class = 59, TK_class = 59,
TK_const = 32, TK_const = 31,
TK_const_cast = 35, TK_const_cast = 35,
TK_continue = 79, TK_continue = 79,
TK_default = 80, TK_default = 80,
TK_delete = 62, TK_delete = 66,
TK_do = 81, TK_do = 81,
TK_double = 15, TK_double = 15,
TK_dynamic_cast = 36, TK_dynamic_cast = 36,
TK_else = 122, TK_else = 122,
TK_enum = 63, TK_enum = 62,
TK_explicit = 37, TK_explicit = 37,
TK_export = 87, TK_export = 87,
TK_extern = 12, TK_extern = 12,
@ -47,11 +47,11 @@ public interface CPPParsersym {
TK_long = 18, TK_long = 18,
TK_mutable = 41, TK_mutable = 41,
TK_namespace = 56, TK_namespace = 56,
TK_new = 64, TK_new = 67,
TK_operator = 7, TK_operator = 7,
TK_private = 114, TK_private = 103,
TK_protected = 115, TK_protected = 104,
TK_public = 116, TK_public = 105,
TK_register = 42, TK_register = 42,
TK_reinterpret_cast = 43, TK_reinterpret_cast = 43,
TK_return = 85, TK_return = 85,
@ -60,27 +60,27 @@ public interface CPPParsersym {
TK_sizeof = 44, TK_sizeof = 44,
TK_static = 45, TK_static = 45,
TK_static_cast = 46, TK_static_cast = 46,
TK_struct = 65, TK_struct = 63,
TK_switch = 86, TK_switch = 86,
TK_template = 47, TK_template = 29,
TK_this = 48, TK_this = 47,
TK_throw = 60, TK_throw = 60,
TK_try = 75, TK_try = 75,
TK_true = 49, TK_true = 48,
TK_typedef = 50, TK_typedef = 49,
TK_typeid = 51, TK_typeid = 50,
TK_typename = 10, TK_typename = 10,
TK_union = 66, TK_union = 64,
TK_unsigned = 21, TK_unsigned = 21,
TK_using = 57, TK_using = 57,
TK_virtual = 29, TK_virtual = 30,
TK_void = 22, TK_void = 22,
TK_volatile = 33, TK_volatile = 32,
TK_wchar_t = 23, TK_wchar_t = 23,
TK_while = 76, TK_while = 76,
TK_integer = 52, TK_integer = 51,
TK_floating = 53, TK_floating = 52,
TK_charconst = 54, TK_charconst = 53,
TK_stringlit = 28, TK_stringlit = 28,
TK_identifier = 1, TK_identifier = 1,
TK_Completion = 2, TK_Completion = 2,
@ -89,8 +89,8 @@ public interface CPPParsersym {
TK_LeftBracket = 61, TK_LeftBracket = 61,
TK_LeftParen = 3, TK_LeftParen = 3,
TK_Dot = 120, TK_Dot = 120,
TK_DotStar = 96, TK_DotStar = 92,
TK_Arrow = 103, TK_Arrow = 106,
TK_ArrowStar = 90, TK_ArrowStar = 90,
TK_PlusPlus = 26, TK_PlusPlus = 26,
TK_MinusMinus = 27, TK_MinusMinus = 27,
@ -99,43 +99,43 @@ public interface CPPParsersym {
TK_Plus = 24, TK_Plus = 24,
TK_Minus = 25, TK_Minus = 25,
TK_Tilde = 5, TK_Tilde = 5,
TK_Bang = 30, TK_Bang = 33,
TK_Slash = 91, TK_Slash = 93,
TK_Percent = 92, TK_Percent = 94,
TK_RightShift = 88, TK_RightShift = 88,
TK_LeftShift = 89, TK_LeftShift = 89,
TK_LT = 31, TK_LT = 54,
TK_GT = 68, TK_GT = 68,
TK_LE = 93, TK_LE = 95,
TK_GE = 94, TK_GE = 96,
TK_EQ = 97, TK_EQ = 97,
TK_NE = 98, TK_NE = 98,
TK_Caret = 99, TK_Caret = 99,
TK_Or = 100, TK_Or = 100,
TK_AndAnd = 101, TK_AndAnd = 101,
TK_OrOr = 102, TK_OrOr = 102,
TK_Question = 117, TK_Question = 107,
TK_Colon = 73, TK_Colon = 73,
TK_ColonColon = 4, TK_ColonColon = 4,
TK_DotDotDot = 95, TK_DotDotDot = 91,
TK_Assign = 69, TK_Assign = 70,
TK_StarAssign = 104, TK_StarAssign = 108,
TK_SlashAssign = 105, TK_SlashAssign = 109,
TK_PercentAssign = 106, TK_PercentAssign = 110,
TK_PlusAssign = 107, TK_PlusAssign = 111,
TK_MinusAssign = 108, TK_MinusAssign = 112,
TK_RightShiftAssign = 109, TK_RightShiftAssign = 113,
TK_LeftShiftAssign = 110, TK_LeftShiftAssign = 114,
TK_AndAssign = 111, TK_AndAssign = 115,
TK_CaretAssign = 112, TK_CaretAssign = 116,
TK_OrAssign = 113, TK_OrAssign = 117,
TK_Comma = 70, TK_Comma = 71,
TK_RightBracket = 118, TK_RightBracket = 118,
TK_RightParen = 74, TK_RightParen = 74,
TK_RightBrace = 72, TK_RightBrace = 72,
TK_SemiColon = 11, TK_SemiColon = 11,
TK_LeftBrace = 67, TK_LeftBrace = 65,
TK_ERROR_TOKEN = 71, TK_ERROR_TOKEN = 69,
TK_0 = 55, TK_0 = 55,
TK_EOF_TOKEN = 121; TK_EOF_TOKEN = 121;
@ -169,11 +169,11 @@ public interface CPPParsersym {
"PlusPlus", "PlusPlus",
"MinusMinus", "MinusMinus",
"stringlit", "stringlit",
"template",
"virtual", "virtual",
"Bang",
"LT",
"const", "const",
"volatile", "volatile",
"Bang",
"auto", "auto",
"const_cast", "const_cast",
"dynamic_cast", "dynamic_cast",
@ -187,7 +187,6 @@ public interface CPPParsersym {
"sizeof", "sizeof",
"static", "static",
"static_cast", "static_cast",
"template",
"this", "this",
"true", "true",
"typedef", "typedef",
@ -195,6 +194,7 @@ public interface CPPParsersym {
"integer", "integer",
"floating", "floating",
"charconst", "charconst",
"LT",
"0", "0",
"namespace", "namespace",
"using", "using",
@ -202,16 +202,16 @@ public interface CPPParsersym {
"class", "class",
"throw", "throw",
"LeftBracket", "LeftBracket",
"delete",
"enum", "enum",
"new",
"struct", "struct",
"union", "union",
"LeftBrace", "LeftBrace",
"delete",
"new",
"GT", "GT",
"ERROR_TOKEN",
"Assign", "Assign",
"Comma", "Comma",
"ERROR_TOKEN",
"RightBrace", "RightBrace",
"Colon", "Colon",
"RightParen", "RightParen",
@ -231,19 +231,23 @@ public interface CPPParsersym {
"RightShift", "RightShift",
"LeftShift", "LeftShift",
"ArrowStar", "ArrowStar",
"DotDotDot",
"DotStar",
"Slash", "Slash",
"Percent", "Percent",
"LE", "LE",
"GE", "GE",
"DotDotDot",
"DotStar",
"EQ", "EQ",
"NE", "NE",
"Caret", "Caret",
"Or", "Or",
"AndAnd", "AndAnd",
"OrOr", "OrOr",
"private",
"protected",
"public",
"Arrow", "Arrow",
"Question",
"StarAssign", "StarAssign",
"SlashAssign", "SlashAssign",
"PercentAssign", "PercentAssign",
@ -254,10 +258,6 @@ public interface CPPParsersym {
"AndAssign", "AndAssign",
"CaretAssign", "CaretAssign",
"OrAssign", "OrAssign",
"private",
"protected",
"public",
"Question",
"RightBracket", "RightBracket",
"catch", "catch",
"Dot", "Dot",

View file

@ -16,71 +16,71 @@ package org.eclipse.cdt.internal.core.dom.lrparser.cpp;
public interface CPPSizeofExpressionParsersym { public interface CPPSizeofExpressionParsersym {
public final static int public final static int
TK_asm = 60, TK_asm = 60,
TK_auto = 47, TK_auto = 48,
TK_bool = 14, TK_bool = 14,
TK_break = 77, TK_break = 77,
TK_case = 78, TK_case = 78,
TK_catch = 119, TK_catch = 119,
TK_char = 15, TK_char = 15,
TK_class = 61, TK_class = 61,
TK_const = 45, TK_const = 46,
TK_const_cast = 31, TK_const_cast = 30,
TK_continue = 79, TK_continue = 79,
TK_default = 80, TK_default = 80,
TK_delete = 62, TK_delete = 62,
TK_do = 81, TK_do = 81,
TK_double = 16, TK_double = 16,
TK_dynamic_cast = 32, TK_dynamic_cast = 31,
TK_else = 122, TK_else = 122,
TK_enum = 66, TK_enum = 65,
TK_explicit = 48, TK_explicit = 49,
TK_export = 87, TK_export = 87,
TK_extern = 17, TK_extern = 17,
TK_false = 33, TK_false = 32,
TK_float = 18, TK_float = 18,
TK_for = 82, TK_for = 82,
TK_friend = 49, TK_friend = 50,
TK_goto = 83, TK_goto = 83,
TK_if = 84, TK_if = 84,
TK_inline = 50, TK_inline = 51,
TK_int = 19, TK_int = 19,
TK_long = 20, TK_long = 20,
TK_mutable = 51, TK_mutable = 52,
TK_namespace = 56, TK_namespace = 56,
TK_new = 63, TK_new = 63,
TK_operator = 7, TK_operator = 7,
TK_private = 114, TK_private = 103,
TK_protected = 115, TK_protected = 104,
TK_public = 116, TK_public = 105,
TK_register = 52, TK_register = 53,
TK_reinterpret_cast = 34, TK_reinterpret_cast = 33,
TK_return = 85, TK_return = 85,
TK_short = 21, TK_short = 21,
TK_signed = 22, TK_signed = 22,
TK_sizeof = 35, TK_sizeof = 34,
TK_static = 53, TK_static = 54,
TK_static_cast = 36, TK_static_cast = 35,
TK_struct = 67, TK_struct = 66,
TK_switch = 86, TK_switch = 86,
TK_template = 54, TK_template = 43,
TK_this = 37, TK_this = 36,
TK_throw = 57, TK_throw = 57,
TK_try = 75, TK_try = 75,
TK_true = 38, TK_true = 37,
TK_typedef = 55, TK_typedef = 55,
TK_typeid = 39, TK_typeid = 38,
TK_typename = 10, TK_typename = 10,
TK_union = 68, TK_union = 67,
TK_unsigned = 23, TK_unsigned = 23,
TK_using = 58, TK_using = 58,
TK_virtual = 44, TK_virtual = 44,
TK_void = 24, TK_void = 24,
TK_volatile = 46, TK_volatile = 47,
TK_wchar_t = 25, TK_wchar_t = 25,
TK_while = 76, TK_while = 76,
TK_integer = 40, TK_integer = 39,
TK_floating = 41, TK_floating = 40,
TK_charconst = 42, TK_charconst = 41,
TK_stringlit = 28, TK_stringlit = 28,
TK_identifier = 1, TK_identifier = 1,
TK_Completion = 2, TK_Completion = 2,
@ -89,8 +89,8 @@ public interface CPPSizeofExpressionParsersym {
TK_LeftBracket = 59, TK_LeftBracket = 59,
TK_LeftParen = 3, TK_LeftParen = 3,
TK_Dot = 120, TK_Dot = 120,
TK_DotStar = 96, TK_DotStar = 92,
TK_Arrow = 103, TK_Arrow = 106,
TK_ArrowStar = 90, TK_ArrowStar = 90,
TK_PlusPlus = 26, TK_PlusPlus = 26,
TK_MinusMinus = 27, TK_MinusMinus = 27,
@ -100,35 +100,35 @@ public interface CPPSizeofExpressionParsersym {
TK_Minus = 12, TK_Minus = 12,
TK_Tilde = 5, TK_Tilde = 5,
TK_Bang = 29, TK_Bang = 29,
TK_Slash = 91, TK_Slash = 93,
TK_Percent = 92, TK_Percent = 94,
TK_RightShift = 88, TK_RightShift = 88,
TK_LeftShift = 89, TK_LeftShift = 89,
TK_LT = 30, TK_LT = 45,
TK_GT = 65, TK_GT = 68,
TK_LE = 93, TK_LE = 95,
TK_GE = 94, TK_GE = 96,
TK_EQ = 97, TK_EQ = 97,
TK_NE = 98, TK_NE = 98,
TK_Caret = 99, TK_Caret = 99,
TK_Or = 100, TK_Or = 100,
TK_AndAnd = 101, TK_AndAnd = 101,
TK_OrOr = 102, TK_OrOr = 102,
TK_Question = 117, TK_Question = 107,
TK_Colon = 73, TK_Colon = 73,
TK_ColonColon = 4, TK_ColonColon = 4,
TK_DotDotDot = 95, TK_DotDotDot = 91,
TK_Assign = 69, TK_Assign = 69,
TK_StarAssign = 104, TK_StarAssign = 108,
TK_SlashAssign = 105, TK_SlashAssign = 109,
TK_PercentAssign = 106, TK_PercentAssign = 110,
TK_PlusAssign = 107, TK_PlusAssign = 111,
TK_MinusAssign = 108, TK_MinusAssign = 112,
TK_RightShiftAssign = 109, TK_RightShiftAssign = 113,
TK_LeftShiftAssign = 110, TK_LeftShiftAssign = 114,
TK_AndAssign = 111, TK_AndAssign = 115,
TK_CaretAssign = 112, TK_CaretAssign = 116,
TK_OrAssign = 113, TK_OrAssign = 117,
TK_Comma = 70, TK_Comma = 70,
TK_RightBracket = 118, TK_RightBracket = 118,
TK_RightParen = 74, TK_RightParen = 74,
@ -136,7 +136,7 @@ public interface CPPSizeofExpressionParsersym {
TK_SemiColon = 13, TK_SemiColon = 13,
TK_LeftBrace = 64, TK_LeftBrace = 64,
TK_ERROR_TOKEN = 72, TK_ERROR_TOKEN = 72,
TK_0 = 43, TK_0 = 42,
TK_EOF_TOKEN = 121; TK_EOF_TOKEN = 121;
public final static String orderedTerminalSymbols[] = { public final static String orderedTerminalSymbols[] = {
@ -170,7 +170,6 @@ public interface CPPSizeofExpressionParsersym {
"MinusMinus", "MinusMinus",
"stringlit", "stringlit",
"Bang", "Bang",
"LT",
"const_cast", "const_cast",
"dynamic_cast", "dynamic_cast",
"false", "false",
@ -184,7 +183,9 @@ public interface CPPSizeofExpressionParsersym {
"floating", "floating",
"charconst", "charconst",
"0", "0",
"template",
"virtual", "virtual",
"LT",
"const", "const",
"volatile", "volatile",
"auto", "auto",
@ -194,7 +195,6 @@ public interface CPPSizeofExpressionParsersym {
"mutable", "mutable",
"register", "register",
"static", "static",
"template",
"typedef", "typedef",
"namespace", "namespace",
"throw", "throw",
@ -205,10 +205,10 @@ public interface CPPSizeofExpressionParsersym {
"delete", "delete",
"new", "new",
"LeftBrace", "LeftBrace",
"GT",
"enum", "enum",
"struct", "struct",
"union", "union",
"GT",
"Assign", "Assign",
"Comma", "Comma",
"RightBrace", "RightBrace",
@ -231,19 +231,23 @@ public interface CPPSizeofExpressionParsersym {
"RightShift", "RightShift",
"LeftShift", "LeftShift",
"ArrowStar", "ArrowStar",
"DotDotDot",
"DotStar",
"Slash", "Slash",
"Percent", "Percent",
"LE", "LE",
"GE", "GE",
"DotDotDot",
"DotStar",
"EQ", "EQ",
"NE", "NE",
"Caret", "Caret",
"Or", "Or",
"AndAnd", "AndAnd",
"OrOr", "OrOr",
"private",
"protected",
"public",
"Arrow", "Arrow",
"Question",
"StarAssign", "StarAssign",
"SlashAssign", "SlashAssign",
"PercentAssign", "PercentAssign",
@ -254,10 +258,6 @@ public interface CPPSizeofExpressionParsersym {
"AndAssign", "AndAssign",
"CaretAssign", "CaretAssign",
"OrAssign", "OrAssign",
"private",
"protected",
"public",
"Question",
"RightBracket", "RightBracket",
"catch", "catch",
"Dot", "Dot",

View file

@ -22,20 +22,20 @@ public interface CPPTemplateTypeParameterParsersym {
TK_case = 78, TK_case = 78,
TK_catch = 119, TK_catch = 119,
TK_char = 16, TK_char = 16,
TK_class = 60, TK_class = 59,
TK_const = 45, TK_const = 46,
TK_const_cast = 31, TK_const_cast = 31,
TK_continue = 79, TK_continue = 79,
TK_default = 80, TK_default = 80,
TK_delete = 62, TK_delete = 63,
TK_do = 81, TK_do = 81,
TK_double = 17, TK_double = 17,
TK_dynamic_cast = 32, TK_dynamic_cast = 32,
TK_else = 122, TK_else = 122,
TK_enum = 66, TK_enum = 65,
TK_explicit = 49, TK_explicit = 49,
TK_export = 87, TK_export = 87,
TK_extern = 14, TK_extern = 12,
TK_false = 33, TK_false = 33,
TK_float = 18, TK_float = 18,
TK_for = 82, TK_for = 82,
@ -47,11 +47,11 @@ public interface CPPTemplateTypeParameterParsersym {
TK_long = 20, TK_long = 20,
TK_mutable = 52, TK_mutable = 52,
TK_namespace = 56, TK_namespace = 56,
TK_new = 63, TK_new = 64,
TK_operator = 8, TK_operator = 8,
TK_private = 114, TK_private = 103,
TK_protected = 115, TK_protected = 104,
TK_public = 116, TK_public = 105,
TK_register = 53, TK_register = 53,
TK_reinterpret_cast = 34, TK_reinterpret_cast = 34,
TK_return = 85, TK_return = 85,
@ -60,9 +60,9 @@ public interface CPPTemplateTypeParameterParsersym {
TK_sizeof = 35, TK_sizeof = 35,
TK_static = 54, TK_static = 54,
TK_static_cast = 36, TK_static_cast = 36,
TK_struct = 67, TK_struct = 66,
TK_switch = 86, TK_switch = 86,
TK_template = 46, TK_template = 29,
TK_this = 37, TK_this = 37,
TK_throw = 57, TK_throw = 57,
TK_try = 75, TK_try = 75,
@ -70,7 +70,7 @@ public interface CPPTemplateTypeParameterParsersym {
TK_typedef = 55, TK_typedef = 55,
TK_typeid = 39, TK_typeid = 39,
TK_typename = 10, TK_typename = 10,
TK_union = 68, TK_union = 67,
TK_unsigned = 23, TK_unsigned = 23,
TK_using = 58, TK_using = 58,
TK_virtual = 40, TK_virtual = 40,
@ -86,57 +86,57 @@ public interface CPPTemplateTypeParameterParsersym {
TK_Completion = 2, TK_Completion = 2,
TK_EndOfCompletion = 7, TK_EndOfCompletion = 7,
TK_Invalid = 123, TK_Invalid = 123,
TK_LeftBracket = 59, TK_LeftBracket = 60,
TK_LeftParen = 3, TK_LeftParen = 3,
TK_Dot = 120, TK_Dot = 120,
TK_DotStar = 96, TK_DotStar = 92,
TK_Arrow = 103, TK_Arrow = 106,
TK_ArrowStar = 90, TK_ArrowStar = 90,
TK_PlusPlus = 26, TK_PlusPlus = 26,
TK_MinusMinus = 27, TK_MinusMinus = 27,
TK_And = 9, TK_And = 9,
TK_Star = 6, TK_Star = 6,
TK_Plus = 11, TK_Plus = 13,
TK_Minus = 12, TK_Minus = 14,
TK_Tilde = 5, TK_Tilde = 5,
TK_Bang = 29, TK_Bang = 30,
TK_Slash = 91, TK_Slash = 93,
TK_Percent = 92, TK_Percent = 94,
TK_RightShift = 88, TK_RightShift = 88,
TK_LeftShift = 89, TK_LeftShift = 89,
TK_LT = 30, TK_LT = 44,
TK_GT = 65, TK_GT = 68,
TK_LE = 93, TK_LE = 95,
TK_GE = 94, TK_GE = 96,
TK_EQ = 97, TK_EQ = 97,
TK_NE = 98, TK_NE = 98,
TK_Caret = 99, TK_Caret = 99,
TK_Or = 100, TK_Or = 100,
TK_AndAnd = 101, TK_AndAnd = 101,
TK_OrOr = 102, TK_OrOr = 102,
TK_Question = 117, TK_Question = 107,
TK_Colon = 73, TK_Colon = 73,
TK_ColonColon = 4, TK_ColonColon = 4,
TK_DotDotDot = 95, TK_DotDotDot = 91,
TK_Assign = 69, TK_Assign = 69,
TK_StarAssign = 104, TK_StarAssign = 108,
TK_SlashAssign = 105, TK_SlashAssign = 109,
TK_PercentAssign = 106, TK_PercentAssign = 110,
TK_PlusAssign = 107, TK_PlusAssign = 111,
TK_MinusAssign = 108, TK_MinusAssign = 112,
TK_RightShiftAssign = 109, TK_RightShiftAssign = 113,
TK_LeftShiftAssign = 110, TK_LeftShiftAssign = 114,
TK_AndAssign = 111, TK_AndAssign = 115,
TK_CaretAssign = 112, TK_CaretAssign = 116,
TK_OrAssign = 113, TK_OrAssign = 117,
TK_Comma = 70, TK_Comma = 70,
TK_RightBracket = 118, TK_RightBracket = 118,
TK_RightParen = 74, TK_RightParen = 74,
TK_RightBrace = 71, TK_RightBrace = 71,
TK_SemiColon = 13, TK_SemiColon = 11,
TK_LeftBrace = 64, TK_LeftBrace = 62,
TK_ERROR_TOKEN = 72, TK_ERROR_TOKEN = 72,
TK_0 = 44, TK_0 = 45,
TK_EOF_TOKEN = 121; TK_EOF_TOKEN = 121;
public final static String orderedTerminalSymbols[] = { public final static String orderedTerminalSymbols[] = {
@ -151,10 +151,10 @@ public interface CPPTemplateTypeParameterParsersym {
"operator", "operator",
"And", "And",
"typename", "typename",
"Plus",
"Minus",
"SemiColon", "SemiColon",
"extern", "extern",
"Plus",
"Minus",
"bool", "bool",
"char", "char",
"double", "double",
@ -169,8 +169,8 @@ public interface CPPTemplateTypeParameterParsersym {
"PlusPlus", "PlusPlus",
"MinusMinus", "MinusMinus",
"stringlit", "stringlit",
"template",
"Bang", "Bang",
"LT",
"const_cast", "const_cast",
"dynamic_cast", "dynamic_cast",
"false", "false",
@ -184,9 +184,9 @@ public interface CPPTemplateTypeParameterParsersym {
"integer", "integer",
"floating", "floating",
"charconst", "charconst",
"LT",
"0", "0",
"const", "const",
"template",
"volatile", "volatile",
"auto", "auto",
"explicit", "explicit",
@ -199,16 +199,16 @@ public interface CPPTemplateTypeParameterParsersym {
"namespace", "namespace",
"throw", "throw",
"using", "using",
"LeftBracket",
"class", "class",
"LeftBracket",
"asm", "asm",
"LeftBrace",
"delete", "delete",
"new", "new",
"LeftBrace",
"GT",
"enum", "enum",
"struct", "struct",
"union", "union",
"GT",
"Assign", "Assign",
"Comma", "Comma",
"RightBrace", "RightBrace",
@ -231,19 +231,23 @@ public interface CPPTemplateTypeParameterParsersym {
"RightShift", "RightShift",
"LeftShift", "LeftShift",
"ArrowStar", "ArrowStar",
"DotDotDot",
"DotStar",
"Slash", "Slash",
"Percent", "Percent",
"LE", "LE",
"GE", "GE",
"DotDotDot",
"DotStar",
"EQ", "EQ",
"NE", "NE",
"Caret", "Caret",
"Or", "Or",
"AndAnd", "AndAnd",
"OrOr", "OrOr",
"private",
"protected",
"public",
"Arrow", "Arrow",
"Question",
"StarAssign", "StarAssign",
"SlashAssign", "SlashAssign",
"PercentAssign", "PercentAssign",
@ -254,10 +258,6 @@ public interface CPPTemplateTypeParameterParsersym {
"AndAssign", "AndAssign",
"CaretAssign", "CaretAssign",
"OrAssign", "OrAssign",
"private",
"protected",
"public",
"Question",
"RightBracket", "RightBracket",
"catch", "catch",
"Dot", "Dot",