mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
fixed problems with auto_ptr tests and overloadable operators
This commit is contained in:
parent
8342cee582
commit
230652a572
13 changed files with 5656 additions and 5762 deletions
|
@ -306,18 +306,6 @@ $Rules
|
||||||
::= $empty
|
::= $empty
|
||||||
/.$Action $Builder openASTScope(); $EndBuilder $EndAction./
|
/.$Action $Builder openASTScope(); $EndBuilder $EndAction./
|
||||||
|
|
||||||
<openscope-symbol>
|
|
||||||
::= $empty
|
|
||||||
-- /.$Action $Resolve openSymbolScope(); $EndResolve $EndAction./
|
|
||||||
|
|
||||||
<openscope-declaration>
|
|
||||||
::= $empty
|
|
||||||
-- /.$Action $Resolve openDeclarationScope(); $EndResolve $EndAction./
|
|
||||||
|
|
||||||
<placeholder>
|
|
||||||
::= $empty
|
|
||||||
/.$Action $Builder consumePlaceHolder(); $EndBuilder $EndAction./
|
|
||||||
|
|
||||||
<empty>
|
<empty>
|
||||||
::= $empty
|
::= $empty
|
||||||
/.$Action $Builder consumeEmpty(); $EndBuilder $EndAction./
|
/.$Action $Builder consumeEmpty(); $EndBuilder $EndAction./
|
||||||
|
@ -371,11 +359,6 @@ external_declaration
|
||||||
/. $Build consumeDeclarationProblem(); $EndBuild ./
|
/. $Build consumeDeclarationProblem(); $EndBuild ./
|
||||||
|
|
||||||
|
|
||||||
--expression_as_translation_unit
|
|
||||||
-- ::= expression
|
|
||||||
-- /. $Build consumeExpressionAsTranslationUnit(); $EndBuild ./
|
|
||||||
|
|
||||||
|
|
||||||
------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------
|
||||||
-- Expressions
|
-- Expressions
|
||||||
------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------
|
||||||
|
@ -996,7 +979,7 @@ simple_declaration_specifiers
|
||||||
| no_type_declaration_specifiers simple_type_specifier
|
| no_type_declaration_specifiers simple_type_specifier
|
||||||
| simple_declaration_specifiers simple_type_specifier
|
| simple_declaration_specifiers simple_type_specifier
|
||||||
| simple_declaration_specifiers no_type_declaration_specifier
|
| simple_declaration_specifiers no_type_declaration_specifier
|
||||||
| $empty
|
| no_type_declaration_specifiers
|
||||||
|
|
||||||
|
|
||||||
-- struct, union or class!
|
-- struct, union or class!
|
||||||
|
@ -1724,7 +1707,7 @@ template_id_name
|
||||||
/. $Build consumeTemplateId(); $EndBuild ./
|
/. $Build consumeTemplateId(); $EndBuild ./
|
||||||
|
|
||||||
template_identifier
|
template_identifier
|
||||||
::= 'identifier'
|
::= identifier_name
|
||||||
|
|
||||||
|
|
||||||
template_argument_list
|
template_argument_list
|
||||||
|
|
|
@ -23,7 +23,7 @@ import lpg.lpgjavaruntime.PrsStream;
|
||||||
*
|
*
|
||||||
* @author Mike Kucera
|
* @author Mike Kucera
|
||||||
*/
|
*/
|
||||||
class LPGTokenAdapter implements lpg.lpgjavaruntime.IToken {
|
public class LPGTokenAdapter implements lpg.lpgjavaruntime.IToken {
|
||||||
|
|
||||||
/** The token object that is being wrapped */
|
/** The token object that is being wrapped */
|
||||||
private final org.eclipse.cdt.core.parser.IToken token;
|
private final org.eclipse.cdt.core.parser.IToken token;
|
||||||
|
@ -39,6 +39,10 @@ class LPGTokenAdapter implements lpg.lpgjavaruntime.IToken {
|
||||||
this.kind = parserKind;
|
this.kind = parserKind;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public org.eclipse.cdt.core.parser.IToken getWrappedToken() {
|
||||||
|
return token;
|
||||||
|
}
|
||||||
|
|
||||||
public int getAdjunctIndex() {
|
public int getAdjunctIndex() {
|
||||||
return adjunctIndex;
|
return adjunctIndex;
|
||||||
}
|
}
|
||||||
|
|
|
@ -850,8 +850,10 @@ public abstract class BuildASTParserAction {
|
||||||
IASTDeclarator declarator;
|
IASTDeclarator declarator;
|
||||||
if(hasDeclarator)
|
if(hasDeclarator)
|
||||||
declarator = (IASTDeclarator) astStack.pop();
|
declarator = (IASTDeclarator) astStack.pop();
|
||||||
else
|
else {
|
||||||
declarator = nodeFactory.newDeclarator(nodeFactory.newName());
|
declarator = nodeFactory.newDeclarator(nodeFactory.newName());
|
||||||
|
setOffsetAndLength(declarator, parser.getRightIToken().getEndOffset(), 0);
|
||||||
|
}
|
||||||
|
|
||||||
IASTDeclSpecifier declSpecifier = (IASTDeclSpecifier) astStack.pop();
|
IASTDeclSpecifier declSpecifier = (IASTDeclSpecifier) astStack.pop();
|
||||||
IASTTypeId typeId = nodeFactory.newTypeId(declSpecifier, declarator);
|
IASTTypeId typeId = nodeFactory.newTypeId(declSpecifier, declarator);
|
||||||
|
|
|
@ -181,6 +181,7 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTUsingDeclaration;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTUsingDirective;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTUsingDirective;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTVisibilityLabel;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTVisibilityLabel;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTWhileStatement;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTWhileStatement;
|
||||||
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.OverloadableOperator;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -206,8 +207,8 @@ public class CPPASTNodeFactory implements ICPPASTNodeFactory {
|
||||||
return new CPPASTName();
|
return new CPPASTName();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICPPASTOperatorName newCPPOperatorName(char[] name) {
|
public ICPPASTOperatorName newCPPOperatorName(OverloadableOperator op) {
|
||||||
return new CPPASTOperatorName(name);
|
return new CPPASTOperatorName(op);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IASTProblem newProblem(int id, char[] arg, boolean error) {
|
public IASTProblem newProblem(int id, char[] arg, boolean error) {
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.core.dom.lrparser.action.cpp;
|
package org.eclipse.cdt.core.dom.lrparser.action.cpp;
|
||||||
|
|
||||||
import static org.eclipse.cdt.core.dom.lrparser.util.CollectionUtils.findFirstAndRemove;
|
import static org.eclipse.cdt.core.dom.lrparser.util.CollectionUtils.*;
|
||||||
import static org.eclipse.cdt.core.dom.lrparser.util.CollectionUtils.reverseIterable;
|
|
||||||
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.*;
|
import static org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym.*;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
@ -36,6 +36,7 @@ import org.eclipse.cdt.core.dom.ast.IASTInitializer;
|
||||||
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.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;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTPointerOperator;
|
import org.eclipse.cdt.core.dom.ast.IASTPointerOperator;
|
||||||
|
@ -84,7 +85,9 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTVisiblityLabel;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.lrparser.IParser;
|
import org.eclipse.cdt.core.dom.lrparser.IParser;
|
||||||
import org.eclipse.cdt.core.dom.lrparser.IParserActionTokenProvider;
|
import org.eclipse.cdt.core.dom.lrparser.IParserActionTokenProvider;
|
||||||
|
import org.eclipse.cdt.core.dom.lrparser.LPGTokenAdapter;
|
||||||
import org.eclipse.cdt.core.dom.lrparser.action.BuildASTParserAction;
|
import org.eclipse.cdt.core.dom.lrparser.action.BuildASTParserAction;
|
||||||
|
import org.eclipse.cdt.core.dom.lrparser.util.CollectionUtils;
|
||||||
import org.eclipse.cdt.core.dom.lrparser.util.DebugUtil;
|
import org.eclipse.cdt.core.dom.lrparser.util.DebugUtil;
|
||||||
import org.eclipse.cdt.internal.core.dom.lrparser.c99.C99ExpressionStatementParser;
|
import org.eclipse.cdt.internal.core.dom.lrparser.c99.C99ExpressionStatementParser;
|
||||||
import org.eclipse.cdt.internal.core.dom.lrparser.c99.C99Parsersym;
|
import org.eclipse.cdt.internal.core.dom.lrparser.c99.C99Parsersym;
|
||||||
|
@ -92,6 +95,7 @@ import org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPExpressionStatementPars
|
||||||
import org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPNoCastExpressionParser;
|
import org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPNoCastExpressionParser;
|
||||||
import org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym;
|
import org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPParsersym;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDeclarator;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDeclarator;
|
||||||
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.OverloadableOperator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Semantic actions that build the AST during the parse.
|
* Semantic actions that build the AST during the parse.
|
||||||
|
@ -134,36 +138,6 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// /**
|
|
||||||
// * Used only for debugging purposes.
|
|
||||||
// *
|
|
||||||
// * Use this to make expression the start symbol for the grammar,
|
|
||||||
// * it will be inserted into the translation unit inside a function.
|
|
||||||
// */
|
|
||||||
// @Deprecated public void consumeExpressionAsTranslationUnit() {
|
|
||||||
// if(TRACE_ACTIONS) DebugUtil.printMethodTrace();
|
|
||||||
//
|
|
||||||
// IASTExpression expression = (IASTExpression) astStack.pop();
|
|
||||||
//
|
|
||||||
// ICPPASTSimpleDeclSpecifier declSpec = nodeFactory.newCPPSimpleDeclSpecifier();
|
|
||||||
// declSpec.setType(IASTSimpleDeclSpecifier.t_int);
|
|
||||||
//
|
|
||||||
// IASTFunctionDeclarator declarator = nodeFactory.newFunctionDeclarator(nodeFactory.newName("main".toCharArray())); //$NON-NLS-1$
|
|
||||||
//
|
|
||||||
// IASTCompoundStatement body = nodeFactory.newCompoundStatement();
|
|
||||||
// body.addStatement(nodeFactory.newExpressionStatement(expression));
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// IASTFunctionDefinition funcDef =
|
|
||||||
// nodeFactory.newFunctionDefinition(declSpec, declarator, body);
|
|
||||||
//
|
|
||||||
// tu.addDeclaration(funcDef);
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* new_expression
|
* new_expression
|
||||||
* ::= dcolon_opt 'new' new_placement_opt new_type_id <openscope-ast> new_array_expressions_op new_initializer_opt
|
* ::= dcolon_opt 'new' new_placement_opt new_type_id <openscope-ast> new_array_expressions_op new_initializer_opt
|
||||||
|
@ -407,9 +381,10 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
|
||||||
if(TRACE_ACTIONS) DebugUtil.printMethodTrace();
|
if(TRACE_ACTIONS) DebugUtil.printMethodTrace();
|
||||||
|
|
||||||
List<IToken> tokens = parser.getRuleTokens();
|
List<IToken> tokens = parser.getRuleTokens();
|
||||||
char[] operatorName = concatenateTokens(tokens.subList(1, tokens.size()));
|
tokens = tokens.subList(1, tokens.size());
|
||||||
|
OverloadableOperator operator = getOverloadableOperator(tokens);
|
||||||
|
|
||||||
ICPPASTOperatorName name = nodeFactory.newCPPOperatorName(operatorName);
|
ICPPASTOperatorName name = nodeFactory.newCPPOperatorName(operator);
|
||||||
setOffsetAndLength(name);
|
setOffsetAndLength(name);
|
||||||
astStack.push(name);
|
astStack.push(name);
|
||||||
|
|
||||||
|
@ -417,15 +392,20 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static char[] concatenateTokens(List<IToken> tokens) {
|
private static OverloadableOperator getOverloadableOperator(List<IToken> tokens) {
|
||||||
StringBuilder sb = new StringBuilder(20); // longest operator name: operator delete[]
|
if(tokens.size() == 1) {
|
||||||
|
// TODO this is a hack that I did to save time
|
||||||
|
LPGTokenAdapter coreToken = (LPGTokenAdapter) tokens.get(0);
|
||||||
|
return OverloadableOperator.valueOf(coreToken.getWrappedToken());
|
||||||
|
}
|
||||||
|
else if(matchTokens(tokens, TK_new, TK_LeftBracket, TK_RightBracket)) {
|
||||||
|
return OverloadableOperator.NEW_ARRAY;
|
||||||
|
}
|
||||||
|
else if(matchTokens(tokens, TK_delete, TK_LeftBracket, TK_RightBracket)) {
|
||||||
|
return OverloadableOperator.DELETE_ARRAY;
|
||||||
|
}
|
||||||
|
|
||||||
for(IToken t : tokens)
|
return null;
|
||||||
sb.append(t);
|
|
||||||
|
|
||||||
char[] cs = new char[sb.length()];
|
|
||||||
sb.getChars(0, sb.length(), cs, 0);
|
|
||||||
return cs;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -448,6 +428,17 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static char[] concatenateTokens(List<IToken> tokens) {
|
||||||
|
StringBuilder sb = new StringBuilder(20); // longest operator name: operator delete[]
|
||||||
|
|
||||||
|
for(IToken t : tokens)
|
||||||
|
sb.append(t);
|
||||||
|
|
||||||
|
char[] cs = new char[sb.length()];
|
||||||
|
sb.getChars(0, sb.length(), cs, 0);
|
||||||
|
return cs;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unqualified_id
|
* unqualified_id
|
||||||
* ::= '~' class_name
|
* ::= '~' class_name
|
||||||
|
@ -1367,6 +1358,11 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
|
||||||
ICPPASTFunctionDeclarator declarator = (ICPPASTFunctionDeclarator) astStack.pop();
|
ICPPASTFunctionDeclarator declarator = (ICPPASTFunctionDeclarator) 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
|
||||||
|
declSpec = nodeFactory.newSimpleDeclSpecifier();
|
||||||
|
setOffsetAndLength(declSpec, parser.getLeftIToken().getStartOffset(), 0);
|
||||||
|
}
|
||||||
|
|
||||||
if(isTryBlockDeclarator) {
|
if(isTryBlockDeclarator) {
|
||||||
// perform a shallow copy
|
// perform a shallow copy
|
||||||
ICPPASTFunctionTryBlockDeclarator tryBlockDeclarator = nodeFactory.newFunctionTryBlockDeclarator(declarator.getName());
|
ICPPASTFunctionTryBlockDeclarator tryBlockDeclarator = nodeFactory.newFunctionTryBlockDeclarator(declarator.getName());
|
||||||
|
@ -1380,7 +1376,6 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
|
||||||
for(IASTTypeId exception : declarator.getExceptionSpecification()) {
|
for(IASTTypeId exception : declarator.getExceptionSpecification()) {
|
||||||
tryBlockDeclarator.addExceptionSpecificationTypeId(exception);
|
tryBlockDeclarator.addExceptionSpecificationTypeId(exception);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(Object handler : handlers) {
|
for(Object handler : handlers) {
|
||||||
tryBlockDeclarator.addCatchHandler((ICPPASTCatchHandler)handler);
|
tryBlockDeclarator.addCatchHandler((ICPPASTCatchHandler)handler);
|
||||||
}
|
}
|
||||||
|
@ -1388,8 +1383,16 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
|
||||||
declarator = tryBlockDeclarator;
|
declarator = tryBlockDeclarator;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(Object initializer : initializers) {
|
|
||||||
declarator.addConstructorToChain((ICPPASTConstructorChainInitializer)initializer);
|
if(initializers != null && !initializers.isEmpty()) {
|
||||||
|
for(Object initializer : initializers)
|
||||||
|
declarator.addConstructorToChain((ICPPASTConstructorChainInitializer)initializer);
|
||||||
|
|
||||||
|
// recalculate the length of the declarator to include the initializers
|
||||||
|
IASTNode lastInitializer = (IASTNode)initializers.get(initializers.size()-1);
|
||||||
|
int offset = offset(declarator);
|
||||||
|
int length = endOffset(lastInitializer) - offset;
|
||||||
|
setOffsetAndLength(declarator, offset, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
IASTFunctionDefinition definition = nodeFactory.newFunctionDefinition(declSpec, declarator, body);
|
IASTFunctionDefinition definition = nodeFactory.newFunctionDefinition(declSpec, declarator, body);
|
||||||
|
|
|
@ -53,6 +53,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTVisiblityLabel;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.lrparser.action.IASTNodeFactory;
|
import org.eclipse.cdt.core.dom.lrparser.action.IASTNodeFactory;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguousDeclaration;
|
import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguousDeclaration;
|
||||||
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.OverloadableOperator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO remove CPP from method names.
|
* TODO remove CPP from method names.
|
||||||
|
@ -62,7 +63,7 @@ import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguousDeclaration;
|
||||||
@SuppressWarnings("restriction")
|
@SuppressWarnings("restriction")
|
||||||
public interface ICPPASTNodeFactory extends IASTNodeFactory {
|
public interface ICPPASTNodeFactory extends IASTNodeFactory {
|
||||||
|
|
||||||
public ICPPASTOperatorName newCPPOperatorName(char[] name);
|
public ICPPASTOperatorName newCPPOperatorName(OverloadableOperator op);
|
||||||
|
|
||||||
public ICPPASTNewExpression newCPPNewExpression(IASTExpression placement, IASTExpression initializer, IASTTypeId typeId);
|
public ICPPASTNewExpression newCPPNewExpression(IASTExpression placement, IASTExpression initializer, IASTTypeId typeId);
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@ 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.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.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.IASTEnumerationSpecifier.IASTEnumerator;
|
||||||
|
@ -51,16 +52,18 @@ import org.eclipse.cdt.internal.core.dom.parser.ITypeContainer;
|
||||||
*
|
*
|
||||||
* @author Mike Kucera
|
* @author Mike Kucera
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("restriction")
|
@SuppressWarnings({"restriction","nls"})
|
||||||
class ASTPrinter {
|
class ASTPrinter {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prints the AST to the given PrintStream.
|
* Prints the AST to the given PrintStream.
|
||||||
*/
|
*/
|
||||||
public static void printAST(IASTTranslationUnit root, PrintStream stream) {
|
public static void printAST(IASTTranslationUnit root, PrintStream stream) {
|
||||||
PrintStream out = stream == null ? System.out : stream;
|
PrintStream out = stream == null ? System.out : stream;
|
||||||
if(root == null) {
|
if(root == null) {
|
||||||
out.println("null"); //$NON-NLS-1$
|
out.println("null");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,7 +106,7 @@ class ASTPrinter {
|
||||||
public static void printProblems(IASTTranslationUnit root, PrintStream stream) {
|
public static void printProblems(IASTTranslationUnit root, PrintStream stream) {
|
||||||
PrintStream out = stream == null ? System.out : stream;
|
PrintStream out = stream == null ? System.out : stream;
|
||||||
if(root == null) {
|
if(root == null) {
|
||||||
out.println("null");//$NON-NLS-1$
|
out.println("null");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,10 +128,10 @@ class ASTPrinter {
|
||||||
|
|
||||||
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(" "); //$NON-NLS-1$
|
out.print(" ");
|
||||||
|
|
||||||
if(n == null) {
|
if(n == null) {
|
||||||
out.println("NULL"); //$NON-NLS-1$
|
out.println("NULL");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,18 +140,18 @@ class ASTPrinter {
|
||||||
|
|
||||||
if(n instanceof ASTNode) {
|
if(n instanceof ASTNode) {
|
||||||
ASTNode node = (ASTNode) n;
|
ASTNode node = (ASTNode) n;
|
||||||
out.print(" (" + node.getOffset() + "," + node.getLength() + ") "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
out.print(" (" + node.getOffset() + "," + node.getLength() + ") "); //$NON-NLS-2$ //$NON-NLS-3$
|
||||||
if(node.getParent() == null && !(node instanceof IASTTranslationUnit)) {
|
if(node.getParent() == null && !(node instanceof IASTTranslationUnit)) {
|
||||||
out.print("PARENT IS NULL ");//$NON-NLS-1$
|
out.print("PARENT IS NULL ");
|
||||||
}
|
}
|
||||||
//out.print(node.getPropertyInParent());
|
out.print(node.getPropertyInParent());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(n instanceof ICArrayType) {
|
if(n instanceof ICArrayType) {
|
||||||
ICArrayType at = (ICArrayType)n;
|
ICArrayType at = (ICArrayType)n;
|
||||||
try {
|
try {
|
||||||
if(at.isRestrict()) {
|
if(at.isRestrict()) {
|
||||||
out.print(" restrict"); //$NON-NLS-1$
|
out.print(" restrict");
|
||||||
}
|
}
|
||||||
} catch (DOMException e) {
|
} catch (DOMException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -156,26 +159,26 @@ class ASTPrinter {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(n instanceof IASTName) {
|
if(n instanceof IASTName) {
|
||||||
out.print(" " + ((IASTName)n).toString()); //$NON-NLS-1$
|
out.print(" " + ((IASTName)n).toString());
|
||||||
}
|
}
|
||||||
else if(n instanceof ICASTPointer) {
|
else if(n instanceof ICASTPointer) {
|
||||||
ICASTPointer pointer = (ICASTPointer) n;
|
ICASTPointer pointer = (ICASTPointer) n;
|
||||||
if(pointer.isConst())
|
if(pointer.isConst())
|
||||||
out.print(" const"); //$NON-NLS-1$
|
out.print(" const");
|
||||||
if(pointer.isVolatile())
|
if(pointer.isVolatile())
|
||||||
out.print(" volatile"); //$NON-NLS-1$
|
out.print(" volatile");
|
||||||
if(pointer.isRestrict())
|
if(pointer.isRestrict())
|
||||||
out.print(" restrict");//$NON-NLS-1$
|
out.print(" restrict");
|
||||||
}
|
}
|
||||||
else if(n instanceof ICPointerType) {
|
else if(n instanceof ICPointerType) {
|
||||||
ICPointerType pointer = (ICPointerType)n;
|
ICPointerType pointer = (ICPointerType)n;
|
||||||
try {
|
try {
|
||||||
if(pointer.isConst())
|
if(pointer.isConst())
|
||||||
out.print(" const"); //$NON-NLS-1$
|
out.print(" const");
|
||||||
if(pointer.isVolatile())
|
if(pointer.isVolatile())
|
||||||
out.print(" volatile"); //$NON-NLS-1$
|
out.print(" volatile");
|
||||||
if(pointer.isRestrict())
|
if(pointer.isRestrict())
|
||||||
out.print(" restrict");//$NON-NLS-1$
|
out.print(" restrict");
|
||||||
} catch (DOMException e) {
|
} catch (DOMException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -186,7 +189,7 @@ class ASTPrinter {
|
||||||
}
|
}
|
||||||
else if(n instanceof ICASTArrayModifier) {
|
else if(n instanceof ICASTArrayModifier) {
|
||||||
if(((ICASTArrayModifier)n).isRestrict()) {
|
if(((ICASTArrayModifier)n).isRestrict()) {
|
||||||
out.print(" restrict"); //$NON-NLS-1$
|
out.print(" restrict");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(n instanceof IASTComment) {
|
else if(n instanceof IASTComment) {
|
||||||
|
@ -224,6 +227,10 @@ class ASTPrinter {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
else if(n instanceof IProblemBinding) {
|
||||||
|
IProblemBinding problem = (IProblemBinding)n;
|
||||||
|
out.print(problem.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
out.println();
|
out.println();
|
||||||
|
@ -241,23 +248,27 @@ class ASTPrinter {
|
||||||
shouldVisitExpressions = true;
|
shouldVisitExpressions = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int visit(IASTProblem problem) {
|
public int visit(IASTProblem problem) {
|
||||||
print(out, 1, problem);
|
print(out, 1, problem);
|
||||||
return PROCESS_CONTINUE;
|
return PROCESS_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int visit(IASTDeclaration declaration) {
|
public int visit(IASTDeclaration declaration) {
|
||||||
if(declaration instanceof IASTProblemDeclaration)
|
if(declaration instanceof IASTProblemDeclaration)
|
||||||
print(out, 0, declaration);
|
print(out, 0, declaration);
|
||||||
return PROCESS_CONTINUE;
|
return PROCESS_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int visit(IASTExpression expression) {
|
public int visit(IASTExpression expression) {
|
||||||
if(expression instanceof IASTProblemExpression)
|
if(expression instanceof IASTProblemExpression)
|
||||||
print(out, 0, expression);
|
print(out, 0, expression);
|
||||||
return PROCESS_CONTINUE;
|
return PROCESS_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int visit(IASTStatement statement) {
|
public int visit(IASTStatement statement) {
|
||||||
if(statement instanceof IASTProblemStatement)
|
if(statement instanceof IASTProblemStatement)
|
||||||
print(out, 0, statement);
|
print(out, 0, statement);
|
||||||
|
@ -298,24 +309,28 @@ class ASTPrinter {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
public int visit(IASTComment comment) {
|
public int visit(IASTComment comment) {
|
||||||
print(comment);
|
print(comment);
|
||||||
indentLevel++;
|
indentLevel++;
|
||||||
return super.visit(comment);
|
return super.visit(comment);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int visit(ICASTDesignator designator) {
|
public int visit(ICASTDesignator designator) {
|
||||||
print(designator);
|
print(designator);
|
||||||
indentLevel++;
|
indentLevel++;
|
||||||
return super.visit(designator);
|
return super.visit(designator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int visit(IASTDeclaration declaration) {
|
public int visit(IASTDeclaration declaration) {
|
||||||
print(declaration);
|
print(declaration);
|
||||||
indentLevel++;
|
indentLevel++;
|
||||||
return super.visit(declaration);
|
return super.visit(declaration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int visit(IASTDeclarator declarator) {
|
public int visit(IASTDeclarator declarator) {
|
||||||
print(declarator);
|
print(declarator);
|
||||||
indentLevel++;
|
indentLevel++;
|
||||||
|
@ -327,146 +342,172 @@ class ASTPrinter {
|
||||||
IASTArrayDeclarator decl = (IASTArrayDeclarator)declarator;
|
IASTArrayDeclarator decl = (IASTArrayDeclarator)declarator;
|
||||||
org.eclipse.cdt.core.dom.ast.IASTArrayModifier[] modifiers = decl.getArrayModifiers();
|
org.eclipse.cdt.core.dom.ast.IASTArrayModifier[] modifiers = decl.getArrayModifiers();
|
||||||
for(int i = 0; i < modifiers.length; i++) {
|
for(int i = 0; i < modifiers.length; i++) {
|
||||||
print((IASTNode)modifiers[i]);
|
print(modifiers[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return super.visit(declarator);
|
return super.visit(declarator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int visit(IASTDeclSpecifier declSpec) {
|
public int visit(IASTDeclSpecifier declSpec) {
|
||||||
print(declSpec);
|
print(declSpec);
|
||||||
indentLevel++;
|
indentLevel++;
|
||||||
return super.visit(declSpec);
|
return super.visit(declSpec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int visit(IASTEnumerator enumerator) {
|
public int visit(IASTEnumerator enumerator) {
|
||||||
print(enumerator);
|
print(enumerator);
|
||||||
indentLevel++;
|
indentLevel++;
|
||||||
return super.visit(enumerator);
|
return super.visit(enumerator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int visit(IASTExpression expression) {
|
public int visit(IASTExpression expression) {
|
||||||
print(expression);
|
print(expression);
|
||||||
indentLevel++;
|
indentLevel++;
|
||||||
return super.visit(expression);
|
return super.visit(expression);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int visit(IASTInitializer initializer) {
|
public int visit(IASTInitializer initializer) {
|
||||||
print(initializer);
|
print(initializer);
|
||||||
indentLevel++;
|
indentLevel++;
|
||||||
return super.visit(initializer);
|
return super.visit(initializer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int visit(IASTName name) {
|
public int visit(IASTName name) {
|
||||||
print(name);
|
print(name);
|
||||||
IBinding binding = name.resolveBinding();
|
try {
|
||||||
print(binding);
|
IBinding binding = name.resolveBinding();
|
||||||
|
print(binding);
|
||||||
|
} catch(Exception e) {
|
||||||
|
System.out.println("Exception while resolving binding: " + name);
|
||||||
|
}
|
||||||
|
|
||||||
indentLevel++;
|
indentLevel++;
|
||||||
return super.visit(name);
|
return super.visit(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int visit(IASTParameterDeclaration parameterDeclaration) {
|
public int visit(IASTParameterDeclaration parameterDeclaration) {
|
||||||
print(parameterDeclaration);
|
print(parameterDeclaration);
|
||||||
indentLevel++;
|
indentLevel++;
|
||||||
return super.visit(parameterDeclaration);
|
return super.visit(parameterDeclaration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int visit(IASTProblem problem) {
|
public int visit(IASTProblem problem) {
|
||||||
print(problem);
|
print(problem);
|
||||||
indentLevel++;
|
indentLevel++;
|
||||||
return super.visit(problem);
|
return super.visit(problem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int visit(IASTStatement statement) {
|
public int visit(IASTStatement statement) {
|
||||||
print(statement);
|
print(statement);
|
||||||
indentLevel++;
|
indentLevel++;
|
||||||
return super.visit(statement);
|
return super.visit(statement);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int visit(IASTTranslationUnit tu) {
|
public int visit(IASTTranslationUnit tu) {
|
||||||
print(tu);
|
print(tu);
|
||||||
indentLevel++;
|
indentLevel++;
|
||||||
return super.visit(tu);
|
return super.visit(tu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int visit(IASTTypeId typeId) {
|
public int visit(IASTTypeId typeId) {
|
||||||
print(typeId);
|
print(typeId);
|
||||||
indentLevel++;
|
indentLevel++;
|
||||||
return super.visit(typeId);
|
return super.visit(typeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int leave(IASTComment comment) {
|
public int leave(IASTComment comment) {
|
||||||
indentLevel--;
|
indentLevel--;
|
||||||
return super.leave(comment);
|
return super.leave(comment);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int leave(ICASTDesignator designator) {
|
public int leave(ICASTDesignator designator) {
|
||||||
indentLevel--;
|
indentLevel--;
|
||||||
return super.leave(designator);
|
return super.leave(designator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int leave(IASTDeclaration declaration) {
|
public int leave(IASTDeclaration declaration) {
|
||||||
indentLevel--;
|
indentLevel--;
|
||||||
return super.leave(declaration);
|
return super.leave(declaration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int leave(IASTDeclarator declarator) {
|
public int leave(IASTDeclarator declarator) {
|
||||||
indentLevel--;
|
indentLevel--;
|
||||||
return super.leave(declarator);
|
return super.leave(declarator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int leave(IASTDeclSpecifier declSpec) {
|
public int leave(IASTDeclSpecifier declSpec) {
|
||||||
indentLevel--;
|
indentLevel--;
|
||||||
return super.leave(declSpec);
|
return super.leave(declSpec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int leave(IASTEnumerator enumerator) {
|
public int leave(IASTEnumerator enumerator) {
|
||||||
indentLevel--;
|
indentLevel--;
|
||||||
return super.leave(enumerator);
|
return super.leave(enumerator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int leave(IASTExpression expression) {
|
public int leave(IASTExpression expression) {
|
||||||
indentLevel--;
|
indentLevel--;
|
||||||
return super.leave(expression);
|
return super.leave(expression);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int leave(IASTInitializer initializer) {
|
public int leave(IASTInitializer initializer) {
|
||||||
indentLevel--;
|
indentLevel--;
|
||||||
return super.leave(initializer);
|
return super.leave(initializer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int leave(IASTName name) {
|
public int leave(IASTName name) {
|
||||||
indentLevel--;
|
indentLevel--;
|
||||||
return super.leave(name);
|
return super.leave(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int leave(IASTParameterDeclaration parameterDeclaration) {
|
public int leave(IASTParameterDeclaration parameterDeclaration) {
|
||||||
indentLevel--;
|
indentLevel--;
|
||||||
return super.leave(parameterDeclaration);
|
return super.leave(parameterDeclaration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int leave(IASTProblem problem) {
|
public int leave(IASTProblem problem) {
|
||||||
indentLevel--;
|
indentLevel--;
|
||||||
return super.leave(problem);
|
return super.leave(problem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int leave(IASTStatement statement) {
|
public int leave(IASTStatement statement) {
|
||||||
indentLevel--;
|
indentLevel--;
|
||||||
return super.leave(statement);
|
return super.leave(statement);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int leave(IASTTranslationUnit tu) {
|
public int leave(IASTTranslationUnit tu) {
|
||||||
indentLevel--;
|
indentLevel--;
|
||||||
return super.leave(tu);
|
return super.leave(tu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int leave(IASTTypeId typeId) {
|
public int leave(IASTTypeId typeId) {
|
||||||
indentLevel--;
|
indentLevel--;
|
||||||
return super.leave(typeId);
|
return super.leave(typeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
File diff suppressed because it is too large
Load diff
|
@ -15,38 +15,38 @@ package org.eclipse.cdt.internal.core.dom.lrparser.cpp;
|
||||||
|
|
||||||
public interface CPPExpressionStatementParsersym {
|
public interface CPPExpressionStatementParsersym {
|
||||||
public final static int
|
public final static int
|
||||||
TK_asm = 68,
|
TK_asm = 67,
|
||||||
TK_auto = 48,
|
TK_auto = 48,
|
||||||
TK_bool = 13,
|
TK_bool = 13,
|
||||||
TK_break = 78,
|
TK_break = 76,
|
||||||
TK_case = 79,
|
TK_case = 77,
|
||||||
TK_catch = 115,
|
TK_catch = 115,
|
||||||
TK_char = 14,
|
TK_char = 14,
|
||||||
TK_class = 58,
|
TK_class = 57,
|
||||||
TK_const = 46,
|
TK_const = 46,
|
||||||
TK_const_cast = 26,
|
TK_const_cast = 26,
|
||||||
TK_continue = 80,
|
TK_continue = 78,
|
||||||
TK_default = 81,
|
TK_default = 79,
|
||||||
TK_delete = 40,
|
TK_delete = 40,
|
||||||
TK_do = 82,
|
TK_do = 80,
|
||||||
TK_double = 15,
|
TK_double = 15,
|
||||||
TK_dynamic_cast = 27,
|
TK_dynamic_cast = 27,
|
||||||
TK_else = 120,
|
TK_else = 120,
|
||||||
TK_enum = 60,
|
TK_enum = 59,
|
||||||
TK_explicit = 49,
|
TK_explicit = 49,
|
||||||
TK_export = 74,
|
TK_export = 74,
|
||||||
TK_extern = 42,
|
TK_extern = 42,
|
||||||
TK_false = 28,
|
TK_false = 28,
|
||||||
TK_float = 16,
|
TK_float = 16,
|
||||||
TK_for = 83,
|
TK_for = 81,
|
||||||
TK_friend = 50,
|
TK_friend = 50,
|
||||||
TK_goto = 84,
|
TK_goto = 82,
|
||||||
TK_if = 85,
|
TK_if = 83,
|
||||||
TK_inline = 51,
|
TK_inline = 51,
|
||||||
TK_int = 17,
|
TK_int = 17,
|
||||||
TK_long = 18,
|
TK_long = 18,
|
||||||
TK_mutable = 52,
|
TK_mutable = 52,
|
||||||
TK_namespace = 66,
|
TK_namespace = 65,
|
||||||
TK_new = 41,
|
TK_new = 41,
|
||||||
TK_operator = 6,
|
TK_operator = 6,
|
||||||
TK_private = 116,
|
TK_private = 116,
|
||||||
|
@ -54,14 +54,14 @@ public interface CPPExpressionStatementParsersym {
|
||||||
TK_public = 118,
|
TK_public = 118,
|
||||||
TK_register = 53,
|
TK_register = 53,
|
||||||
TK_reinterpret_cast = 29,
|
TK_reinterpret_cast = 29,
|
||||||
TK_return = 86,
|
TK_return = 84,
|
||||||
TK_short = 19,
|
TK_short = 19,
|
||||||
TK_signed = 20,
|
TK_signed = 20,
|
||||||
TK_sizeof = 30,
|
TK_sizeof = 30,
|
||||||
TK_static = 54,
|
TK_static = 54,
|
||||||
TK_static_cast = 31,
|
TK_static_cast = 31,
|
||||||
TK_struct = 61,
|
TK_struct = 60,
|
||||||
TK_switch = 87,
|
TK_switch = 85,
|
||||||
TK_template = 55,
|
TK_template = 55,
|
||||||
TK_this = 32,
|
TK_this = 32,
|
||||||
TK_throw = 39,
|
TK_throw = 39,
|
||||||
|
@ -69,8 +69,8 @@ public interface CPPExpressionStatementParsersym {
|
||||||
TK_true = 33,
|
TK_true = 33,
|
||||||
TK_typedef = 56,
|
TK_typedef = 56,
|
||||||
TK_typeid = 34,
|
TK_typeid = 34,
|
||||||
TK_typename = 10,
|
TK_typename = 8,
|
||||||
TK_union = 62,
|
TK_union = 61,
|
||||||
TK_unsigned = 21,
|
TK_unsigned = 21,
|
||||||
TK_using = 64,
|
TK_using = 64,
|
||||||
TK_virtual = 45,
|
TK_virtual = 45,
|
||||||
|
@ -86,9 +86,9 @@ public interface CPPExpressionStatementParsersym {
|
||||||
TK_Completion = 121,
|
TK_Completion = 121,
|
||||||
TK_EndOfCompletion = 122,
|
TK_EndOfCompletion = 122,
|
||||||
TK_Invalid = 123,
|
TK_Invalid = 123,
|
||||||
TK_LeftBracket = 57,
|
TK_LeftBracket = 62,
|
||||||
TK_LeftParen = 2,
|
TK_LeftParen = 2,
|
||||||
TK_LeftBrace = 59,
|
TK_LeftBrace = 63,
|
||||||
TK_Dot = 114,
|
TK_Dot = 114,
|
||||||
TK_DotStar = 94,
|
TK_DotStar = 94,
|
||||||
TK_Arrow = 101,
|
TK_Arrow = 101,
|
||||||
|
@ -97,16 +97,16 @@ public interface CPPExpressionStatementParsersym {
|
||||||
TK_MinusMinus = 12,
|
TK_MinusMinus = 12,
|
||||||
TK_And = 7,
|
TK_And = 7,
|
||||||
TK_Star = 5,
|
TK_Star = 5,
|
||||||
TK_Plus = 8,
|
TK_Plus = 9,
|
||||||
TK_Minus = 9,
|
TK_Minus = 10,
|
||||||
TK_Tilde = 4,
|
TK_Tilde = 4,
|
||||||
TK_Bang = 25,
|
TK_Bang = 25,
|
||||||
TK_Slash = 89,
|
TK_Slash = 89,
|
||||||
TK_Percent = 90,
|
TK_Percent = 90,
|
||||||
TK_RightShift = 76,
|
TK_RightShift = 86,
|
||||||
TK_LeftShift = 77,
|
TK_LeftShift = 87,
|
||||||
TK_LT = 63,
|
TK_LT = 58,
|
||||||
TK_GT = 65,
|
TK_GT = 66,
|
||||||
TK_LE = 91,
|
TK_LE = 91,
|
||||||
TK_GE = 92,
|
TK_GE = 92,
|
||||||
TK_EQ = 95,
|
TK_EQ = 95,
|
||||||
|
@ -130,11 +130,11 @@ public interface CPPExpressionStatementParsersym {
|
||||||
TK_AndAssign = 109,
|
TK_AndAssign = 109,
|
||||||
TK_CaretAssign = 110,
|
TK_CaretAssign = 110,
|
||||||
TK_OrAssign = 111,
|
TK_OrAssign = 111,
|
||||||
TK_Comma = 67,
|
TK_Comma = 68,
|
||||||
TK_zero = 38,
|
TK_zero = 38,
|
||||||
TK_RightBracket = 113,
|
TK_RightBracket = 113,
|
||||||
TK_RightParen = 71,
|
TK_RightParen = 72,
|
||||||
TK_RightBrace = 72,
|
TK_RightBrace = 71,
|
||||||
TK_SemiColon = 43,
|
TK_SemiColon = 43,
|
||||||
TK_ERROR_TOKEN = 44,
|
TK_ERROR_TOKEN = 44,
|
||||||
TK_EOF_TOKEN = 119;
|
TK_EOF_TOKEN = 119;
|
||||||
|
@ -148,9 +148,9 @@ public interface CPPExpressionStatementParsersym {
|
||||||
"Star",
|
"Star",
|
||||||
"operator",
|
"operator",
|
||||||
"And",
|
"And",
|
||||||
|
"typename",
|
||||||
"Plus",
|
"Plus",
|
||||||
"Minus",
|
"Minus",
|
||||||
"typename",
|
|
||||||
"PlusPlus",
|
"PlusPlus",
|
||||||
"MinusMinus",
|
"MinusMinus",
|
||||||
"bool",
|
"bool",
|
||||||
|
@ -197,27 +197,25 @@ public interface CPPExpressionStatementParsersym {
|
||||||
"static",
|
"static",
|
||||||
"template",
|
"template",
|
||||||
"typedef",
|
"typedef",
|
||||||
"LeftBracket",
|
|
||||||
"class",
|
"class",
|
||||||
"LeftBrace",
|
"LT",
|
||||||
"enum",
|
"enum",
|
||||||
"struct",
|
"struct",
|
||||||
"union",
|
"union",
|
||||||
"LT",
|
"LeftBracket",
|
||||||
|
"LeftBrace",
|
||||||
"using",
|
"using",
|
||||||
"GT",
|
|
||||||
"namespace",
|
"namespace",
|
||||||
"Comma",
|
"GT",
|
||||||
"asm",
|
"asm",
|
||||||
|
"Comma",
|
||||||
"Assign",
|
"Assign",
|
||||||
"Colon",
|
"Colon",
|
||||||
"RightParen",
|
|
||||||
"RightBrace",
|
"RightBrace",
|
||||||
|
"RightParen",
|
||||||
"try",
|
"try",
|
||||||
"export",
|
"export",
|
||||||
"while",
|
"while",
|
||||||
"RightShift",
|
|
||||||
"LeftShift",
|
|
||||||
"break",
|
"break",
|
||||||
"case",
|
"case",
|
||||||
"continue",
|
"continue",
|
||||||
|
@ -228,6 +226,8 @@ public interface CPPExpressionStatementParsersym {
|
||||||
"if",
|
"if",
|
||||||
"return",
|
"return",
|
||||||
"switch",
|
"switch",
|
||||||
|
"RightShift",
|
||||||
|
"LeftShift",
|
||||||
"ArrowStar",
|
"ArrowStar",
|
||||||
"Slash",
|
"Slash",
|
||||||
"Percent",
|
"Percent",
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -15,20 +15,20 @@ 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 = 68,
|
TK_asm = 67,
|
||||||
TK_auto = 49,
|
TK_auto = 49,
|
||||||
TK_bool = 13,
|
TK_bool = 13,
|
||||||
TK_break = 78,
|
TK_break = 76,
|
||||||
TK_case = 79,
|
TK_case = 77,
|
||||||
TK_catch = 116,
|
TK_catch = 116,
|
||||||
TK_char = 14,
|
TK_char = 14,
|
||||||
TK_class = 58,
|
TK_class = 58,
|
||||||
TK_const = 46,
|
TK_const = 46,
|
||||||
TK_const_cast = 26,
|
TK_const_cast = 26,
|
||||||
TK_continue = 80,
|
TK_continue = 78,
|
||||||
TK_default = 81,
|
TK_default = 79,
|
||||||
TK_delete = 40,
|
TK_delete = 40,
|
||||||
TK_do = 82,
|
TK_do = 80,
|
||||||
TK_double = 15,
|
TK_double = 15,
|
||||||
TK_dynamic_cast = 27,
|
TK_dynamic_cast = 27,
|
||||||
TK_else = 120,
|
TK_else = 120,
|
||||||
|
@ -38,15 +38,15 @@ public interface CPPNoCastExpressionParsersym {
|
||||||
TK_extern = 42,
|
TK_extern = 42,
|
||||||
TK_false = 28,
|
TK_false = 28,
|
||||||
TK_float = 16,
|
TK_float = 16,
|
||||||
TK_for = 83,
|
TK_for = 81,
|
||||||
TK_friend = 51,
|
TK_friend = 51,
|
||||||
TK_goto = 84,
|
TK_goto = 82,
|
||||||
TK_if = 85,
|
TK_if = 83,
|
||||||
TK_inline = 52,
|
TK_inline = 52,
|
||||||
TK_int = 17,
|
TK_int = 17,
|
||||||
TK_long = 18,
|
TK_long = 18,
|
||||||
TK_mutable = 53,
|
TK_mutable = 53,
|
||||||
TK_namespace = 66,
|
TK_namespace = 65,
|
||||||
TK_new = 41,
|
TK_new = 41,
|
||||||
TK_operator = 6,
|
TK_operator = 6,
|
||||||
TK_private = 117,
|
TK_private = 117,
|
||||||
|
@ -54,14 +54,14 @@ public interface CPPNoCastExpressionParsersym {
|
||||||
TK_public = 119,
|
TK_public = 119,
|
||||||
TK_register = 54,
|
TK_register = 54,
|
||||||
TK_reinterpret_cast = 29,
|
TK_reinterpret_cast = 29,
|
||||||
TK_return = 86,
|
TK_return = 84,
|
||||||
TK_short = 19,
|
TK_short = 19,
|
||||||
TK_signed = 20,
|
TK_signed = 20,
|
||||||
TK_sizeof = 30,
|
TK_sizeof = 30,
|
||||||
TK_static = 55,
|
TK_static = 55,
|
||||||
TK_static_cast = 31,
|
TK_static_cast = 31,
|
||||||
TK_struct = 62,
|
TK_struct = 62,
|
||||||
TK_switch = 87,
|
TK_switch = 85,
|
||||||
TK_template = 47,
|
TK_template = 47,
|
||||||
TK_this = 32,
|
TK_this = 32,
|
||||||
TK_throw = 39,
|
TK_throw = 39,
|
||||||
|
@ -69,7 +69,7 @@ public interface CPPNoCastExpressionParsersym {
|
||||||
TK_true = 33,
|
TK_true = 33,
|
||||||
TK_typedef = 56,
|
TK_typedef = 56,
|
||||||
TK_typeid = 34,
|
TK_typeid = 34,
|
||||||
TK_typename = 10,
|
TK_typename = 8,
|
||||||
TK_union = 63,
|
TK_union = 63,
|
||||||
TK_unsigned = 21,
|
TK_unsigned = 21,
|
||||||
TK_using = 64,
|
TK_using = 64,
|
||||||
|
@ -86,9 +86,9 @@ public interface CPPNoCastExpressionParsersym {
|
||||||
TK_Completion = 121,
|
TK_Completion = 121,
|
||||||
TK_EndOfCompletion = 122,
|
TK_EndOfCompletion = 122,
|
||||||
TK_Invalid = 123,
|
TK_Invalid = 123,
|
||||||
TK_LeftBracket = 57,
|
TK_LeftBracket = 59,
|
||||||
TK_LeftParen = 2,
|
TK_LeftParen = 2,
|
||||||
TK_LeftBrace = 59,
|
TK_LeftBrace = 60,
|
||||||
TK_Dot = 115,
|
TK_Dot = 115,
|
||||||
TK_DotStar = 94,
|
TK_DotStar = 94,
|
||||||
TK_Arrow = 101,
|
TK_Arrow = 101,
|
||||||
|
@ -97,16 +97,16 @@ public interface CPPNoCastExpressionParsersym {
|
||||||
TK_MinusMinus = 12,
|
TK_MinusMinus = 12,
|
||||||
TK_And = 7,
|
TK_And = 7,
|
||||||
TK_Star = 5,
|
TK_Star = 5,
|
||||||
TK_Plus = 8,
|
TK_Plus = 9,
|
||||||
TK_Minus = 9,
|
TK_Minus = 10,
|
||||||
TK_Tilde = 4,
|
TK_Tilde = 4,
|
||||||
TK_Bang = 25,
|
TK_Bang = 25,
|
||||||
TK_Slash = 89,
|
TK_Slash = 89,
|
||||||
TK_Percent = 90,
|
TK_Percent = 90,
|
||||||
TK_RightShift = 76,
|
TK_RightShift = 86,
|
||||||
TK_LeftShift = 77,
|
TK_LeftShift = 87,
|
||||||
TK_LT = 60,
|
TK_LT = 57,
|
||||||
TK_GT = 65,
|
TK_GT = 66,
|
||||||
TK_LE = 91,
|
TK_LE = 91,
|
||||||
TK_GE = 92,
|
TK_GE = 92,
|
||||||
TK_EQ = 95,
|
TK_EQ = 95,
|
||||||
|
@ -130,7 +130,7 @@ public interface CPPNoCastExpressionParsersym {
|
||||||
TK_AndAssign = 109,
|
TK_AndAssign = 109,
|
||||||
TK_CaretAssign = 110,
|
TK_CaretAssign = 110,
|
||||||
TK_OrAssign = 111,
|
TK_OrAssign = 111,
|
||||||
TK_Comma = 67,
|
TK_Comma = 68,
|
||||||
TK_zero = 38,
|
TK_zero = 38,
|
||||||
TK_RightBracket = 113,
|
TK_RightBracket = 113,
|
||||||
TK_RightParen = 72,
|
TK_RightParen = 72,
|
||||||
|
@ -148,9 +148,9 @@ public interface CPPNoCastExpressionParsersym {
|
||||||
"Star",
|
"Star",
|
||||||
"operator",
|
"operator",
|
||||||
"And",
|
"And",
|
||||||
|
"typename",
|
||||||
"Plus",
|
"Plus",
|
||||||
"Minus",
|
"Minus",
|
||||||
"typename",
|
|
||||||
"PlusPlus",
|
"PlusPlus",
|
||||||
"MinusMinus",
|
"MinusMinus",
|
||||||
"bool",
|
"bool",
|
||||||
|
@ -197,18 +197,18 @@ public interface CPPNoCastExpressionParsersym {
|
||||||
"register",
|
"register",
|
||||||
"static",
|
"static",
|
||||||
"typedef",
|
"typedef",
|
||||||
"LeftBracket",
|
|
||||||
"class",
|
|
||||||
"LeftBrace",
|
|
||||||
"LT",
|
"LT",
|
||||||
|
"class",
|
||||||
|
"LeftBracket",
|
||||||
|
"LeftBrace",
|
||||||
"enum",
|
"enum",
|
||||||
"struct",
|
"struct",
|
||||||
"union",
|
"union",
|
||||||
"using",
|
"using",
|
||||||
"GT",
|
|
||||||
"namespace",
|
"namespace",
|
||||||
"Comma",
|
"GT",
|
||||||
"asm",
|
"asm",
|
||||||
|
"Comma",
|
||||||
"Assign",
|
"Assign",
|
||||||
"Colon",
|
"Colon",
|
||||||
"RightBrace",
|
"RightBrace",
|
||||||
|
@ -216,8 +216,6 @@ public interface CPPNoCastExpressionParsersym {
|
||||||
"try",
|
"try",
|
||||||
"export",
|
"export",
|
||||||
"while",
|
"while",
|
||||||
"RightShift",
|
|
||||||
"LeftShift",
|
|
||||||
"break",
|
"break",
|
||||||
"case",
|
"case",
|
||||||
"continue",
|
"continue",
|
||||||
|
@ -228,6 +226,8 @@ public interface CPPNoCastExpressionParsersym {
|
||||||
"if",
|
"if",
|
||||||
"return",
|
"return",
|
||||||
"switch",
|
"switch",
|
||||||
|
"RightShift",
|
||||||
|
"LeftShift",
|
||||||
"ArrowStar",
|
"ArrowStar",
|
||||||
"Slash",
|
"Slash",
|
||||||
"Percent",
|
"Percent",
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -18,35 +18,35 @@ public interface CPPParsersym {
|
||||||
TK_asm = 66,
|
TK_asm = 66,
|
||||||
TK_auto = 48,
|
TK_auto = 48,
|
||||||
TK_bool = 11,
|
TK_bool = 11,
|
||||||
TK_break = 78,
|
TK_break = 76,
|
||||||
TK_case = 79,
|
TK_case = 77,
|
||||||
TK_catch = 115,
|
TK_catch = 115,
|
||||||
TK_char = 12,
|
TK_char = 12,
|
||||||
TK_class = 57,
|
TK_class = 57,
|
||||||
TK_const = 46,
|
TK_const = 46,
|
||||||
TK_const_cast = 26,
|
TK_const_cast = 26,
|
||||||
TK_continue = 80,
|
TK_continue = 78,
|
||||||
TK_default = 81,
|
TK_default = 79,
|
||||||
TK_delete = 41,
|
TK_delete = 41,
|
||||||
TK_do = 82,
|
TK_do = 80,
|
||||||
TK_double = 13,
|
TK_double = 13,
|
||||||
TK_dynamic_cast = 27,
|
TK_dynamic_cast = 27,
|
||||||
TK_else = 120,
|
TK_else = 120,
|
||||||
TK_enum = 59,
|
TK_enum = 59,
|
||||||
TK_explicit = 49,
|
TK_explicit = 49,
|
||||||
TK_export = 73,
|
TK_export = 72,
|
||||||
TK_extern = 40,
|
TK_extern = 40,
|
||||||
TK_false = 28,
|
TK_false = 28,
|
||||||
TK_float = 14,
|
TK_float = 14,
|
||||||
TK_for = 83,
|
TK_for = 81,
|
||||||
TK_friend = 50,
|
TK_friend = 50,
|
||||||
TK_goto = 84,
|
TK_goto = 82,
|
||||||
TK_if = 85,
|
TK_if = 83,
|
||||||
TK_inline = 51,
|
TK_inline = 51,
|
||||||
TK_int = 15,
|
TK_int = 15,
|
||||||
TK_long = 16,
|
TK_long = 16,
|
||||||
TK_mutable = 52,
|
TK_mutable = 52,
|
||||||
TK_namespace = 64,
|
TK_namespace = 63,
|
||||||
TK_new = 42,
|
TK_new = 42,
|
||||||
TK_operator = 6,
|
TK_operator = 6,
|
||||||
TK_private = 116,
|
TK_private = 116,
|
||||||
|
@ -54,14 +54,14 @@ public interface CPPParsersym {
|
||||||
TK_public = 118,
|
TK_public = 118,
|
||||||
TK_register = 53,
|
TK_register = 53,
|
||||||
TK_reinterpret_cast = 29,
|
TK_reinterpret_cast = 29,
|
||||||
TK_return = 86,
|
TK_return = 84,
|
||||||
TK_short = 17,
|
TK_short = 17,
|
||||||
TK_signed = 18,
|
TK_signed = 18,
|
||||||
TK_sizeof = 30,
|
TK_sizeof = 30,
|
||||||
TK_static = 54,
|
TK_static = 54,
|
||||||
TK_static_cast = 31,
|
TK_static_cast = 31,
|
||||||
TK_struct = 60,
|
TK_struct = 60,
|
||||||
TK_switch = 87,
|
TK_switch = 85,
|
||||||
TK_template = 55,
|
TK_template = 55,
|
||||||
TK_this = 32,
|
TK_this = 32,
|
||||||
TK_throw = 39,
|
TK_throw = 39,
|
||||||
|
@ -86,9 +86,9 @@ public interface CPPParsersym {
|
||||||
TK_Completion = 121,
|
TK_Completion = 121,
|
||||||
TK_EndOfCompletion = 122,
|
TK_EndOfCompletion = 122,
|
||||||
TK_Invalid = 123,
|
TK_Invalid = 123,
|
||||||
TK_LeftBracket = 58,
|
TK_LeftBracket = 64,
|
||||||
TK_LeftParen = 2,
|
TK_LeftParen = 2,
|
||||||
TK_LeftBrace = 63,
|
TK_LeftBrace = 65,
|
||||||
TK_Dot = 114,
|
TK_Dot = 114,
|
||||||
TK_DotStar = 94,
|
TK_DotStar = 94,
|
||||||
TK_Arrow = 101,
|
TK_Arrow = 101,
|
||||||
|
@ -103,9 +103,9 @@ public interface CPPParsersym {
|
||||||
TK_Bang = 25,
|
TK_Bang = 25,
|
||||||
TK_Slash = 89,
|
TK_Slash = 89,
|
||||||
TK_Percent = 90,
|
TK_Percent = 90,
|
||||||
TK_RightShift = 76,
|
TK_RightShift = 86,
|
||||||
TK_LeftShift = 77,
|
TK_LeftShift = 87,
|
||||||
TK_LT = 65,
|
TK_LT = 58,
|
||||||
TK_GT = 67,
|
TK_GT = 67,
|
||||||
TK_LE = 91,
|
TK_LE = 91,
|
||||||
TK_GE = 92,
|
TK_GE = 92,
|
||||||
|
@ -133,8 +133,8 @@ public interface CPPParsersym {
|
||||||
TK_Comma = 68,
|
TK_Comma = 68,
|
||||||
TK_zero = 38,
|
TK_zero = 38,
|
||||||
TK_RightBracket = 113,
|
TK_RightBracket = 113,
|
||||||
TK_RightParen = 71,
|
TK_RightParen = 73,
|
||||||
TK_RightBrace = 72,
|
TK_RightBrace = 71,
|
||||||
TK_SemiColon = 43,
|
TK_SemiColon = 43,
|
||||||
TK_ERROR_TOKEN = 44,
|
TK_ERROR_TOKEN = 44,
|
||||||
TK_EOF_TOKEN = 119;
|
TK_EOF_TOKEN = 119;
|
||||||
|
@ -198,26 +198,24 @@ public interface CPPParsersym {
|
||||||
"template",
|
"template",
|
||||||
"typedef",
|
"typedef",
|
||||||
"class",
|
"class",
|
||||||
"LeftBracket",
|
"LT",
|
||||||
"enum",
|
"enum",
|
||||||
"struct",
|
"struct",
|
||||||
"union",
|
"union",
|
||||||
"using",
|
"using",
|
||||||
"LeftBrace",
|
|
||||||
"namespace",
|
"namespace",
|
||||||
"LT",
|
"LeftBracket",
|
||||||
|
"LeftBrace",
|
||||||
"asm",
|
"asm",
|
||||||
"GT",
|
"GT",
|
||||||
"Comma",
|
"Comma",
|
||||||
"Assign",
|
"Assign",
|
||||||
"Colon",
|
"Colon",
|
||||||
"RightParen",
|
|
||||||
"RightBrace",
|
"RightBrace",
|
||||||
"export",
|
"export",
|
||||||
|
"RightParen",
|
||||||
"try",
|
"try",
|
||||||
"while",
|
"while",
|
||||||
"RightShift",
|
|
||||||
"LeftShift",
|
|
||||||
"break",
|
"break",
|
||||||
"case",
|
"case",
|
||||||
"continue",
|
"continue",
|
||||||
|
@ -228,6 +226,8 @@ public interface CPPParsersym {
|
||||||
"if",
|
"if",
|
||||||
"return",
|
"return",
|
||||||
"switch",
|
"switch",
|
||||||
|
"RightShift",
|
||||||
|
"LeftShift",
|
||||||
"ArrowStar",
|
"ArrowStar",
|
||||||
"Slash",
|
"Slash",
|
||||||
"Percent",
|
"Percent",
|
||||||
|
|
Loading…
Add table
Reference in a new issue