mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-05 00:36:16 +02:00
Bug 233310, support for ambiguous template arguments for LR parser
This commit is contained in:
parent
109f2fb5fc
commit
0676e6587a
40 changed files with 12921 additions and 12833 deletions
|
@ -49,7 +49,7 @@
|
||||||
</antcall>
|
</antcall>
|
||||||
<!-- Generate parser for disambiguating declarations vs expression statements -->
|
<!-- Generate parser for disambiguating declarations vs expression statements -->
|
||||||
<antcall target="generate_c99">
|
<antcall target="generate_c99">
|
||||||
<param name="grammar_name" value="C99ExpressionStatementParser"/>
|
<param name="grammar_name" value="C99ExpressionParser"/>
|
||||||
</antcall>
|
</antcall>
|
||||||
<!-- Generate parser for disambiguating cast expressions vs binary expressions-->
|
<!-- Generate parser for disambiguating cast expressions vs binary expressions-->
|
||||||
<antcall target="generate_c99">
|
<antcall target="generate_c99">
|
||||||
|
@ -69,7 +69,7 @@
|
||||||
</antcall>
|
</antcall>
|
||||||
<!-- Generate parser for disambiguating declarations vs expression statements -->
|
<!-- Generate parser for disambiguating declarations vs expression statements -->
|
||||||
<antcall target="generate_cpp">
|
<antcall target="generate_cpp">
|
||||||
<param name="grammar_name" value="CPPExpressionStatementParser"/>
|
<param name="grammar_name" value="CPPExpressionParser"/>
|
||||||
</antcall>
|
</antcall>
|
||||||
<!-- Generate parser for disambiguating cast expressions vs binary expressions-->
|
<!-- Generate parser for disambiguating cast expressions vs binary expressions-->
|
||||||
<antcall target="generate_cpp">
|
<antcall target="generate_cpp">
|
||||||
|
@ -79,11 +79,6 @@
|
||||||
<antcall target="generate_cpp">
|
<antcall target="generate_cpp">
|
||||||
<param name="grammar_name" value="CPPSizeofExpressionParser"/>
|
<param name="grammar_name" value="CPPSizeofExpressionParser"/>
|
||||||
</antcall>
|
</antcall>
|
||||||
<!-- Generate parser for disambiguating declarators
|
|
||||||
<antcall target="generate_cpp">
|
|
||||||
<param name="grammar_name" value="CPPNoConstructorInitializerParser"/>
|
|
||||||
</antcall>
|
|
||||||
-->
|
|
||||||
<!-- Generate parser for disambiguating declarators -->
|
<!-- Generate parser for disambiguating declarators -->
|
||||||
<antcall target="generate_cpp">
|
<antcall target="generate_cpp">
|
||||||
<param name="grammar_name" value="CPPNoFunctionDeclaratorParser"/>
|
<param name="grammar_name" value="CPPNoFunctionDeclaratorParser"/>
|
||||||
|
|
|
@ -27,7 +27,7 @@ $End
|
||||||
$Rules
|
$Rules
|
||||||
|
|
||||||
expression_parser_start
|
expression_parser_start
|
||||||
::= expression ';'
|
::= expression
|
||||||
| ERROR_TOKEN
|
| ERROR_TOKEN
|
||||||
/. $Build consumeExpressionProblem(); $EndBuild ./
|
/. $Build consumeExpressionProblem(); $EndBuild ./
|
||||||
|
|
|
@ -26,7 +26,7 @@ $End
|
||||||
$Rules
|
$Rules
|
||||||
|
|
||||||
expression_parser_start
|
expression_parser_start
|
||||||
::= expression ';'
|
::= expression
|
||||||
| ERROR_TOKEN
|
| ERROR_TOKEN
|
||||||
/. $Build consumeExpressionProblem(); $EndBuild ./
|
/. $Build consumeExpressionProblem(); $EndBuild ./
|
||||||
|
|
|
@ -1737,12 +1737,11 @@ template_argument_list_opt
|
||||||
| $empty
|
| $empty
|
||||||
|
|
||||||
|
|
||||||
-- TODO there are ambiguities here, for example f<i>, i could be variable or type
|
|
||||||
-- may need to double parse
|
|
||||||
template_argument
|
template_argument
|
||||||
::= assignment_expression
|
::= assignment_expression
|
||||||
| type_id
|
| type_id
|
||||||
| qualified_or_unqualified_name
|
/. $Build consumeTemplateArgumentTypeId(); $EndBuild ./
|
||||||
|
--| qualified_or_unqualified_name -- accessible through assignment_expression
|
||||||
|
|
||||||
|
|
||||||
explicit_instantiation
|
explicit_instantiation
|
||||||
|
|
|
@ -70,6 +70,7 @@ import org.eclipse.cdt.core.dom.lrparser.IParserActionTokenProvider;
|
||||||
import org.eclipse.cdt.core.parser.IProblem;
|
import org.eclipse.cdt.core.parser.IProblem;
|
||||||
import org.eclipse.cdt.core.parser.util.DebugUtil;
|
import org.eclipse.cdt.core.parser.util.DebugUtil;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
||||||
|
import org.eclipse.cdt.internal.core.dom.parser.ASTTranslationUnit;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -122,9 +123,9 @@ public abstract class BuildASTParserAction {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the parser that will recognize expression statements.
|
* Get the parser that will recognize expressions.
|
||||||
*/
|
*/
|
||||||
protected abstract IParser getExpressionStatementParser();
|
protected abstract IParser getExpressionParser();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -261,11 +262,18 @@ public abstract class BuildASTParserAction {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Runs the given parser on the tokens that make up the current rule.
|
* Runs the given parser on the given token list.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
protected IASTNode runSecondaryParser(IParser secondaryParser) {
|
protected IASTNode runSecondaryParser(IParser secondaryParser) {
|
||||||
List<IToken> tokens = parser.getRuleTokens();
|
return runSecondaryParser(secondaryParser, parser.getRuleTokens());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Runs the given parser on the tokens that make up the current rule.
|
||||||
|
*/
|
||||||
|
protected IASTNode runSecondaryParser(IParser secondaryParser, List<IToken> tokens) {
|
||||||
// the secondary parser will alter the token kinds, which will need to be undone
|
// the secondary parser will alter the token kinds, which will need to be undone
|
||||||
int[] savedKinds = new int[tokens.size()];
|
int[] savedKinds = new int[tokens.size()];
|
||||||
|
|
||||||
|
@ -430,6 +438,9 @@ public abstract class BuildASTParserAction {
|
||||||
*/
|
*/
|
||||||
private void resolveAmbiguityNodes() {
|
private void resolveAmbiguityNodes() {
|
||||||
tu.accept(EMPTY_VISITOR);
|
tu.accept(EMPTY_VISITOR);
|
||||||
|
if (tu instanceof ASTTranslationUnit) {
|
||||||
|
((ASTTranslationUnit)tu).cleanupAfterAmbiguityResolution();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -469,8 +480,11 @@ public abstract class BuildASTParserAction {
|
||||||
// attempt to also parse the tokens as an expression
|
// attempt to also parse the tokens as an expression
|
||||||
IASTExpressionStatement expressionStatement = null;
|
IASTExpressionStatement expressionStatement = null;
|
||||||
if(decl instanceof IASTSimpleDeclaration) {
|
if(decl instanceof IASTSimpleDeclaration) {
|
||||||
IParser expressionParser = getExpressionStatementParser();
|
List<IToken> expressionTokens = parser.getRuleTokens();
|
||||||
IASTExpression expr = (IASTExpression) runSecondaryParser(expressionParser);
|
expressionTokens = expressionTokens.subList(0, expressionTokens.size()-1); // remove the semicolon at the end
|
||||||
|
|
||||||
|
IParser expressionParser = getExpressionParser();
|
||||||
|
IASTExpression expr = (IASTExpression) runSecondaryParser(expressionParser, expressionTokens);
|
||||||
|
|
||||||
if(expr != null && !(expr instanceof IASTProblemExpression)) { // the parse may fail
|
if(expr != null && !(expr instanceof IASTProblemExpression)) { // the parse may fail
|
||||||
expressionStatement = nodeFactory.newExpressionStatement(expr);
|
expressionStatement = nodeFactory.newExpressionStatement(expr);
|
||||||
|
|
|
@ -62,7 +62,7 @@ import org.eclipse.cdt.core.dom.lrparser.action.ITokenMap;
|
||||||
import org.eclipse.cdt.core.dom.lrparser.action.TokenMap;
|
import org.eclipse.cdt.core.dom.lrparser.action.TokenMap;
|
||||||
import org.eclipse.cdt.core.parser.util.CollectionUtils;
|
import org.eclipse.cdt.core.parser.util.CollectionUtils;
|
||||||
import org.eclipse.cdt.core.parser.util.DebugUtil;
|
import org.eclipse.cdt.core.parser.util.DebugUtil;
|
||||||
import org.eclipse.cdt.internal.core.dom.lrparser.c99.C99ExpressionStatementParser;
|
import org.eclipse.cdt.internal.core.dom.lrparser.c99.C99ExpressionParser;
|
||||||
import org.eclipse.cdt.internal.core.dom.lrparser.c99.C99NoCastExpressionParser;
|
import org.eclipse.cdt.internal.core.dom.lrparser.c99.C99NoCastExpressionParser;
|
||||||
import org.eclipse.cdt.internal.core.dom.lrparser.c99.C99Parsersym;
|
import org.eclipse.cdt.internal.core.dom.lrparser.c99.C99Parsersym;
|
||||||
import org.eclipse.cdt.internal.core.dom.lrparser.c99.C99SizeofExpressionParser;
|
import org.eclipse.cdt.internal.core.dom.lrparser.c99.C99SizeofExpressionParser;
|
||||||
|
@ -103,10 +103,9 @@ public class C99BuildASTParserAction extends BuildASTParserAction {
|
||||||
return baseKind(token) == TK_Completion;
|
return baseKind(token) == TK_Completion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected IParser getExpressionStatementParser() {
|
protected IParser getExpressionParser() {
|
||||||
return new C99ExpressionStatementParser(parser.getOrderedTerminalSymbols());
|
return new C99ExpressionParser(parser.getOrderedTerminalSymbols());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -64,6 +64,7 @@ import org.eclipse.cdt.core.dom.ast.IASTTypeIdExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTUnaryExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTUnaryExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTWhileStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTWhileStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTEnumerationSpecifier.IASTEnumerator;
|
import org.eclipse.cdt.core.dom.ast.IASTEnumerationSpecifier.IASTEnumerator;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTAmbiguousTemplateArgument;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCatchHandler;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCatchHandler;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTConstructorChainInitializer;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTConstructorChainInitializer;
|
||||||
|
@ -103,6 +104,7 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTASMDeclaration;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTAmbiguousDeclaration;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTAmbiguousDeclaration;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTAmbiguousExpression;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTAmbiguousExpression;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTAmbiguousStatement;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTAmbiguousStatement;
|
||||||
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTAmbiguousTemplateArgument;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTArrayDeclarator;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTArrayDeclarator;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTArrayModifier;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTArrayModifier;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTArraySubscriptExpression;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTArraySubscriptExpression;
|
||||||
|
@ -560,6 +562,13 @@ public class CPPASTNodeFactory implements ICPPASTNodeFactory {
|
||||||
return newCPPSimpleDeclSpecifier();
|
return newCPPSimpleDeclSpecifier();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ICPPASTAmbiguousTemplateArgument newAmbiguousTemplateArgument(IASTTypeId typeId, IASTIdExpression idExpression) {
|
||||||
|
ICPPASTAmbiguousTemplateArgument ambiguity = new CPPASTAmbiguousTemplateArgument();
|
||||||
|
ambiguity.addTypeId(typeId);
|
||||||
|
ambiguity.addIdExpression(idExpression);
|
||||||
|
return ambiguity;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,7 @@ import org.eclipse.cdt.core.dom.ast.IASTFieldReference;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTForStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTForStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTFunctionDeclarator;
|
import org.eclipse.cdt.core.dom.ast.IASTFunctionDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition;
|
import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IASTIdExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTIfStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTIfStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTInitializerExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTInitializerExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTLiteralExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTLiteralExpression;
|
||||||
|
@ -41,6 +42,7 @@ 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;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTProblemDeclaration;
|
import org.eclipse.cdt.core.dom.ast.IASTProblemDeclaration;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IASTProblemExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclSpecifier;
|
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
|
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTStatement;
|
||||||
|
@ -49,6 +51,7 @@ 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.IASTUnaryExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTUnaryExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTWhileStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTWhileStatement;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTAmbiguousTemplateArgument;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCatchHandler;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCatchHandler;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTConstructorChainInitializer;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTConstructorChainInitializer;
|
||||||
|
@ -91,13 +94,14 @@ import org.eclipse.cdt.core.dom.lrparser.action.BuildASTParserAction;
|
||||||
import org.eclipse.cdt.core.dom.lrparser.action.ITokenMap;
|
import org.eclipse.cdt.core.dom.lrparser.action.ITokenMap;
|
||||||
import org.eclipse.cdt.core.dom.lrparser.action.TokenMap;
|
import org.eclipse.cdt.core.dom.lrparser.action.TokenMap;
|
||||||
import org.eclipse.cdt.core.parser.util.DebugUtil;
|
import org.eclipse.cdt.core.parser.util.DebugUtil;
|
||||||
import org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPExpressionStatementParser;
|
import org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPExpressionParser;
|
||||||
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.CPPNoFunctionDeclaratorParser;
|
import org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPNoFunctionDeclaratorParser;
|
||||||
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.lrparser.cpp.CPPSizeofExpressionParser;
|
import org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPSizeofExpressionParser;
|
||||||
import org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPTemplateTypeParameterParser;
|
import org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPTemplateTypeParameterParser;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent;
|
import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent;
|
||||||
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTAmbiguousTemplateArgument;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTQualifiedName;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTQualifiedName;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.OverloadableOperator;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.OverloadableOperator;
|
||||||
|
|
||||||
|
@ -141,8 +145,8 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected IParser getExpressionStatementParser() {
|
protected IParser getExpressionParser() {
|
||||||
return new CPPExpressionStatementParser(parser.getOrderedTerminalSymbols());
|
return new CPPExpressionParser(parser.getOrderedTerminalSymbols());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -386,8 +390,10 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
|
||||||
for(Object arg : templateArguments) {
|
for(Object arg : templateArguments) {
|
||||||
if(arg instanceof IASTExpression)
|
if(arg instanceof IASTExpression)
|
||||||
templateId.addTemplateArgument((IASTExpression)arg);
|
templateId.addTemplateArgument((IASTExpression)arg);
|
||||||
else
|
else if(arg instanceof IASTTypeId)
|
||||||
templateId.addTemplateArgument((IASTTypeId)arg);
|
templateId.addTemplateArgument((IASTTypeId)arg);
|
||||||
|
else if(arg instanceof ICPPASTAmbiguousTemplateArgument)
|
||||||
|
templateId.addTemplateArgument((ICPPASTAmbiguousTemplateArgument)arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
setOffsetAndLength(templateId);
|
setOffsetAndLength(templateId);
|
||||||
|
@ -397,6 +403,32 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disambiguates template arguments.
|
||||||
|
*/
|
||||||
|
public void consumeTemplateArgumentTypeId() {
|
||||||
|
if(TRACE_ACTIONS) DebugUtil.printMethodTrace();
|
||||||
|
|
||||||
|
IParser secondaryParser = getExpressionParser();
|
||||||
|
IASTNode result = runSecondaryParser(secondaryParser);
|
||||||
|
|
||||||
|
// The grammar rule allows assignment_expression, but the ambiguity
|
||||||
|
// only arises with id_expressions.
|
||||||
|
if(!(result instanceof IASTIdExpression))
|
||||||
|
return;
|
||||||
|
|
||||||
|
IASTTypeId typeId = (IASTTypeId) astStack.pop();
|
||||||
|
IASTIdExpression idExpression = (IASTIdExpression) result;
|
||||||
|
|
||||||
|
ICPPASTAmbiguousTemplateArgument ambiguityNode = nodeFactory.newAmbiguousTemplateArgument(typeId, idExpression);
|
||||||
|
//setOffsetAndLength(ambiguityNode);
|
||||||
|
|
||||||
|
astStack.push(ambiguityNode);
|
||||||
|
|
||||||
|
if(TRACE_AST_STACK) System.out.println(astStack);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* operator_id
|
* operator_id
|
||||||
* ::= 'operator' overloadable_operator
|
* ::= 'operator' overloadable_operator
|
||||||
|
@ -1170,7 +1202,7 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
|
||||||
IASTName typeName = findFirstAndRemove(topScope, IASTName.class);
|
IASTName typeName = findFirstAndRemove(topScope, IASTName.class);
|
||||||
|
|
||||||
// TODO what does the second argument mean?
|
// TODO what does the second argument mean?
|
||||||
ICPPASTNamedTypeSpecifier declSpec = nodeFactory.newCPPNamedTypeSpecifier(typeName, true);
|
ICPPASTNamedTypeSpecifier declSpec = nodeFactory.newCPPNamedTypeSpecifier(typeName, false);
|
||||||
|
|
||||||
// now apply the rest of the specifiers
|
// now apply the rest of the specifiers
|
||||||
for(Object token : topScope)
|
for(Object token : topScope)
|
||||||
|
@ -1838,6 +1870,9 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTFieldReference;
|
import org.eclipse.cdt.core.dom.ast.IASTFieldReference;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTForStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTForStatement;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IASTIdExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTIfStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTIfStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTPointer;
|
import org.eclipse.cdt.core.dom.ast.IASTPointer;
|
||||||
|
@ -21,6 +22,7 @@ import org.eclipse.cdt.core.dom.ast.IASTStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTSwitchStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTSwitchStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
|
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTWhileStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTWhileStatement;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTAmbiguousTemplateArgument;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCatchHandler;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCatchHandler;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTConstructorChainInitializer;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTConstructorChainInitializer;
|
||||||
|
@ -140,4 +142,6 @@ public interface ICPPASTNodeFactory extends IASTNodeFactory {
|
||||||
public ICPPASTTemplatedTypeTemplateParameter newTemplatedTypeTemplateParameter(IASTName name, IASTExpression idExpression);
|
public ICPPASTTemplatedTypeTemplateParameter newTemplatedTypeTemplateParameter(IASTName name, IASTExpression idExpression);
|
||||||
|
|
||||||
public IASTAmbiguousDeclaration newAmbiguousDeclaration(IASTDeclaration... declarations);
|
public IASTAmbiguousDeclaration newAmbiguousDeclaration(IASTDeclaration... declarations);
|
||||||
|
|
||||||
|
public ICPPASTAmbiguousTemplateArgument newAmbiguousTemplateArgument(IASTTypeId typeId, IASTIdExpression idExpression);
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,9 +26,9 @@ import org.eclipse.cdt.core.dom.lrparser.action.TokenMap;
|
||||||
import org.eclipse.cdt.core.dom.lrparser.action.c99.C99ASTNodeFactory;
|
import org.eclipse.cdt.core.dom.lrparser.action.c99.C99ASTNodeFactory;
|
||||||
import org.eclipse.cdt.core.dom.lrparser.action.c99.C99BuildASTParserAction;
|
import org.eclipse.cdt.core.dom.lrparser.action.c99.C99BuildASTParserAction;
|
||||||
|
|
||||||
public class C99ExpressionStatementParser extends PrsStream implements RuleAction , IParserActionTokenProvider, IParser
|
public class C99ExpressionParser extends PrsStream implements RuleAction , IParserActionTokenProvider, IParser
|
||||||
{
|
{
|
||||||
private static ParseTable prs = new C99ExpressionStatementParserprs();
|
private static ParseTable prs = new C99ExpressionParserprs();
|
||||||
private BacktrackingParser btParser;
|
private BacktrackingParser btParser;
|
||||||
|
|
||||||
public BacktrackingParser getParser() { return btParser; }
|
public BacktrackingParser getParser() { return btParser; }
|
||||||
|
@ -63,13 +63,13 @@ public class C99ExpressionStatementParser extends PrsStream implements RuleActio
|
||||||
return (ErrorToken) (err instanceof ErrorToken ? err : null);
|
return (ErrorToken) (err instanceof ErrorToken ? err : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public C99ExpressionStatementParser(LexStream lexStream)
|
public C99ExpressionParser(LexStream lexStream)
|
||||||
{
|
{
|
||||||
super(lexStream);
|
super(lexStream);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
super.remapTerminalSymbols(orderedTerminalSymbols(), C99ExpressionStatementParserprs.EOFT_SYMBOL);
|
super.remapTerminalSymbols(orderedTerminalSymbols(), C99ExpressionParserprs.EOFT_SYMBOL);
|
||||||
}
|
}
|
||||||
catch(NullExportedSymbolsException e) {
|
catch(NullExportedSymbolsException e) {
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,7 @@ public class C99ExpressionStatementParser extends PrsStream implements RuleActio
|
||||||
for (int i = 0; i < unimplemented_symbols.size(); i++)
|
for (int i = 0; i < unimplemented_symbols.size(); i++)
|
||||||
{
|
{
|
||||||
Integer id = (Integer) unimplemented_symbols.get(i);
|
Integer id = (Integer) unimplemented_symbols.get(i);
|
||||||
System.out.println(" " + C99ExpressionStatementParsersym.orderedTerminalSymbols[id.intValue()]);
|
System.out.println(" " + C99ExpressionParsersym.orderedTerminalSymbols[id.intValue()]);
|
||||||
}
|
}
|
||||||
System.out.println();
|
System.out.println();
|
||||||
}
|
}
|
||||||
|
@ -90,13 +90,13 @@ public class C99ExpressionStatementParser extends PrsStream implements RuleActio
|
||||||
{
|
{
|
||||||
throw new Error(new UndefinedEofSymbolException
|
throw new Error(new UndefinedEofSymbolException
|
||||||
("The Lexer does not implement the Eof symbol " +
|
("The Lexer does not implement the Eof symbol " +
|
||||||
C99ExpressionStatementParsersym.orderedTerminalSymbols[C99ExpressionStatementParserprs.EOFT_SYMBOL]));
|
C99ExpressionParsersym.orderedTerminalSymbols[C99ExpressionParserprs.EOFT_SYMBOL]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String[] orderedTerminalSymbols() { return C99ExpressionStatementParsersym.orderedTerminalSymbols; }
|
public String[] orderedTerminalSymbols() { return C99ExpressionParsersym.orderedTerminalSymbols; }
|
||||||
public String getTokenKindName(int kind) { return C99ExpressionStatementParsersym.orderedTerminalSymbols[kind]; }
|
public String getTokenKindName(int kind) { return C99ExpressionParsersym.orderedTerminalSymbols[kind]; }
|
||||||
public int getEOFTokenKind() { return C99ExpressionStatementParserprs.EOFT_SYMBOL; }
|
public int getEOFTokenKind() { return C99ExpressionParserprs.EOFT_SYMBOL; }
|
||||||
public PrsStream getParseStream() { return (PrsStream) this; }
|
public PrsStream getParseStream() { return (PrsStream) this; }
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -141,11 +141,11 @@ public class C99ExpressionStatementParser extends PrsStream implements RuleActio
|
||||||
catch (NotBacktrackParseTableException e)
|
catch (NotBacktrackParseTableException e)
|
||||||
{
|
{
|
||||||
throw new Error(new NotBacktrackParseTableException
|
throw new Error(new NotBacktrackParseTableException
|
||||||
("Regenerate C99ExpressionStatementParserprs.java with -BACKTRACK option"));
|
("Regenerate C99ExpressionParserprs.java with -BACKTRACK option"));
|
||||||
}
|
}
|
||||||
catch (BadParseSymFileException e)
|
catch (BadParseSymFileException e)
|
||||||
{
|
{
|
||||||
throw new Error(new BadParseSymFileException("Bad Parser Symbol File -- C99ExpressionStatementParsersym.java"));
|
throw new Error(new BadParseSymFileException("Bad Parser Symbol File -- C99ExpressionParsersym.java"));
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
|
@ -165,7 +165,7 @@ public class C99ExpressionStatementParser extends PrsStream implements RuleActio
|
||||||
|
|
||||||
private C99BuildASTParserAction action;
|
private C99BuildASTParserAction action;
|
||||||
|
|
||||||
public C99ExpressionStatementParser() { // constructor
|
public C99ExpressionParser() { // constructor
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initActions(IASTTranslationUnit tu) {
|
private void initActions(IASTTranslationUnit tu) {
|
||||||
|
@ -207,11 +207,11 @@ public IASTNode getSecondaryParseResult() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String[] getOrderedTerminalSymbols() {
|
public String[] getOrderedTerminalSymbols() {
|
||||||
return C99ExpressionStatementParsersym.orderedTerminalSymbols;
|
return C99ExpressionParsersym.orderedTerminalSymbols;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "C99ExpressionStatementParser"; //$NON-NLS-1$
|
return "C99ExpressionParser"; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -225,11 +225,11 @@ public void setTokens(List<IToken> tokens) {
|
||||||
token.setKind(tokenMap.mapKind(token.getKind()));
|
token.setKind(tokenMap.mapKind(token.getKind()));
|
||||||
addToken(token);
|
addToken(token);
|
||||||
}
|
}
|
||||||
addToken(new Token(null, 0, 0, C99ExpressionStatementParsersym.TK_EOF_TOKEN));
|
addToken(new Token(null, 0, 0, C99ExpressionParsersym.TK_EOF_TOKEN));
|
||||||
}
|
}
|
||||||
|
|
||||||
public C99ExpressionStatementParser(String[] mapFrom) { // constructor
|
public C99ExpressionParser(String[] mapFrom) { // constructor
|
||||||
tokenMap = new TokenMap(C99ExpressionStatementParsersym.orderedTerminalSymbols, mapFrom);
|
tokenMap = new TokenMap(C99ExpressionParsersym.orderedTerminalSymbols, mapFrom);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.core.dom.lrparser.c99;
|
package org.eclipse.cdt.internal.core.dom.lrparser.c99;
|
||||||
|
|
||||||
public interface C99ExpressionStatementParsersym {
|
public interface C99ExpressionParsersym {
|
||||||
public final static int
|
public final static int
|
||||||
TK_auto = 14,
|
TK_auto = 14,
|
||||||
TK_break = 81,
|
TK_break = 81,
|
||||||
|
@ -81,11 +81,11 @@ public interface C99ExpressionStatementParsersym {
|
||||||
TK_GT = 56,
|
TK_GT = 56,
|
||||||
TK_LE = 57,
|
TK_LE = 57,
|
||||||
TK_GE = 58,
|
TK_GE = 58,
|
||||||
TK_EQ = 62,
|
TK_EQ = 61,
|
||||||
TK_NE = 63,
|
TK_NE = 62,
|
||||||
TK_Caret = 64,
|
TK_Caret = 63,
|
||||||
TK_Or = 65,
|
TK_Or = 64,
|
||||||
TK_AndAnd = 66,
|
TK_AndAnd = 65,
|
||||||
TK_OrOr = 68,
|
TK_OrOr = 68,
|
||||||
TK_Question = 69,
|
TK_Question = 69,
|
||||||
TK_Colon = 59,
|
TK_Colon = 59,
|
||||||
|
@ -105,7 +105,7 @@ public interface C99ExpressionStatementParsersym {
|
||||||
TK_RightBracket = 51,
|
TK_RightBracket = 51,
|
||||||
TK_RightParen = 41,
|
TK_RightParen = 41,
|
||||||
TK_RightBrace = 46,
|
TK_RightBrace = 46,
|
||||||
TK_SemiColon = 61,
|
TK_SemiColon = 66,
|
||||||
TK_ERROR_TOKEN = 47,
|
TK_ERROR_TOKEN = 47,
|
||||||
TK_EOF_TOKEN = 80;
|
TK_EOF_TOKEN = 80;
|
||||||
|
|
||||||
|
@ -171,12 +171,12 @@ public interface C99ExpressionStatementParsersym {
|
||||||
"GE",
|
"GE",
|
||||||
"Colon",
|
"Colon",
|
||||||
"Assign",
|
"Assign",
|
||||||
"SemiColon",
|
|
||||||
"EQ",
|
"EQ",
|
||||||
"NE",
|
"NE",
|
||||||
"Caret",
|
"Caret",
|
||||||
"Or",
|
"Or",
|
||||||
"AndAnd",
|
"AndAnd",
|
||||||
|
"SemiColon",
|
||||||
"Arrow",
|
"Arrow",
|
||||||
"OrOr",
|
"OrOr",
|
||||||
"Question",
|
"Question",
|
File diff suppressed because it is too large
Load diff
|
@ -27,9 +27,9 @@ import org.eclipse.cdt.core.dom.lrparser.IParserActionTokenProvider;
|
||||||
import org.eclipse.cdt.core.dom.lrparser.action.ITokenMap;
|
import org.eclipse.cdt.core.dom.lrparser.action.ITokenMap;
|
||||||
import org.eclipse.cdt.core.dom.lrparser.action.TokenMap;
|
import org.eclipse.cdt.core.dom.lrparser.action.TokenMap;
|
||||||
|
|
||||||
public class CPPExpressionStatementParser extends PrsStream implements RuleAction , IParserActionTokenProvider, IParser
|
public class CPPExpressionParser extends PrsStream implements RuleAction , IParserActionTokenProvider, IParser
|
||||||
{
|
{
|
||||||
private static ParseTable prs = new CPPExpressionStatementParserprs();
|
private static ParseTable prs = new CPPExpressionParserprs();
|
||||||
private BacktrackingParser btParser;
|
private BacktrackingParser btParser;
|
||||||
|
|
||||||
public BacktrackingParser getParser() { return btParser; }
|
public BacktrackingParser getParser() { return btParser; }
|
||||||
|
@ -64,13 +64,13 @@ public class CPPExpressionStatementParser extends PrsStream implements RuleActio
|
||||||
return (ErrorToken) (err instanceof ErrorToken ? err : null);
|
return (ErrorToken) (err instanceof ErrorToken ? err : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CPPExpressionStatementParser(LexStream lexStream)
|
public CPPExpressionParser(LexStream lexStream)
|
||||||
{
|
{
|
||||||
super(lexStream);
|
super(lexStream);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
super.remapTerminalSymbols(orderedTerminalSymbols(), CPPExpressionStatementParserprs.EOFT_SYMBOL);
|
super.remapTerminalSymbols(orderedTerminalSymbols(), CPPExpressionParserprs.EOFT_SYMBOL);
|
||||||
}
|
}
|
||||||
catch(NullExportedSymbolsException e) {
|
catch(NullExportedSymbolsException e) {
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ public class CPPExpressionStatementParser extends PrsStream implements RuleActio
|
||||||
for (int i = 0; i < unimplemented_symbols.size(); i++)
|
for (int i = 0; i < unimplemented_symbols.size(); i++)
|
||||||
{
|
{
|
||||||
Integer id = (Integer) unimplemented_symbols.get(i);
|
Integer id = (Integer) unimplemented_symbols.get(i);
|
||||||
System.out.println(" " + CPPExpressionStatementParsersym.orderedTerminalSymbols[id.intValue()]);
|
System.out.println(" " + CPPExpressionParsersym.orderedTerminalSymbols[id.intValue()]);
|
||||||
}
|
}
|
||||||
System.out.println();
|
System.out.println();
|
||||||
}
|
}
|
||||||
|
@ -91,13 +91,13 @@ public class CPPExpressionStatementParser extends PrsStream implements RuleActio
|
||||||
{
|
{
|
||||||
throw new Error(new UndefinedEofSymbolException
|
throw new Error(new UndefinedEofSymbolException
|
||||||
("The Lexer does not implement the Eof symbol " +
|
("The Lexer does not implement the Eof symbol " +
|
||||||
CPPExpressionStatementParsersym.orderedTerminalSymbols[CPPExpressionStatementParserprs.EOFT_SYMBOL]));
|
CPPExpressionParsersym.orderedTerminalSymbols[CPPExpressionParserprs.EOFT_SYMBOL]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String[] orderedTerminalSymbols() { return CPPExpressionStatementParsersym.orderedTerminalSymbols; }
|
public String[] orderedTerminalSymbols() { return CPPExpressionParsersym.orderedTerminalSymbols; }
|
||||||
public String getTokenKindName(int kind) { return CPPExpressionStatementParsersym.orderedTerminalSymbols[kind]; }
|
public String getTokenKindName(int kind) { return CPPExpressionParsersym.orderedTerminalSymbols[kind]; }
|
||||||
public int getEOFTokenKind() { return CPPExpressionStatementParserprs.EOFT_SYMBOL; }
|
public int getEOFTokenKind() { return CPPExpressionParserprs.EOFT_SYMBOL; }
|
||||||
public PrsStream getParseStream() { return (PrsStream) this; }
|
public PrsStream getParseStream() { return (PrsStream) this; }
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -142,11 +142,11 @@ public class CPPExpressionStatementParser extends PrsStream implements RuleActio
|
||||||
catch (NotBacktrackParseTableException e)
|
catch (NotBacktrackParseTableException e)
|
||||||
{
|
{
|
||||||
throw new Error(new NotBacktrackParseTableException
|
throw new Error(new NotBacktrackParseTableException
|
||||||
("Regenerate CPPExpressionStatementParserprs.java with -BACKTRACK option"));
|
("Regenerate CPPExpressionParserprs.java with -BACKTRACK option"));
|
||||||
}
|
}
|
||||||
catch (BadParseSymFileException e)
|
catch (BadParseSymFileException e)
|
||||||
{
|
{
|
||||||
throw new Error(new BadParseSymFileException("Bad Parser Symbol File -- CPPExpressionStatementParsersym.java"));
|
throw new Error(new BadParseSymFileException("Bad Parser Symbol File -- CPPExpressionParsersym.java"));
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
|
@ -167,7 +167,7 @@ public class CPPExpressionStatementParser extends PrsStream implements RuleActio
|
||||||
private CPPParserAction action;
|
private CPPParserAction action;
|
||||||
|
|
||||||
// uncomment to use with backtracking parser
|
// uncomment to use with backtracking parser
|
||||||
public CPPExpressionStatementParser() { // constructor
|
public CPPExpressionParser() { // constructor
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initActions(IASTTranslationUnit tu) {
|
private void initActions(IASTTranslationUnit tu) {
|
||||||
|
@ -219,11 +219,11 @@ public IASTNode getSecondaryParseResult() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String[] getOrderedTerminalSymbols() {
|
public String[] getOrderedTerminalSymbols() {
|
||||||
return CPPExpressionStatementParsersym.orderedTerminalSymbols;
|
return CPPExpressionParsersym.orderedTerminalSymbols;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "CPPExpressionStatementParser"; //$NON-NLS-1$
|
return "CPPExpressionParser"; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -237,11 +237,11 @@ public void setTokens(List<IToken> tokens) {
|
||||||
token.setKind(tokenMap.mapKind(token.getKind()));
|
token.setKind(tokenMap.mapKind(token.getKind()));
|
||||||
addToken(token);
|
addToken(token);
|
||||||
}
|
}
|
||||||
addToken(new Token(null, 0, 0, CPPExpressionStatementParsersym.TK_EOF_TOKEN));
|
addToken(new Token(null, 0, 0, CPPExpressionParsersym.TK_EOF_TOKEN));
|
||||||
}
|
}
|
||||||
|
|
||||||
public CPPExpressionStatementParser(String[] mapFrom) { // constructor
|
public CPPExpressionParser(String[] mapFrom) { // constructor
|
||||||
tokenMap = new TokenMap(CPPExpressionStatementParsersym.orderedTerminalSymbols, mapFrom);
|
tokenMap = new TokenMap(CPPExpressionParsersym.orderedTerminalSymbols, mapFrom);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2198,65 +2198,72 @@ public CPPExpressionStatementParser(String[] mapFrom) { // constructor
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 517: explicit_instantiation ::= template declaration
|
// Rule 515: template_argument ::= type_id
|
||||||
//
|
//
|
||||||
case 517: { action.builder.
|
case 515: { action.builder.
|
||||||
|
consumeTemplateArgumentTypeId(); break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Rule 516: explicit_instantiation ::= template declaration
|
||||||
|
//
|
||||||
|
case 516: { action.builder.
|
||||||
consumeTemplateExplicitInstantiation(); break;
|
consumeTemplateExplicitInstantiation(); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 518: explicit_specialization ::= template < > declaration
|
// Rule 517: explicit_specialization ::= template < > declaration
|
||||||
//
|
//
|
||||||
case 518: { action.builder.
|
case 517: { action.builder.
|
||||||
consumeTemplateExplicitSpecialization(); break;
|
consumeTemplateExplicitSpecialization(); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 519: try_block ::= try compound_statement <openscope-ast> handler_seq
|
// Rule 518: try_block ::= try compound_statement <openscope-ast> handler_seq
|
||||||
//
|
//
|
||||||
case 519: { action.builder.
|
case 518: { action.builder.
|
||||||
consumeStatementTryBlock(); break;
|
consumeStatementTryBlock(); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 522: handler ::= catch ( exception_declaration ) compound_statement
|
// Rule 521: handler ::= catch ( exception_declaration ) compound_statement
|
||||||
//
|
//
|
||||||
case 522: { action.builder.
|
case 521: { action.builder.
|
||||||
consumeStatementCatchHandler(false); break;
|
consumeStatementCatchHandler(false); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 523: handler ::= catch ( ... ) compound_statement
|
// Rule 522: handler ::= catch ( ... ) compound_statement
|
||||||
//
|
//
|
||||||
case 523: { action.builder.
|
case 522: { action.builder.
|
||||||
consumeStatementCatchHandler(true); break;
|
consumeStatementCatchHandler(true); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 524: exception_declaration ::= type_specifier_seq <openscope-ast> declarator
|
// Rule 523: exception_declaration ::= type_specifier_seq <openscope-ast> declarator
|
||||||
|
//
|
||||||
|
case 523: { action.builder.
|
||||||
|
consumeDeclarationSimple(true); break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Rule 524: exception_declaration ::= type_specifier_seq <openscope-ast> abstract_declarator
|
||||||
//
|
//
|
||||||
case 524: { action.builder.
|
case 524: { action.builder.
|
||||||
consumeDeclarationSimple(true); break;
|
consumeDeclarationSimple(true); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 525: exception_declaration ::= type_specifier_seq <openscope-ast> abstract_declarator
|
// Rule 525: exception_declaration ::= type_specifier_seq
|
||||||
//
|
//
|
||||||
case 525: { action.builder.
|
case 525: { action.builder.
|
||||||
consumeDeclarationSimple(true); break;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Rule 526: exception_declaration ::= type_specifier_seq
|
|
||||||
//
|
|
||||||
case 526: { action.builder.
|
|
||||||
consumeDeclarationSimple(false); break;
|
consumeDeclarationSimple(false); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 534: expression_parser_start ::= ERROR_TOKEN
|
// Rule 533: expression_parser_start ::= ERROR_TOKEN
|
||||||
//
|
//
|
||||||
case 534: { action.builder.
|
case 533: { action.builder.
|
||||||
consumeExpressionProblem(); break;
|
consumeExpressionProblem(); break;
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.core.dom.lrparser.cpp;
|
package org.eclipse.cdt.internal.core.dom.lrparser.cpp;
|
||||||
|
|
||||||
public interface CPPExpressionStatementParsersym {
|
public interface CPPExpressionParsersym {
|
||||||
public final static int
|
public final static int
|
||||||
TK_asm = 63,
|
TK_asm = 63,
|
||||||
TK_auto = 48,
|
TK_auto = 48,
|
||||||
|
@ -22,7 +22,7 @@ public interface CPPExpressionStatementParsersym {
|
||||||
TK_case = 79,
|
TK_case = 79,
|
||||||
TK_catch = 119,
|
TK_catch = 119,
|
||||||
TK_char = 15,
|
TK_char = 15,
|
||||||
TK_class = 62,
|
TK_class = 61,
|
||||||
TK_const = 46,
|
TK_const = 46,
|
||||||
TK_const_cast = 32,
|
TK_const_cast = 32,
|
||||||
TK_continue = 80,
|
TK_continue = 80,
|
||||||
|
@ -31,7 +31,7 @@ public interface CPPExpressionStatementParsersym {
|
||||||
TK_do = 82,
|
TK_do = 82,
|
||||||
TK_double = 16,
|
TK_double = 16,
|
||||||
TK_dynamic_cast = 33,
|
TK_dynamic_cast = 33,
|
||||||
TK_else = 121,
|
TK_else = 122,
|
||||||
TK_enum = 68,
|
TK_enum = 68,
|
||||||
TK_explicit = 49,
|
TK_explicit = 49,
|
||||||
TK_export = 75,
|
TK_export = 75,
|
||||||
|
@ -106,7 +106,7 @@ public interface CPPExpressionStatementParsersym {
|
||||||
TK_RightShift = 88,
|
TK_RightShift = 88,
|
||||||
TK_LeftShift = 89,
|
TK_LeftShift = 89,
|
||||||
TK_LT = 28,
|
TK_LT = 28,
|
||||||
TK_GT = 61,
|
TK_GT = 62,
|
||||||
TK_LE = 93,
|
TK_LE = 93,
|
||||||
TK_GE = 94,
|
TK_GE = 94,
|
||||||
TK_EQ = 97,
|
TK_EQ = 97,
|
||||||
|
@ -119,7 +119,7 @@ public interface CPPExpressionStatementParsersym {
|
||||||
TK_Colon = 71,
|
TK_Colon = 71,
|
||||||
TK_ColonColon = 4,
|
TK_ColonColon = 4,
|
||||||
TK_DotDotDot = 95,
|
TK_DotDotDot = 95,
|
||||||
TK_Assign = 67,
|
TK_Assign = 66,
|
||||||
TK_StarAssign = 107,
|
TK_StarAssign = 107,
|
||||||
TK_SlashAssign = 108,
|
TK_SlashAssign = 108,
|
||||||
TK_PercentAssign = 109,
|
TK_PercentAssign = 109,
|
||||||
|
@ -130,14 +130,14 @@ public interface CPPExpressionStatementParsersym {
|
||||||
TK_AndAssign = 114,
|
TK_AndAssign = 114,
|
||||||
TK_CaretAssign = 115,
|
TK_CaretAssign = 115,
|
||||||
TK_OrAssign = 116,
|
TK_OrAssign = 116,
|
||||||
TK_Comma = 66,
|
TK_Comma = 67,
|
||||||
TK_RightBracket = 118,
|
TK_RightBracket = 118,
|
||||||
TK_RightParen = 73,
|
TK_RightParen = 73,
|
||||||
TK_RightBrace = 72,
|
TK_RightBrace = 72,
|
||||||
TK_SemiColon = 13,
|
TK_SemiColon = 13,
|
||||||
TK_ERROR_TOKEN = 74,
|
TK_ERROR_TOKEN = 74,
|
||||||
TK_0 = 45,
|
TK_0 = 45,
|
||||||
TK_EOF_TOKEN = 122;
|
TK_EOF_TOKEN = 121;
|
||||||
|
|
||||||
public final static String orderedTerminalSymbols[] = {
|
public final static String orderedTerminalSymbols[] = {
|
||||||
"",
|
"",
|
||||||
|
@ -201,13 +201,13 @@ public interface CPPExpressionStatementParsersym {
|
||||||
"throw",
|
"throw",
|
||||||
"using",
|
"using",
|
||||||
"LeftBrace",
|
"LeftBrace",
|
||||||
"GT",
|
|
||||||
"class",
|
"class",
|
||||||
|
"GT",
|
||||||
"asm",
|
"asm",
|
||||||
"delete",
|
"delete",
|
||||||
"new",
|
"new",
|
||||||
"Comma",
|
|
||||||
"Assign",
|
"Assign",
|
||||||
|
"Comma",
|
||||||
"enum",
|
"enum",
|
||||||
"struct",
|
"struct",
|
||||||
"union",
|
"union",
|
||||||
|
@ -261,8 +261,8 @@ public interface CPPExpressionStatementParsersym {
|
||||||
"RightBracket",
|
"RightBracket",
|
||||||
"catch",
|
"catch",
|
||||||
"Dot",
|
"Dot",
|
||||||
"else",
|
|
||||||
"EOF_TOKEN",
|
"EOF_TOKEN",
|
||||||
|
"else",
|
||||||
"Invalid"
|
"Invalid"
|
||||||
};
|
};
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -2191,65 +2191,72 @@ public CPPNoCastExpressionParser(String[] mapFrom) { // constructor
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 516: explicit_instantiation ::= template declaration
|
// Rule 514: template_argument ::= type_id
|
||||||
//
|
//
|
||||||
case 516: { action.builder.
|
case 514: { action.builder.
|
||||||
|
consumeTemplateArgumentTypeId(); break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Rule 515: explicit_instantiation ::= template declaration
|
||||||
|
//
|
||||||
|
case 515: { action.builder.
|
||||||
consumeTemplateExplicitInstantiation(); break;
|
consumeTemplateExplicitInstantiation(); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 517: explicit_specialization ::= template < > declaration
|
// Rule 516: explicit_specialization ::= template < > declaration
|
||||||
//
|
//
|
||||||
case 517: { action.builder.
|
case 516: { action.builder.
|
||||||
consumeTemplateExplicitSpecialization(); break;
|
consumeTemplateExplicitSpecialization(); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 518: try_block ::= try compound_statement <openscope-ast> handler_seq
|
// Rule 517: try_block ::= try compound_statement <openscope-ast> handler_seq
|
||||||
//
|
//
|
||||||
case 518: { action.builder.
|
case 517: { action.builder.
|
||||||
consumeStatementTryBlock(); break;
|
consumeStatementTryBlock(); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 521: handler ::= catch ( exception_declaration ) compound_statement
|
// Rule 520: handler ::= catch ( exception_declaration ) compound_statement
|
||||||
//
|
//
|
||||||
case 521: { action.builder.
|
case 520: { action.builder.
|
||||||
consumeStatementCatchHandler(false); break;
|
consumeStatementCatchHandler(false); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 522: handler ::= catch ( ... ) compound_statement
|
// Rule 521: handler ::= catch ( ... ) compound_statement
|
||||||
//
|
//
|
||||||
case 522: { action.builder.
|
case 521: { action.builder.
|
||||||
consumeStatementCatchHandler(true); break;
|
consumeStatementCatchHandler(true); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 523: exception_declaration ::= type_specifier_seq <openscope-ast> declarator
|
// Rule 522: exception_declaration ::= type_specifier_seq <openscope-ast> declarator
|
||||||
|
//
|
||||||
|
case 522: { action.builder.
|
||||||
|
consumeDeclarationSimple(true); break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Rule 523: exception_declaration ::= type_specifier_seq <openscope-ast> abstract_declarator
|
||||||
//
|
//
|
||||||
case 523: { action.builder.
|
case 523: { action.builder.
|
||||||
consumeDeclarationSimple(true); break;
|
consumeDeclarationSimple(true); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 524: exception_declaration ::= type_specifier_seq <openscope-ast> abstract_declarator
|
// Rule 524: exception_declaration ::= type_specifier_seq
|
||||||
//
|
//
|
||||||
case 524: { action.builder.
|
case 524: { action.builder.
|
||||||
consumeDeclarationSimple(true); break;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Rule 525: exception_declaration ::= type_specifier_seq
|
|
||||||
//
|
|
||||||
case 525: { action.builder.
|
|
||||||
consumeDeclarationSimple(false); break;
|
consumeDeclarationSimple(false); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 533: no_cast_start ::= ERROR_TOKEN
|
// Rule 532: no_cast_start ::= ERROR_TOKEN
|
||||||
//
|
//
|
||||||
case 533: { action.builder.
|
case 532: { action.builder.
|
||||||
consumeExpressionProblem(); break;
|
consumeExpressionProblem(); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -22,7 +22,7 @@ public interface CPPNoCastExpressionParsersym {
|
||||||
TK_case = 79,
|
TK_case = 79,
|
||||||
TK_catch = 119,
|
TK_catch = 119,
|
||||||
TK_char = 15,
|
TK_char = 15,
|
||||||
TK_class = 62,
|
TK_class = 61,
|
||||||
TK_const = 46,
|
TK_const = 46,
|
||||||
TK_const_cast = 32,
|
TK_const_cast = 32,
|
||||||
TK_continue = 80,
|
TK_continue = 80,
|
||||||
|
@ -106,7 +106,7 @@ public interface CPPNoCastExpressionParsersym {
|
||||||
TK_RightShift = 88,
|
TK_RightShift = 88,
|
||||||
TK_LeftShift = 89,
|
TK_LeftShift = 89,
|
||||||
TK_LT = 28,
|
TK_LT = 28,
|
||||||
TK_GT = 61,
|
TK_GT = 62,
|
||||||
TK_LE = 93,
|
TK_LE = 93,
|
||||||
TK_GE = 94,
|
TK_GE = 94,
|
||||||
TK_EQ = 97,
|
TK_EQ = 97,
|
||||||
|
@ -119,7 +119,7 @@ public interface CPPNoCastExpressionParsersym {
|
||||||
TK_Colon = 71,
|
TK_Colon = 71,
|
||||||
TK_ColonColon = 4,
|
TK_ColonColon = 4,
|
||||||
TK_DotDotDot = 95,
|
TK_DotDotDot = 95,
|
||||||
TK_Assign = 67,
|
TK_Assign = 66,
|
||||||
TK_StarAssign = 107,
|
TK_StarAssign = 107,
|
||||||
TK_SlashAssign = 108,
|
TK_SlashAssign = 108,
|
||||||
TK_PercentAssign = 109,
|
TK_PercentAssign = 109,
|
||||||
|
@ -130,7 +130,7 @@ public interface CPPNoCastExpressionParsersym {
|
||||||
TK_AndAssign = 114,
|
TK_AndAssign = 114,
|
||||||
TK_CaretAssign = 115,
|
TK_CaretAssign = 115,
|
||||||
TK_OrAssign = 116,
|
TK_OrAssign = 116,
|
||||||
TK_Comma = 66,
|
TK_Comma = 67,
|
||||||
TK_RightBracket = 118,
|
TK_RightBracket = 118,
|
||||||
TK_RightParen = 73,
|
TK_RightParen = 73,
|
||||||
TK_RightBrace = 72,
|
TK_RightBrace = 72,
|
||||||
|
@ -201,13 +201,13 @@ public interface CPPNoCastExpressionParsersym {
|
||||||
"throw",
|
"throw",
|
||||||
"using",
|
"using",
|
||||||
"LeftBrace",
|
"LeftBrace",
|
||||||
"GT",
|
|
||||||
"class",
|
"class",
|
||||||
|
"GT",
|
||||||
"asm",
|
"asm",
|
||||||
"delete",
|
"delete",
|
||||||
"new",
|
"new",
|
||||||
"Comma",
|
|
||||||
"Assign",
|
"Assign",
|
||||||
|
"Comma",
|
||||||
"enum",
|
"enum",
|
||||||
"struct",
|
"struct",
|
||||||
"union",
|
"union",
|
||||||
|
|
|
@ -2191,65 +2191,72 @@ public CPPNoFunctionDeclaratorParser(String[] mapFrom) { // constructor
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 515: explicit_instantiation ::= template declaration
|
// Rule 513: template_argument ::= type_id
|
||||||
//
|
//
|
||||||
case 515: { action.builder.
|
case 513: { action.builder.
|
||||||
|
consumeTemplateArgumentTypeId(); break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Rule 514: explicit_instantiation ::= template declaration
|
||||||
|
//
|
||||||
|
case 514: { action.builder.
|
||||||
consumeTemplateExplicitInstantiation(); break;
|
consumeTemplateExplicitInstantiation(); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 516: explicit_specialization ::= template < > declaration
|
// Rule 515: explicit_specialization ::= template < > declaration
|
||||||
//
|
//
|
||||||
case 516: { action.builder.
|
case 515: { action.builder.
|
||||||
consumeTemplateExplicitSpecialization(); break;
|
consumeTemplateExplicitSpecialization(); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 517: try_block ::= try compound_statement <openscope-ast> handler_seq
|
// Rule 516: try_block ::= try compound_statement <openscope-ast> handler_seq
|
||||||
//
|
//
|
||||||
case 517: { action.builder.
|
case 516: { action.builder.
|
||||||
consumeStatementTryBlock(); break;
|
consumeStatementTryBlock(); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 520: handler ::= catch ( exception_declaration ) compound_statement
|
// Rule 519: handler ::= catch ( exception_declaration ) compound_statement
|
||||||
//
|
//
|
||||||
case 520: { action.builder.
|
case 519: { action.builder.
|
||||||
consumeStatementCatchHandler(false); break;
|
consumeStatementCatchHandler(false); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 521: handler ::= catch ( ... ) compound_statement
|
// Rule 520: handler ::= catch ( ... ) compound_statement
|
||||||
//
|
//
|
||||||
case 521: { action.builder.
|
case 520: { action.builder.
|
||||||
consumeStatementCatchHandler(true); break;
|
consumeStatementCatchHandler(true); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 522: exception_declaration ::= type_specifier_seq <openscope-ast> declarator
|
// Rule 521: exception_declaration ::= type_specifier_seq <openscope-ast> declarator
|
||||||
|
//
|
||||||
|
case 521: { action.builder.
|
||||||
|
consumeDeclarationSimple(true); break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Rule 522: exception_declaration ::= type_specifier_seq <openscope-ast> abstract_declarator
|
||||||
//
|
//
|
||||||
case 522: { action.builder.
|
case 522: { action.builder.
|
||||||
consumeDeclarationSimple(true); break;
|
consumeDeclarationSimple(true); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 523: exception_declaration ::= type_specifier_seq <openscope-ast> abstract_declarator
|
// Rule 523: exception_declaration ::= type_specifier_seq
|
||||||
//
|
//
|
||||||
case 523: { action.builder.
|
case 523: { action.builder.
|
||||||
consumeDeclarationSimple(true); break;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Rule 524: exception_declaration ::= type_specifier_seq
|
|
||||||
//
|
|
||||||
case 524: { action.builder.
|
|
||||||
consumeDeclarationSimple(false); break;
|
consumeDeclarationSimple(false); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 532: no_function_declarator_start ::= ERROR_TOKEN
|
// Rule 531: no_function_declarator_start ::= ERROR_TOKEN
|
||||||
//
|
//
|
||||||
case 532: { action.builder.
|
case 531: { action.builder.
|
||||||
consumeDeclarationProblem(); break;
|
consumeDeclarationProblem(); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -22,12 +22,12 @@ public interface CPPNoFunctionDeclaratorParsersym {
|
||||||
TK_case = 79,
|
TK_case = 79,
|
||||||
TK_catch = 119,
|
TK_catch = 119,
|
||||||
TK_char = 16,
|
TK_char = 16,
|
||||||
TK_class = 62,
|
TK_class = 61,
|
||||||
TK_const = 33,
|
TK_const = 33,
|
||||||
TK_const_cast = 34,
|
TK_const_cast = 34,
|
||||||
TK_continue = 80,
|
TK_continue = 80,
|
||||||
TK_default = 81,
|
TK_default = 81,
|
||||||
TK_delete = 65,
|
TK_delete = 64,
|
||||||
TK_do = 82,
|
TK_do = 82,
|
||||||
TK_double = 17,
|
TK_double = 17,
|
||||||
TK_dynamic_cast = 35,
|
TK_dynamic_cast = 35,
|
||||||
|
@ -47,7 +47,7 @@ public interface CPPNoFunctionDeclaratorParsersym {
|
||||||
TK_long = 20,
|
TK_long = 20,
|
||||||
TK_mutable = 52,
|
TK_mutable = 52,
|
||||||
TK_namespace = 57,
|
TK_namespace = 57,
|
||||||
TK_new = 66,
|
TK_new = 65,
|
||||||
TK_operator = 7,
|
TK_operator = 7,
|
||||||
TK_private = 103,
|
TK_private = 103,
|
||||||
TK_protected = 104,
|
TK_protected = 104,
|
||||||
|
@ -106,7 +106,7 @@ public interface CPPNoFunctionDeclaratorParsersym {
|
||||||
TK_RightShift = 88,
|
TK_RightShift = 88,
|
||||||
TK_LeftShift = 89,
|
TK_LeftShift = 89,
|
||||||
TK_LT = 28,
|
TK_LT = 28,
|
||||||
TK_GT = 61,
|
TK_GT = 62,
|
||||||
TK_LE = 93,
|
TK_LE = 93,
|
||||||
TK_GE = 94,
|
TK_GE = 94,
|
||||||
TK_EQ = 97,
|
TK_EQ = 97,
|
||||||
|
@ -119,7 +119,7 @@ public interface CPPNoFunctionDeclaratorParsersym {
|
||||||
TK_Colon = 71,
|
TK_Colon = 71,
|
||||||
TK_ColonColon = 4,
|
TK_ColonColon = 4,
|
||||||
TK_DotDotDot = 95,
|
TK_DotDotDot = 95,
|
||||||
TK_Assign = 67,
|
TK_Assign = 66,
|
||||||
TK_StarAssign = 107,
|
TK_StarAssign = 107,
|
||||||
TK_SlashAssign = 108,
|
TK_SlashAssign = 108,
|
||||||
TK_PercentAssign = 109,
|
TK_PercentAssign = 109,
|
||||||
|
@ -130,7 +130,7 @@ public interface CPPNoFunctionDeclaratorParsersym {
|
||||||
TK_AndAssign = 114,
|
TK_AndAssign = 114,
|
||||||
TK_CaretAssign = 115,
|
TK_CaretAssign = 115,
|
||||||
TK_OrAssign = 116,
|
TK_OrAssign = 116,
|
||||||
TK_Comma = 64,
|
TK_Comma = 67,
|
||||||
TK_RightBracket = 118,
|
TK_RightBracket = 118,
|
||||||
TK_RightParen = 73,
|
TK_RightParen = 73,
|
||||||
TK_RightBrace = 72,
|
TK_RightBrace = 72,
|
||||||
|
@ -201,13 +201,13 @@ public interface CPPNoFunctionDeclaratorParsersym {
|
||||||
"using",
|
"using",
|
||||||
"throw",
|
"throw",
|
||||||
"LeftBrace",
|
"LeftBrace",
|
||||||
"GT",
|
|
||||||
"class",
|
"class",
|
||||||
|
"GT",
|
||||||
"asm",
|
"asm",
|
||||||
"Comma",
|
|
||||||
"delete",
|
"delete",
|
||||||
"new",
|
"new",
|
||||||
"Assign",
|
"Assign",
|
||||||
|
"Comma",
|
||||||
"enum",
|
"enum",
|
||||||
"struct",
|
"struct",
|
||||||
"union",
|
"union",
|
||||||
|
|
|
@ -2198,58 +2198,65 @@ public CPPParser(String[] mapFrom) { // constructor
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 517: explicit_instantiation ::= template declaration
|
// Rule 515: template_argument ::= type_id
|
||||||
//
|
//
|
||||||
case 517: { action.builder.
|
case 515: { action.builder.
|
||||||
|
consumeTemplateArgumentTypeId(); break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Rule 516: explicit_instantiation ::= template declaration
|
||||||
|
//
|
||||||
|
case 516: { action.builder.
|
||||||
consumeTemplateExplicitInstantiation(); break;
|
consumeTemplateExplicitInstantiation(); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 518: explicit_specialization ::= template < > declaration
|
// Rule 517: explicit_specialization ::= template < > declaration
|
||||||
//
|
//
|
||||||
case 518: { action.builder.
|
case 517: { action.builder.
|
||||||
consumeTemplateExplicitSpecialization(); break;
|
consumeTemplateExplicitSpecialization(); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 519: try_block ::= try compound_statement <openscope-ast> handler_seq
|
// Rule 518: try_block ::= try compound_statement <openscope-ast> handler_seq
|
||||||
//
|
//
|
||||||
case 519: { action.builder.
|
case 518: { action.builder.
|
||||||
consumeStatementTryBlock(); break;
|
consumeStatementTryBlock(); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 522: handler ::= catch ( exception_declaration ) compound_statement
|
// Rule 521: handler ::= catch ( exception_declaration ) compound_statement
|
||||||
//
|
//
|
||||||
case 522: { action.builder.
|
case 521: { action.builder.
|
||||||
consumeStatementCatchHandler(false); break;
|
consumeStatementCatchHandler(false); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 523: handler ::= catch ( ... ) compound_statement
|
// Rule 522: handler ::= catch ( ... ) compound_statement
|
||||||
//
|
//
|
||||||
case 523: { action.builder.
|
case 522: { action.builder.
|
||||||
consumeStatementCatchHandler(true); break;
|
consumeStatementCatchHandler(true); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 524: exception_declaration ::= type_specifier_seq <openscope-ast> declarator
|
// Rule 523: exception_declaration ::= type_specifier_seq <openscope-ast> declarator
|
||||||
|
//
|
||||||
|
case 523: { action.builder.
|
||||||
|
consumeDeclarationSimple(true); break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Rule 524: exception_declaration ::= type_specifier_seq <openscope-ast> abstract_declarator
|
||||||
//
|
//
|
||||||
case 524: { action.builder.
|
case 524: { action.builder.
|
||||||
consumeDeclarationSimple(true); break;
|
consumeDeclarationSimple(true); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 525: exception_declaration ::= type_specifier_seq <openscope-ast> abstract_declarator
|
// Rule 525: exception_declaration ::= type_specifier_seq
|
||||||
//
|
//
|
||||||
case 525: { action.builder.
|
case 525: { action.builder.
|
||||||
consumeDeclarationSimple(true); break;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Rule 526: exception_declaration ::= type_specifier_seq
|
|
||||||
//
|
|
||||||
case 526: { action.builder.
|
|
||||||
consumeDeclarationSimple(false); break;
|
consumeDeclarationSimple(false); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -27,7 +27,7 @@ public interface CPPParsersym {
|
||||||
TK_const_cast = 43,
|
TK_const_cast = 43,
|
||||||
TK_continue = 80,
|
TK_continue = 80,
|
||||||
TK_default = 81,
|
TK_default = 81,
|
||||||
TK_delete = 68,
|
TK_delete = 67,
|
||||||
TK_do = 82,
|
TK_do = 82,
|
||||||
TK_double = 15,
|
TK_double = 15,
|
||||||
TK_dynamic_cast = 44,
|
TK_dynamic_cast = 44,
|
||||||
|
@ -47,7 +47,7 @@ public interface CPPParsersym {
|
||||||
TK_long = 18,
|
TK_long = 18,
|
||||||
TK_mutable = 39,
|
TK_mutable = 39,
|
||||||
TK_namespace = 46,
|
TK_namespace = 46,
|
||||||
TK_new = 69,
|
TK_new = 68,
|
||||||
TK_operator = 7,
|
TK_operator = 7,
|
||||||
TK_private = 103,
|
TK_private = 103,
|
||||||
TK_protected = 104,
|
TK_protected = 104,
|
||||||
|
@ -119,7 +119,7 @@ public interface CPPParsersym {
|
||||||
TK_Colon = 71,
|
TK_Colon = 71,
|
||||||
TK_ColonColon = 4,
|
TK_ColonColon = 4,
|
||||||
TK_DotDotDot = 95,
|
TK_DotDotDot = 95,
|
||||||
TK_Assign = 70,
|
TK_Assign = 69,
|
||||||
TK_StarAssign = 107,
|
TK_StarAssign = 107,
|
||||||
TK_SlashAssign = 108,
|
TK_SlashAssign = 108,
|
||||||
TK_PercentAssign = 109,
|
TK_PercentAssign = 109,
|
||||||
|
@ -130,7 +130,7 @@ public interface CPPParsersym {
|
||||||
TK_AndAssign = 114,
|
TK_AndAssign = 114,
|
||||||
TK_CaretAssign = 115,
|
TK_CaretAssign = 115,
|
||||||
TK_OrAssign = 116,
|
TK_OrAssign = 116,
|
||||||
TK_Comma = 67,
|
TK_Comma = 70,
|
||||||
TK_RightBracket = 118,
|
TK_RightBracket = 118,
|
||||||
TK_RightParen = 73,
|
TK_RightParen = 73,
|
||||||
TK_RightBrace = 72,
|
TK_RightBrace = 72,
|
||||||
|
@ -207,10 +207,10 @@ public interface CPPParsersym {
|
||||||
"enum",
|
"enum",
|
||||||
"struct",
|
"struct",
|
||||||
"union",
|
"union",
|
||||||
"Comma",
|
|
||||||
"delete",
|
"delete",
|
||||||
"new",
|
"new",
|
||||||
"Assign",
|
"Assign",
|
||||||
|
"Comma",
|
||||||
"Colon",
|
"Colon",
|
||||||
"RightBrace",
|
"RightBrace",
|
||||||
"RightParen",
|
"RightParen",
|
||||||
|
|
|
@ -2184,65 +2184,72 @@ public CPPSizeofExpressionParser(String[] mapFrom) { // constructor
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 515: explicit_instantiation ::= template declaration
|
// Rule 513: template_argument ::= type_id
|
||||||
//
|
//
|
||||||
case 515: { action.builder.
|
case 513: { action.builder.
|
||||||
|
consumeTemplateArgumentTypeId(); break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Rule 514: explicit_instantiation ::= template declaration
|
||||||
|
//
|
||||||
|
case 514: { action.builder.
|
||||||
consumeTemplateExplicitInstantiation(); break;
|
consumeTemplateExplicitInstantiation(); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 516: explicit_specialization ::= template < > declaration
|
// Rule 515: explicit_specialization ::= template < > declaration
|
||||||
//
|
//
|
||||||
case 516: { action.builder.
|
case 515: { action.builder.
|
||||||
consumeTemplateExplicitSpecialization(); break;
|
consumeTemplateExplicitSpecialization(); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 517: try_block ::= try compound_statement <openscope-ast> handler_seq
|
// Rule 516: try_block ::= try compound_statement <openscope-ast> handler_seq
|
||||||
//
|
//
|
||||||
case 517: { action.builder.
|
case 516: { action.builder.
|
||||||
consumeStatementTryBlock(); break;
|
consumeStatementTryBlock(); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 520: handler ::= catch ( exception_declaration ) compound_statement
|
// Rule 519: handler ::= catch ( exception_declaration ) compound_statement
|
||||||
//
|
//
|
||||||
case 520: { action.builder.
|
case 519: { action.builder.
|
||||||
consumeStatementCatchHandler(false); break;
|
consumeStatementCatchHandler(false); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 521: handler ::= catch ( ... ) compound_statement
|
// Rule 520: handler ::= catch ( ... ) compound_statement
|
||||||
//
|
//
|
||||||
case 521: { action.builder.
|
case 520: { action.builder.
|
||||||
consumeStatementCatchHandler(true); break;
|
consumeStatementCatchHandler(true); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 522: exception_declaration ::= type_specifier_seq <openscope-ast> declarator
|
// Rule 521: exception_declaration ::= type_specifier_seq <openscope-ast> declarator
|
||||||
|
//
|
||||||
|
case 521: { action.builder.
|
||||||
|
consumeDeclarationSimple(true); break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Rule 522: exception_declaration ::= type_specifier_seq <openscope-ast> abstract_declarator
|
||||||
//
|
//
|
||||||
case 522: { action.builder.
|
case 522: { action.builder.
|
||||||
consumeDeclarationSimple(true); break;
|
consumeDeclarationSimple(true); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 523: exception_declaration ::= type_specifier_seq <openscope-ast> abstract_declarator
|
// Rule 523: exception_declaration ::= type_specifier_seq
|
||||||
//
|
//
|
||||||
case 523: { action.builder.
|
case 523: { action.builder.
|
||||||
consumeDeclarationSimple(true); break;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Rule 524: exception_declaration ::= type_specifier_seq
|
|
||||||
//
|
|
||||||
case 524: { action.builder.
|
|
||||||
consumeDeclarationSimple(false); break;
|
consumeDeclarationSimple(false); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 532: no_sizeof_type_name_start ::= ERROR_TOKEN
|
// Rule 531: no_sizeof_type_name_start ::= ERROR_TOKEN
|
||||||
//
|
//
|
||||||
case 532: { action.builder.
|
case 531: { action.builder.
|
||||||
consumeExpressionProblem(); break;
|
consumeExpressionProblem(); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -22,7 +22,7 @@ public interface CPPSizeofExpressionParsersym {
|
||||||
TK_case = 79,
|
TK_case = 79,
|
||||||
TK_catch = 119,
|
TK_catch = 119,
|
||||||
TK_char = 15,
|
TK_char = 15,
|
||||||
TK_class = 62,
|
TK_class = 61,
|
||||||
TK_const = 46,
|
TK_const = 46,
|
||||||
TK_const_cast = 32,
|
TK_const_cast = 32,
|
||||||
TK_continue = 80,
|
TK_continue = 80,
|
||||||
|
@ -106,7 +106,7 @@ public interface CPPSizeofExpressionParsersym {
|
||||||
TK_RightShift = 88,
|
TK_RightShift = 88,
|
||||||
TK_LeftShift = 89,
|
TK_LeftShift = 89,
|
||||||
TK_LT = 28,
|
TK_LT = 28,
|
||||||
TK_GT = 61,
|
TK_GT = 62,
|
||||||
TK_LE = 93,
|
TK_LE = 93,
|
||||||
TK_GE = 94,
|
TK_GE = 94,
|
||||||
TK_EQ = 97,
|
TK_EQ = 97,
|
||||||
|
@ -119,7 +119,7 @@ public interface CPPSizeofExpressionParsersym {
|
||||||
TK_Colon = 71,
|
TK_Colon = 71,
|
||||||
TK_ColonColon = 4,
|
TK_ColonColon = 4,
|
||||||
TK_DotDotDot = 95,
|
TK_DotDotDot = 95,
|
||||||
TK_Assign = 67,
|
TK_Assign = 66,
|
||||||
TK_StarAssign = 107,
|
TK_StarAssign = 107,
|
||||||
TK_SlashAssign = 108,
|
TK_SlashAssign = 108,
|
||||||
TK_PercentAssign = 109,
|
TK_PercentAssign = 109,
|
||||||
|
@ -130,7 +130,7 @@ public interface CPPSizeofExpressionParsersym {
|
||||||
TK_AndAssign = 114,
|
TK_AndAssign = 114,
|
||||||
TK_CaretAssign = 115,
|
TK_CaretAssign = 115,
|
||||||
TK_OrAssign = 116,
|
TK_OrAssign = 116,
|
||||||
TK_Comma = 66,
|
TK_Comma = 67,
|
||||||
TK_RightBracket = 118,
|
TK_RightBracket = 118,
|
||||||
TK_RightParen = 73,
|
TK_RightParen = 73,
|
||||||
TK_RightBrace = 72,
|
TK_RightBrace = 72,
|
||||||
|
@ -201,13 +201,13 @@ public interface CPPSizeofExpressionParsersym {
|
||||||
"throw",
|
"throw",
|
||||||
"using",
|
"using",
|
||||||
"LeftBrace",
|
"LeftBrace",
|
||||||
"GT",
|
|
||||||
"class",
|
"class",
|
||||||
|
"GT",
|
||||||
"asm",
|
"asm",
|
||||||
"delete",
|
"delete",
|
||||||
"new",
|
"new",
|
||||||
"Comma",
|
|
||||||
"Assign",
|
"Assign",
|
||||||
|
"Comma",
|
||||||
"enum",
|
"enum",
|
||||||
"struct",
|
"struct",
|
||||||
"union",
|
"union",
|
||||||
|
|
|
@ -2198,65 +2198,72 @@ public CPPTemplateTypeParameterParser(String[] mapFrom) { // constructor
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 517: explicit_instantiation ::= template declaration
|
// Rule 515: template_argument ::= type_id
|
||||||
//
|
//
|
||||||
case 517: { action.builder.
|
case 515: { action.builder.
|
||||||
|
consumeTemplateArgumentTypeId(); break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Rule 516: explicit_instantiation ::= template declaration
|
||||||
|
//
|
||||||
|
case 516: { action.builder.
|
||||||
consumeTemplateExplicitInstantiation(); break;
|
consumeTemplateExplicitInstantiation(); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 518: explicit_specialization ::= template < > declaration
|
// Rule 517: explicit_specialization ::= template < > declaration
|
||||||
//
|
//
|
||||||
case 518: { action.builder.
|
case 517: { action.builder.
|
||||||
consumeTemplateExplicitSpecialization(); break;
|
consumeTemplateExplicitSpecialization(); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 519: try_block ::= try compound_statement <openscope-ast> handler_seq
|
// Rule 518: try_block ::= try compound_statement <openscope-ast> handler_seq
|
||||||
//
|
//
|
||||||
case 519: { action.builder.
|
case 518: { action.builder.
|
||||||
consumeStatementTryBlock(); break;
|
consumeStatementTryBlock(); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 522: handler ::= catch ( exception_declaration ) compound_statement
|
// Rule 521: handler ::= catch ( exception_declaration ) compound_statement
|
||||||
//
|
//
|
||||||
case 522: { action.builder.
|
case 521: { action.builder.
|
||||||
consumeStatementCatchHandler(false); break;
|
consumeStatementCatchHandler(false); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 523: handler ::= catch ( ... ) compound_statement
|
// Rule 522: handler ::= catch ( ... ) compound_statement
|
||||||
//
|
//
|
||||||
case 523: { action.builder.
|
case 522: { action.builder.
|
||||||
consumeStatementCatchHandler(true); break;
|
consumeStatementCatchHandler(true); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 524: exception_declaration ::= type_specifier_seq <openscope-ast> declarator
|
// Rule 523: exception_declaration ::= type_specifier_seq <openscope-ast> declarator
|
||||||
|
//
|
||||||
|
case 523: { action.builder.
|
||||||
|
consumeDeclarationSimple(true); break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Rule 524: exception_declaration ::= type_specifier_seq <openscope-ast> abstract_declarator
|
||||||
//
|
//
|
||||||
case 524: { action.builder.
|
case 524: { action.builder.
|
||||||
consumeDeclarationSimple(true); break;
|
consumeDeclarationSimple(true); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 525: exception_declaration ::= type_specifier_seq <openscope-ast> abstract_declarator
|
// Rule 525: exception_declaration ::= type_specifier_seq
|
||||||
//
|
//
|
||||||
case 525: { action.builder.
|
case 525: { action.builder.
|
||||||
consumeDeclarationSimple(true); break;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Rule 526: exception_declaration ::= type_specifier_seq
|
|
||||||
//
|
|
||||||
case 526: { action.builder.
|
|
||||||
consumeDeclarationSimple(false); break;
|
consumeDeclarationSimple(false); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Rule 534: type_parameter_start ::= ERROR_TOKEN
|
// Rule 533: type_parameter_start ::= ERROR_TOKEN
|
||||||
//
|
//
|
||||||
case 534: { action.builder.
|
case 533: { action.builder.
|
||||||
consumeDeclarationProblem(); break;
|
consumeDeclarationProblem(); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -27,7 +27,7 @@ public interface CPPTemplateTypeParameterParsersym {
|
||||||
TK_const_cast = 34,
|
TK_const_cast = 34,
|
||||||
TK_continue = 80,
|
TK_continue = 80,
|
||||||
TK_default = 81,
|
TK_default = 81,
|
||||||
TK_delete = 65,
|
TK_delete = 64,
|
||||||
TK_do = 82,
|
TK_do = 82,
|
||||||
TK_double = 17,
|
TK_double = 17,
|
||||||
TK_dynamic_cast = 35,
|
TK_dynamic_cast = 35,
|
||||||
|
@ -47,7 +47,7 @@ public interface CPPTemplateTypeParameterParsersym {
|
||||||
TK_long = 20,
|
TK_long = 20,
|
||||||
TK_mutable = 52,
|
TK_mutable = 52,
|
||||||
TK_namespace = 57,
|
TK_namespace = 57,
|
||||||
TK_new = 66,
|
TK_new = 65,
|
||||||
TK_operator = 7,
|
TK_operator = 7,
|
||||||
TK_private = 103,
|
TK_private = 103,
|
||||||
TK_protected = 104,
|
TK_protected = 104,
|
||||||
|
@ -119,7 +119,7 @@ public interface CPPTemplateTypeParameterParsersym {
|
||||||
TK_Colon = 71,
|
TK_Colon = 71,
|
||||||
TK_ColonColon = 4,
|
TK_ColonColon = 4,
|
||||||
TK_DotDotDot = 95,
|
TK_DotDotDot = 95,
|
||||||
TK_Assign = 67,
|
TK_Assign = 66,
|
||||||
TK_StarAssign = 107,
|
TK_StarAssign = 107,
|
||||||
TK_SlashAssign = 108,
|
TK_SlashAssign = 108,
|
||||||
TK_PercentAssign = 109,
|
TK_PercentAssign = 109,
|
||||||
|
@ -130,7 +130,7 @@ public interface CPPTemplateTypeParameterParsersym {
|
||||||
TK_AndAssign = 114,
|
TK_AndAssign = 114,
|
||||||
TK_CaretAssign = 115,
|
TK_CaretAssign = 115,
|
||||||
TK_OrAssign = 116,
|
TK_OrAssign = 116,
|
||||||
TK_Comma = 64,
|
TK_Comma = 67,
|
||||||
TK_RightBracket = 118,
|
TK_RightBracket = 118,
|
||||||
TK_RightParen = 73,
|
TK_RightParen = 73,
|
||||||
TK_RightBrace = 72,
|
TK_RightBrace = 72,
|
||||||
|
@ -204,10 +204,10 @@ public interface CPPTemplateTypeParameterParsersym {
|
||||||
"LeftBrace",
|
"LeftBrace",
|
||||||
"GT",
|
"GT",
|
||||||
"asm",
|
"asm",
|
||||||
"Comma",
|
|
||||||
"delete",
|
"delete",
|
||||||
"new",
|
"new",
|
||||||
"Assign",
|
"Assign",
|
||||||
|
"Comma",
|
||||||
"enum",
|
"enum",
|
||||||
"struct",
|
"struct",
|
||||||
"union",
|
"union",
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
</antcall>
|
</antcall>
|
||||||
<!-- Generate parser for disambiguating declarations vs expression statements -->
|
<!-- Generate parser for disambiguating declarations vs expression statements -->
|
||||||
<antcall target="generate_upc">
|
<antcall target="generate_upc">
|
||||||
<param name="grammar_name" value="UPCExpressionStatementParser"/>
|
<param name="grammar_name" value="UPCExpressionParser"/>
|
||||||
</antcall>
|
</antcall>
|
||||||
<!-- Generate parser for disambiguating cast expressions vs binary expressions-->
|
<!-- Generate parser for disambiguating cast expressions vs binary expressions-->
|
||||||
<antcall target="generate_upc">
|
<antcall target="generate_upc">
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
|
|
||||||
$Import
|
$Import
|
||||||
C99ExpressionStatementParser.g
|
C99ExpressionParser.g
|
||||||
$End
|
$End
|
||||||
|
|
||||||
$Import
|
$Import
|
|
@ -22,7 +22,7 @@ import org.eclipse.cdt.core.dom.parser.upc.UPCASTNodeFactory;
|
||||||
import org.eclipse.cdt.core.dom.parser.upc.UPCParserAction;
|
import org.eclipse.cdt.core.dom.parser.upc.UPCParserAction;
|
||||||
import org.eclipse.cdt.core.dom.upc.ast.IUPCASTKeywordExpression;
|
import org.eclipse.cdt.core.dom.upc.ast.IUPCASTKeywordExpression;
|
||||||
import org.eclipse.cdt.core.dom.upc.ast.IUPCASTSynchronizationStatement;
|
import org.eclipse.cdt.core.dom.upc.ast.IUPCASTSynchronizationStatement;
|
||||||
import org.eclipse.cdt.core.dom.upc.ast.IUPCASTUnaryExpression;
|
import org.eclipse.cdt.core.dom.upc.ast.IUPCASTUnarySizeofExpression;
|
||||||
./
|
./
|
||||||
$End
|
$End
|
||||||
|
|
||||||
|
@ -65,17 +65,17 @@ literal
|
||||||
-- causes ambiguities because of no type information, solution is SGLR
|
-- causes ambiguities because of no type information, solution is SGLR
|
||||||
unary_expression
|
unary_expression
|
||||||
::= 'upc_localsizeof' unary_expression
|
::= 'upc_localsizeof' unary_expression
|
||||||
/. $Build consumeExpressionUnarySizeofOperator(IUPCASTUnaryExpression.upc_localsizeof); $EndBuild ./
|
/. $Build consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_localsizeof); $EndBuild ./
|
||||||
| 'upc_localsizeof' '(' type_name ')'
|
| 'upc_localsizeof' '(' type_name ')'
|
||||||
/. $Build consumeExpressionSizeofTypeId(IUPCASTUnaryExpression.upc_localsizeof); $EndBuild ./
|
/. $Build consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_localsizeof); $EndBuild ./
|
||||||
| 'upc_blocksizeof' unary_expression
|
| 'upc_blocksizeof' unary_expression
|
||||||
/. $Build consumeExpressionUnarySizeofOperator(IUPCASTUnaryExpression.upc_blocksizeof); $EndBuild ./
|
/. $Build consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_blocksizeof); $EndBuild ./
|
||||||
| 'upc_blocksizeof' '(' type_name ')'
|
| 'upc_blocksizeof' '(' type_name ')'
|
||||||
/. $Build consumeExpressionSizeofTypeId(IUPCASTUnaryExpression.upc_blocksizeof); $EndBuild ./
|
/. $Build consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_blocksizeof); $EndBuild ./
|
||||||
| 'upc_elemsizeof' unary_expression
|
| 'upc_elemsizeof' unary_expression
|
||||||
/. $Build consumeExpressionUnarySizeofOperator(IUPCASTUnaryExpression.upc_elemsizeof); $EndBuild ./
|
/. $Build consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_elemsizeof); $EndBuild ./
|
||||||
| 'upc_elemsizeof' '(' type_name ')'
|
| 'upc_elemsizeof' '(' type_name ')'
|
||||||
/. $Build consumeExpressionSizeofTypeId(IUPCASTUnaryExpression.upc_elemsizeof); $EndBuild ./
|
/. $Build consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_elemsizeof); $EndBuild ./
|
||||||
|
|
||||||
|
|
||||||
-----------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------
|
||||||
|
|
|
@ -28,7 +28,7 @@ import org.eclipse.cdt.core.dom.upc.ast.IUPCASTDeclSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.upc.ast.IUPCASTForallStatement;
|
import org.eclipse.cdt.core.dom.upc.ast.IUPCASTForallStatement;
|
||||||
import org.eclipse.cdt.core.dom.upc.ast.IUPCASTKeywordExpression;
|
import org.eclipse.cdt.core.dom.upc.ast.IUPCASTKeywordExpression;
|
||||||
import org.eclipse.cdt.core.dom.upc.ast.IUPCASTSynchronizationStatement;
|
import org.eclipse.cdt.core.dom.upc.ast.IUPCASTSynchronizationStatement;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.upc.UPCExpressionStatementParser;
|
import org.eclipse.cdt.internal.core.dom.parser.upc.UPCExpressionParser;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.upc.UPCNoCastExpressionParser;
|
import org.eclipse.cdt.internal.core.dom.parser.upc.UPCNoCastExpressionParser;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.upc.UPCSizeofExpressionParser;
|
import org.eclipse.cdt.internal.core.dom.parser.upc.UPCSizeofExpressionParser;
|
||||||
|
|
||||||
|
@ -61,8 +61,8 @@ public class UPCParserAction extends C99BuildASTParserAction {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected IParser getExpressionStatementParser() {
|
protected IParser getExpressionParser() {
|
||||||
return new UPCExpressionStatementParser(parser.getOrderedTerminalSymbols());
|
return new UPCExpressionParser(parser.getOrderedTerminalSymbols());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -32,9 +32,9 @@ import org.eclipse.cdt.core.dom.upc.ast.IUPCASTKeywordExpression;
|
||||||
import org.eclipse.cdt.core.dom.upc.ast.IUPCASTSynchronizationStatement;
|
import org.eclipse.cdt.core.dom.upc.ast.IUPCASTSynchronizationStatement;
|
||||||
import org.eclipse.cdt.core.dom.upc.ast.IUPCASTUnarySizeofExpression;
|
import org.eclipse.cdt.core.dom.upc.ast.IUPCASTUnarySizeofExpression;
|
||||||
|
|
||||||
public class UPCExpressionStatementParser extends PrsStream implements RuleAction , IParserActionTokenProvider, IParser
|
public class UPCExpressionParser extends PrsStream implements RuleAction , IParserActionTokenProvider, IParser
|
||||||
{
|
{
|
||||||
private static ParseTable prs = new UPCExpressionStatementParserprs();
|
private static ParseTable prs = new UPCExpressionParserprs();
|
||||||
private BacktrackingParser btParser;
|
private BacktrackingParser btParser;
|
||||||
|
|
||||||
public BacktrackingParser getParser() { return btParser; }
|
public BacktrackingParser getParser() { return btParser; }
|
||||||
|
@ -69,13 +69,13 @@ public class UPCExpressionStatementParser extends PrsStream implements RuleActio
|
||||||
return (ErrorToken) (err instanceof ErrorToken ? err : null);
|
return (ErrorToken) (err instanceof ErrorToken ? err : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public UPCExpressionStatementParser(LexStream lexStream)
|
public UPCExpressionParser(LexStream lexStream)
|
||||||
{
|
{
|
||||||
super(lexStream);
|
super(lexStream);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
super.remapTerminalSymbols(orderedTerminalSymbols(), UPCExpressionStatementParserprs.EOFT_SYMBOL);
|
super.remapTerminalSymbols(orderedTerminalSymbols(), UPCExpressionParserprs.EOFT_SYMBOL);
|
||||||
}
|
}
|
||||||
catch(NullExportedSymbolsException e) {
|
catch(NullExportedSymbolsException e) {
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@ public class UPCExpressionStatementParser extends PrsStream implements RuleActio
|
||||||
for (int i = 0; i < unimplemented_symbols.size(); i++)
|
for (int i = 0; i < unimplemented_symbols.size(); i++)
|
||||||
{
|
{
|
||||||
Integer id = (Integer) unimplemented_symbols.get(i);
|
Integer id = (Integer) unimplemented_symbols.get(i);
|
||||||
System.out.println(" " + UPCExpressionStatementParsersym.orderedTerminalSymbols[id.intValue()]);
|
System.out.println(" " + UPCExpressionParsersym.orderedTerminalSymbols[id.intValue()]);
|
||||||
}
|
}
|
||||||
System.out.println();
|
System.out.println();
|
||||||
}
|
}
|
||||||
|
@ -96,13 +96,13 @@ public class UPCExpressionStatementParser extends PrsStream implements RuleActio
|
||||||
{
|
{
|
||||||
throw new Error(new UndefinedEofSymbolException
|
throw new Error(new UndefinedEofSymbolException
|
||||||
("The Lexer does not implement the Eof symbol " +
|
("The Lexer does not implement the Eof symbol " +
|
||||||
UPCExpressionStatementParsersym.orderedTerminalSymbols[UPCExpressionStatementParserprs.EOFT_SYMBOL]));
|
UPCExpressionParsersym.orderedTerminalSymbols[UPCExpressionParserprs.EOFT_SYMBOL]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String[] orderedTerminalSymbols() { return UPCExpressionStatementParsersym.orderedTerminalSymbols; }
|
public String[] orderedTerminalSymbols() { return UPCExpressionParsersym.orderedTerminalSymbols; }
|
||||||
public String getTokenKindName(int kind) { return UPCExpressionStatementParsersym.orderedTerminalSymbols[kind]; }
|
public String getTokenKindName(int kind) { return UPCExpressionParsersym.orderedTerminalSymbols[kind]; }
|
||||||
public int getEOFTokenKind() { return UPCExpressionStatementParserprs.EOFT_SYMBOL; }
|
public int getEOFTokenKind() { return UPCExpressionParserprs.EOFT_SYMBOL; }
|
||||||
public PrsStream getParseStream() { return (PrsStream) this; }
|
public PrsStream getParseStream() { return (PrsStream) this; }
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -147,11 +147,11 @@ public class UPCExpressionStatementParser extends PrsStream implements RuleActio
|
||||||
catch (NotBacktrackParseTableException e)
|
catch (NotBacktrackParseTableException e)
|
||||||
{
|
{
|
||||||
throw new Error(new NotBacktrackParseTableException
|
throw new Error(new NotBacktrackParseTableException
|
||||||
("Regenerate UPCExpressionStatementParserprs.java with -BACKTRACK option"));
|
("Regenerate UPCExpressionParserprs.java with -BACKTRACK option"));
|
||||||
}
|
}
|
||||||
catch (BadParseSymFileException e)
|
catch (BadParseSymFileException e)
|
||||||
{
|
{
|
||||||
throw new Error(new BadParseSymFileException("Bad Parser Symbol File -- UPCExpressionStatementParsersym.java"));
|
throw new Error(new BadParseSymFileException("Bad Parser Symbol File -- UPCExpressionParsersym.java"));
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
|
@ -171,7 +171,7 @@ public class UPCExpressionStatementParser extends PrsStream implements RuleActio
|
||||||
|
|
||||||
private UPCParserAction action;
|
private UPCParserAction action;
|
||||||
|
|
||||||
public UPCExpressionStatementParser() { // constructor
|
public UPCExpressionParser() { // constructor
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initActions(IASTTranslationUnit tu) {
|
private void initActions(IASTTranslationUnit tu) {
|
||||||
|
@ -213,11 +213,11 @@ public IASTNode getSecondaryParseResult() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String[] getOrderedTerminalSymbols() {
|
public String[] getOrderedTerminalSymbols() {
|
||||||
return UPCExpressionStatementParsersym.orderedTerminalSymbols;
|
return UPCExpressionParsersym.orderedTerminalSymbols;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "UPCExpressionStatementParser"; //$NON-NLS-1$
|
return "UPCExpressionParser"; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -231,11 +231,11 @@ public void setTokens(List<IToken> tokens) {
|
||||||
token.setKind(tokenMap.mapKind(token.getKind()));
|
token.setKind(tokenMap.mapKind(token.getKind()));
|
||||||
addToken(token);
|
addToken(token);
|
||||||
}
|
}
|
||||||
addToken(new Token(null, 0, 0, UPCExpressionStatementParsersym.TK_EOF_TOKEN));
|
addToken(new Token(null, 0, 0, UPCExpressionParsersym.TK_EOF_TOKEN));
|
||||||
}
|
}
|
||||||
|
|
||||||
public UPCExpressionStatementParser(String[] mapFrom) { // constructor
|
public UPCExpressionParser(String[] mapFrom) { // constructor
|
||||||
tokenMap = new TokenMap(UPCExpressionStatementParsersym.orderedTerminalSymbols, mapFrom);
|
tokenMap = new TokenMap(UPCExpressionParsersym.orderedTerminalSymbols, mapFrom);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.upc;
|
package org.eclipse.cdt.internal.core.dom.parser.upc;
|
||||||
|
|
||||||
public interface UPCExpressionStatementParsersym {
|
public interface UPCExpressionParsersym {
|
||||||
public final static int
|
public final static int
|
||||||
TK_auto = 33,
|
TK_auto = 33,
|
||||||
TK_break = 90,
|
TK_break = 90,
|
||||||
|
@ -81,11 +81,11 @@ public interface UPCExpressionStatementParsersym {
|
||||||
TK_GT = 65,
|
TK_GT = 65,
|
||||||
TK_LE = 66,
|
TK_LE = 66,
|
||||||
TK_GE = 67,
|
TK_GE = 67,
|
||||||
TK_EQ = 71,
|
TK_EQ = 70,
|
||||||
TK_NE = 72,
|
TK_NE = 71,
|
||||||
TK_Caret = 73,
|
TK_Caret = 72,
|
||||||
TK_Or = 74,
|
TK_Or = 73,
|
||||||
TK_AndAnd = 75,
|
TK_AndAnd = 74,
|
||||||
TK_OrOr = 77,
|
TK_OrOr = 77,
|
||||||
TK_Question = 78,
|
TK_Question = 78,
|
||||||
TK_Colon = 68,
|
TK_Colon = 68,
|
||||||
|
@ -105,7 +105,7 @@ public interface UPCExpressionStatementParsersym {
|
||||||
TK_RightBracket = 59,
|
TK_RightBracket = 59,
|
||||||
TK_RightParen = 50,
|
TK_RightParen = 50,
|
||||||
TK_RightBrace = 55,
|
TK_RightBrace = 55,
|
||||||
TK_SemiColon = 70,
|
TK_SemiColon = 75,
|
||||||
TK_MYTHREAD = 24,
|
TK_MYTHREAD = 24,
|
||||||
TK_THREADS = 25,
|
TK_THREADS = 25,
|
||||||
TK_UPC_MAX_BLOCKSIZE = 26,
|
TK_UPC_MAX_BLOCKSIZE = 26,
|
||||||
|
@ -194,12 +194,12 @@ public interface UPCExpressionStatementParsersym {
|
||||||
"GE",
|
"GE",
|
||||||
"Colon",
|
"Colon",
|
||||||
"Assign",
|
"Assign",
|
||||||
"SemiColon",
|
|
||||||
"EQ",
|
"EQ",
|
||||||
"NE",
|
"NE",
|
||||||
"Caret",
|
"Caret",
|
||||||
"Or",
|
"Or",
|
||||||
"AndAnd",
|
"AndAnd",
|
||||||
|
"SemiColon",
|
||||||
"Arrow",
|
"Arrow",
|
||||||
"OrOr",
|
"OrOr",
|
||||||
"Question",
|
"Question",
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue