1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-05 08:46:02 +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 org.eclipse.cdt.core.dom.ast.ASTVisitor;
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.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.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.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.IASTTypeId;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IProblemBinding;
import org.eclipse.cdt.core.dom.ast.IType;
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.ICASTPointer;
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.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.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
*/
@ -67,30 +47,30 @@ public class ASTPrinter {
* @return Always returns false, boolean return type allows this method
* to be called from a conditional breakpoint during debugging.
*/
public static boolean print(IASTNode root, PrintStream out) {
if (root == null) {
public static boolean print(IASTNode node, PrintStream out) {
if (node == null) {
out.println("null");
return false;
}
if (root instanceof IASTTranslationUnit) {
IASTPreprocessorStatement[] preStats = ((IASTTranslationUnit)root).getAllPreprocessorStatements();
if (node instanceof IASTTranslationUnit) {
IASTPreprocessorStatement[] preStats = ((IASTTranslationUnit)node).getAllPreprocessorStatements();
if (preStats != null) {
for (IASTPreprocessorStatement stat : preStats)
print(out, 0, stat);
}
}
root.accept(new PrintVisitor(out));
printAST(out, 0, node);
if (root instanceof IASTTranslationUnit) {
IASTProblem[] problems = ((IASTTranslationUnit)root).getPreprocessorProblems();
if (node instanceof IASTTranslationUnit) {
IASTProblem[] problems = ((IASTTranslationUnit)node).getPreprocessorProblems();
if (problems != null) {
for (IASTProblem problem : problems)
print(out, 0, problem);
}
IASTComment[] comments = ((IASTTranslationUnit)root).getComments();
IASTComment[] comments = ((IASTTranslationUnit)node).getComments();
if (comments != null) {
for (IASTComment comment : comments)
print(out, 0, comment);
@ -109,22 +89,23 @@ public class ASTPrinter {
return print(root, System.out);
}
/**
* Prints problem nodes in the AST to the given printstream.
*
* @return Always returns false, boolean return type allows this method
* to be called from a conditional breakpoint during debugging.
*/
public static boolean printProblems(IASTNode root, PrintStream out) {
if (root == null) {
public static boolean printProblems(IASTNode node, PrintStream out) {
if (node == null) {
out.println("null");
return false;
}
root.accept(new ProblemVisitor(out));
printASTProblems(out, 0, node);
if (root instanceof IASTTranslationUnit) {
IASTProblem[] problems = ((IASTTranslationUnit)root).getPreprocessorProblems();
if (node instanceof IASTTranslationUnit) {
IASTProblem[] problems = ((IASTTranslationUnit)node).getPreprocessorProblems();
if (problems != null) {
for (IASTProblem problem : problems) {
print(out, 0, problem);
@ -145,6 +126,31 @@ public class ASTPrinter {
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) {
for (int i = 0; i < indentLevel; i++)
out.print(" ");
@ -179,7 +185,16 @@ public class ASTPrinter {
}
if (n instanceof IASTName) {
IASTName name = (IASTName)n;
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) {
ICASTPointer pointer = (ICASTPointer) n;
if (pointer.isConst())
@ -243,308 +258,4 @@ public class ASTPrinter {
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
::= dcolon_opt nested_name_specifier template_opt unqualified_id_name
/. $Build consumeQualifiedId(true); $EndBuild ./
| '::' identifier_name
/. $Build consumeGlobalQualifiedId(); $EndBuild ./
| '::' operator_function_id_name
/. $Build consumeGlobalQualifiedId(); $EndBuild ./
| '::' template_id_name
| '::' unqualified_id_name
/. $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
::=? $empty -- this option must come first for constructors to parse correctly
::= declaration_specifiers
| $empty
/. $Build consumeEmpty(); $EndBuild ./
| declaration_specifiers
@ -1189,6 +1192,7 @@ namespace_alias_definition
-- | 'using' '::' unqualified_id_name ';'
-- TODO why not just check if the second token is 'typename'?
using_declaration
::= 'using' typename_opt dcolon_opt nested_name_specifier_opt unqualified_id_name ';'
/. $Build consumeUsingDeclaration(); $EndBuild ./
@ -1317,15 +1321,15 @@ cv_qualifier
/. $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
::= unqualified_id_name
| <empty> nested_name_specifier template_opt unqualified_id_name
/. $Build consumeQualifiedId(true); $EndBuild ./
::= qualified_or_unqualified_name
| dcolon_opt nested_name_specifier_opt type_name
/. $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
@ -1749,11 +1753,11 @@ template_argument_list_opt
template_argument
::= assignment_expression
/. $Build consumeTemplateArgumentExpression(); $EndBuild ./
| type_id
/. $Build consumeTemplateArgumentTypeId(); $EndBuild ./
--| qualified_or_unqualified_name -- accessible through assignment_expression
explicit_instantiation
::= 'template' declaration
/. $Build consumeTemplateExplicitInstantiation(); $EndBuild ./

View file

@ -46,8 +46,8 @@ import org.eclipse.core.runtime.CoreException;
public abstract class BaseExtensibleLanguage extends AbstractLanguage {
private static final boolean DEBUG_PRINT_GCC_AST = true;
private static final boolean DEBUG_PRINT_AST = true;
private static final boolean DEBUG_PRINT_GCC_AST = false;
private static final boolean DEBUG_PRINT_AST = false;
/**
@ -101,13 +101,14 @@ public abstract class BaseExtensibleLanguage extends AbstractLanguage {
IASTTranslationUnit gtu = null;
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("Parsing");
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:");
ASTPrinter.print(gtu);
System.out.println();

View file

@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.cdt.core.dom.lrparser.action;
import java.util.Arrays;
import java.util.EnumSet;
import java.util.List;
import java.util.Set;
@ -266,8 +267,16 @@ public abstract class BuildASTParserAction {
protected static void setOffsetAndLength(IASTNode node, int offset, int 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.
* 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();
IASTNode result;
if(expressionStatement == null)
if(expressionStatement == null)
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
result = expressionStatement;
else if(isImplicitInt(decl))
@ -535,6 +546,7 @@ public abstract class BuildASTParserAction {
if(TRACE_AST_STACK) System.out.println(astStack);
}
protected abstract IASTAmbiguousStatement createAmbiguousStatement(IASTStatement ... statements);
@ -657,9 +669,12 @@ public abstract class BuildASTParserAction {
}
else {
IASTExpressionList exprList = nodeFactory.newExpressionList();
for(Object o : expressions) {
exprList.addExpression((IASTExpression)o);
}
setOffsetAndLength(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.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.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 static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.*;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedList;
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.IASTLiteralExpression;
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.IASTParameterDeclaration;
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.ICPPASTNewExpression;
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.ICPPASTQualifiedName;
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.IASTAmbiguousExpression;
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.CPPASTAmbiguousStatement;
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 */
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 orderedTerminalSymbols When an instance of this class is created for a parser
@ -463,6 +427,7 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
public void consumeTemplateArgumentTypeId() {
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();
IASTNode result = runSecondaryParser(secondaryParser);
@ -472,9 +437,9 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
return;
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);
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' overloadable_operator
@ -1133,7 +1130,7 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
if(declarator instanceof CPPASTAmbiguousDeclarator) {
IASTAmbiguityParent owner = (IASTAmbiguityParent) declaration;
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;
}
}
}
@ -1273,8 +1269,17 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
ICPPASTNamedTypeSpecifier declSpec = nodeFactory.newTypedefNameSpecifier(typeName);
// now apply the rest of the specifiers
for(Object token : topScope)
for(Object token : topScope) {
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);
astStack.push(declSpec);
@ -1325,7 +1330,8 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
if(TRACE_ACTIONS) DebugUtil.printMethodTrace();
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();
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.
else if(matchTokens(ruleTokens, tokenMap, TK_Completion, TK_EndOfCompletion)) {
IASTName name = createName(parser.getLeftIToken());
declSpecifier = nodeFactory.newTypedefNameSpecifier(name);
setOffsetAndLength(declSpecifier, offset(name), length(name));
declSpec = nodeFactory.newTypedefNameSpecifier(name);
setOffsetAndLength(declSpec, offset(name), length(name));
declarators = Collections.emptyList(); // throw away the bogus declarator
}
// can happen if implicit int is used
else if(declSpecifier == null) {
declSpecifier = nodeFactory.newSimpleDeclSpecifier();
setOffsetAndLength(declSpecifier, parser.getLeftIToken().getStartOffset(), 0);
else if(declSpec == null) {
declSpec = nodeFactory.newSimpleDeclSpecifier();
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;
// this will get parsed wrong, the following is a hack to rebuild the AST as it should have been parsed
else if(declarators.isEmpty() &&
declSpecifier instanceof ICPPASTNamedTypeSpecifier &&
declSpec instanceof ICPPASTNamedTypeSpecifier &&
ruleTokens.size() >= 2 &&
baseKind(nameToken = ruleTokens.get(ruleTokens.size() - 2)) == TK_identifier) {
declSpecifier = nodeFactory.newSimpleDeclSpecifier();
declSpec = nodeFactory.newSimpleDeclSpecifier();
for(IToken t : ruleTokens.subList(0, ruleTokens.size()-1))
setSpecifier(declSpecifier, t);
setSpecifier(declSpec, t);
int offset = offset(parser.getLeftIToken());
int length = endOffset(ruleTokens.get(ruleTokens.size()-2)) - offset;
setOffsetAndLength(declSpecifier, offset, length);
setOffsetAndLength(declSpec, offset, length);
IASTName name = createName(nameToken);
IASTDeclarator declarator = nodeFactory.newDeclarator(name);
setOffsetAndLength(declarator, nameToken);
declarators.add(declarator);
}
IASTSimpleDeclaration declaration = nodeFactory.newSimpleDeclaration(declSpecifier);
IASTSimpleDeclaration declaration = nodeFactory.newSimpleDeclaration(declSpec);
setOffsetAndLength(declaration);
for(Object declarator : declarators)
declaration.addDeclarator((IASTDeclarator)declarator);
// simple ambiguity resolutions
// if(declSpecifier.isFriend())
// resolveAmbiguousDeclaratorsToFunction(declaration);
@ -1389,17 +1399,82 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
//
// }
astStack.push(declaration);
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() {
if(TRACE_ACTIONS) DebugUtil.printMethodTrace();
@ -1413,14 +1488,14 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
return;
IParser secondaryParser = getNoFunctionDeclaratorParser();
IASTNode alternateDeclarator = runSecondaryParser(secondaryParser);
IASTNode notFunctionDeclarator = runSecondaryParser(secondaryParser);
if(alternateDeclarator == null || alternateDeclarator instanceof IASTProblemDeclaration)
if(notFunctionDeclarator == null || notFunctionDeclarator instanceof IASTProblemDeclaration)
return;
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);
astStack.push(ambiguityNode);
@ -1507,14 +1582,14 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
List<Object> declarations = astStack.closeScope();
// 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);
}
setOffsetAndLength(classSpecifier);
astStack.push(classSpecifier);
classNames.removeLast(); // pop the stack of class names
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()
astStack.push(classSpecifier);
classNames.add(className); // push
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();
IASTCompoundStatement body = (IASTCompoundStatement) astStack.pop();
List<Object> initializers = astStack.closeScope();
ICPPASTFunctionDeclarator declarator = (ICPPASTFunctionDeclarator) astStack.pop();
IASTFunctionDeclarator declarator = (IASTFunctionDeclarator) astStack.pop();
IASTDeclSpecifier declSpec = (IASTDeclSpecifier) astStack.pop(); // may be null
if(declSpec == null) { // can happen if implicit int is used
declSpec = nodeFactory.newSimpleDeclSpecifier();
setOffsetAndLength(declSpec, parser.getLeftIToken().getStartOffset(), 0);
}
else if(disambiguateToConstructor(declSpec, declarator)) {
declSpec = (IASTDeclSpecifier) astStack.pop();
declarator = (IASTFunctionDeclarator) astStack.pop();
}
ICPPASTFunctionDefinition definition;
if (isTryBlockDeclarator) {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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