mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
[272950] [LR Parser] Add ability to pass properties to extending parsers and update (regenerate) the parsers to support this.
This commit is contained in:
parent
21e1364cb5
commit
0a80b06634
55 changed files with 14463 additions and 14722 deletions
|
@ -643,7 +643,7 @@ statement
|
|||
|
||||
|
||||
labeled_statement
|
||||
::= identifier ':' statement
|
||||
::= 'identifier' ':' statement
|
||||
/. $Build consumeStatementLabeled(); $EndBuild ./
|
||||
| 'case' constant_expression ':' statement
|
||||
/. $Build consumeStatementCase(); $EndBuild ./
|
||||
|
|
|
@ -51,8 +51,7 @@ $Define
|
|||
$action_initializations /.
|
||||
|
||||
gnuAction = new $gnu_action_class (this, astStack, $node_factory_create_expression);
|
||||
gnuAction.setParserOptions(options);
|
||||
//gnuAction.setBaseAction(action);
|
||||
gnuAction.setParserProperties(properties);
|
||||
./
|
||||
|
||||
$End
|
||||
|
|
|
@ -296,7 +296,7 @@ $End
|
|||
$Notice
|
||||
-- Copied into all files generated by LPG
|
||||
/./*******************************************************************************
|
||||
* Copyright (c) 2006, 2008 IBM Corporation and others.
|
||||
* Copyright (c) 2006, 2009 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -353,17 +353,17 @@ $Headers
|
|||
private IASTCompletionNode compNode;
|
||||
|
||||
|
||||
public $action_type(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Set<IParser.Options> options) {
|
||||
initActions(options);
|
||||
public $action_type(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Map<String,String> properties) {
|
||||
initActions(properties);
|
||||
action.initializeTranslationUnit(scanner, builtinBindingsProvider, index);
|
||||
CPreprocessorAdapter.runCPreprocessor(scanner, this, tokenMap);
|
||||
}
|
||||
|
||||
private void initActions(Set<IParser.Options> options) {
|
||||
private void initActions(Map<String,String> properties) {
|
||||
ScopedStack<Object> astStack = new ScopedStack<Object>();
|
||||
|
||||
action = new $build_action_class(this, astStack, $node_factory_create_expression, $parser_factory_create_expression);
|
||||
action.setParserOptions(options);
|
||||
action.setParserProperties(properties);
|
||||
|
||||
$action_initializations
|
||||
}
|
||||
|
|
|
@ -56,8 +56,8 @@ $Headers
|
|||
addToken(new Token(null, 0, 0, $sym_type.TK_EOF_TOKEN));
|
||||
}
|
||||
|
||||
public $action_type(ITokenStream stream, Set<IParser.Options> options) { // constructor for creating secondary parser
|
||||
initActions(options);
|
||||
public $action_type(ITokenStream stream, Map<String,String> properties) { // constructor for creating secondary parser
|
||||
initActions(properties);
|
||||
tokenMap = new TokenMap($sym_type.orderedTerminalSymbols, stream.getOrderedTerminalSymbols());
|
||||
}
|
||||
|
||||
|
|
|
@ -10,9 +10,8 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.core.dom.lrparser;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ICodeReaderFactory;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTCompletionNode;
|
||||
|
@ -46,15 +45,14 @@ import org.eclipse.core.runtime.CoreException;
|
|||
/**
|
||||
* Implementation of the ILanguage extension point,
|
||||
* provides the ability to add LPG based languages to CDT.
|
||||
*
|
||||
* @author Mike Kucera
|
||||
*/
|
||||
@SuppressWarnings("restriction")
|
||||
@SuppressWarnings({ "restriction", "nls" })
|
||||
public abstract class BaseExtensibleLanguage extends AbstractLanguage {
|
||||
|
||||
|
||||
private static final boolean DEBUG_PRINT_GCC_AST = false;
|
||||
private static final boolean DEBUG_PRINT_AST = false;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
@ -63,7 +61,7 @@ public abstract class BaseExtensibleLanguage extends AbstractLanguage {
|
|||
* Can be overridden in subclasses to provide a different parser
|
||||
* for a language extension.
|
||||
*/
|
||||
protected abstract IParser<IASTTranslationUnit> getParser(IScanner scanner, IIndex index, Set<IParser.Options> options);
|
||||
protected abstract IParser<IASTTranslationUnit> getParser(IScanner scanner, IIndex index, Map<String,String> properties);
|
||||
|
||||
/**
|
||||
* Returns the ParserLanguage value that is to be used when creating
|
||||
|
@ -79,18 +77,13 @@ public abstract class BaseExtensibleLanguage extends AbstractLanguage {
|
|||
protected abstract IScannerExtensionConfiguration getScannerExtensionConfiguration();
|
||||
|
||||
|
||||
|
||||
@SuppressWarnings("nls")
|
||||
@Override
|
||||
public IASTTranslationUnit getASTTranslationUnit(CodeReader reader, IScannerInfo scanInfo,
|
||||
ICodeReaderFactory fileCreator, IIndex index, int options, IParserLogService log) throws CoreException {
|
||||
|
||||
IASTTranslationUnit gtu = null;
|
||||
if(DEBUG_PRINT_GCC_AST) {
|
||||
System.out.println();
|
||||
System.out.println("********************************************************");
|
||||
System.out.println("Parsing");
|
||||
System.out.println("Options: " + options);
|
||||
System.out.println("\n********************************************************\nParsing\nOptions: " + options);
|
||||
|
||||
ILanguage gppLanguage = getParserLanguage() == ParserLanguage.CPP ? GPPLanguage.getDefault() : GCCLanguage.getDefault();
|
||||
gtu = gppLanguage.getASTTranslationUnit(reader, scanInfo, fileCreator, index, options, log);
|
||||
|
@ -106,19 +99,14 @@ public abstract class BaseExtensibleLanguage extends AbstractLanguage {
|
|||
IScanner preprocessor = new CPreprocessor(reader, scanInfo, pl, log, config, fileCreator);
|
||||
preprocessor.setComputeImageLocations((options & ILanguage.OPTION_NO_IMAGE_LOCATIONS) == 0);
|
||||
|
||||
|
||||
//parser.setScanner(preprocessor, getTokenMap());
|
||||
//CPreprocessorAdapter.runCPreprocessor(preprocessor, parser, getTokenMap());
|
||||
|
||||
Set<IParser.Options> parserOptions = new HashSet<IParser.Options>();
|
||||
//if((options & OPTION_SKIP_FUNCTION_BODIES) != 0)
|
||||
// parserOptions.add(IParser.Options.OPTION_SKIP_FUNCTION_BODIES);
|
||||
Map<String,String> parserProperties = new HashMap<String,String>();
|
||||
parserProperties.put(LRParserProperties.TRANSLATION_UNIT_PATH, reader.getPath());
|
||||
if((options & OPTION_SKIP_FUNCTION_BODIES) != 0)
|
||||
parserProperties.put(LRParserProperties.SKIP_FUNCTION_BODIES, "true");
|
||||
if((options & OPTION_SKIP_TRIVIAL_EXPRESSIONS_IN_AGGREGATE_INITIALIZERS) != 0)
|
||||
parserOptions.add(IParser.Options.OPTION_SKIP_TRIVIAL_EXPRESSIONS_IN_AGGREGATE_INITIALIZERS);
|
||||
if(!parserOptions.isEmpty())
|
||||
parserOptions = EnumSet.copyOf(parserOptions);
|
||||
parserProperties.put(LRParserProperties.SKIP_TRIVIAL_EXPRESSIONS_IN_AGGREGATE_INITIALIZERS, "true");
|
||||
|
||||
IParser<IASTTranslationUnit> parser = getParser(preprocessor, index, parserOptions);
|
||||
IParser<IASTTranslationUnit> parser = getParser(preprocessor, index, parserProperties);
|
||||
IASTTranslationUnit tu = parser.parse();
|
||||
tu.setIsHeaderUnit((options & OPTION_IS_SOURCE_UNIT) == 0); // the TU is marked as either a source file or a header file
|
||||
|
||||
|
@ -139,7 +127,6 @@ public abstract class BaseExtensibleLanguage extends AbstractLanguage {
|
|||
}
|
||||
|
||||
|
||||
@SuppressWarnings("nls")
|
||||
public IASTCompletionNode getCompletionNode(CodeReader reader,
|
||||
IScannerInfo scanInfo, ICodeReaderFactory fileCreator,
|
||||
IIndex index, IParserLogService log, int offset) throws CoreException {
|
||||
|
@ -162,9 +149,15 @@ public abstract class BaseExtensibleLanguage extends AbstractLanguage {
|
|||
IScanner preprocessor = new CPreprocessor(reader, scanInfo, pl, log, config, fileCreator);
|
||||
preprocessor.setContentAssistMode(offset);
|
||||
|
||||
Set<IParser.Options> parserOptions = EnumSet.of(IParser.Options.OPTION_SKIP_TRIVIAL_EXPRESSIONS_IN_AGGREGATE_INITIALIZERS);
|
||||
IParser<IASTTranslationUnit> parser = getParser(preprocessor, index, parserOptions);
|
||||
|
||||
Map<String,String> parserProperties = new HashMap<String,String>();
|
||||
parserProperties.put(LRParserProperties.TRANSLATION_UNIT_PATH, reader.getPath());
|
||||
parserProperties.put(LRParserProperties.SKIP_FUNCTION_BODIES, "true");
|
||||
parserProperties.put(LRParserProperties.SKIP_TRIVIAL_EXPRESSIONS_IN_AGGREGATE_INITIALIZERS, "true");
|
||||
|
||||
IParser<IASTTranslationUnit> parser = getParser(preprocessor, index, parserProperties);
|
||||
parser.parse();
|
||||
|
||||
IASTCompletionNode completionNode = parser.getCompletionNode();
|
||||
|
||||
if(DEBUG_PRINT_AST) {
|
||||
|
@ -179,7 +172,6 @@ public abstract class BaseExtensibleLanguage extends AbstractLanguage {
|
|||
/*
|
||||
* For debugging.
|
||||
*/
|
||||
@SuppressWarnings("nls")
|
||||
private static void printCompletionNode(IASTCompletionNode cn) {
|
||||
if(cn == null) {
|
||||
System.out.println("Completion node is null");
|
||||
|
|
|
@ -10,11 +10,8 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.core.dom.lrparser;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.IASTCompletionNode;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||
import org.eclipse.cdt.core.model.ILanguage;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -24,49 +21,15 @@ import org.eclipse.cdt.core.model.ILanguage;
|
|||
*/
|
||||
public interface IParser<N extends IASTNode> {
|
||||
|
||||
/**
|
||||
* Options used by implementations of IParser. Some of the options
|
||||
* may be duplicates of the options in ILanguage.
|
||||
* @see ILanguage
|
||||
*/
|
||||
public enum Options {
|
||||
|
||||
/**
|
||||
* The LR parsers do not actually skip the parsing of function bodies,
|
||||
* but this option does have the effect of not generating AST nodes
|
||||
* for function bodies.
|
||||
*
|
||||
* TODO Implement this
|
||||
*/
|
||||
//OPTION_SKIP_FUNCTION_BODIES,
|
||||
|
||||
/**
|
||||
* Instructs the parser not to create AST nodes for expressions
|
||||
* within aggregate initializers when they do not contain names.
|
||||
*
|
||||
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=253690
|
||||
*/
|
||||
OPTION_SKIP_TRIVIAL_EXPRESSIONS_IN_AGGREGATE_INITIALIZERS,
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Performs the actual parse.
|
||||
*
|
||||
* The given translation unit is assumed to not have any children, during the parse
|
||||
* it will have its declaration fields filled in, resulting in a complete AST.
|
||||
*
|
||||
* If there were any errors during the parse these will be represented in the
|
||||
* AST as problem nodes.
|
||||
*
|
||||
* If the parser encounters a completion token then a completion node
|
||||
* is returned, null is returned otherwise.
|
||||
*
|
||||
* @param tu An IASTTranslationUnit instance that will have its declarations filled in.
|
||||
* @param options a Set of parser options, use an EnumSet
|
||||
* @return a completion node if a completion token is encountered during the parser, null otherwise.
|
||||
* @throws NullPointerException if either parameter is null
|
||||
* @see EnumSet
|
||||
* will be available via the getCompletionNode() method.
|
||||
*/
|
||||
public N parse();
|
||||
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2009 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* IBM Corporation - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.core.dom.lrparser;
|
||||
|
||||
|
||||
@SuppressWarnings("nls")
|
||||
public final class LRParserProperties {
|
||||
|
||||
/**
|
||||
* The LR parsers do not actually skip the parsing of function bodies,
|
||||
* but this option does have the effect of not generating AST nodes
|
||||
* for function bodies.
|
||||
*
|
||||
* TODO this is not implemented yet in the LR parser
|
||||
*
|
||||
* Possible values: "true", null
|
||||
*/
|
||||
public static final String SKIP_FUNCTION_BODIES = "org.eclipse.cdt.core.dom.lrparser.skipFunctionBodies";
|
||||
|
||||
/**
|
||||
* Instructs the parser not to create AST nodes for expressions
|
||||
* within aggregate initializers when they do not contain names.
|
||||
*
|
||||
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=253690
|
||||
*
|
||||
* Possible values: "true", null
|
||||
*/
|
||||
public static final String SKIP_TRIVIAL_EXPRESSIONS_IN_AGGREGATE_INITIALIZERS = "org.eclipse.cdt.core.dom.lrparser.skipTrivialExpressionsInAggregateInitializers";
|
||||
|
||||
/**
|
||||
* The location of the translation unit as given by the CodeReader.
|
||||
*/
|
||||
public static final String TRANSLATION_UNIT_PATH = "org.eclipse.cdt.core.dom.lrparser.translationUnitPath";
|
||||
|
||||
}
|
|
@ -10,16 +10,15 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.core.dom.lrparser.action;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.Map;
|
||||
|
||||
import lpg.lpgjavaruntime.IToken;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.IASTCompletionNode;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||
import org.eclipse.cdt.core.dom.lrparser.IParser;
|
||||
import org.eclipse.cdt.core.dom.lrparser.ISecondaryParser;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
||||
|
||||
|
@ -50,7 +49,7 @@ public abstract class AbstractParserAction {
|
|||
protected ASTCompletionNode completionNode;
|
||||
|
||||
/** Options that change the behavior of the parser actions */
|
||||
protected Set<IParser.Options> options = EnumSet.noneOf(IParser.Options.class);
|
||||
protected Map<String,String> properties = Collections.emptyMap();
|
||||
|
||||
|
||||
|
||||
|
@ -102,8 +101,8 @@ public abstract class AbstractParserAction {
|
|||
return name;
|
||||
}
|
||||
|
||||
public void setParserOptions(Set<IParser.Options> options) {
|
||||
this.options = options == null ? EnumSet.noneOf(IParser.Options.class) : options;
|
||||
public void setParserProperties(Map<String,String> properties) {
|
||||
this.properties = properties == null ? Collections.<String,String>emptyMap() : properties;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -69,9 +69,9 @@ import org.eclipse.cdt.core.dom.ast.IScope;
|
|||
import org.eclipse.cdt.core.dom.ast.IASTEnumerationSpecifier.IASTEnumerator;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCastExpression;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTLiteralExpression;
|
||||
import org.eclipse.cdt.core.dom.lrparser.IParser;
|
||||
import org.eclipse.cdt.core.dom.lrparser.ISecondaryParser;
|
||||
import org.eclipse.cdt.core.dom.lrparser.LRParserPlugin;
|
||||
import org.eclipse.cdt.core.dom.lrparser.LRParserProperties;
|
||||
import org.eclipse.cdt.core.dom.parser.IBuiltinBindingsProvider;
|
||||
import org.eclipse.cdt.core.index.IIndex;
|
||||
import org.eclipse.cdt.core.parser.IProblem;
|
||||
|
@ -217,7 +217,7 @@ public abstract class BuildASTParserAction extends AbstractParserAction {
|
|||
List<IToken> expressionTokens = stream.getRuleTokens();
|
||||
expressionTokens = expressionTokens.subList(0, expressionTokens.size()-1); // remove the semicolon at the end
|
||||
|
||||
ISecondaryParser<IASTExpression> expressionParser = parserFactory.getExpressionParser(stream, options);
|
||||
ISecondaryParser<IASTExpression> expressionParser = parserFactory.getExpressionParser(stream, properties);
|
||||
IASTExpression expr = runSecondaryParser(expressionParser, expressionTokens);
|
||||
|
||||
if(expr != null) { // the parse may fail
|
||||
|
@ -394,7 +394,7 @@ public abstract class BuildASTParserAction extends AbstractParserAction {
|
|||
IASTExpression alternateExpr = null;
|
||||
if(operator == IASTCastExpression.op_cast) { // don't reparse for dynamic_cast etc as those are not ambiguous
|
||||
// try parsing as non-cast to resolve ambiguities
|
||||
ISecondaryParser<IASTExpression> secondaryParser = parserFactory.getNoCastExpressionParser(stream, options);
|
||||
ISecondaryParser<IASTExpression> secondaryParser = parserFactory.getNoCastExpressionParser(stream, properties);
|
||||
alternateExpr = runSecondaryParser(secondaryParser);
|
||||
}
|
||||
|
||||
|
@ -434,7 +434,7 @@ public abstract class BuildASTParserAction extends AbstractParserAction {
|
|||
setOffsetAndLength(expr);
|
||||
|
||||
// try parsing as an expression to resolve ambiguities
|
||||
ISecondaryParser<IASTExpression> secondaryParser = parserFactory.getSizeofExpressionParser(stream, options);
|
||||
ISecondaryParser<IASTExpression> secondaryParser = parserFactory.getSizeofExpressionParser(stream, properties);
|
||||
IASTExpression alternateExpr = runSecondaryParser(secondaryParser);
|
||||
|
||||
if(alternateExpr == null)
|
||||
|
@ -1019,7 +1019,7 @@ public abstract class BuildASTParserAction extends AbstractParserAction {
|
|||
|
||||
private boolean discardInitializer(IASTExpression expression) {
|
||||
return initializerListNestingLevel > 0
|
||||
&& options.contains(IParser.Options.OPTION_SKIP_TRIVIAL_EXPRESSIONS_IN_AGGREGATE_INITIALIZERS)
|
||||
&& "true".equals(properties.get(LRParserProperties.SKIP_TRIVIAL_EXPRESSIONS_IN_AGGREGATE_INITIALIZERS)) //$NON-NLS-1$
|
||||
&& !ASTQueries.canContainName(expression);
|
||||
}
|
||||
|
||||
|
|
|
@ -10,10 +10,9 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.core.dom.lrparser.action;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||
import org.eclipse.cdt.core.dom.lrparser.IParser;
|
||||
import org.eclipse.cdt.core.dom.lrparser.ISecondaryParser;
|
||||
|
||||
|
||||
|
@ -30,20 +29,20 @@ public interface ISecondaryParserFactory {
|
|||
/**
|
||||
* Get the parser that will recognize expressions.
|
||||
*/
|
||||
ISecondaryParser<IASTExpression> getExpressionParser(ITokenStream stream, Set<IParser.Options> options);
|
||||
ISecondaryParser<IASTExpression> getExpressionParser(ITokenStream stream, Map<String,String> properties);
|
||||
|
||||
|
||||
/**
|
||||
* Expression parser that does not recognize cast expressions,
|
||||
* used to disambiguate casts.
|
||||
*/
|
||||
ISecondaryParser<IASTExpression> getNoCastExpressionParser(ITokenStream stream, Set<IParser.Options> options);
|
||||
ISecondaryParser<IASTExpression> getNoCastExpressionParser(ITokenStream stream, Map<String,String> properties);
|
||||
|
||||
|
||||
/**
|
||||
* Expression parser that treats all sizeof and typeid expressions
|
||||
* as unary expressions.
|
||||
*/
|
||||
ISecondaryParser<IASTExpression> getSizeofExpressionParser(ITokenStream stream, Set<IParser.Options> options);
|
||||
ISecondaryParser<IASTExpression> getSizeofExpressionParser(ITokenStream stream, Map<String,String> properties);
|
||||
|
||||
}
|
||||
|
|
|
@ -10,10 +10,9 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.core.dom.lrparser.action.c99;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||
import org.eclipse.cdt.core.dom.lrparser.IParser;
|
||||
import org.eclipse.cdt.core.dom.lrparser.ISecondaryParser;
|
||||
import org.eclipse.cdt.core.dom.lrparser.action.ISecondaryParserFactory;
|
||||
import org.eclipse.cdt.core.dom.lrparser.action.ITokenStream;
|
||||
|
@ -30,15 +29,15 @@ public class C99SecondaryParserFactory implements ISecondaryParserFactory {
|
|||
}
|
||||
|
||||
|
||||
public ISecondaryParser<IASTExpression> getExpressionParser(ITokenStream stream, Set<IParser.Options> options) {
|
||||
return new C99ExpressionParser(stream, options);
|
||||
public ISecondaryParser<IASTExpression> getExpressionParser(ITokenStream stream, Map<String,String> properties) {
|
||||
return new C99ExpressionParser(stream, properties);
|
||||
}
|
||||
|
||||
public ISecondaryParser<IASTExpression> getNoCastExpressionParser(ITokenStream stream, Set<IParser.Options> options) {
|
||||
return new C99NoCastExpressionParser(stream, options);
|
||||
public ISecondaryParser<IASTExpression> getNoCastExpressionParser(ITokenStream stream, Map<String,String> properties) {
|
||||
return new C99NoCastExpressionParser(stream, properties);
|
||||
}
|
||||
|
||||
public ISecondaryParser<IASTExpression> getSizeofExpressionParser(ITokenStream stream, Set<IParser.Options> options) {
|
||||
return new C99SizeofExpressionParser(stream, options);
|
||||
public ISecondaryParser<IASTExpression> getSizeofExpressionParser(ITokenStream stream, Map<String,String> properties) {
|
||||
return new C99SizeofExpressionParser(stream, properties);
|
||||
}
|
||||
}
|
|
@ -407,7 +407,7 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
|
|||
*/
|
||||
public void consumeTemplateArgumentTypeId() {
|
||||
// TODO is this necessary? It should be able to tell if it looks like an id expression
|
||||
ISecondaryParser<IASTExpression> secondaryParser = parserFactory.getExpressionParser(stream, options);
|
||||
ISecondaryParser<IASTExpression> secondaryParser = parserFactory.getExpressionParser(stream, properties);
|
||||
IASTExpression result = runSecondaryParser(secondaryParser);
|
||||
|
||||
// The grammar rule allows assignment_expression, but the ambiguity
|
||||
|
@ -1276,7 +1276,7 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
|
|||
if(!(declarator instanceof IASTFunctionDeclarator))
|
||||
return;
|
||||
|
||||
ISecondaryParser<IASTDeclarator> secondaryParser = parserFactory.getNoFunctionDeclaratorParser(stream, options);
|
||||
ISecondaryParser<IASTDeclarator> secondaryParser = parserFactory.getNoFunctionDeclaratorParser(stream, properties);
|
||||
IASTDeclarator notFunctionDeclarator = runSecondaryParser(secondaryParser);
|
||||
|
||||
if(notFunctionDeclarator == null)
|
||||
|
@ -1684,7 +1684,7 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
|
|||
* Yes its a hack.
|
||||
*/
|
||||
public void consumeTemplateParamterDeclaration() {
|
||||
ISecondaryParser<ICPPASTTemplateParameter> typeParameterParser = parserFactory.getTemplateTypeParameterParser(stream, options);
|
||||
ISecondaryParser<ICPPASTTemplateParameter> typeParameterParser = parserFactory.getTemplateTypeParameterParser(stream, properties);
|
||||
IASTNode alternate = runSecondaryParser(typeParameterParser);
|
||||
|
||||
if(alternate == null)
|
||||
|
|
|
@ -10,12 +10,11 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.core.dom.lrparser.action.cpp;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateParameter;
|
||||
import org.eclipse.cdt.core.dom.lrparser.IParser;
|
||||
import org.eclipse.cdt.core.dom.lrparser.ISecondaryParser;
|
||||
import org.eclipse.cdt.core.dom.lrparser.action.ITokenStream;
|
||||
import org.eclipse.cdt.internal.core.dom.lrparser.cpp.CPPExpressionParser;
|
||||
|
@ -34,24 +33,24 @@ public class CPPSecondaryParserFactory implements ICPPSecondaryParserFactory {
|
|||
}
|
||||
|
||||
|
||||
public ISecondaryParser<ICPPASTTemplateParameter> getTemplateTypeParameterParser(ITokenStream stream, Set<IParser.Options> options) {
|
||||
return new CPPTemplateTypeParameterParser(stream, options);
|
||||
public ISecondaryParser<ICPPASTTemplateParameter> getTemplateTypeParameterParser(ITokenStream stream, Map<String,String> properties) {
|
||||
return new CPPTemplateTypeParameterParser(stream, properties);
|
||||
}
|
||||
|
||||
public ISecondaryParser<IASTDeclarator> getNoFunctionDeclaratorParser(ITokenStream stream, Set<IParser.Options> options) {
|
||||
return new CPPNoFunctionDeclaratorParser(stream, options);
|
||||
public ISecondaryParser<IASTDeclarator> getNoFunctionDeclaratorParser(ITokenStream stream, Map<String,String> properties) {
|
||||
return new CPPNoFunctionDeclaratorParser(stream, properties);
|
||||
}
|
||||
|
||||
public ISecondaryParser<IASTExpression> getExpressionParser(ITokenStream stream, Set<IParser.Options> options) {
|
||||
return new CPPExpressionParser(stream, options);
|
||||
public ISecondaryParser<IASTExpression> getExpressionParser(ITokenStream stream, Map<String,String> properties) {
|
||||
return new CPPExpressionParser(stream, properties);
|
||||
}
|
||||
|
||||
public ISecondaryParser<IASTExpression> getNoCastExpressionParser(ITokenStream stream, Set<IParser.Options> options) {
|
||||
return new CPPNoCastExpressionParser(stream, options);
|
||||
public ISecondaryParser<IASTExpression> getNoCastExpressionParser(ITokenStream stream, Map<String,String> properties) {
|
||||
return new CPPNoCastExpressionParser(stream, properties);
|
||||
}
|
||||
|
||||
public ISecondaryParser<IASTExpression> getSizeofExpressionParser(ITokenStream stream, Set<IParser.Options> options) {
|
||||
return new CPPSizeofExpressionParser(stream, options);
|
||||
public ISecondaryParser<IASTExpression> getSizeofExpressionParser(ITokenStream stream, Map<String,String> properties) {
|
||||
return new CPPSizeofExpressionParser(stream, properties);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -10,11 +10,10 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.core.dom.lrparser.action.cpp;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateParameter;
|
||||
import org.eclipse.cdt.core.dom.lrparser.IParser;
|
||||
import org.eclipse.cdt.core.dom.lrparser.ISecondaryParser;
|
||||
import org.eclipse.cdt.core.dom.lrparser.action.ISecondaryParserFactory;
|
||||
import org.eclipse.cdt.core.dom.lrparser.action.ITokenStream;
|
||||
|
@ -27,8 +26,8 @@ import org.eclipse.cdt.core.dom.lrparser.action.ITokenStream;
|
|||
*/
|
||||
public interface ICPPSecondaryParserFactory extends ISecondaryParserFactory {
|
||||
|
||||
ISecondaryParser<ICPPASTTemplateParameter> getTemplateTypeParameterParser(ITokenStream stream, Set<IParser.Options> options);
|
||||
ISecondaryParser<ICPPASTTemplateParameter> getTemplateTypeParameterParser(ITokenStream stream, Map<String,String> properties);
|
||||
|
||||
ISecondaryParser<IASTDeclarator> getNoFunctionDeclaratorParser(ITokenStream stream, Set<IParser.Options> options);
|
||||
ISecondaryParser<IASTDeclarator> getNoFunctionDeclaratorParser(ITokenStream stream, Map<String,String> properties);
|
||||
|
||||
}
|
||||
|
|
|
@ -10,10 +10,9 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.core.dom.lrparser.action.gnu;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||
import org.eclipse.cdt.core.dom.lrparser.IParser;
|
||||
import org.eclipse.cdt.core.dom.lrparser.ISecondaryParser;
|
||||
import org.eclipse.cdt.core.dom.lrparser.action.ISecondaryParserFactory;
|
||||
import org.eclipse.cdt.core.dom.lrparser.action.ITokenStream;
|
||||
|
@ -30,15 +29,15 @@ public class GCCSecondaryParserFactory implements ISecondaryParserFactory {
|
|||
}
|
||||
|
||||
|
||||
public ISecondaryParser<IASTExpression> getExpressionParser(ITokenStream stream, Set<IParser.Options> options) {
|
||||
return new C99ExpressionParser(stream, options);
|
||||
public ISecondaryParser<IASTExpression> getExpressionParser(ITokenStream stream, Map<String,String> properties) {
|
||||
return new C99ExpressionParser(stream, properties);
|
||||
}
|
||||
|
||||
public ISecondaryParser<IASTExpression> getNoCastExpressionParser(ITokenStream stream, Set<IParser.Options> options) {
|
||||
return new C99NoCastExpressionParser(stream, options);
|
||||
public ISecondaryParser<IASTExpression> getNoCastExpressionParser(ITokenStream stream, Map<String,String> properties) {
|
||||
return new C99NoCastExpressionParser(stream, properties);
|
||||
}
|
||||
|
||||
public ISecondaryParser<IASTExpression> getSizeofExpressionParser(ITokenStream stream, Set<IParser.Options> options) {
|
||||
return new GCCSizeofExpressionParser(stream, options);
|
||||
public ISecondaryParser<IASTExpression> getSizeofExpressionParser(ITokenStream stream, Map<String,String> properties) {
|
||||
return new GCCSizeofExpressionParser(stream, properties);
|
||||
}
|
||||
}
|
|
@ -10,12 +10,11 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.core.dom.lrparser.action.gnu;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateParameter;
|
||||
import org.eclipse.cdt.core.dom.lrparser.IParser;
|
||||
import org.eclipse.cdt.core.dom.lrparser.ISecondaryParser;
|
||||
import org.eclipse.cdt.core.dom.lrparser.action.ITokenStream;
|
||||
import org.eclipse.cdt.core.dom.lrparser.action.cpp.ICPPSecondaryParserFactory;
|
||||
|
@ -35,24 +34,24 @@ public class GPPSecondaryParserFactory implements ICPPSecondaryParserFactory {
|
|||
}
|
||||
|
||||
|
||||
public ISecondaryParser<ICPPASTTemplateParameter> getTemplateTypeParameterParser(ITokenStream stream, Set<IParser.Options> options) {
|
||||
return new CPPTemplateTypeParameterParser(stream, options);
|
||||
public ISecondaryParser<ICPPASTTemplateParameter> getTemplateTypeParameterParser(ITokenStream stream, Map<String,String> properties) {
|
||||
return new CPPTemplateTypeParameterParser(stream, properties);
|
||||
}
|
||||
|
||||
public ISecondaryParser<IASTDeclarator> getNoFunctionDeclaratorParser(ITokenStream stream, Set<IParser.Options> options) {
|
||||
return new CPPNoFunctionDeclaratorParser(stream, options);
|
||||
public ISecondaryParser<IASTDeclarator> getNoFunctionDeclaratorParser(ITokenStream stream, Map<String,String> properties) {
|
||||
return new CPPNoFunctionDeclaratorParser(stream, properties);
|
||||
}
|
||||
|
||||
public ISecondaryParser<IASTExpression> getExpressionParser(ITokenStream stream, Set<IParser.Options> options) {
|
||||
return new CPPExpressionParser(stream, options);
|
||||
public ISecondaryParser<IASTExpression> getExpressionParser(ITokenStream stream, Map<String,String> properties) {
|
||||
return new CPPExpressionParser(stream, properties);
|
||||
}
|
||||
|
||||
public ISecondaryParser<IASTExpression> getNoCastExpressionParser(ITokenStream stream, Set<IParser.Options> options) {
|
||||
return new CPPNoCastExpressionParser(stream, options);
|
||||
public ISecondaryParser<IASTExpression> getNoCastExpressionParser(ITokenStream stream, Map<String,String> properties) {
|
||||
return new CPPNoCastExpressionParser(stream, properties);
|
||||
}
|
||||
|
||||
public ISecondaryParser<IASTExpression> getSizeofExpressionParser(ITokenStream stream, Set<IParser.Options> options) {
|
||||
return new GPPSizeofExpressionParser(stream, options);
|
||||
public ISecondaryParser<IASTExpression> getSizeofExpressionParser(ITokenStream stream, Map<String,String> properties) {
|
||||
return new GPPSizeofExpressionParser(stream, properties);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -10,14 +10,13 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.core.dom.lrparser.c99;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ILinkage;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
|
||||
import org.eclipse.cdt.core.dom.lrparser.BaseExtensibleLanguage;
|
||||
import org.eclipse.cdt.core.dom.lrparser.IParser;
|
||||
import org.eclipse.cdt.core.dom.lrparser.ScannerExtensionConfiguration;
|
||||
import org.eclipse.cdt.core.dom.lrparser.IParser.Options;
|
||||
import org.eclipse.cdt.core.dom.parser.IBuiltinBindingsProvider;
|
||||
import org.eclipse.cdt.core.dom.parser.IScannerExtensionConfiguration;
|
||||
import org.eclipse.cdt.core.dom.parser.c.ANSICParserExtensionConfiguration;
|
||||
|
@ -44,8 +43,8 @@ public class C99Language extends BaseExtensibleLanguage {
|
|||
|
||||
|
||||
@Override
|
||||
protected IParser<IASTTranslationUnit> getParser(IScanner scanner, IIndex index, Set<Options> options) {
|
||||
return new C99Parser(scanner, DOMToC99TokenMap.DEFAULT_MAP, getBuiltinBindingsProvider(), index, options);
|
||||
protected IParser<IASTTranslationUnit> getParser(IScanner scanner, IIndex index, Map<String,String> properties) {
|
||||
return new C99Parser(scanner, DOMToC99TokenMap.DEFAULT_MAP, getBuiltinBindingsProvider(), index, properties);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.core.dom.lrparser.cpp;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ILinkage;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
|
||||
|
@ -41,8 +41,8 @@ public class ISOCPPLanguage extends BaseExtensibleLanguage {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected IParser<IASTTranslationUnit> getParser(IScanner scanner, IIndex index, Set<IParser.Options> options) {
|
||||
return new CPPParser(scanner, DOMToISOCPPTokenMap.DEFAULT_MAP, getBuiltinBindingsProvider(), index, options);
|
||||
protected IParser<IASTTranslationUnit> getParser(IScanner scanner, IIndex index, Map<String,String> properties) {
|
||||
return new CPPParser(scanner, DOMToISOCPPTokenMap.DEFAULT_MAP, getBuiltinBindingsProvider(), index, properties);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.core.dom.lrparser.gnu;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ILinkage;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
|
||||
|
@ -41,8 +41,8 @@ public class GCCLanguage extends BaseExtensibleLanguage {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected IParser<IASTTranslationUnit> getParser(IScanner scanner, IIndex index, Set<IParser.Options> options) {
|
||||
return new GCCParser(scanner, DOMToGCCTokenMap.DEFAULT_MAP, getBuiltinBindingsProvider(), index, options);
|
||||
protected IParser<IASTTranslationUnit> getParser(IScanner scanner, IIndex index, Map<String,String> properties) {
|
||||
return new GCCParser(scanner, DOMToGCCTokenMap.DEFAULT_MAP, getBuiltinBindingsProvider(), index, properties);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.core.dom.lrparser.gnu;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ILinkage;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
|
||||
|
@ -41,8 +41,8 @@ public class GPPLanguage extends BaseExtensibleLanguage {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected IParser<IASTTranslationUnit> getParser(IScanner scanner, IIndex index, Set<IParser.Options> options) {
|
||||
return new GPPParser(scanner, DOMToGPPTokenMap.DEFAULT_MAP, getBuiltinBindingsProvider(), index, options);
|
||||
protected IParser<IASTTranslationUnit> getParser(IScanner scanner, IIndex index, Map<String,String> properties) {
|
||||
return new GPPParser(scanner, DOMToGPPTokenMap.DEFAULT_MAP, getBuiltinBindingsProvider(), index, properties);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -177,17 +177,17 @@ private C99BuildASTParserAction action;
|
|||
private IASTCompletionNode compNode;
|
||||
|
||||
|
||||
public C99ExpressionParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Set<IParser.Options> options) {
|
||||
initActions(options);
|
||||
public C99ExpressionParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Map<String,String> properties) {
|
||||
initActions(properties);
|
||||
action.initializeTranslationUnit(scanner, builtinBindingsProvider, index);
|
||||
CPreprocessorAdapter.runCPreprocessor(scanner, this, tokenMap);
|
||||
}
|
||||
|
||||
private void initActions(Set<IParser.Options> options) {
|
||||
private void initActions(Map<String,String> properties) {
|
||||
ScopedStack<Object> astStack = new ScopedStack<Object>();
|
||||
|
||||
action = new C99BuildASTParserAction (this, astStack, CNodeFactory.getDefault() , C99SecondaryParserFactory.getDefault() );
|
||||
action.setParserOptions(options);
|
||||
action.setParserProperties(properties);
|
||||
|
||||
|
||||
}
|
||||
|
@ -244,8 +244,8 @@ public void setTokens(List<IToken> tokens) {
|
|||
addToken(new Token(null, 0, 0, C99ExpressionParsersym.TK_EOF_TOKEN));
|
||||
}
|
||||
|
||||
public C99ExpressionParser(ITokenStream stream, Set<IParser.Options> options) { // constructor for creating secondary parser
|
||||
initActions(options);
|
||||
public C99ExpressionParser(ITokenStream stream, Map<String,String> properties) { // constructor for creating secondary parser
|
||||
initActions(properties);
|
||||
tokenMap = new TokenMap(C99ExpressionParsersym.orderedTerminalSymbols, stream.getOrderedTerminalSymbols());
|
||||
}
|
||||
|
||||
|
|
|
@ -177,17 +177,17 @@ private C99BuildASTParserAction action;
|
|||
private IASTCompletionNode compNode;
|
||||
|
||||
|
||||
public C99NoCastExpressionParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Set<IParser.Options> options) {
|
||||
initActions(options);
|
||||
public C99NoCastExpressionParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Map<String,String> properties) {
|
||||
initActions(properties);
|
||||
action.initializeTranslationUnit(scanner, builtinBindingsProvider, index);
|
||||
CPreprocessorAdapter.runCPreprocessor(scanner, this, tokenMap);
|
||||
}
|
||||
|
||||
private void initActions(Set<IParser.Options> options) {
|
||||
private void initActions(Map<String,String> properties) {
|
||||
ScopedStack<Object> astStack = new ScopedStack<Object>();
|
||||
|
||||
action = new C99BuildASTParserAction (this, astStack, CNodeFactory.getDefault() , C99SecondaryParserFactory.getDefault() );
|
||||
action.setParserOptions(options);
|
||||
action.setParserProperties(properties);
|
||||
|
||||
|
||||
}
|
||||
|
@ -244,8 +244,8 @@ public void setTokens(List<IToken> tokens) {
|
|||
addToken(new Token(null, 0, 0, C99NoCastExpressionParsersym.TK_EOF_TOKEN));
|
||||
}
|
||||
|
||||
public C99NoCastExpressionParser(ITokenStream stream, Set<IParser.Options> options) { // constructor for creating secondary parser
|
||||
initActions(options);
|
||||
public C99NoCastExpressionParser(ITokenStream stream, Map<String,String> properties) { // constructor for creating secondary parser
|
||||
initActions(properties);
|
||||
tokenMap = new TokenMap(C99NoCastExpressionParsersym.orderedTerminalSymbols, stream.getOrderedTerminalSymbols());
|
||||
}
|
||||
|
||||
|
|
|
@ -173,17 +173,17 @@ private C99BuildASTParserAction action;
|
|||
private IASTCompletionNode compNode;
|
||||
|
||||
|
||||
public C99Parser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Set<IParser.Options> options) {
|
||||
initActions(options);
|
||||
public C99Parser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Map<String,String> properties) {
|
||||
initActions(properties);
|
||||
action.initializeTranslationUnit(scanner, builtinBindingsProvider, index);
|
||||
CPreprocessorAdapter.runCPreprocessor(scanner, this, tokenMap);
|
||||
}
|
||||
|
||||
private void initActions(Set<IParser.Options> options) {
|
||||
private void initActions(Map<String,String> properties) {
|
||||
ScopedStack<Object> astStack = new ScopedStack<Object>();
|
||||
|
||||
action = new C99BuildASTParserAction (this, astStack, CNodeFactory.getDefault() , C99SecondaryParserFactory.getDefault() );
|
||||
action.setParserOptions(options);
|
||||
action.setParserProperties(properties);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -177,17 +177,17 @@ private C99BuildASTParserAction action;
|
|||
private IASTCompletionNode compNode;
|
||||
|
||||
|
||||
public C99SizeofExpressionParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Set<IParser.Options> options) {
|
||||
initActions(options);
|
||||
public C99SizeofExpressionParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Map<String,String> properties) {
|
||||
initActions(properties);
|
||||
action.initializeTranslationUnit(scanner, builtinBindingsProvider, index);
|
||||
CPreprocessorAdapter.runCPreprocessor(scanner, this, tokenMap);
|
||||
}
|
||||
|
||||
private void initActions(Set<IParser.Options> options) {
|
||||
private void initActions(Map<String,String> properties) {
|
||||
ScopedStack<Object> astStack = new ScopedStack<Object>();
|
||||
|
||||
action = new C99BuildASTParserAction (this, astStack, CNodeFactory.getDefault() , C99SecondaryParserFactory.getDefault() );
|
||||
action.setParserOptions(options);
|
||||
action.setParserProperties(properties);
|
||||
|
||||
|
||||
}
|
||||
|
@ -244,8 +244,8 @@ public void setTokens(List<IToken> tokens) {
|
|||
addToken(new Token(null, 0, 0, C99SizeofExpressionParsersym.TK_EOF_TOKEN));
|
||||
}
|
||||
|
||||
public C99SizeofExpressionParser(ITokenStream stream, Set<IParser.Options> options) { // constructor for creating secondary parser
|
||||
initActions(options);
|
||||
public C99SizeofExpressionParser(ITokenStream stream, Map<String,String> properties) { // constructor for creating secondary parser
|
||||
initActions(properties);
|
||||
tokenMap = new TokenMap(C99SizeofExpressionParsersym.orderedTerminalSymbols, stream.getOrderedTerminalSymbols());
|
||||
}
|
||||
|
||||
|
|
|
@ -17,17 +17,17 @@ import lpg.lpgjavaruntime.*;
|
|||
|
||||
import java.util.*;
|
||||
import org.eclipse.cdt.core.dom.ast.*;
|
||||
import org.eclipse.cdt.core.dom.lrparser.CPreprocessorAdapter;
|
||||
import org.eclipse.cdt.core.dom.lrparser.IDOMTokenMap;
|
||||
import org.eclipse.cdt.core.dom.lrparser.IParser;
|
||||
import org.eclipse.cdt.core.dom.lrparser.ITokenCollector;
|
||||
import org.eclipse.cdt.core.dom.lrparser.CPreprocessorAdapter;
|
||||
import org.eclipse.cdt.core.dom.lrparser.action.ITokenStream;
|
||||
import org.eclipse.cdt.core.dom.lrparser.lpgextensions.FixedBacktrackingParser;
|
||||
import org.eclipse.cdt.core.dom.lrparser.action.ScopedStack;
|
||||
import org.eclipse.cdt.core.parser.IScanner;
|
||||
import org.eclipse.cdt.core.dom.parser.IBuiltinBindingsProvider;
|
||||
import org.eclipse.cdt.core.index.IIndex;
|
||||
|
||||
import org.eclipse.cdt.core.dom.lrparser.action.ITokenStream;
|
||||
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.ISecondaryParser;
|
||||
|
@ -178,17 +178,17 @@ private CPPBuildASTParserAction action;
|
|||
private IASTCompletionNode compNode;
|
||||
|
||||
|
||||
public CPPExpressionParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Set<IParser.Options> options) {
|
||||
initActions(options);
|
||||
public CPPExpressionParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Map<String,String> properties) {
|
||||
initActions(properties);
|
||||
action.initializeTranslationUnit(scanner, builtinBindingsProvider, index);
|
||||
CPreprocessorAdapter.runCPreprocessor(scanner, this, tokenMap);
|
||||
}
|
||||
|
||||
private void initActions(Set<IParser.Options> options) {
|
||||
private void initActions(Map<String,String> properties) {
|
||||
ScopedStack<Object> astStack = new ScopedStack<Object>();
|
||||
|
||||
action = new CPPBuildASTParserAction (this, astStack, CPPNodeFactory.getDefault() , CPPSecondaryParserFactory.getDefault() );
|
||||
action.setParserOptions(options);
|
||||
action.setParserProperties(properties);
|
||||
|
||||
|
||||
}
|
||||
|
@ -245,9 +245,9 @@ public void setTokens(List<IToken> tokens) {
|
|||
addToken(new Token(null, 0, 0, CPPExpressionParsersym.TK_EOF_TOKEN));
|
||||
}
|
||||
|
||||
public CPPExpressionParser(ITokenStream parser, Set<IParser.Options> options) { // constructor for creating secondary parser
|
||||
initActions(options);
|
||||
tokenMap = new TokenMap(CPPExpressionParsersym.orderedTerminalSymbols, parser.getOrderedTerminalSymbols());
|
||||
public CPPExpressionParser(ITokenStream stream, Map<String,String> properties) { // constructor for creating secondary parser
|
||||
initActions(properties);
|
||||
tokenMap = new TokenMap(CPPExpressionParsersym.orderedTerminalSymbols, stream.getOrderedTerminalSymbols());
|
||||
}
|
||||
|
||||
|
||||
|
@ -1307,331 +1307,331 @@ public CPPExpressionParser(ITokenStream parser, Set<IParser.Options> options) {
|
|||
}
|
||||
|
||||
//
|
||||
// Rule 296: named_namespace_definition ::= namespace namespace_name { <openscope-ast> declaration_seq_opt }
|
||||
// Rule 294: namespace_definition ::= namespace namespace_name namespace_definition_hook { <openscope-ast> declaration_seq_opt }
|
||||
//
|
||||
case 296: { action. consumeNamespaceDefinition(true); break;
|
||||
case 294: { action. consumeNamespaceDefinition(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 297: unnamed_namespace_definition ::= namespace { <openscope-ast> declaration_seq_opt }
|
||||
// Rule 295: namespace_definition ::= namespace namespace_definition_hook { <openscope-ast> declaration_seq_opt }
|
||||
//
|
||||
case 297: { action. consumeNamespaceDefinition(false); break;
|
||||
case 295: { action. consumeNamespaceDefinition(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 298: namespace_alias_definition ::= namespace identifier_token = dcolon_opt nested_name_specifier_opt namespace_name ;
|
||||
// Rule 297: namespace_alias_definition ::= namespace identifier_token = dcolon_opt nested_name_specifier_opt namespace_name ;
|
||||
//
|
||||
case 298: { action. consumeNamespaceAliasDefinition(); break;
|
||||
case 297: { action. consumeNamespaceAliasDefinition(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 299: using_declaration ::= using typename_opt dcolon_opt nested_name_specifier_opt unqualified_id_name ;
|
||||
// Rule 298: using_declaration ::= using typename_opt dcolon_opt nested_name_specifier_opt unqualified_id_name ;
|
||||
//
|
||||
case 299: { action. consumeUsingDeclaration(); break;
|
||||
case 298: { action. consumeUsingDeclaration(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 300: typename_opt ::= typename
|
||||
// Rule 299: typename_opt ::= typename
|
||||
//
|
||||
case 300: { action. consumePlaceHolder(); break;
|
||||
case 299: { action. consumePlaceHolder(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 301: typename_opt ::= $Empty
|
||||
// Rule 300: typename_opt ::= $Empty
|
||||
//
|
||||
case 301: { action. consumeEmpty(); break;
|
||||
case 300: { action. consumeEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 302: using_directive ::= using namespace dcolon_opt nested_name_specifier_opt namespace_name ;
|
||||
// Rule 301: using_directive ::= using namespace dcolon_opt nested_name_specifier_opt namespace_name ;
|
||||
//
|
||||
case 302: { action. consumeUsingDirective(); break;
|
||||
case 301: { action. consumeUsingDirective(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 303: asm_definition ::= asm ( stringlit ) ;
|
||||
// Rule 302: asm_definition ::= asm ( stringlit ) ;
|
||||
//
|
||||
case 303: { action. consumeDeclarationASM(); break;
|
||||
case 302: { action. consumeDeclarationASM(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 304: linkage_specification ::= extern stringlit { <openscope-ast> declaration_seq_opt }
|
||||
// Rule 303: linkage_specification ::= extern stringlit { <openscope-ast> declaration_seq_opt }
|
||||
//
|
||||
case 303: { action. consumeLinkageSpecification(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 304: linkage_specification ::= extern stringlit <openscope-ast> declaration
|
||||
//
|
||||
case 304: { action. consumeLinkageSpecification(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 305: linkage_specification ::= extern stringlit <openscope-ast> declaration
|
||||
// Rule 309: init_declarator_complete ::= init_declarator
|
||||
//
|
||||
case 305: { action. consumeLinkageSpecification(); break;
|
||||
case 309: { action. consumeInitDeclaratorComplete(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 310: init_declarator_complete ::= init_declarator
|
||||
// Rule 311: init_declarator ::= complete_declarator initializer
|
||||
//
|
||||
case 310: { action. consumeInitDeclaratorComplete(); break;
|
||||
case 311: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 312: init_declarator ::= complete_declarator initializer
|
||||
// Rule 314: declarator ::= <openscope-ast> ptr_operator_seq direct_declarator
|
||||
//
|
||||
case 312: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
case 314: { action. consumeDeclaratorWithPointer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 315: declarator ::= <openscope-ast> ptr_operator_seq direct_declarator
|
||||
// Rule 316: function_declarator ::= <openscope-ast> ptr_operator_seq direct_declarator
|
||||
//
|
||||
case 315: { action. consumeDeclaratorWithPointer(true); break;
|
||||
case 316: { action. consumeDeclaratorWithPointer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 317: function_declarator ::= <openscope-ast> ptr_operator_seq direct_declarator
|
||||
// Rule 320: basic_direct_declarator ::= declarator_id_name
|
||||
//
|
||||
case 317: { action. consumeDeclaratorWithPointer(true); break;
|
||||
case 320: { action. consumeDirectDeclaratorIdentifier(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 321: basic_direct_declarator ::= declarator_id_name
|
||||
// Rule 321: basic_direct_declarator ::= ( declarator )
|
||||
//
|
||||
case 321: { action. consumeDirectDeclaratorIdentifier(); break;
|
||||
case 321: { action. consumeDirectDeclaratorBracketed(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 322: basic_direct_declarator ::= ( declarator )
|
||||
// Rule 322: function_direct_declarator ::= basic_direct_declarator ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
//
|
||||
case 322: { action. consumeDirectDeclaratorBracketed(); break;
|
||||
case 322: { action. consumeDirectDeclaratorFunctionDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 323: function_direct_declarator ::= basic_direct_declarator ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
// Rule 323: array_direct_declarator ::= array_direct_declarator array_modifier
|
||||
//
|
||||
case 323: { action. consumeDirectDeclaratorFunctionDeclarator(true); break;
|
||||
case 323: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 324: array_direct_declarator ::= array_direct_declarator array_modifier
|
||||
// Rule 324: array_direct_declarator ::= basic_direct_declarator array_modifier
|
||||
//
|
||||
case 324: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 325: array_direct_declarator ::= basic_direct_declarator array_modifier
|
||||
// Rule 325: array_modifier ::= [ constant_expression ]
|
||||
//
|
||||
case 325: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
case 325: { action. consumeDirectDeclaratorArrayModifier(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 326: array_modifier ::= [ constant_expression ]
|
||||
// Rule 326: array_modifier ::= [ ]
|
||||
//
|
||||
case 326: { action. consumeDirectDeclaratorArrayModifier(true); break;
|
||||
case 326: { action. consumeDirectDeclaratorArrayModifier(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 327: array_modifier ::= [ ]
|
||||
// Rule 327: ptr_operator ::= pointer_hook * pointer_hook <openscope-ast> cv_qualifier_seq_opt
|
||||
//
|
||||
case 327: { action. consumeDirectDeclaratorArrayModifier(false); break;
|
||||
case 327: { action. consumePointer(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 328: ptr_operator ::= pointer_hook * pointer_hook <openscope-ast> cv_qualifier_seq_opt
|
||||
// Rule 328: ptr_operator ::= pointer_hook & pointer_hook
|
||||
//
|
||||
case 328: { action. consumePointer(); break;
|
||||
case 328: { action. consumeReferenceOperator(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 329: ptr_operator ::= pointer_hook & pointer_hook
|
||||
// Rule 329: ptr_operator ::= dcolon_opt nested_name_specifier pointer_hook * pointer_hook <openscope-ast> cv_qualifier_seq_opt
|
||||
//
|
||||
case 329: { action. consumeReferenceOperator(); break;
|
||||
case 329: { action. consumePointerToMember(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 330: ptr_operator ::= dcolon_opt nested_name_specifier pointer_hook * pointer_hook <openscope-ast> cv_qualifier_seq_opt
|
||||
// Rule 336: cv_qualifier ::= const
|
||||
//
|
||||
case 330: { action. consumePointerToMember(); break;
|
||||
case 336: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 337: cv_qualifier ::= const
|
||||
// Rule 337: cv_qualifier ::= volatile
|
||||
//
|
||||
case 337: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 338: cv_qualifier ::= volatile
|
||||
// Rule 339: declarator_id_name ::= dcolon_opt nested_name_specifier_opt type_name
|
||||
//
|
||||
case 338: { action. consumeToken(); break;
|
||||
case 339: { action. consumeQualifiedId(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 340: declarator_id_name ::= dcolon_opt nested_name_specifier_opt type_name
|
||||
// Rule 340: type_id ::= type_specifier_seq
|
||||
//
|
||||
case 340: { action. consumeQualifiedId(false); break;
|
||||
case 340: { action. consumeTypeId(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 341: type_id ::= type_specifier_seq
|
||||
// Rule 341: type_id ::= type_specifier_seq abstract_declarator
|
||||
//
|
||||
case 341: { action. consumeTypeId(false); break;
|
||||
case 341: { action. consumeTypeId(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 342: type_id ::= type_specifier_seq abstract_declarator
|
||||
// Rule 344: abstract_declarator ::= <openscope-ast> ptr_operator_seq
|
||||
//
|
||||
case 342: { action. consumeTypeId(true); break;
|
||||
case 344: { action. consumeDeclaratorWithPointer(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 345: abstract_declarator ::= <openscope-ast> ptr_operator_seq
|
||||
// Rule 345: abstract_declarator ::= <openscope-ast> ptr_operator_seq direct_abstract_declarator
|
||||
//
|
||||
case 345: { action. consumeDeclaratorWithPointer(false); break;
|
||||
case 345: { action. consumeDeclaratorWithPointer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 346: abstract_declarator ::= <openscope-ast> ptr_operator_seq direct_abstract_declarator
|
||||
// Rule 349: basic_direct_abstract_declarator ::= ( abstract_declarator )
|
||||
//
|
||||
case 346: { action. consumeDeclaratorWithPointer(true); break;
|
||||
case 349: { action. consumeDirectDeclaratorBracketed(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 350: basic_direct_abstract_declarator ::= ( abstract_declarator )
|
||||
// Rule 350: basic_direct_abstract_declarator ::= ( )
|
||||
//
|
||||
case 350: { action. consumeDirectDeclaratorBracketed(); break;
|
||||
case 350: { action. consumeAbstractDeclaratorEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 351: basic_direct_abstract_declarator ::= ( )
|
||||
// Rule 351: array_direct_abstract_declarator ::= array_modifier
|
||||
//
|
||||
case 351: { action. consumeAbstractDeclaratorEmpty(); break;
|
||||
case 351: { action. consumeDirectDeclaratorArrayDeclarator(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 352: array_direct_abstract_declarator ::= array_modifier
|
||||
// Rule 352: array_direct_abstract_declarator ::= array_direct_abstract_declarator array_modifier
|
||||
//
|
||||
case 352: { action. consumeDirectDeclaratorArrayDeclarator(false); break;
|
||||
case 352: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 353: array_direct_abstract_declarator ::= array_direct_abstract_declarator array_modifier
|
||||
// Rule 353: array_direct_abstract_declarator ::= basic_direct_abstract_declarator array_modifier
|
||||
//
|
||||
case 353: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 354: array_direct_abstract_declarator ::= basic_direct_abstract_declarator array_modifier
|
||||
// Rule 354: function_direct_abstract_declarator ::= basic_direct_abstract_declarator ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
//
|
||||
case 354: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
case 354: { action. consumeDirectDeclaratorFunctionDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 355: function_direct_abstract_declarator ::= basic_direct_abstract_declarator ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
// Rule 355: function_direct_abstract_declarator ::= ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
//
|
||||
case 355: { action. consumeDirectDeclaratorFunctionDeclarator(true); break;
|
||||
case 355: { action. consumeDirectDeclaratorFunctionDeclarator(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 356: function_direct_abstract_declarator ::= ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
// Rule 356: parameter_declaration_clause ::= parameter_declaration_list_opt ...
|
||||
//
|
||||
case 356: { action. consumeDirectDeclaratorFunctionDeclarator(false); break;
|
||||
case 356: { action. consumePlaceHolder(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 357: parameter_declaration_clause ::= parameter_declaration_list_opt ...
|
||||
// Rule 357: parameter_declaration_clause ::= parameter_declaration_list_opt
|
||||
//
|
||||
case 357: { action. consumePlaceHolder(); break;
|
||||
case 357: { action. consumeEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 358: parameter_declaration_clause ::= parameter_declaration_list_opt
|
||||
// Rule 358: parameter_declaration_clause ::= parameter_declaration_list , ...
|
||||
//
|
||||
case 358: { action. consumeEmpty(); break;
|
||||
case 358: { action. consumePlaceHolder(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 359: parameter_declaration_clause ::= parameter_declaration_list , ...
|
||||
// Rule 364: abstract_declarator_opt ::= $Empty
|
||||
//
|
||||
case 359: { action. consumePlaceHolder(); break;
|
||||
case 364: { action. consumeEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 365: abstract_declarator_opt ::= $Empty
|
||||
// Rule 365: parameter_declaration ::= declaration_specifiers parameter_init_declarator
|
||||
//
|
||||
case 365: { action. consumeEmpty(); break;
|
||||
case 365: { action. consumeParameterDeclaration(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 366: parameter_declaration ::= declaration_specifiers parameter_init_declarator
|
||||
// Rule 366: parameter_declaration ::= declaration_specifiers
|
||||
//
|
||||
case 366: { action. consumeParameterDeclaration(); break;
|
||||
case 366: { action. consumeParameterDeclarationWithoutDeclarator(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 367: parameter_declaration ::= declaration_specifiers
|
||||
// Rule 368: parameter_init_declarator ::= declarator = parameter_initializer
|
||||
//
|
||||
case 367: { action. consumeParameterDeclarationWithoutDeclarator(); break;
|
||||
case 368: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 369: parameter_init_declarator ::= declarator = parameter_initializer
|
||||
// Rule 370: parameter_init_declarator ::= abstract_declarator = parameter_initializer
|
||||
//
|
||||
case 369: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
case 370: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 371: parameter_init_declarator ::= abstract_declarator = parameter_initializer
|
||||
// Rule 371: parameter_init_declarator ::= = parameter_initializer
|
||||
//
|
||||
case 371: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
case 371: { action. consumeDeclaratorWithInitializer(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 372: parameter_init_declarator ::= = parameter_initializer
|
||||
// Rule 372: parameter_initializer ::= assignment_expression
|
||||
//
|
||||
case 372: { action. consumeDeclaratorWithInitializer(false); break;
|
||||
case 372: { action. consumeInitializer(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 373: parameter_initializer ::= assignment_expression
|
||||
// Rule 373: function_definition ::= declaration_specifiers_opt function_declarator <openscope-ast> ctor_initializer_list_opt function_body
|
||||
//
|
||||
case 373: { action. consumeInitializer(); break;
|
||||
case 373: { action. consumeFunctionDefinition(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 374: function_definition ::= declaration_specifiers_opt function_declarator <openscope-ast> ctor_initializer_list_opt function_body
|
||||
// Rule 374: function_definition ::= declaration_specifiers_opt function_declarator try <openscope-ast> ctor_initializer_list_opt function_body <openscope-ast> handler_seq
|
||||
//
|
||||
case 374: { action. consumeFunctionDefinition(false); break;
|
||||
case 374: { action. consumeFunctionDefinition(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 375: function_definition ::= declaration_specifiers_opt function_declarator try <openscope-ast> ctor_initializer_list_opt function_body <openscope-ast> handler_seq
|
||||
// Rule 377: initializer ::= ( expression_list )
|
||||
//
|
||||
case 375: { action. consumeFunctionDefinition(true); break;
|
||||
case 377: { action. consumeInitializerConstructor(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 378: initializer ::= ( expression_list )
|
||||
// Rule 378: initializer_clause ::= assignment_expression
|
||||
//
|
||||
case 378: { action. consumeInitializerConstructor(); break;
|
||||
case 378: { action. consumeInitializer(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 379: initializer_clause ::= assignment_expression
|
||||
//
|
||||
case 379: { action. consumeInitializer(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 380: initializer_clause ::= start_initializer_list { <openscope-ast> initializer_list , } end_initializer_list
|
||||
// Rule 380: initializer_list ::= start_initializer_list { <openscope-ast> initializer_seq , } end_initializer_list
|
||||
//
|
||||
case 380: { action. consumeInitializerList(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 381: initializer_clause ::= start_initializer_list { <openscope-ast> initializer_list } end_initializer_list
|
||||
// Rule 381: initializer_list ::= start_initializer_list { <openscope-ast> initializer_seq } end_initializer_list
|
||||
//
|
||||
case 381: { action. consumeInitializerList(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 382: initializer_clause ::= { <openscope-ast> }
|
||||
// Rule 382: initializer_list ::= { <openscope-ast> }
|
||||
//
|
||||
case 382: { action. consumeInitializerList(); break;
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -17,17 +17,17 @@ import lpg.lpgjavaruntime.*;
|
|||
|
||||
import java.util.*;
|
||||
import org.eclipse.cdt.core.dom.ast.*;
|
||||
import org.eclipse.cdt.core.dom.lrparser.CPreprocessorAdapter;
|
||||
import org.eclipse.cdt.core.dom.lrparser.IDOMTokenMap;
|
||||
import org.eclipse.cdt.core.dom.lrparser.IParser;
|
||||
import org.eclipse.cdt.core.dom.lrparser.ITokenCollector;
|
||||
import org.eclipse.cdt.core.dom.lrparser.CPreprocessorAdapter;
|
||||
import org.eclipse.cdt.core.dom.lrparser.action.ITokenStream;
|
||||
import org.eclipse.cdt.core.dom.lrparser.lpgextensions.FixedBacktrackingParser;
|
||||
import org.eclipse.cdt.core.dom.lrparser.action.ScopedStack;
|
||||
import org.eclipse.cdt.core.parser.IScanner;
|
||||
import org.eclipse.cdt.core.dom.parser.IBuiltinBindingsProvider;
|
||||
import org.eclipse.cdt.core.index.IIndex;
|
||||
|
||||
import org.eclipse.cdt.core.dom.lrparser.action.ITokenStream;
|
||||
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.ISecondaryParser;
|
||||
|
@ -178,17 +178,17 @@ private CPPBuildASTParserAction action;
|
|||
private IASTCompletionNode compNode;
|
||||
|
||||
|
||||
public CPPNoCastExpressionParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Set<IParser.Options> options) {
|
||||
initActions(options);
|
||||
public CPPNoCastExpressionParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Map<String,String> properties) {
|
||||
initActions(properties);
|
||||
action.initializeTranslationUnit(scanner, builtinBindingsProvider, index);
|
||||
CPreprocessorAdapter.runCPreprocessor(scanner, this, tokenMap);
|
||||
}
|
||||
|
||||
private void initActions(Set<IParser.Options> options) {
|
||||
private void initActions(Map<String,String> properties) {
|
||||
ScopedStack<Object> astStack = new ScopedStack<Object>();
|
||||
|
||||
action = new CPPBuildASTParserAction (this, astStack, CPPNodeFactory.getDefault() , CPPSecondaryParserFactory.getDefault() );
|
||||
action.setParserOptions(options);
|
||||
action.setParserProperties(properties);
|
||||
|
||||
|
||||
}
|
||||
|
@ -245,9 +245,9 @@ public void setTokens(List<IToken> tokens) {
|
|||
addToken(new Token(null, 0, 0, CPPNoCastExpressionParsersym.TK_EOF_TOKEN));
|
||||
}
|
||||
|
||||
public CPPNoCastExpressionParser(ITokenStream parser, Set<IParser.Options> options) { // constructor for creating secondary parser
|
||||
initActions(options);
|
||||
tokenMap = new TokenMap(CPPNoCastExpressionParsersym.orderedTerminalSymbols, parser.getOrderedTerminalSymbols());
|
||||
public CPPNoCastExpressionParser(ITokenStream stream, Map<String,String> properties) { // constructor for creating secondary parser
|
||||
initActions(properties);
|
||||
tokenMap = new TokenMap(CPPNoCastExpressionParsersym.orderedTerminalSymbols, stream.getOrderedTerminalSymbols());
|
||||
}
|
||||
|
||||
|
||||
|
@ -1301,331 +1301,331 @@ public CPPNoCastExpressionParser(ITokenStream parser, Set<IParser.Options> optio
|
|||
}
|
||||
|
||||
//
|
||||
// Rule 295: named_namespace_definition ::= namespace namespace_name { <openscope-ast> declaration_seq_opt }
|
||||
// Rule 293: namespace_definition ::= namespace namespace_name namespace_definition_hook { <openscope-ast> declaration_seq_opt }
|
||||
//
|
||||
case 295: { action. consumeNamespaceDefinition(true); break;
|
||||
case 293: { action. consumeNamespaceDefinition(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 296: unnamed_namespace_definition ::= namespace { <openscope-ast> declaration_seq_opt }
|
||||
// Rule 294: namespace_definition ::= namespace namespace_definition_hook { <openscope-ast> declaration_seq_opt }
|
||||
//
|
||||
case 296: { action. consumeNamespaceDefinition(false); break;
|
||||
case 294: { action. consumeNamespaceDefinition(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 297: namespace_alias_definition ::= namespace identifier_token = dcolon_opt nested_name_specifier_opt namespace_name ;
|
||||
// Rule 296: namespace_alias_definition ::= namespace identifier_token = dcolon_opt nested_name_specifier_opt namespace_name ;
|
||||
//
|
||||
case 297: { action. consumeNamespaceAliasDefinition(); break;
|
||||
case 296: { action. consumeNamespaceAliasDefinition(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 298: using_declaration ::= using typename_opt dcolon_opt nested_name_specifier_opt unqualified_id_name ;
|
||||
// Rule 297: using_declaration ::= using typename_opt dcolon_opt nested_name_specifier_opt unqualified_id_name ;
|
||||
//
|
||||
case 298: { action. consumeUsingDeclaration(); break;
|
||||
case 297: { action. consumeUsingDeclaration(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 299: typename_opt ::= typename
|
||||
// Rule 298: typename_opt ::= typename
|
||||
//
|
||||
case 299: { action. consumePlaceHolder(); break;
|
||||
case 298: { action. consumePlaceHolder(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 300: typename_opt ::= $Empty
|
||||
// Rule 299: typename_opt ::= $Empty
|
||||
//
|
||||
case 300: { action. consumeEmpty(); break;
|
||||
case 299: { action. consumeEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 301: using_directive ::= using namespace dcolon_opt nested_name_specifier_opt namespace_name ;
|
||||
// Rule 300: using_directive ::= using namespace dcolon_opt nested_name_specifier_opt namespace_name ;
|
||||
//
|
||||
case 301: { action. consumeUsingDirective(); break;
|
||||
case 300: { action. consumeUsingDirective(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 302: asm_definition ::= asm ( stringlit ) ;
|
||||
// Rule 301: asm_definition ::= asm ( stringlit ) ;
|
||||
//
|
||||
case 302: { action. consumeDeclarationASM(); break;
|
||||
case 301: { action. consumeDeclarationASM(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 303: linkage_specification ::= extern stringlit { <openscope-ast> declaration_seq_opt }
|
||||
// Rule 302: linkage_specification ::= extern stringlit { <openscope-ast> declaration_seq_opt }
|
||||
//
|
||||
case 302: { action. consumeLinkageSpecification(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 303: linkage_specification ::= extern stringlit <openscope-ast> declaration
|
||||
//
|
||||
case 303: { action. consumeLinkageSpecification(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 304: linkage_specification ::= extern stringlit <openscope-ast> declaration
|
||||
// Rule 308: init_declarator_complete ::= init_declarator
|
||||
//
|
||||
case 304: { action. consumeLinkageSpecification(); break;
|
||||
case 308: { action. consumeInitDeclaratorComplete(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 309: init_declarator_complete ::= init_declarator
|
||||
// Rule 310: init_declarator ::= complete_declarator initializer
|
||||
//
|
||||
case 309: { action. consumeInitDeclaratorComplete(); break;
|
||||
case 310: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 311: init_declarator ::= complete_declarator initializer
|
||||
// Rule 313: declarator ::= <openscope-ast> ptr_operator_seq direct_declarator
|
||||
//
|
||||
case 311: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
case 313: { action. consumeDeclaratorWithPointer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 314: declarator ::= <openscope-ast> ptr_operator_seq direct_declarator
|
||||
// Rule 315: function_declarator ::= <openscope-ast> ptr_operator_seq direct_declarator
|
||||
//
|
||||
case 314: { action. consumeDeclaratorWithPointer(true); break;
|
||||
case 315: { action. consumeDeclaratorWithPointer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 316: function_declarator ::= <openscope-ast> ptr_operator_seq direct_declarator
|
||||
// Rule 319: basic_direct_declarator ::= declarator_id_name
|
||||
//
|
||||
case 316: { action. consumeDeclaratorWithPointer(true); break;
|
||||
case 319: { action. consumeDirectDeclaratorIdentifier(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 320: basic_direct_declarator ::= declarator_id_name
|
||||
// Rule 320: basic_direct_declarator ::= ( declarator )
|
||||
//
|
||||
case 320: { action. consumeDirectDeclaratorIdentifier(); break;
|
||||
case 320: { action. consumeDirectDeclaratorBracketed(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 321: basic_direct_declarator ::= ( declarator )
|
||||
// Rule 321: function_direct_declarator ::= basic_direct_declarator ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
//
|
||||
case 321: { action. consumeDirectDeclaratorBracketed(); break;
|
||||
case 321: { action. consumeDirectDeclaratorFunctionDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 322: function_direct_declarator ::= basic_direct_declarator ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
// Rule 322: array_direct_declarator ::= array_direct_declarator array_modifier
|
||||
//
|
||||
case 322: { action. consumeDirectDeclaratorFunctionDeclarator(true); break;
|
||||
case 322: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 323: array_direct_declarator ::= array_direct_declarator array_modifier
|
||||
// Rule 323: array_direct_declarator ::= basic_direct_declarator array_modifier
|
||||
//
|
||||
case 323: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 324: array_direct_declarator ::= basic_direct_declarator array_modifier
|
||||
// Rule 324: array_modifier ::= [ constant_expression ]
|
||||
//
|
||||
case 324: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
case 324: { action. consumeDirectDeclaratorArrayModifier(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 325: array_modifier ::= [ constant_expression ]
|
||||
// Rule 325: array_modifier ::= [ ]
|
||||
//
|
||||
case 325: { action. consumeDirectDeclaratorArrayModifier(true); break;
|
||||
case 325: { action. consumeDirectDeclaratorArrayModifier(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 326: array_modifier ::= [ ]
|
||||
// Rule 326: ptr_operator ::= pointer_hook * pointer_hook <openscope-ast> cv_qualifier_seq_opt
|
||||
//
|
||||
case 326: { action. consumeDirectDeclaratorArrayModifier(false); break;
|
||||
case 326: { action. consumePointer(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 327: ptr_operator ::= pointer_hook * pointer_hook <openscope-ast> cv_qualifier_seq_opt
|
||||
// Rule 327: ptr_operator ::= pointer_hook & pointer_hook
|
||||
//
|
||||
case 327: { action. consumePointer(); break;
|
||||
case 327: { action. consumeReferenceOperator(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 328: ptr_operator ::= pointer_hook & pointer_hook
|
||||
// Rule 328: ptr_operator ::= dcolon_opt nested_name_specifier pointer_hook * pointer_hook <openscope-ast> cv_qualifier_seq_opt
|
||||
//
|
||||
case 328: { action. consumeReferenceOperator(); break;
|
||||
case 328: { action. consumePointerToMember(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 329: ptr_operator ::= dcolon_opt nested_name_specifier pointer_hook * pointer_hook <openscope-ast> cv_qualifier_seq_opt
|
||||
// Rule 335: cv_qualifier ::= const
|
||||
//
|
||||
case 329: { action. consumePointerToMember(); break;
|
||||
case 335: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 336: cv_qualifier ::= const
|
||||
// Rule 336: cv_qualifier ::= volatile
|
||||
//
|
||||
case 336: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 337: cv_qualifier ::= volatile
|
||||
// Rule 338: declarator_id_name ::= dcolon_opt nested_name_specifier_opt type_name
|
||||
//
|
||||
case 337: { action. consumeToken(); break;
|
||||
case 338: { action. consumeQualifiedId(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 339: declarator_id_name ::= dcolon_opt nested_name_specifier_opt type_name
|
||||
// Rule 339: type_id ::= type_specifier_seq
|
||||
//
|
||||
case 339: { action. consumeQualifiedId(false); break;
|
||||
case 339: { action. consumeTypeId(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 340: type_id ::= type_specifier_seq
|
||||
// Rule 340: type_id ::= type_specifier_seq abstract_declarator
|
||||
//
|
||||
case 340: { action. consumeTypeId(false); break;
|
||||
case 340: { action. consumeTypeId(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 341: type_id ::= type_specifier_seq abstract_declarator
|
||||
// Rule 343: abstract_declarator ::= <openscope-ast> ptr_operator_seq
|
||||
//
|
||||
case 341: { action. consumeTypeId(true); break;
|
||||
case 343: { action. consumeDeclaratorWithPointer(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 344: abstract_declarator ::= <openscope-ast> ptr_operator_seq
|
||||
// Rule 344: abstract_declarator ::= <openscope-ast> ptr_operator_seq direct_abstract_declarator
|
||||
//
|
||||
case 344: { action. consumeDeclaratorWithPointer(false); break;
|
||||
case 344: { action. consumeDeclaratorWithPointer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 345: abstract_declarator ::= <openscope-ast> ptr_operator_seq direct_abstract_declarator
|
||||
// Rule 348: basic_direct_abstract_declarator ::= ( abstract_declarator )
|
||||
//
|
||||
case 345: { action. consumeDeclaratorWithPointer(true); break;
|
||||
case 348: { action. consumeDirectDeclaratorBracketed(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 349: basic_direct_abstract_declarator ::= ( abstract_declarator )
|
||||
// Rule 349: basic_direct_abstract_declarator ::= ( )
|
||||
//
|
||||
case 349: { action. consumeDirectDeclaratorBracketed(); break;
|
||||
case 349: { action. consumeAbstractDeclaratorEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 350: basic_direct_abstract_declarator ::= ( )
|
||||
// Rule 350: array_direct_abstract_declarator ::= array_modifier
|
||||
//
|
||||
case 350: { action. consumeAbstractDeclaratorEmpty(); break;
|
||||
case 350: { action. consumeDirectDeclaratorArrayDeclarator(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 351: array_direct_abstract_declarator ::= array_modifier
|
||||
// Rule 351: array_direct_abstract_declarator ::= array_direct_abstract_declarator array_modifier
|
||||
//
|
||||
case 351: { action. consumeDirectDeclaratorArrayDeclarator(false); break;
|
||||
case 351: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 352: array_direct_abstract_declarator ::= array_direct_abstract_declarator array_modifier
|
||||
// Rule 352: array_direct_abstract_declarator ::= basic_direct_abstract_declarator array_modifier
|
||||
//
|
||||
case 352: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 353: array_direct_abstract_declarator ::= basic_direct_abstract_declarator array_modifier
|
||||
// Rule 353: function_direct_abstract_declarator ::= basic_direct_abstract_declarator ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
//
|
||||
case 353: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
case 353: { action. consumeDirectDeclaratorFunctionDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 354: function_direct_abstract_declarator ::= basic_direct_abstract_declarator ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
// Rule 354: function_direct_abstract_declarator ::= ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
//
|
||||
case 354: { action. consumeDirectDeclaratorFunctionDeclarator(true); break;
|
||||
case 354: { action. consumeDirectDeclaratorFunctionDeclarator(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 355: function_direct_abstract_declarator ::= ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
// Rule 355: parameter_declaration_clause ::= parameter_declaration_list_opt ...
|
||||
//
|
||||
case 355: { action. consumeDirectDeclaratorFunctionDeclarator(false); break;
|
||||
case 355: { action. consumePlaceHolder(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 356: parameter_declaration_clause ::= parameter_declaration_list_opt ...
|
||||
// Rule 356: parameter_declaration_clause ::= parameter_declaration_list_opt
|
||||
//
|
||||
case 356: { action. consumePlaceHolder(); break;
|
||||
case 356: { action. consumeEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 357: parameter_declaration_clause ::= parameter_declaration_list_opt
|
||||
// Rule 357: parameter_declaration_clause ::= parameter_declaration_list , ...
|
||||
//
|
||||
case 357: { action. consumeEmpty(); break;
|
||||
case 357: { action. consumePlaceHolder(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 358: parameter_declaration_clause ::= parameter_declaration_list , ...
|
||||
// Rule 363: abstract_declarator_opt ::= $Empty
|
||||
//
|
||||
case 358: { action. consumePlaceHolder(); break;
|
||||
case 363: { action. consumeEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 364: abstract_declarator_opt ::= $Empty
|
||||
// Rule 364: parameter_declaration ::= declaration_specifiers parameter_init_declarator
|
||||
//
|
||||
case 364: { action. consumeEmpty(); break;
|
||||
case 364: { action. consumeParameterDeclaration(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 365: parameter_declaration ::= declaration_specifiers parameter_init_declarator
|
||||
// Rule 365: parameter_declaration ::= declaration_specifiers
|
||||
//
|
||||
case 365: { action. consumeParameterDeclaration(); break;
|
||||
case 365: { action. consumeParameterDeclarationWithoutDeclarator(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 366: parameter_declaration ::= declaration_specifiers
|
||||
// Rule 367: parameter_init_declarator ::= declarator = parameter_initializer
|
||||
//
|
||||
case 366: { action. consumeParameterDeclarationWithoutDeclarator(); break;
|
||||
case 367: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 368: parameter_init_declarator ::= declarator = parameter_initializer
|
||||
// Rule 369: parameter_init_declarator ::= abstract_declarator = parameter_initializer
|
||||
//
|
||||
case 368: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
case 369: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 370: parameter_init_declarator ::= abstract_declarator = parameter_initializer
|
||||
// Rule 370: parameter_init_declarator ::= = parameter_initializer
|
||||
//
|
||||
case 370: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
case 370: { action. consumeDeclaratorWithInitializer(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 371: parameter_init_declarator ::= = parameter_initializer
|
||||
// Rule 371: parameter_initializer ::= assignment_expression
|
||||
//
|
||||
case 371: { action. consumeDeclaratorWithInitializer(false); break;
|
||||
case 371: { action. consumeInitializer(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 372: parameter_initializer ::= assignment_expression
|
||||
// Rule 372: function_definition ::= declaration_specifiers_opt function_declarator <openscope-ast> ctor_initializer_list_opt function_body
|
||||
//
|
||||
case 372: { action. consumeInitializer(); break;
|
||||
case 372: { action. consumeFunctionDefinition(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 373: function_definition ::= declaration_specifiers_opt function_declarator <openscope-ast> ctor_initializer_list_opt function_body
|
||||
// Rule 373: function_definition ::= declaration_specifiers_opt function_declarator try <openscope-ast> ctor_initializer_list_opt function_body <openscope-ast> handler_seq
|
||||
//
|
||||
case 373: { action. consumeFunctionDefinition(false); break;
|
||||
case 373: { action. consumeFunctionDefinition(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 374: function_definition ::= declaration_specifiers_opt function_declarator try <openscope-ast> ctor_initializer_list_opt function_body <openscope-ast> handler_seq
|
||||
// Rule 376: initializer ::= ( expression_list )
|
||||
//
|
||||
case 374: { action. consumeFunctionDefinition(true); break;
|
||||
case 376: { action. consumeInitializerConstructor(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 377: initializer ::= ( expression_list )
|
||||
// Rule 377: initializer_clause ::= assignment_expression
|
||||
//
|
||||
case 377: { action. consumeInitializerConstructor(); break;
|
||||
case 377: { action. consumeInitializer(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 378: initializer_clause ::= assignment_expression
|
||||
//
|
||||
case 378: { action. consumeInitializer(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 379: initializer_clause ::= start_initializer_list { <openscope-ast> initializer_list , } end_initializer_list
|
||||
// Rule 379: initializer_list ::= start_initializer_list { <openscope-ast> initializer_seq , } end_initializer_list
|
||||
//
|
||||
case 379: { action. consumeInitializerList(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 380: initializer_clause ::= start_initializer_list { <openscope-ast> initializer_list } end_initializer_list
|
||||
// Rule 380: initializer_list ::= start_initializer_list { <openscope-ast> initializer_seq } end_initializer_list
|
||||
//
|
||||
case 380: { action. consumeInitializerList(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 381: initializer_clause ::= { <openscope-ast> }
|
||||
// Rule 381: initializer_list ::= { <openscope-ast> }
|
||||
//
|
||||
case 381: { action. consumeInitializerList(); break;
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -17,17 +17,17 @@ import lpg.lpgjavaruntime.*;
|
|||
|
||||
import java.util.*;
|
||||
import org.eclipse.cdt.core.dom.ast.*;
|
||||
import org.eclipse.cdt.core.dom.lrparser.CPreprocessorAdapter;
|
||||
import org.eclipse.cdt.core.dom.lrparser.IDOMTokenMap;
|
||||
import org.eclipse.cdt.core.dom.lrparser.IParser;
|
||||
import org.eclipse.cdt.core.dom.lrparser.ITokenCollector;
|
||||
import org.eclipse.cdt.core.dom.lrparser.CPreprocessorAdapter;
|
||||
import org.eclipse.cdt.core.dom.lrparser.action.ITokenStream;
|
||||
import org.eclipse.cdt.core.dom.lrparser.lpgextensions.FixedBacktrackingParser;
|
||||
import org.eclipse.cdt.core.dom.lrparser.action.ScopedStack;
|
||||
import org.eclipse.cdt.core.parser.IScanner;
|
||||
import org.eclipse.cdt.core.dom.parser.IBuiltinBindingsProvider;
|
||||
import org.eclipse.cdt.core.index.IIndex;
|
||||
|
||||
import org.eclipse.cdt.core.dom.lrparser.action.ITokenStream;
|
||||
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.ISecondaryParser;
|
||||
|
@ -178,17 +178,17 @@ private CPPBuildASTParserAction action;
|
|||
private IASTCompletionNode compNode;
|
||||
|
||||
|
||||
public CPPNoFunctionDeclaratorParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Set<IParser.Options> options) {
|
||||
initActions(options);
|
||||
public CPPNoFunctionDeclaratorParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Map<String,String> properties) {
|
||||
initActions(properties);
|
||||
action.initializeTranslationUnit(scanner, builtinBindingsProvider, index);
|
||||
CPreprocessorAdapter.runCPreprocessor(scanner, this, tokenMap);
|
||||
}
|
||||
|
||||
private void initActions(Set<IParser.Options> options) {
|
||||
private void initActions(Map<String,String> properties) {
|
||||
ScopedStack<Object> astStack = new ScopedStack<Object>();
|
||||
|
||||
action = new CPPBuildASTParserAction (this, astStack, CPPNodeFactory.getDefault() , CPPSecondaryParserFactory.getDefault() );
|
||||
action.setParserOptions(options);
|
||||
action.setParserProperties(properties);
|
||||
|
||||
|
||||
}
|
||||
|
@ -245,9 +245,9 @@ public void setTokens(List<IToken> tokens) {
|
|||
addToken(new Token(null, 0, 0, CPPNoFunctionDeclaratorParsersym.TK_EOF_TOKEN));
|
||||
}
|
||||
|
||||
public CPPNoFunctionDeclaratorParser(ITokenStream parser, Set<IParser.Options> options) { // constructor for creating secondary parser
|
||||
initActions(options);
|
||||
tokenMap = new TokenMap(CPPNoFunctionDeclaratorParsersym.orderedTerminalSymbols, parser.getOrderedTerminalSymbols());
|
||||
public CPPNoFunctionDeclaratorParser(ITokenStream stream, Map<String,String> properties) { // constructor for creating secondary parser
|
||||
initActions(properties);
|
||||
tokenMap = new TokenMap(CPPNoFunctionDeclaratorParsersym.orderedTerminalSymbols, stream.getOrderedTerminalSymbols());
|
||||
}
|
||||
|
||||
|
||||
|
@ -1307,325 +1307,325 @@ public CPPNoFunctionDeclaratorParser(ITokenStream parser, Set<IParser.Options> o
|
|||
}
|
||||
|
||||
//
|
||||
// Rule 296: named_namespace_definition ::= namespace namespace_name { <openscope-ast> declaration_seq_opt }
|
||||
// Rule 294: namespace_definition ::= namespace namespace_name namespace_definition_hook { <openscope-ast> declaration_seq_opt }
|
||||
//
|
||||
case 296: { action. consumeNamespaceDefinition(true); break;
|
||||
case 294: { action. consumeNamespaceDefinition(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 297: unnamed_namespace_definition ::= namespace { <openscope-ast> declaration_seq_opt }
|
||||
// Rule 295: namespace_definition ::= namespace namespace_definition_hook { <openscope-ast> declaration_seq_opt }
|
||||
//
|
||||
case 297: { action. consumeNamespaceDefinition(false); break;
|
||||
case 295: { action. consumeNamespaceDefinition(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 298: namespace_alias_definition ::= namespace identifier_token = dcolon_opt nested_name_specifier_opt namespace_name ;
|
||||
// Rule 297: namespace_alias_definition ::= namespace identifier_token = dcolon_opt nested_name_specifier_opt namespace_name ;
|
||||
//
|
||||
case 298: { action. consumeNamespaceAliasDefinition(); break;
|
||||
case 297: { action. consumeNamespaceAliasDefinition(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 299: using_declaration ::= using typename_opt dcolon_opt nested_name_specifier_opt unqualified_id_name ;
|
||||
// Rule 298: using_declaration ::= using typename_opt dcolon_opt nested_name_specifier_opt unqualified_id_name ;
|
||||
//
|
||||
case 299: { action. consumeUsingDeclaration(); break;
|
||||
case 298: { action. consumeUsingDeclaration(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 300: typename_opt ::= typename
|
||||
// Rule 299: typename_opt ::= typename
|
||||
//
|
||||
case 300: { action. consumePlaceHolder(); break;
|
||||
case 299: { action. consumePlaceHolder(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 301: typename_opt ::= $Empty
|
||||
// Rule 300: typename_opt ::= $Empty
|
||||
//
|
||||
case 301: { action. consumeEmpty(); break;
|
||||
case 300: { action. consumeEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 302: using_directive ::= using namespace dcolon_opt nested_name_specifier_opt namespace_name ;
|
||||
// Rule 301: using_directive ::= using namespace dcolon_opt nested_name_specifier_opt namespace_name ;
|
||||
//
|
||||
case 302: { action. consumeUsingDirective(); break;
|
||||
case 301: { action. consumeUsingDirective(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 303: asm_definition ::= asm ( stringlit ) ;
|
||||
// Rule 302: asm_definition ::= asm ( stringlit ) ;
|
||||
//
|
||||
case 303: { action. consumeDeclarationASM(); break;
|
||||
case 302: { action. consumeDeclarationASM(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 304: linkage_specification ::= extern stringlit { <openscope-ast> declaration_seq_opt }
|
||||
// Rule 303: linkage_specification ::= extern stringlit { <openscope-ast> declaration_seq_opt }
|
||||
//
|
||||
case 303: { action. consumeLinkageSpecification(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 304: linkage_specification ::= extern stringlit <openscope-ast> declaration
|
||||
//
|
||||
case 304: { action. consumeLinkageSpecification(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 305: linkage_specification ::= extern stringlit <openscope-ast> declaration
|
||||
// Rule 310: init_declarator ::= complete_declarator initializer
|
||||
//
|
||||
case 305: { action. consumeLinkageSpecification(); break;
|
||||
case 310: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 311: init_declarator ::= complete_declarator initializer
|
||||
// Rule 313: declarator ::= <openscope-ast> ptr_operator_seq direct_declarator
|
||||
//
|
||||
case 311: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
case 313: { action. consumeDeclaratorWithPointer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 314: declarator ::= <openscope-ast> ptr_operator_seq direct_declarator
|
||||
// Rule 315: function_declarator ::= <openscope-ast> ptr_operator_seq direct_declarator
|
||||
//
|
||||
case 314: { action. consumeDeclaratorWithPointer(true); break;
|
||||
case 315: { action. consumeDeclaratorWithPointer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 316: function_declarator ::= <openscope-ast> ptr_operator_seq direct_declarator
|
||||
// Rule 318: basic_direct_declarator ::= declarator_id_name
|
||||
//
|
||||
case 316: { action. consumeDeclaratorWithPointer(true); break;
|
||||
case 318: { action. consumeDirectDeclaratorIdentifier(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 319: basic_direct_declarator ::= declarator_id_name
|
||||
// Rule 319: basic_direct_declarator ::= ( declarator )
|
||||
//
|
||||
case 319: { action. consumeDirectDeclaratorIdentifier(); break;
|
||||
case 319: { action. consumeDirectDeclaratorBracketed(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 320: basic_direct_declarator ::= ( declarator )
|
||||
// Rule 320: function_direct_declarator ::= basic_direct_declarator ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
//
|
||||
case 320: { action. consumeDirectDeclaratorBracketed(); break;
|
||||
case 320: { action. consumeDirectDeclaratorFunctionDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 321: function_direct_declarator ::= basic_direct_declarator ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
// Rule 321: array_direct_declarator ::= array_direct_declarator array_modifier
|
||||
//
|
||||
case 321: { action. consumeDirectDeclaratorFunctionDeclarator(true); break;
|
||||
case 321: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 322: array_direct_declarator ::= array_direct_declarator array_modifier
|
||||
// Rule 322: array_direct_declarator ::= basic_direct_declarator array_modifier
|
||||
//
|
||||
case 322: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 323: array_direct_declarator ::= basic_direct_declarator array_modifier
|
||||
// Rule 323: array_modifier ::= [ constant_expression ]
|
||||
//
|
||||
case 323: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
case 323: { action. consumeDirectDeclaratorArrayModifier(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 324: array_modifier ::= [ constant_expression ]
|
||||
// Rule 324: array_modifier ::= [ ]
|
||||
//
|
||||
case 324: { action. consumeDirectDeclaratorArrayModifier(true); break;
|
||||
case 324: { action. consumeDirectDeclaratorArrayModifier(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 325: array_modifier ::= [ ]
|
||||
// Rule 325: ptr_operator ::= pointer_hook * pointer_hook <openscope-ast> cv_qualifier_seq_opt
|
||||
//
|
||||
case 325: { action. consumeDirectDeclaratorArrayModifier(false); break;
|
||||
case 325: { action. consumePointer(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 326: ptr_operator ::= pointer_hook * pointer_hook <openscope-ast> cv_qualifier_seq_opt
|
||||
// Rule 326: ptr_operator ::= pointer_hook & pointer_hook
|
||||
//
|
||||
case 326: { action. consumePointer(); break;
|
||||
case 326: { action. consumeReferenceOperator(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 327: ptr_operator ::= pointer_hook & pointer_hook
|
||||
// Rule 327: ptr_operator ::= dcolon_opt nested_name_specifier pointer_hook * pointer_hook <openscope-ast> cv_qualifier_seq_opt
|
||||
//
|
||||
case 327: { action. consumeReferenceOperator(); break;
|
||||
case 327: { action. consumePointerToMember(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 328: ptr_operator ::= dcolon_opt nested_name_specifier pointer_hook * pointer_hook <openscope-ast> cv_qualifier_seq_opt
|
||||
// Rule 334: cv_qualifier ::= const
|
||||
//
|
||||
case 328: { action. consumePointerToMember(); break;
|
||||
case 334: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 335: cv_qualifier ::= const
|
||||
// Rule 335: cv_qualifier ::= volatile
|
||||
//
|
||||
case 335: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 336: cv_qualifier ::= volatile
|
||||
// Rule 337: declarator_id_name ::= dcolon_opt nested_name_specifier_opt type_name
|
||||
//
|
||||
case 336: { action. consumeToken(); break;
|
||||
case 337: { action. consumeQualifiedId(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 338: declarator_id_name ::= dcolon_opt nested_name_specifier_opt type_name
|
||||
// Rule 338: type_id ::= type_specifier_seq
|
||||
//
|
||||
case 338: { action. consumeQualifiedId(false); break;
|
||||
case 338: { action. consumeTypeId(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 339: type_id ::= type_specifier_seq
|
||||
// Rule 339: type_id ::= type_specifier_seq abstract_declarator
|
||||
//
|
||||
case 339: { action. consumeTypeId(false); break;
|
||||
case 339: { action. consumeTypeId(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 340: type_id ::= type_specifier_seq abstract_declarator
|
||||
// Rule 342: abstract_declarator ::= <openscope-ast> ptr_operator_seq
|
||||
//
|
||||
case 340: { action. consumeTypeId(true); break;
|
||||
case 342: { action. consumeDeclaratorWithPointer(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 343: abstract_declarator ::= <openscope-ast> ptr_operator_seq
|
||||
// Rule 343: abstract_declarator ::= <openscope-ast> ptr_operator_seq direct_abstract_declarator
|
||||
//
|
||||
case 343: { action. consumeDeclaratorWithPointer(false); break;
|
||||
case 343: { action. consumeDeclaratorWithPointer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 344: abstract_declarator ::= <openscope-ast> ptr_operator_seq direct_abstract_declarator
|
||||
// Rule 347: basic_direct_abstract_declarator ::= ( abstract_declarator )
|
||||
//
|
||||
case 344: { action. consumeDeclaratorWithPointer(true); break;
|
||||
case 347: { action. consumeDirectDeclaratorBracketed(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 348: basic_direct_abstract_declarator ::= ( abstract_declarator )
|
||||
// Rule 348: basic_direct_abstract_declarator ::= ( )
|
||||
//
|
||||
case 348: { action. consumeDirectDeclaratorBracketed(); break;
|
||||
case 348: { action. consumeAbstractDeclaratorEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 349: basic_direct_abstract_declarator ::= ( )
|
||||
// Rule 349: array_direct_abstract_declarator ::= array_modifier
|
||||
//
|
||||
case 349: { action. consumeAbstractDeclaratorEmpty(); break;
|
||||
case 349: { action. consumeDirectDeclaratorArrayDeclarator(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 350: array_direct_abstract_declarator ::= array_modifier
|
||||
// Rule 350: array_direct_abstract_declarator ::= array_direct_abstract_declarator array_modifier
|
||||
//
|
||||
case 350: { action. consumeDirectDeclaratorArrayDeclarator(false); break;
|
||||
case 350: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 351: array_direct_abstract_declarator ::= array_direct_abstract_declarator array_modifier
|
||||
// Rule 351: array_direct_abstract_declarator ::= basic_direct_abstract_declarator array_modifier
|
||||
//
|
||||
case 351: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 352: array_direct_abstract_declarator ::= basic_direct_abstract_declarator array_modifier
|
||||
// Rule 352: function_direct_abstract_declarator ::= basic_direct_abstract_declarator ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
//
|
||||
case 352: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
case 352: { action. consumeDirectDeclaratorFunctionDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 353: function_direct_abstract_declarator ::= basic_direct_abstract_declarator ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
// Rule 353: function_direct_abstract_declarator ::= ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
//
|
||||
case 353: { action. consumeDirectDeclaratorFunctionDeclarator(true); break;
|
||||
case 353: { action. consumeDirectDeclaratorFunctionDeclarator(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 354: function_direct_abstract_declarator ::= ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
// Rule 354: parameter_declaration_clause ::= parameter_declaration_list_opt ...
|
||||
//
|
||||
case 354: { action. consumeDirectDeclaratorFunctionDeclarator(false); break;
|
||||
case 354: { action. consumePlaceHolder(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 355: parameter_declaration_clause ::= parameter_declaration_list_opt ...
|
||||
// Rule 355: parameter_declaration_clause ::= parameter_declaration_list_opt
|
||||
//
|
||||
case 355: { action. consumePlaceHolder(); break;
|
||||
case 355: { action. consumeEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 356: parameter_declaration_clause ::= parameter_declaration_list_opt
|
||||
// Rule 356: parameter_declaration_clause ::= parameter_declaration_list , ...
|
||||
//
|
||||
case 356: { action. consumeEmpty(); break;
|
||||
case 356: { action. consumePlaceHolder(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 357: parameter_declaration_clause ::= parameter_declaration_list , ...
|
||||
// Rule 362: abstract_declarator_opt ::= $Empty
|
||||
//
|
||||
case 357: { action. consumePlaceHolder(); break;
|
||||
case 362: { action. consumeEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 363: abstract_declarator_opt ::= $Empty
|
||||
// Rule 363: parameter_declaration ::= declaration_specifiers parameter_init_declarator
|
||||
//
|
||||
case 363: { action. consumeEmpty(); break;
|
||||
case 363: { action. consumeParameterDeclaration(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 364: parameter_declaration ::= declaration_specifiers parameter_init_declarator
|
||||
// Rule 364: parameter_declaration ::= declaration_specifiers
|
||||
//
|
||||
case 364: { action. consumeParameterDeclaration(); break;
|
||||
case 364: { action. consumeParameterDeclarationWithoutDeclarator(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 365: parameter_declaration ::= declaration_specifiers
|
||||
// Rule 366: parameter_init_declarator ::= declarator = parameter_initializer
|
||||
//
|
||||
case 365: { action. consumeParameterDeclarationWithoutDeclarator(); break;
|
||||
case 366: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 367: parameter_init_declarator ::= declarator = parameter_initializer
|
||||
// Rule 368: parameter_init_declarator ::= abstract_declarator = parameter_initializer
|
||||
//
|
||||
case 367: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
case 368: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 369: parameter_init_declarator ::= abstract_declarator = parameter_initializer
|
||||
// Rule 369: parameter_init_declarator ::= = parameter_initializer
|
||||
//
|
||||
case 369: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
case 369: { action. consumeDeclaratorWithInitializer(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 370: parameter_init_declarator ::= = parameter_initializer
|
||||
// Rule 370: parameter_initializer ::= assignment_expression
|
||||
//
|
||||
case 370: { action. consumeDeclaratorWithInitializer(false); break;
|
||||
case 370: { action. consumeInitializer(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 371: parameter_initializer ::= assignment_expression
|
||||
// Rule 371: function_definition ::= declaration_specifiers_opt function_declarator <openscope-ast> ctor_initializer_list_opt function_body
|
||||
//
|
||||
case 371: { action. consumeInitializer(); break;
|
||||
case 371: { action. consumeFunctionDefinition(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 372: function_definition ::= declaration_specifiers_opt function_declarator <openscope-ast> ctor_initializer_list_opt function_body
|
||||
// Rule 372: function_definition ::= declaration_specifiers_opt function_declarator try <openscope-ast> ctor_initializer_list_opt function_body <openscope-ast> handler_seq
|
||||
//
|
||||
case 372: { action. consumeFunctionDefinition(false); break;
|
||||
case 372: { action. consumeFunctionDefinition(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 373: function_definition ::= declaration_specifiers_opt function_declarator try <openscope-ast> ctor_initializer_list_opt function_body <openscope-ast> handler_seq
|
||||
// Rule 375: initializer ::= ( expression_list )
|
||||
//
|
||||
case 373: { action. consumeFunctionDefinition(true); break;
|
||||
case 375: { action. consumeInitializerConstructor(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 376: initializer ::= ( expression_list )
|
||||
// Rule 376: initializer_clause ::= assignment_expression
|
||||
//
|
||||
case 376: { action. consumeInitializerConstructor(); break;
|
||||
case 376: { action. consumeInitializer(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 377: initializer_clause ::= assignment_expression
|
||||
//
|
||||
case 377: { action. consumeInitializer(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 378: initializer_clause ::= start_initializer_list { <openscope-ast> initializer_list , } end_initializer_list
|
||||
// Rule 378: initializer_list ::= start_initializer_list { <openscope-ast> initializer_seq , } end_initializer_list
|
||||
//
|
||||
case 378: { action. consumeInitializerList(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 379: initializer_clause ::= start_initializer_list { <openscope-ast> initializer_list } end_initializer_list
|
||||
// Rule 379: initializer_list ::= start_initializer_list { <openscope-ast> initializer_seq } end_initializer_list
|
||||
//
|
||||
case 379: { action. consumeInitializerList(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 380: initializer_clause ::= { <openscope-ast> }
|
||||
// Rule 380: initializer_list ::= { <openscope-ast> }
|
||||
//
|
||||
case 380: { action. consumeInitializerList(); break;
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -17,12 +17,12 @@ import lpg.lpgjavaruntime.*;
|
|||
|
||||
import java.util.*;
|
||||
import org.eclipse.cdt.core.dom.ast.*;
|
||||
import org.eclipse.cdt.core.dom.lrparser.CPreprocessorAdapter;
|
||||
import org.eclipse.cdt.core.dom.lrparser.IDOMTokenMap;
|
||||
import org.eclipse.cdt.core.dom.lrparser.IParser;
|
||||
import org.eclipse.cdt.core.dom.lrparser.ITokenCollector;
|
||||
import org.eclipse.cdt.core.dom.lrparser.lpgextensions.FixedBacktrackingParser;
|
||||
import org.eclipse.cdt.core.dom.lrparser.CPreprocessorAdapter;
|
||||
import org.eclipse.cdt.core.dom.lrparser.action.ITokenStream;
|
||||
import org.eclipse.cdt.core.dom.lrparser.lpgextensions.FixedBacktrackingParser;
|
||||
import org.eclipse.cdt.core.dom.lrparser.action.ScopedStack;
|
||||
import org.eclipse.cdt.core.parser.IScanner;
|
||||
import org.eclipse.cdt.core.dom.parser.IBuiltinBindingsProvider;
|
||||
|
@ -174,17 +174,17 @@ private CPPBuildASTParserAction action;
|
|||
private IASTCompletionNode compNode;
|
||||
|
||||
|
||||
public CPPParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Set<IParser.Options> options) {
|
||||
initActions(options);
|
||||
public CPPParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Map<String,String> properties) {
|
||||
initActions(properties);
|
||||
action.initializeTranslationUnit(scanner, builtinBindingsProvider, index);
|
||||
CPreprocessorAdapter.runCPreprocessor(scanner, this, tokenMap);
|
||||
}
|
||||
|
||||
private void initActions(Set<IParser.Options> options) {
|
||||
private void initActions(Map<String,String> properties) {
|
||||
ScopedStack<Object> astStack = new ScopedStack<Object>();
|
||||
|
||||
action = new CPPBuildASTParserAction (this, astStack, CPPNodeFactory.getDefault() , CPPSecondaryParserFactory.getDefault() );
|
||||
action.setParserOptions(options);
|
||||
action.setParserProperties(properties);
|
||||
|
||||
|
||||
}
|
||||
|
@ -1284,331 +1284,331 @@ public String getName() {
|
|||
}
|
||||
|
||||
//
|
||||
// Rule 296: named_namespace_definition ::= namespace namespace_name { <openscope-ast> declaration_seq_opt }
|
||||
// Rule 294: namespace_definition ::= namespace namespace_name namespace_definition_hook { <openscope-ast> declaration_seq_opt }
|
||||
//
|
||||
case 296: { action. consumeNamespaceDefinition(true); break;
|
||||
case 294: { action. consumeNamespaceDefinition(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 297: unnamed_namespace_definition ::= namespace { <openscope-ast> declaration_seq_opt }
|
||||
// Rule 295: namespace_definition ::= namespace namespace_definition_hook { <openscope-ast> declaration_seq_opt }
|
||||
//
|
||||
case 297: { action. consumeNamespaceDefinition(false); break;
|
||||
case 295: { action. consumeNamespaceDefinition(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 298: namespace_alias_definition ::= namespace identifier_token = dcolon_opt nested_name_specifier_opt namespace_name ;
|
||||
// Rule 297: namespace_alias_definition ::= namespace identifier_token = dcolon_opt nested_name_specifier_opt namespace_name ;
|
||||
//
|
||||
case 298: { action. consumeNamespaceAliasDefinition(); break;
|
||||
case 297: { action. consumeNamespaceAliasDefinition(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 299: using_declaration ::= using typename_opt dcolon_opt nested_name_specifier_opt unqualified_id_name ;
|
||||
// Rule 298: using_declaration ::= using typename_opt dcolon_opt nested_name_specifier_opt unqualified_id_name ;
|
||||
//
|
||||
case 299: { action. consumeUsingDeclaration(); break;
|
||||
case 298: { action. consumeUsingDeclaration(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 300: typename_opt ::= typename
|
||||
// Rule 299: typename_opt ::= typename
|
||||
//
|
||||
case 300: { action. consumePlaceHolder(); break;
|
||||
case 299: { action. consumePlaceHolder(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 301: typename_opt ::= $Empty
|
||||
// Rule 300: typename_opt ::= $Empty
|
||||
//
|
||||
case 301: { action. consumeEmpty(); break;
|
||||
case 300: { action. consumeEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 302: using_directive ::= using namespace dcolon_opt nested_name_specifier_opt namespace_name ;
|
||||
// Rule 301: using_directive ::= using namespace dcolon_opt nested_name_specifier_opt namespace_name ;
|
||||
//
|
||||
case 302: { action. consumeUsingDirective(); break;
|
||||
case 301: { action. consumeUsingDirective(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 303: asm_definition ::= asm ( stringlit ) ;
|
||||
// Rule 302: asm_definition ::= asm ( stringlit ) ;
|
||||
//
|
||||
case 303: { action. consumeDeclarationASM(); break;
|
||||
case 302: { action. consumeDeclarationASM(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 304: linkage_specification ::= extern stringlit { <openscope-ast> declaration_seq_opt }
|
||||
// Rule 303: linkage_specification ::= extern stringlit { <openscope-ast> declaration_seq_opt }
|
||||
//
|
||||
case 303: { action. consumeLinkageSpecification(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 304: linkage_specification ::= extern stringlit <openscope-ast> declaration
|
||||
//
|
||||
case 304: { action. consumeLinkageSpecification(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 305: linkage_specification ::= extern stringlit <openscope-ast> declaration
|
||||
// Rule 309: init_declarator_complete ::= init_declarator
|
||||
//
|
||||
case 305: { action. consumeLinkageSpecification(); break;
|
||||
case 309: { action. consumeInitDeclaratorComplete(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 310: init_declarator_complete ::= init_declarator
|
||||
// Rule 311: init_declarator ::= complete_declarator initializer
|
||||
//
|
||||
case 310: { action. consumeInitDeclaratorComplete(); break;
|
||||
case 311: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 312: init_declarator ::= complete_declarator initializer
|
||||
// Rule 314: declarator ::= <openscope-ast> ptr_operator_seq direct_declarator
|
||||
//
|
||||
case 312: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
case 314: { action. consumeDeclaratorWithPointer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 315: declarator ::= <openscope-ast> ptr_operator_seq direct_declarator
|
||||
// Rule 316: function_declarator ::= <openscope-ast> ptr_operator_seq direct_declarator
|
||||
//
|
||||
case 315: { action. consumeDeclaratorWithPointer(true); break;
|
||||
case 316: { action. consumeDeclaratorWithPointer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 317: function_declarator ::= <openscope-ast> ptr_operator_seq direct_declarator
|
||||
// Rule 320: basic_direct_declarator ::= declarator_id_name
|
||||
//
|
||||
case 317: { action. consumeDeclaratorWithPointer(true); break;
|
||||
case 320: { action. consumeDirectDeclaratorIdentifier(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 321: basic_direct_declarator ::= declarator_id_name
|
||||
// Rule 321: basic_direct_declarator ::= ( declarator )
|
||||
//
|
||||
case 321: { action. consumeDirectDeclaratorIdentifier(); break;
|
||||
case 321: { action. consumeDirectDeclaratorBracketed(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 322: basic_direct_declarator ::= ( declarator )
|
||||
// Rule 322: function_direct_declarator ::= basic_direct_declarator ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
//
|
||||
case 322: { action. consumeDirectDeclaratorBracketed(); break;
|
||||
case 322: { action. consumeDirectDeclaratorFunctionDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 323: function_direct_declarator ::= basic_direct_declarator ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
// Rule 323: array_direct_declarator ::= array_direct_declarator array_modifier
|
||||
//
|
||||
case 323: { action. consumeDirectDeclaratorFunctionDeclarator(true); break;
|
||||
case 323: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 324: array_direct_declarator ::= array_direct_declarator array_modifier
|
||||
// Rule 324: array_direct_declarator ::= basic_direct_declarator array_modifier
|
||||
//
|
||||
case 324: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 325: array_direct_declarator ::= basic_direct_declarator array_modifier
|
||||
// Rule 325: array_modifier ::= [ constant_expression ]
|
||||
//
|
||||
case 325: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
case 325: { action. consumeDirectDeclaratorArrayModifier(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 326: array_modifier ::= [ constant_expression ]
|
||||
// Rule 326: array_modifier ::= [ ]
|
||||
//
|
||||
case 326: { action. consumeDirectDeclaratorArrayModifier(true); break;
|
||||
case 326: { action. consumeDirectDeclaratorArrayModifier(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 327: array_modifier ::= [ ]
|
||||
// Rule 327: ptr_operator ::= pointer_hook * pointer_hook <openscope-ast> cv_qualifier_seq_opt
|
||||
//
|
||||
case 327: { action. consumeDirectDeclaratorArrayModifier(false); break;
|
||||
case 327: { action. consumePointer(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 328: ptr_operator ::= pointer_hook * pointer_hook <openscope-ast> cv_qualifier_seq_opt
|
||||
// Rule 328: ptr_operator ::= pointer_hook & pointer_hook
|
||||
//
|
||||
case 328: { action. consumePointer(); break;
|
||||
case 328: { action. consumeReferenceOperator(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 329: ptr_operator ::= pointer_hook & pointer_hook
|
||||
// Rule 329: ptr_operator ::= dcolon_opt nested_name_specifier pointer_hook * pointer_hook <openscope-ast> cv_qualifier_seq_opt
|
||||
//
|
||||
case 329: { action. consumeReferenceOperator(); break;
|
||||
case 329: { action. consumePointerToMember(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 330: ptr_operator ::= dcolon_opt nested_name_specifier pointer_hook * pointer_hook <openscope-ast> cv_qualifier_seq_opt
|
||||
// Rule 336: cv_qualifier ::= const
|
||||
//
|
||||
case 330: { action. consumePointerToMember(); break;
|
||||
case 336: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 337: cv_qualifier ::= const
|
||||
// Rule 337: cv_qualifier ::= volatile
|
||||
//
|
||||
case 337: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 338: cv_qualifier ::= volatile
|
||||
// Rule 339: declarator_id_name ::= dcolon_opt nested_name_specifier_opt type_name
|
||||
//
|
||||
case 338: { action. consumeToken(); break;
|
||||
case 339: { action. consumeQualifiedId(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 340: declarator_id_name ::= dcolon_opt nested_name_specifier_opt type_name
|
||||
// Rule 340: type_id ::= type_specifier_seq
|
||||
//
|
||||
case 340: { action. consumeQualifiedId(false); break;
|
||||
case 340: { action. consumeTypeId(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 341: type_id ::= type_specifier_seq
|
||||
// Rule 341: type_id ::= type_specifier_seq abstract_declarator
|
||||
//
|
||||
case 341: { action. consumeTypeId(false); break;
|
||||
case 341: { action. consumeTypeId(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 342: type_id ::= type_specifier_seq abstract_declarator
|
||||
// Rule 344: abstract_declarator ::= <openscope-ast> ptr_operator_seq
|
||||
//
|
||||
case 342: { action. consumeTypeId(true); break;
|
||||
case 344: { action. consumeDeclaratorWithPointer(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 345: abstract_declarator ::= <openscope-ast> ptr_operator_seq
|
||||
// Rule 345: abstract_declarator ::= <openscope-ast> ptr_operator_seq direct_abstract_declarator
|
||||
//
|
||||
case 345: { action. consumeDeclaratorWithPointer(false); break;
|
||||
case 345: { action. consumeDeclaratorWithPointer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 346: abstract_declarator ::= <openscope-ast> ptr_operator_seq direct_abstract_declarator
|
||||
// Rule 349: basic_direct_abstract_declarator ::= ( abstract_declarator )
|
||||
//
|
||||
case 346: { action. consumeDeclaratorWithPointer(true); break;
|
||||
case 349: { action. consumeDirectDeclaratorBracketed(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 350: basic_direct_abstract_declarator ::= ( abstract_declarator )
|
||||
// Rule 350: basic_direct_abstract_declarator ::= ( )
|
||||
//
|
||||
case 350: { action. consumeDirectDeclaratorBracketed(); break;
|
||||
case 350: { action. consumeAbstractDeclaratorEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 351: basic_direct_abstract_declarator ::= ( )
|
||||
// Rule 351: array_direct_abstract_declarator ::= array_modifier
|
||||
//
|
||||
case 351: { action. consumeAbstractDeclaratorEmpty(); break;
|
||||
case 351: { action. consumeDirectDeclaratorArrayDeclarator(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 352: array_direct_abstract_declarator ::= array_modifier
|
||||
// Rule 352: array_direct_abstract_declarator ::= array_direct_abstract_declarator array_modifier
|
||||
//
|
||||
case 352: { action. consumeDirectDeclaratorArrayDeclarator(false); break;
|
||||
case 352: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 353: array_direct_abstract_declarator ::= array_direct_abstract_declarator array_modifier
|
||||
// Rule 353: array_direct_abstract_declarator ::= basic_direct_abstract_declarator array_modifier
|
||||
//
|
||||
case 353: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 354: array_direct_abstract_declarator ::= basic_direct_abstract_declarator array_modifier
|
||||
// Rule 354: function_direct_abstract_declarator ::= basic_direct_abstract_declarator ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
//
|
||||
case 354: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
case 354: { action. consumeDirectDeclaratorFunctionDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 355: function_direct_abstract_declarator ::= basic_direct_abstract_declarator ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
// Rule 355: function_direct_abstract_declarator ::= ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
//
|
||||
case 355: { action. consumeDirectDeclaratorFunctionDeclarator(true); break;
|
||||
case 355: { action. consumeDirectDeclaratorFunctionDeclarator(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 356: function_direct_abstract_declarator ::= ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
// Rule 356: parameter_declaration_clause ::= parameter_declaration_list_opt ...
|
||||
//
|
||||
case 356: { action. consumeDirectDeclaratorFunctionDeclarator(false); break;
|
||||
case 356: { action. consumePlaceHolder(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 357: parameter_declaration_clause ::= parameter_declaration_list_opt ...
|
||||
// Rule 357: parameter_declaration_clause ::= parameter_declaration_list_opt
|
||||
//
|
||||
case 357: { action. consumePlaceHolder(); break;
|
||||
case 357: { action. consumeEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 358: parameter_declaration_clause ::= parameter_declaration_list_opt
|
||||
// Rule 358: parameter_declaration_clause ::= parameter_declaration_list , ...
|
||||
//
|
||||
case 358: { action. consumeEmpty(); break;
|
||||
case 358: { action. consumePlaceHolder(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 359: parameter_declaration_clause ::= parameter_declaration_list , ...
|
||||
// Rule 364: abstract_declarator_opt ::= $Empty
|
||||
//
|
||||
case 359: { action. consumePlaceHolder(); break;
|
||||
case 364: { action. consumeEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 365: abstract_declarator_opt ::= $Empty
|
||||
// Rule 365: parameter_declaration ::= declaration_specifiers parameter_init_declarator
|
||||
//
|
||||
case 365: { action. consumeEmpty(); break;
|
||||
case 365: { action. consumeParameterDeclaration(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 366: parameter_declaration ::= declaration_specifiers parameter_init_declarator
|
||||
// Rule 366: parameter_declaration ::= declaration_specifiers
|
||||
//
|
||||
case 366: { action. consumeParameterDeclaration(); break;
|
||||
case 366: { action. consumeParameterDeclarationWithoutDeclarator(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 367: parameter_declaration ::= declaration_specifiers
|
||||
// Rule 368: parameter_init_declarator ::= declarator = parameter_initializer
|
||||
//
|
||||
case 367: { action. consumeParameterDeclarationWithoutDeclarator(); break;
|
||||
case 368: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 369: parameter_init_declarator ::= declarator = parameter_initializer
|
||||
// Rule 370: parameter_init_declarator ::= abstract_declarator = parameter_initializer
|
||||
//
|
||||
case 369: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
case 370: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 371: parameter_init_declarator ::= abstract_declarator = parameter_initializer
|
||||
// Rule 371: parameter_init_declarator ::= = parameter_initializer
|
||||
//
|
||||
case 371: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
case 371: { action. consumeDeclaratorWithInitializer(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 372: parameter_init_declarator ::= = parameter_initializer
|
||||
// Rule 372: parameter_initializer ::= assignment_expression
|
||||
//
|
||||
case 372: { action. consumeDeclaratorWithInitializer(false); break;
|
||||
case 372: { action. consumeInitializer(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 373: parameter_initializer ::= assignment_expression
|
||||
// Rule 373: function_definition ::= declaration_specifiers_opt function_declarator <openscope-ast> ctor_initializer_list_opt function_body
|
||||
//
|
||||
case 373: { action. consumeInitializer(); break;
|
||||
case 373: { action. consumeFunctionDefinition(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 374: function_definition ::= declaration_specifiers_opt function_declarator <openscope-ast> ctor_initializer_list_opt function_body
|
||||
// Rule 374: function_definition ::= declaration_specifiers_opt function_declarator try <openscope-ast> ctor_initializer_list_opt function_body <openscope-ast> handler_seq
|
||||
//
|
||||
case 374: { action. consumeFunctionDefinition(false); break;
|
||||
case 374: { action. consumeFunctionDefinition(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 375: function_definition ::= declaration_specifiers_opt function_declarator try <openscope-ast> ctor_initializer_list_opt function_body <openscope-ast> handler_seq
|
||||
// Rule 377: initializer ::= ( expression_list )
|
||||
//
|
||||
case 375: { action. consumeFunctionDefinition(true); break;
|
||||
case 377: { action. consumeInitializerConstructor(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 378: initializer ::= ( expression_list )
|
||||
// Rule 378: initializer_clause ::= assignment_expression
|
||||
//
|
||||
case 378: { action. consumeInitializerConstructor(); break;
|
||||
case 378: { action. consumeInitializer(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 379: initializer_clause ::= assignment_expression
|
||||
//
|
||||
case 379: { action. consumeInitializer(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 380: initializer_clause ::= start_initializer_list { <openscope-ast> initializer_list , } end_initializer_list
|
||||
// Rule 380: initializer_list ::= start_initializer_list { <openscope-ast> initializer_seq , } end_initializer_list
|
||||
//
|
||||
case 380: { action. consumeInitializerList(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 381: initializer_clause ::= start_initializer_list { <openscope-ast> initializer_list } end_initializer_list
|
||||
// Rule 381: initializer_list ::= start_initializer_list { <openscope-ast> initializer_seq } end_initializer_list
|
||||
//
|
||||
case 381: { action. consumeInitializerList(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 382: initializer_clause ::= { <openscope-ast> }
|
||||
// Rule 382: initializer_list ::= { <openscope-ast> }
|
||||
//
|
||||
case 382: { action. consumeInitializerList(); break;
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -17,17 +17,17 @@ import lpg.lpgjavaruntime.*;
|
|||
|
||||
import java.util.*;
|
||||
import org.eclipse.cdt.core.dom.ast.*;
|
||||
import org.eclipse.cdt.core.dom.lrparser.CPreprocessorAdapter;
|
||||
import org.eclipse.cdt.core.dom.lrparser.IDOMTokenMap;
|
||||
import org.eclipse.cdt.core.dom.lrparser.IParser;
|
||||
import org.eclipse.cdt.core.dom.lrparser.ITokenCollector;
|
||||
import org.eclipse.cdt.core.dom.lrparser.CPreprocessorAdapter;
|
||||
import org.eclipse.cdt.core.dom.lrparser.action.ITokenStream;
|
||||
import org.eclipse.cdt.core.dom.lrparser.lpgextensions.FixedBacktrackingParser;
|
||||
import org.eclipse.cdt.core.dom.lrparser.action.ScopedStack;
|
||||
import org.eclipse.cdt.core.parser.IScanner;
|
||||
import org.eclipse.cdt.core.dom.parser.IBuiltinBindingsProvider;
|
||||
import org.eclipse.cdt.core.index.IIndex;
|
||||
|
||||
import org.eclipse.cdt.core.dom.lrparser.action.ITokenStream;
|
||||
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.ISecondaryParser;
|
||||
|
@ -178,17 +178,17 @@ private CPPBuildASTParserAction action;
|
|||
private IASTCompletionNode compNode;
|
||||
|
||||
|
||||
public CPPSizeofExpressionParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Set<IParser.Options> options) {
|
||||
initActions(options);
|
||||
public CPPSizeofExpressionParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Map<String,String> properties) {
|
||||
initActions(properties);
|
||||
action.initializeTranslationUnit(scanner, builtinBindingsProvider, index);
|
||||
CPreprocessorAdapter.runCPreprocessor(scanner, this, tokenMap);
|
||||
}
|
||||
|
||||
private void initActions(Set<IParser.Options> options) {
|
||||
private void initActions(Map<String,String> properties) {
|
||||
ScopedStack<Object> astStack = new ScopedStack<Object>();
|
||||
|
||||
action = new CPPBuildASTParserAction (this, astStack, CPPNodeFactory.getDefault() , CPPSecondaryParserFactory.getDefault() );
|
||||
action.setParserOptions(options);
|
||||
action.setParserProperties(properties);
|
||||
|
||||
|
||||
}
|
||||
|
@ -245,9 +245,9 @@ public void setTokens(List<IToken> tokens) {
|
|||
addToken(new Token(null, 0, 0, CPPSizeofExpressionParsersym.TK_EOF_TOKEN));
|
||||
}
|
||||
|
||||
public CPPSizeofExpressionParser(ITokenStream parser, Set<IParser.Options> options) { // constructor for creating secondary parser
|
||||
initActions(options);
|
||||
tokenMap = new TokenMap(CPPSizeofExpressionParsersym.orderedTerminalSymbols, parser.getOrderedTerminalSymbols());
|
||||
public CPPSizeofExpressionParser(ITokenStream stream, Map<String,String> properties) { // constructor for creating secondary parser
|
||||
initActions(properties);
|
||||
tokenMap = new TokenMap(CPPSizeofExpressionParsersym.orderedTerminalSymbols, stream.getOrderedTerminalSymbols());
|
||||
}
|
||||
|
||||
|
||||
|
@ -1295,331 +1295,331 @@ public CPPSizeofExpressionParser(ITokenStream parser, Set<IParser.Options> optio
|
|||
}
|
||||
|
||||
//
|
||||
// Rule 294: named_namespace_definition ::= namespace namespace_name { <openscope-ast> declaration_seq_opt }
|
||||
// Rule 292: namespace_definition ::= namespace namespace_name namespace_definition_hook { <openscope-ast> declaration_seq_opt }
|
||||
//
|
||||
case 294: { action. consumeNamespaceDefinition(true); break;
|
||||
case 292: { action. consumeNamespaceDefinition(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 295: unnamed_namespace_definition ::= namespace { <openscope-ast> declaration_seq_opt }
|
||||
// Rule 293: namespace_definition ::= namespace namespace_definition_hook { <openscope-ast> declaration_seq_opt }
|
||||
//
|
||||
case 295: { action. consumeNamespaceDefinition(false); break;
|
||||
case 293: { action. consumeNamespaceDefinition(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 296: namespace_alias_definition ::= namespace identifier_token = dcolon_opt nested_name_specifier_opt namespace_name ;
|
||||
// Rule 295: namespace_alias_definition ::= namespace identifier_token = dcolon_opt nested_name_specifier_opt namespace_name ;
|
||||
//
|
||||
case 296: { action. consumeNamespaceAliasDefinition(); break;
|
||||
case 295: { action. consumeNamespaceAliasDefinition(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 297: using_declaration ::= using typename_opt dcolon_opt nested_name_specifier_opt unqualified_id_name ;
|
||||
// Rule 296: using_declaration ::= using typename_opt dcolon_opt nested_name_specifier_opt unqualified_id_name ;
|
||||
//
|
||||
case 297: { action. consumeUsingDeclaration(); break;
|
||||
case 296: { action. consumeUsingDeclaration(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 298: typename_opt ::= typename
|
||||
// Rule 297: typename_opt ::= typename
|
||||
//
|
||||
case 298: { action. consumePlaceHolder(); break;
|
||||
case 297: { action. consumePlaceHolder(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 299: typename_opt ::= $Empty
|
||||
// Rule 298: typename_opt ::= $Empty
|
||||
//
|
||||
case 299: { action. consumeEmpty(); break;
|
||||
case 298: { action. consumeEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 300: using_directive ::= using namespace dcolon_opt nested_name_specifier_opt namespace_name ;
|
||||
// Rule 299: using_directive ::= using namespace dcolon_opt nested_name_specifier_opt namespace_name ;
|
||||
//
|
||||
case 300: { action. consumeUsingDirective(); break;
|
||||
case 299: { action. consumeUsingDirective(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 301: asm_definition ::= asm ( stringlit ) ;
|
||||
// Rule 300: asm_definition ::= asm ( stringlit ) ;
|
||||
//
|
||||
case 301: { action. consumeDeclarationASM(); break;
|
||||
case 300: { action. consumeDeclarationASM(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 302: linkage_specification ::= extern stringlit { <openscope-ast> declaration_seq_opt }
|
||||
// Rule 301: linkage_specification ::= extern stringlit { <openscope-ast> declaration_seq_opt }
|
||||
//
|
||||
case 301: { action. consumeLinkageSpecification(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 302: linkage_specification ::= extern stringlit <openscope-ast> declaration
|
||||
//
|
||||
case 302: { action. consumeLinkageSpecification(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 303: linkage_specification ::= extern stringlit <openscope-ast> declaration
|
||||
// Rule 307: init_declarator_complete ::= init_declarator
|
||||
//
|
||||
case 303: { action. consumeLinkageSpecification(); break;
|
||||
case 307: { action. consumeInitDeclaratorComplete(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 308: init_declarator_complete ::= init_declarator
|
||||
// Rule 309: init_declarator ::= complete_declarator initializer
|
||||
//
|
||||
case 308: { action. consumeInitDeclaratorComplete(); break;
|
||||
case 309: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 310: init_declarator ::= complete_declarator initializer
|
||||
// Rule 312: declarator ::= <openscope-ast> ptr_operator_seq direct_declarator
|
||||
//
|
||||
case 310: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
case 312: { action. consumeDeclaratorWithPointer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 313: declarator ::= <openscope-ast> ptr_operator_seq direct_declarator
|
||||
// Rule 314: function_declarator ::= <openscope-ast> ptr_operator_seq direct_declarator
|
||||
//
|
||||
case 313: { action. consumeDeclaratorWithPointer(true); break;
|
||||
case 314: { action. consumeDeclaratorWithPointer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 315: function_declarator ::= <openscope-ast> ptr_operator_seq direct_declarator
|
||||
// Rule 318: basic_direct_declarator ::= declarator_id_name
|
||||
//
|
||||
case 315: { action. consumeDeclaratorWithPointer(true); break;
|
||||
case 318: { action. consumeDirectDeclaratorIdentifier(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 319: basic_direct_declarator ::= declarator_id_name
|
||||
// Rule 319: basic_direct_declarator ::= ( declarator )
|
||||
//
|
||||
case 319: { action. consumeDirectDeclaratorIdentifier(); break;
|
||||
case 319: { action. consumeDirectDeclaratorBracketed(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 320: basic_direct_declarator ::= ( declarator )
|
||||
// Rule 320: function_direct_declarator ::= basic_direct_declarator ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
//
|
||||
case 320: { action. consumeDirectDeclaratorBracketed(); break;
|
||||
case 320: { action. consumeDirectDeclaratorFunctionDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 321: function_direct_declarator ::= basic_direct_declarator ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
// Rule 321: array_direct_declarator ::= array_direct_declarator array_modifier
|
||||
//
|
||||
case 321: { action. consumeDirectDeclaratorFunctionDeclarator(true); break;
|
||||
case 321: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 322: array_direct_declarator ::= array_direct_declarator array_modifier
|
||||
// Rule 322: array_direct_declarator ::= basic_direct_declarator array_modifier
|
||||
//
|
||||
case 322: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 323: array_direct_declarator ::= basic_direct_declarator array_modifier
|
||||
// Rule 323: array_modifier ::= [ constant_expression ]
|
||||
//
|
||||
case 323: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
case 323: { action. consumeDirectDeclaratorArrayModifier(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 324: array_modifier ::= [ constant_expression ]
|
||||
// Rule 324: array_modifier ::= [ ]
|
||||
//
|
||||
case 324: { action. consumeDirectDeclaratorArrayModifier(true); break;
|
||||
case 324: { action. consumeDirectDeclaratorArrayModifier(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 325: array_modifier ::= [ ]
|
||||
// Rule 325: ptr_operator ::= pointer_hook * pointer_hook <openscope-ast> cv_qualifier_seq_opt
|
||||
//
|
||||
case 325: { action. consumeDirectDeclaratorArrayModifier(false); break;
|
||||
case 325: { action. consumePointer(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 326: ptr_operator ::= pointer_hook * pointer_hook <openscope-ast> cv_qualifier_seq_opt
|
||||
// Rule 326: ptr_operator ::= pointer_hook & pointer_hook
|
||||
//
|
||||
case 326: { action. consumePointer(); break;
|
||||
case 326: { action. consumeReferenceOperator(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 327: ptr_operator ::= pointer_hook & pointer_hook
|
||||
// Rule 327: ptr_operator ::= dcolon_opt nested_name_specifier pointer_hook * pointer_hook <openscope-ast> cv_qualifier_seq_opt
|
||||
//
|
||||
case 327: { action. consumeReferenceOperator(); break;
|
||||
case 327: { action. consumePointerToMember(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 328: ptr_operator ::= dcolon_opt nested_name_specifier pointer_hook * pointer_hook <openscope-ast> cv_qualifier_seq_opt
|
||||
// Rule 334: cv_qualifier ::= const
|
||||
//
|
||||
case 328: { action. consumePointerToMember(); break;
|
||||
case 334: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 335: cv_qualifier ::= const
|
||||
// Rule 335: cv_qualifier ::= volatile
|
||||
//
|
||||
case 335: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 336: cv_qualifier ::= volatile
|
||||
// Rule 337: declarator_id_name ::= dcolon_opt nested_name_specifier_opt type_name
|
||||
//
|
||||
case 336: { action. consumeToken(); break;
|
||||
case 337: { action. consumeQualifiedId(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 338: declarator_id_name ::= dcolon_opt nested_name_specifier_opt type_name
|
||||
// Rule 338: type_id ::= type_specifier_seq
|
||||
//
|
||||
case 338: { action. consumeQualifiedId(false); break;
|
||||
case 338: { action. consumeTypeId(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 339: type_id ::= type_specifier_seq
|
||||
// Rule 339: type_id ::= type_specifier_seq abstract_declarator
|
||||
//
|
||||
case 339: { action. consumeTypeId(false); break;
|
||||
case 339: { action. consumeTypeId(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 340: type_id ::= type_specifier_seq abstract_declarator
|
||||
// Rule 342: abstract_declarator ::= <openscope-ast> ptr_operator_seq
|
||||
//
|
||||
case 340: { action. consumeTypeId(true); break;
|
||||
case 342: { action. consumeDeclaratorWithPointer(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 343: abstract_declarator ::= <openscope-ast> ptr_operator_seq
|
||||
// Rule 343: abstract_declarator ::= <openscope-ast> ptr_operator_seq direct_abstract_declarator
|
||||
//
|
||||
case 343: { action. consumeDeclaratorWithPointer(false); break;
|
||||
case 343: { action. consumeDeclaratorWithPointer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 344: abstract_declarator ::= <openscope-ast> ptr_operator_seq direct_abstract_declarator
|
||||
// Rule 347: basic_direct_abstract_declarator ::= ( abstract_declarator )
|
||||
//
|
||||
case 344: { action. consumeDeclaratorWithPointer(true); break;
|
||||
case 347: { action. consumeDirectDeclaratorBracketed(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 348: basic_direct_abstract_declarator ::= ( abstract_declarator )
|
||||
// Rule 348: basic_direct_abstract_declarator ::= ( )
|
||||
//
|
||||
case 348: { action. consumeDirectDeclaratorBracketed(); break;
|
||||
case 348: { action. consumeAbstractDeclaratorEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 349: basic_direct_abstract_declarator ::= ( )
|
||||
// Rule 349: array_direct_abstract_declarator ::= array_modifier
|
||||
//
|
||||
case 349: { action. consumeAbstractDeclaratorEmpty(); break;
|
||||
case 349: { action. consumeDirectDeclaratorArrayDeclarator(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 350: array_direct_abstract_declarator ::= array_modifier
|
||||
// Rule 350: array_direct_abstract_declarator ::= array_direct_abstract_declarator array_modifier
|
||||
//
|
||||
case 350: { action. consumeDirectDeclaratorArrayDeclarator(false); break;
|
||||
case 350: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 351: array_direct_abstract_declarator ::= array_direct_abstract_declarator array_modifier
|
||||
// Rule 351: array_direct_abstract_declarator ::= basic_direct_abstract_declarator array_modifier
|
||||
//
|
||||
case 351: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 352: array_direct_abstract_declarator ::= basic_direct_abstract_declarator array_modifier
|
||||
// Rule 352: function_direct_abstract_declarator ::= basic_direct_abstract_declarator ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
//
|
||||
case 352: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
case 352: { action. consumeDirectDeclaratorFunctionDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 353: function_direct_abstract_declarator ::= basic_direct_abstract_declarator ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
// Rule 353: function_direct_abstract_declarator ::= ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
//
|
||||
case 353: { action. consumeDirectDeclaratorFunctionDeclarator(true); break;
|
||||
case 353: { action. consumeDirectDeclaratorFunctionDeclarator(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 354: function_direct_abstract_declarator ::= ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
// Rule 354: parameter_declaration_clause ::= parameter_declaration_list_opt ...
|
||||
//
|
||||
case 354: { action. consumeDirectDeclaratorFunctionDeclarator(false); break;
|
||||
case 354: { action. consumePlaceHolder(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 355: parameter_declaration_clause ::= parameter_declaration_list_opt ...
|
||||
// Rule 355: parameter_declaration_clause ::= parameter_declaration_list_opt
|
||||
//
|
||||
case 355: { action. consumePlaceHolder(); break;
|
||||
case 355: { action. consumeEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 356: parameter_declaration_clause ::= parameter_declaration_list_opt
|
||||
// Rule 356: parameter_declaration_clause ::= parameter_declaration_list , ...
|
||||
//
|
||||
case 356: { action. consumeEmpty(); break;
|
||||
case 356: { action. consumePlaceHolder(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 357: parameter_declaration_clause ::= parameter_declaration_list , ...
|
||||
// Rule 362: abstract_declarator_opt ::= $Empty
|
||||
//
|
||||
case 357: { action. consumePlaceHolder(); break;
|
||||
case 362: { action. consumeEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 363: abstract_declarator_opt ::= $Empty
|
||||
// Rule 363: parameter_declaration ::= declaration_specifiers parameter_init_declarator
|
||||
//
|
||||
case 363: { action. consumeEmpty(); break;
|
||||
case 363: { action. consumeParameterDeclaration(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 364: parameter_declaration ::= declaration_specifiers parameter_init_declarator
|
||||
// Rule 364: parameter_declaration ::= declaration_specifiers
|
||||
//
|
||||
case 364: { action. consumeParameterDeclaration(); break;
|
||||
case 364: { action. consumeParameterDeclarationWithoutDeclarator(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 365: parameter_declaration ::= declaration_specifiers
|
||||
// Rule 366: parameter_init_declarator ::= declarator = parameter_initializer
|
||||
//
|
||||
case 365: { action. consumeParameterDeclarationWithoutDeclarator(); break;
|
||||
case 366: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 367: parameter_init_declarator ::= declarator = parameter_initializer
|
||||
// Rule 368: parameter_init_declarator ::= abstract_declarator = parameter_initializer
|
||||
//
|
||||
case 367: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
case 368: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 369: parameter_init_declarator ::= abstract_declarator = parameter_initializer
|
||||
// Rule 369: parameter_init_declarator ::= = parameter_initializer
|
||||
//
|
||||
case 369: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
case 369: { action. consumeDeclaratorWithInitializer(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 370: parameter_init_declarator ::= = parameter_initializer
|
||||
// Rule 370: parameter_initializer ::= assignment_expression
|
||||
//
|
||||
case 370: { action. consumeDeclaratorWithInitializer(false); break;
|
||||
case 370: { action. consumeInitializer(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 371: parameter_initializer ::= assignment_expression
|
||||
// Rule 371: function_definition ::= declaration_specifiers_opt function_declarator <openscope-ast> ctor_initializer_list_opt function_body
|
||||
//
|
||||
case 371: { action. consumeInitializer(); break;
|
||||
case 371: { action. consumeFunctionDefinition(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 372: function_definition ::= declaration_specifiers_opt function_declarator <openscope-ast> ctor_initializer_list_opt function_body
|
||||
// Rule 372: function_definition ::= declaration_specifiers_opt function_declarator try <openscope-ast> ctor_initializer_list_opt function_body <openscope-ast> handler_seq
|
||||
//
|
||||
case 372: { action. consumeFunctionDefinition(false); break;
|
||||
case 372: { action. consumeFunctionDefinition(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 373: function_definition ::= declaration_specifiers_opt function_declarator try <openscope-ast> ctor_initializer_list_opt function_body <openscope-ast> handler_seq
|
||||
// Rule 375: initializer ::= ( expression_list )
|
||||
//
|
||||
case 373: { action. consumeFunctionDefinition(true); break;
|
||||
case 375: { action. consumeInitializerConstructor(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 376: initializer ::= ( expression_list )
|
||||
// Rule 376: initializer_clause ::= assignment_expression
|
||||
//
|
||||
case 376: { action. consumeInitializerConstructor(); break;
|
||||
case 376: { action. consumeInitializer(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 377: initializer_clause ::= assignment_expression
|
||||
//
|
||||
case 377: { action. consumeInitializer(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 378: initializer_clause ::= start_initializer_list { <openscope-ast> initializer_list , } end_initializer_list
|
||||
// Rule 378: initializer_list ::= start_initializer_list { <openscope-ast> initializer_seq , } end_initializer_list
|
||||
//
|
||||
case 378: { action. consumeInitializerList(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 379: initializer_clause ::= start_initializer_list { <openscope-ast> initializer_list } end_initializer_list
|
||||
// Rule 379: initializer_list ::= start_initializer_list { <openscope-ast> initializer_seq } end_initializer_list
|
||||
//
|
||||
case 379: { action. consumeInitializerList(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 380: initializer_clause ::= { <openscope-ast> }
|
||||
// Rule 380: initializer_list ::= { <openscope-ast> }
|
||||
//
|
||||
case 380: { action. consumeInitializerList(); break;
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -17,17 +17,17 @@ import lpg.lpgjavaruntime.*;
|
|||
|
||||
import java.util.*;
|
||||
import org.eclipse.cdt.core.dom.ast.*;
|
||||
import org.eclipse.cdt.core.dom.lrparser.CPreprocessorAdapter;
|
||||
import org.eclipse.cdt.core.dom.lrparser.IDOMTokenMap;
|
||||
import org.eclipse.cdt.core.dom.lrparser.IParser;
|
||||
import org.eclipse.cdt.core.dom.lrparser.ITokenCollector;
|
||||
import org.eclipse.cdt.core.dom.lrparser.CPreprocessorAdapter;
|
||||
import org.eclipse.cdt.core.dom.lrparser.action.ITokenStream;
|
||||
import org.eclipse.cdt.core.dom.lrparser.lpgextensions.FixedBacktrackingParser;
|
||||
import org.eclipse.cdt.core.dom.lrparser.action.ScopedStack;
|
||||
import org.eclipse.cdt.core.parser.IScanner;
|
||||
import org.eclipse.cdt.core.dom.parser.IBuiltinBindingsProvider;
|
||||
import org.eclipse.cdt.core.index.IIndex;
|
||||
|
||||
import org.eclipse.cdt.core.dom.lrparser.action.ITokenStream;
|
||||
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.ISecondaryParser;
|
||||
|
@ -180,17 +180,17 @@ private CPPBuildASTParserAction action;
|
|||
private IASTCompletionNode compNode;
|
||||
|
||||
|
||||
public CPPTemplateTypeParameterParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Set<IParser.Options> options) {
|
||||
initActions(options);
|
||||
public CPPTemplateTypeParameterParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Map<String,String> properties) {
|
||||
initActions(properties);
|
||||
action.initializeTranslationUnit(scanner, builtinBindingsProvider, index);
|
||||
CPreprocessorAdapter.runCPreprocessor(scanner, this, tokenMap);
|
||||
}
|
||||
|
||||
private void initActions(Set<IParser.Options> options) {
|
||||
private void initActions(Map<String,String> properties) {
|
||||
ScopedStack<Object> astStack = new ScopedStack<Object>();
|
||||
|
||||
action = new CPPBuildASTParserAction (this, astStack, CPPNodeFactory.getDefault() , CPPSecondaryParserFactory.getDefault() );
|
||||
action.setParserOptions(options);
|
||||
action.setParserProperties(properties);
|
||||
|
||||
|
||||
}
|
||||
|
@ -247,9 +247,9 @@ public void setTokens(List<IToken> tokens) {
|
|||
addToken(new Token(null, 0, 0, CPPTemplateTypeParameterParsersym.TK_EOF_TOKEN));
|
||||
}
|
||||
|
||||
public CPPTemplateTypeParameterParser(ITokenStream parser, Set<IParser.Options> options) { // constructor for creating secondary parser
|
||||
initActions(options);
|
||||
tokenMap = new TokenMap(CPPTemplateTypeParameterParsersym.orderedTerminalSymbols, parser.getOrderedTerminalSymbols());
|
||||
public CPPTemplateTypeParameterParser(ITokenStream stream, Map<String,String> properties) { // constructor for creating secondary parser
|
||||
initActions(properties);
|
||||
tokenMap = new TokenMap(CPPTemplateTypeParameterParsersym.orderedTerminalSymbols, stream.getOrderedTerminalSymbols());
|
||||
}
|
||||
|
||||
|
||||
|
@ -1309,331 +1309,331 @@ public CPPTemplateTypeParameterParser(ITokenStream parser, Set<IParser.Options>
|
|||
}
|
||||
|
||||
//
|
||||
// Rule 296: named_namespace_definition ::= namespace namespace_name { <openscope-ast> declaration_seq_opt }
|
||||
// Rule 294: namespace_definition ::= namespace namespace_name namespace_definition_hook { <openscope-ast> declaration_seq_opt }
|
||||
//
|
||||
case 296: { action. consumeNamespaceDefinition(true); break;
|
||||
case 294: { action. consumeNamespaceDefinition(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 297: unnamed_namespace_definition ::= namespace { <openscope-ast> declaration_seq_opt }
|
||||
// Rule 295: namespace_definition ::= namespace namespace_definition_hook { <openscope-ast> declaration_seq_opt }
|
||||
//
|
||||
case 297: { action. consumeNamespaceDefinition(false); break;
|
||||
case 295: { action. consumeNamespaceDefinition(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 298: namespace_alias_definition ::= namespace identifier_token = dcolon_opt nested_name_specifier_opt namespace_name ;
|
||||
// Rule 297: namespace_alias_definition ::= namespace identifier_token = dcolon_opt nested_name_specifier_opt namespace_name ;
|
||||
//
|
||||
case 298: { action. consumeNamespaceAliasDefinition(); break;
|
||||
case 297: { action. consumeNamespaceAliasDefinition(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 299: using_declaration ::= using typename_opt dcolon_opt nested_name_specifier_opt unqualified_id_name ;
|
||||
// Rule 298: using_declaration ::= using typename_opt dcolon_opt nested_name_specifier_opt unqualified_id_name ;
|
||||
//
|
||||
case 299: { action. consumeUsingDeclaration(); break;
|
||||
case 298: { action. consumeUsingDeclaration(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 300: typename_opt ::= typename
|
||||
// Rule 299: typename_opt ::= typename
|
||||
//
|
||||
case 300: { action. consumePlaceHolder(); break;
|
||||
case 299: { action. consumePlaceHolder(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 301: typename_opt ::= $Empty
|
||||
// Rule 300: typename_opt ::= $Empty
|
||||
//
|
||||
case 301: { action. consumeEmpty(); break;
|
||||
case 300: { action. consumeEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 302: using_directive ::= using namespace dcolon_opt nested_name_specifier_opt namespace_name ;
|
||||
// Rule 301: using_directive ::= using namespace dcolon_opt nested_name_specifier_opt namespace_name ;
|
||||
//
|
||||
case 302: { action. consumeUsingDirective(); break;
|
||||
case 301: { action. consumeUsingDirective(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 303: asm_definition ::= asm ( stringlit ) ;
|
||||
// Rule 302: asm_definition ::= asm ( stringlit ) ;
|
||||
//
|
||||
case 303: { action. consumeDeclarationASM(); break;
|
||||
case 302: { action. consumeDeclarationASM(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 304: linkage_specification ::= extern stringlit { <openscope-ast> declaration_seq_opt }
|
||||
// Rule 303: linkage_specification ::= extern stringlit { <openscope-ast> declaration_seq_opt }
|
||||
//
|
||||
case 303: { action. consumeLinkageSpecification(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 304: linkage_specification ::= extern stringlit <openscope-ast> declaration
|
||||
//
|
||||
case 304: { action. consumeLinkageSpecification(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 305: linkage_specification ::= extern stringlit <openscope-ast> declaration
|
||||
// Rule 309: init_declarator_complete ::= init_declarator
|
||||
//
|
||||
case 305: { action. consumeLinkageSpecification(); break;
|
||||
case 309: { action. consumeInitDeclaratorComplete(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 310: init_declarator_complete ::= init_declarator
|
||||
// Rule 311: init_declarator ::= complete_declarator initializer
|
||||
//
|
||||
case 310: { action. consumeInitDeclaratorComplete(); break;
|
||||
case 311: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 312: init_declarator ::= complete_declarator initializer
|
||||
// Rule 314: declarator ::= <openscope-ast> ptr_operator_seq direct_declarator
|
||||
//
|
||||
case 312: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
case 314: { action. consumeDeclaratorWithPointer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 315: declarator ::= <openscope-ast> ptr_operator_seq direct_declarator
|
||||
// Rule 316: function_declarator ::= <openscope-ast> ptr_operator_seq direct_declarator
|
||||
//
|
||||
case 315: { action. consumeDeclaratorWithPointer(true); break;
|
||||
case 316: { action. consumeDeclaratorWithPointer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 317: function_declarator ::= <openscope-ast> ptr_operator_seq direct_declarator
|
||||
// Rule 320: basic_direct_declarator ::= declarator_id_name
|
||||
//
|
||||
case 317: { action. consumeDeclaratorWithPointer(true); break;
|
||||
case 320: { action. consumeDirectDeclaratorIdentifier(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 321: basic_direct_declarator ::= declarator_id_name
|
||||
// Rule 321: basic_direct_declarator ::= ( declarator )
|
||||
//
|
||||
case 321: { action. consumeDirectDeclaratorIdentifier(); break;
|
||||
case 321: { action. consumeDirectDeclaratorBracketed(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 322: basic_direct_declarator ::= ( declarator )
|
||||
// Rule 322: function_direct_declarator ::= basic_direct_declarator ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
//
|
||||
case 322: { action. consumeDirectDeclaratorBracketed(); break;
|
||||
case 322: { action. consumeDirectDeclaratorFunctionDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 323: function_direct_declarator ::= basic_direct_declarator ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
// Rule 323: array_direct_declarator ::= array_direct_declarator array_modifier
|
||||
//
|
||||
case 323: { action. consumeDirectDeclaratorFunctionDeclarator(true); break;
|
||||
case 323: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 324: array_direct_declarator ::= array_direct_declarator array_modifier
|
||||
// Rule 324: array_direct_declarator ::= basic_direct_declarator array_modifier
|
||||
//
|
||||
case 324: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 325: array_direct_declarator ::= basic_direct_declarator array_modifier
|
||||
// Rule 325: array_modifier ::= [ constant_expression ]
|
||||
//
|
||||
case 325: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
case 325: { action. consumeDirectDeclaratorArrayModifier(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 326: array_modifier ::= [ constant_expression ]
|
||||
// Rule 326: array_modifier ::= [ ]
|
||||
//
|
||||
case 326: { action. consumeDirectDeclaratorArrayModifier(true); break;
|
||||
case 326: { action. consumeDirectDeclaratorArrayModifier(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 327: array_modifier ::= [ ]
|
||||
// Rule 327: ptr_operator ::= pointer_hook * pointer_hook <openscope-ast> cv_qualifier_seq_opt
|
||||
//
|
||||
case 327: { action. consumeDirectDeclaratorArrayModifier(false); break;
|
||||
case 327: { action. consumePointer(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 328: ptr_operator ::= pointer_hook * pointer_hook <openscope-ast> cv_qualifier_seq_opt
|
||||
// Rule 328: ptr_operator ::= pointer_hook & pointer_hook
|
||||
//
|
||||
case 328: { action. consumePointer(); break;
|
||||
case 328: { action. consumeReferenceOperator(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 329: ptr_operator ::= pointer_hook & pointer_hook
|
||||
// Rule 329: ptr_operator ::= dcolon_opt nested_name_specifier pointer_hook * pointer_hook <openscope-ast> cv_qualifier_seq_opt
|
||||
//
|
||||
case 329: { action. consumeReferenceOperator(); break;
|
||||
case 329: { action. consumePointerToMember(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 330: ptr_operator ::= dcolon_opt nested_name_specifier pointer_hook * pointer_hook <openscope-ast> cv_qualifier_seq_opt
|
||||
// Rule 336: cv_qualifier ::= const
|
||||
//
|
||||
case 330: { action. consumePointerToMember(); break;
|
||||
case 336: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 337: cv_qualifier ::= const
|
||||
// Rule 337: cv_qualifier ::= volatile
|
||||
//
|
||||
case 337: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 338: cv_qualifier ::= volatile
|
||||
// Rule 339: declarator_id_name ::= dcolon_opt nested_name_specifier_opt type_name
|
||||
//
|
||||
case 338: { action. consumeToken(); break;
|
||||
case 339: { action. consumeQualifiedId(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 340: declarator_id_name ::= dcolon_opt nested_name_specifier_opt type_name
|
||||
// Rule 340: type_id ::= type_specifier_seq
|
||||
//
|
||||
case 340: { action. consumeQualifiedId(false); break;
|
||||
case 340: { action. consumeTypeId(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 341: type_id ::= type_specifier_seq
|
||||
// Rule 341: type_id ::= type_specifier_seq abstract_declarator
|
||||
//
|
||||
case 341: { action. consumeTypeId(false); break;
|
||||
case 341: { action. consumeTypeId(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 342: type_id ::= type_specifier_seq abstract_declarator
|
||||
// Rule 344: abstract_declarator ::= <openscope-ast> ptr_operator_seq
|
||||
//
|
||||
case 342: { action. consumeTypeId(true); break;
|
||||
case 344: { action. consumeDeclaratorWithPointer(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 345: abstract_declarator ::= <openscope-ast> ptr_operator_seq
|
||||
// Rule 345: abstract_declarator ::= <openscope-ast> ptr_operator_seq direct_abstract_declarator
|
||||
//
|
||||
case 345: { action. consumeDeclaratorWithPointer(false); break;
|
||||
case 345: { action. consumeDeclaratorWithPointer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 346: abstract_declarator ::= <openscope-ast> ptr_operator_seq direct_abstract_declarator
|
||||
// Rule 349: basic_direct_abstract_declarator ::= ( abstract_declarator )
|
||||
//
|
||||
case 346: { action. consumeDeclaratorWithPointer(true); break;
|
||||
case 349: { action. consumeDirectDeclaratorBracketed(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 350: basic_direct_abstract_declarator ::= ( abstract_declarator )
|
||||
// Rule 350: basic_direct_abstract_declarator ::= ( )
|
||||
//
|
||||
case 350: { action. consumeDirectDeclaratorBracketed(); break;
|
||||
case 350: { action. consumeAbstractDeclaratorEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 351: basic_direct_abstract_declarator ::= ( )
|
||||
// Rule 351: array_direct_abstract_declarator ::= array_modifier
|
||||
//
|
||||
case 351: { action. consumeAbstractDeclaratorEmpty(); break;
|
||||
case 351: { action. consumeDirectDeclaratorArrayDeclarator(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 352: array_direct_abstract_declarator ::= array_modifier
|
||||
// Rule 352: array_direct_abstract_declarator ::= array_direct_abstract_declarator array_modifier
|
||||
//
|
||||
case 352: { action. consumeDirectDeclaratorArrayDeclarator(false); break;
|
||||
case 352: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 353: array_direct_abstract_declarator ::= array_direct_abstract_declarator array_modifier
|
||||
// Rule 353: array_direct_abstract_declarator ::= basic_direct_abstract_declarator array_modifier
|
||||
//
|
||||
case 353: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 354: array_direct_abstract_declarator ::= basic_direct_abstract_declarator array_modifier
|
||||
// Rule 354: function_direct_abstract_declarator ::= basic_direct_abstract_declarator ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
//
|
||||
case 354: { action. consumeDirectDeclaratorArrayDeclarator(true); break;
|
||||
case 354: { action. consumeDirectDeclaratorFunctionDeclarator(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 355: function_direct_abstract_declarator ::= basic_direct_abstract_declarator ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
// Rule 355: function_direct_abstract_declarator ::= ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
//
|
||||
case 355: { action. consumeDirectDeclaratorFunctionDeclarator(true); break;
|
||||
case 355: { action. consumeDirectDeclaratorFunctionDeclarator(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 356: function_direct_abstract_declarator ::= ( <openscope-ast> parameter_declaration_clause ) <openscope-ast> cv_qualifier_seq_opt <openscope-ast> exception_specification_opt
|
||||
// Rule 356: parameter_declaration_clause ::= parameter_declaration_list_opt ...
|
||||
//
|
||||
case 356: { action. consumeDirectDeclaratorFunctionDeclarator(false); break;
|
||||
case 356: { action. consumePlaceHolder(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 357: parameter_declaration_clause ::= parameter_declaration_list_opt ...
|
||||
// Rule 357: parameter_declaration_clause ::= parameter_declaration_list_opt
|
||||
//
|
||||
case 357: { action. consumePlaceHolder(); break;
|
||||
case 357: { action. consumeEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 358: parameter_declaration_clause ::= parameter_declaration_list_opt
|
||||
// Rule 358: parameter_declaration_clause ::= parameter_declaration_list , ...
|
||||
//
|
||||
case 358: { action. consumeEmpty(); break;
|
||||
case 358: { action. consumePlaceHolder(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 359: parameter_declaration_clause ::= parameter_declaration_list , ...
|
||||
// Rule 364: abstract_declarator_opt ::= $Empty
|
||||
//
|
||||
case 359: { action. consumePlaceHolder(); break;
|
||||
case 364: { action. consumeEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 365: abstract_declarator_opt ::= $Empty
|
||||
// Rule 365: parameter_declaration ::= declaration_specifiers parameter_init_declarator
|
||||
//
|
||||
case 365: { action. consumeEmpty(); break;
|
||||
case 365: { action. consumeParameterDeclaration(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 366: parameter_declaration ::= declaration_specifiers parameter_init_declarator
|
||||
// Rule 366: parameter_declaration ::= declaration_specifiers
|
||||
//
|
||||
case 366: { action. consumeParameterDeclaration(); break;
|
||||
case 366: { action. consumeParameterDeclarationWithoutDeclarator(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 367: parameter_declaration ::= declaration_specifiers
|
||||
// Rule 368: parameter_init_declarator ::= declarator = parameter_initializer
|
||||
//
|
||||
case 367: { action. consumeParameterDeclarationWithoutDeclarator(); break;
|
||||
case 368: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 369: parameter_init_declarator ::= declarator = parameter_initializer
|
||||
// Rule 370: parameter_init_declarator ::= abstract_declarator = parameter_initializer
|
||||
//
|
||||
case 369: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
case 370: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 371: parameter_init_declarator ::= abstract_declarator = parameter_initializer
|
||||
// Rule 371: parameter_init_declarator ::= = parameter_initializer
|
||||
//
|
||||
case 371: { action. consumeDeclaratorWithInitializer(true); break;
|
||||
case 371: { action. consumeDeclaratorWithInitializer(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 372: parameter_init_declarator ::= = parameter_initializer
|
||||
// Rule 372: parameter_initializer ::= assignment_expression
|
||||
//
|
||||
case 372: { action. consumeDeclaratorWithInitializer(false); break;
|
||||
case 372: { action. consumeInitializer(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 373: parameter_initializer ::= assignment_expression
|
||||
// Rule 373: function_definition ::= declaration_specifiers_opt function_declarator <openscope-ast> ctor_initializer_list_opt function_body
|
||||
//
|
||||
case 373: { action. consumeInitializer(); break;
|
||||
case 373: { action. consumeFunctionDefinition(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 374: function_definition ::= declaration_specifiers_opt function_declarator <openscope-ast> ctor_initializer_list_opt function_body
|
||||
// Rule 374: function_definition ::= declaration_specifiers_opt function_declarator try <openscope-ast> ctor_initializer_list_opt function_body <openscope-ast> handler_seq
|
||||
//
|
||||
case 374: { action. consumeFunctionDefinition(false); break;
|
||||
case 374: { action. consumeFunctionDefinition(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 375: function_definition ::= declaration_specifiers_opt function_declarator try <openscope-ast> ctor_initializer_list_opt function_body <openscope-ast> handler_seq
|
||||
// Rule 377: initializer ::= ( expression_list )
|
||||
//
|
||||
case 375: { action. consumeFunctionDefinition(true); break;
|
||||
case 377: { action. consumeInitializerConstructor(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 378: initializer ::= ( expression_list )
|
||||
// Rule 378: initializer_clause ::= assignment_expression
|
||||
//
|
||||
case 378: { action. consumeInitializerConstructor(); break;
|
||||
case 378: { action. consumeInitializer(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 379: initializer_clause ::= assignment_expression
|
||||
//
|
||||
case 379: { action. consumeInitializer(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 380: initializer_clause ::= start_initializer_list { <openscope-ast> initializer_list , } end_initializer_list
|
||||
// Rule 380: initializer_list ::= start_initializer_list { <openscope-ast> initializer_seq , } end_initializer_list
|
||||
//
|
||||
case 380: { action. consumeInitializerList(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 381: initializer_clause ::= start_initializer_list { <openscope-ast> initializer_list } end_initializer_list
|
||||
// Rule 381: initializer_list ::= start_initializer_list { <openscope-ast> initializer_seq } end_initializer_list
|
||||
//
|
||||
case 381: { action. consumeInitializerList(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 382: initializer_clause ::= { <openscope-ast> }
|
||||
// Rule 382: initializer_list ::= { <openscope-ast> }
|
||||
//
|
||||
case 382: { action. consumeInitializerList(); break;
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -178,23 +178,22 @@ private GCCBuildASTParserAction action;
|
|||
private IASTCompletionNode compNode;
|
||||
|
||||
|
||||
public GCCParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Set<IParser.Options> options) {
|
||||
initActions(options);
|
||||
public GCCParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Map<String,String> properties) {
|
||||
initActions(properties);
|
||||
action.initializeTranslationUnit(scanner, builtinBindingsProvider, index);
|
||||
CPreprocessorAdapter.runCPreprocessor(scanner, this, tokenMap);
|
||||
}
|
||||
|
||||
private void initActions(Set<IParser.Options> options) {
|
||||
private void initActions(Map<String,String> properties) {
|
||||
ScopedStack<Object> astStack = new ScopedStack<Object>();
|
||||
|
||||
action = new GCCBuildASTParserAction (this, astStack, CNodeFactory.getDefault() , GCCSecondaryParserFactory.getDefault() );
|
||||
action.setParserOptions(options);
|
||||
action.setParserProperties(properties);
|
||||
|
||||
|
||||
|
||||
gnuAction = new GNUBuildASTParserAction (this, astStack, CNodeFactory.getDefault() );
|
||||
gnuAction.setParserOptions(options);
|
||||
//gnuAction.setBaseAction(action);
|
||||
gnuAction.setParserProperties(properties);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -182,23 +182,22 @@ private GCCBuildASTParserAction action;
|
|||
private IASTCompletionNode compNode;
|
||||
|
||||
|
||||
public GCCSizeofExpressionParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Set<IParser.Options> options) {
|
||||
initActions(options);
|
||||
public GCCSizeofExpressionParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Map<String,String> properties) {
|
||||
initActions(properties);
|
||||
action.initializeTranslationUnit(scanner, builtinBindingsProvider, index);
|
||||
CPreprocessorAdapter.runCPreprocessor(scanner, this, tokenMap);
|
||||
}
|
||||
|
||||
private void initActions(Set<IParser.Options> options) {
|
||||
private void initActions(Map<String,String> properties) {
|
||||
ScopedStack<Object> astStack = new ScopedStack<Object>();
|
||||
|
||||
action = new GCCBuildASTParserAction (this, astStack, CNodeFactory.getDefault() , GCCSecondaryParserFactory.getDefault() );
|
||||
action.setParserOptions(options);
|
||||
action.setParserProperties(properties);
|
||||
|
||||
|
||||
|
||||
gnuAction = new GNUBuildASTParserAction (this, astStack, CNodeFactory.getDefault() );
|
||||
gnuAction.setParserOptions(options);
|
||||
//gnuAction.setBaseAction(action);
|
||||
gnuAction.setParserProperties(properties);
|
||||
|
||||
}
|
||||
|
||||
|
@ -254,8 +253,8 @@ public void setTokens(List<IToken> tokens) {
|
|||
addToken(new Token(null, 0, 0, GCCSizeofExpressionParsersym.TK_EOF_TOKEN));
|
||||
}
|
||||
|
||||
public GCCSizeofExpressionParser(ITokenStream stream, Set<IParser.Options> options) { // constructor for creating secondary parser
|
||||
initActions(options);
|
||||
public GCCSizeofExpressionParser(ITokenStream stream, Map<String,String> properties) { // constructor for creating secondary parser
|
||||
initActions(properties);
|
||||
tokenMap = new TokenMap(GCCSizeofExpressionParsersym.orderedTerminalSymbols, stream.getOrderedTerminalSymbols());
|
||||
}
|
||||
|
||||
|
|
|
@ -180,23 +180,22 @@ private GPPBuildASTParserAction action;
|
|||
private IASTCompletionNode compNode;
|
||||
|
||||
|
||||
public GPPParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Set<IParser.Options> options) {
|
||||
initActions(options);
|
||||
public GPPParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Map<String,String> properties) {
|
||||
initActions(properties);
|
||||
action.initializeTranslationUnit(scanner, builtinBindingsProvider, index);
|
||||
CPreprocessorAdapter.runCPreprocessor(scanner, this, tokenMap);
|
||||
}
|
||||
|
||||
private void initActions(Set<IParser.Options> options) {
|
||||
private void initActions(Map<String,String> properties) {
|
||||
ScopedStack<Object> astStack = new ScopedStack<Object>();
|
||||
|
||||
action = new GPPBuildASTParserAction (this, astStack, CPPNodeFactory.getDefault() , GPPSecondaryParserFactory.getDefault() );
|
||||
action.setParserOptions(options);
|
||||
action.setParserProperties(properties);
|
||||
|
||||
|
||||
|
||||
gnuAction = new GNUBuildASTParserAction (this, astStack, CPPNodeFactory.getDefault() );
|
||||
gnuAction.setParserOptions(options);
|
||||
//gnuAction.setBaseAction(action);
|
||||
gnuAction.setParserProperties(properties);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -184,23 +184,22 @@ private GPPBuildASTParserAction action;
|
|||
private IASTCompletionNode compNode;
|
||||
|
||||
|
||||
public GPPSizeofExpressionParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Set<IParser.Options> options) {
|
||||
initActions(options);
|
||||
public GPPSizeofExpressionParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Map<String,String> properties) {
|
||||
initActions(properties);
|
||||
action.initializeTranslationUnit(scanner, builtinBindingsProvider, index);
|
||||
CPreprocessorAdapter.runCPreprocessor(scanner, this, tokenMap);
|
||||
}
|
||||
|
||||
private void initActions(Set<IParser.Options> options) {
|
||||
private void initActions(Map<String,String> properties) {
|
||||
ScopedStack<Object> astStack = new ScopedStack<Object>();
|
||||
|
||||
action = new GPPBuildASTParserAction (this, astStack, CPPNodeFactory.getDefault() , GPPSecondaryParserFactory.getDefault() );
|
||||
action.setParserOptions(options);
|
||||
action.setParserProperties(properties);
|
||||
|
||||
|
||||
|
||||
gnuAction = new GNUBuildASTParserAction (this, astStack, CPPNodeFactory.getDefault() );
|
||||
gnuAction.setParserOptions(options);
|
||||
//gnuAction.setBaseAction(action);
|
||||
gnuAction.setParserProperties(properties);
|
||||
|
||||
}
|
||||
|
||||
|
@ -256,8 +255,8 @@ public void setTokens(List<IToken> tokens) {
|
|||
addToken(new Token(null, 0, 0, GPPSizeofExpressionParsersym.TK_EOF_TOKEN));
|
||||
}
|
||||
|
||||
public GPPSizeofExpressionParser(ITokenStream stream, Set<IParser.Options> options) { // constructor for creating secondary parser
|
||||
initActions(options);
|
||||
public GPPSizeofExpressionParser(ITokenStream stream, Map<String,String> properties) { // constructor for creating secondary parser
|
||||
initActions(properties);
|
||||
tokenMap = new TokenMap(GPPSizeofExpressionParsersym.orderedTerminalSymbols, stream.getOrderedTerminalSymbols());
|
||||
}
|
||||
|
||||
|
|
|
@ -11,10 +11,9 @@
|
|||
|
||||
package org.eclipse.cdt.core.dom.parser.upc;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||
import org.eclipse.cdt.core.dom.lrparser.IParser;
|
||||
import org.eclipse.cdt.core.dom.lrparser.ISecondaryParser;
|
||||
import org.eclipse.cdt.core.dom.lrparser.action.ISecondaryParserFactory;
|
||||
import org.eclipse.cdt.core.dom.lrparser.action.ITokenStream;
|
||||
|
@ -30,16 +29,16 @@ public class UPCSecondaryParserFactory implements ISecondaryParserFactory{
|
|||
return DEFAULT_INSTANCE;
|
||||
}
|
||||
|
||||
public ISecondaryParser<IASTExpression> getExpressionParser(ITokenStream stream, Set<IParser.Options> options) {
|
||||
return new UPCExpressionParser(stream, options);
|
||||
public ISecondaryParser<IASTExpression> getExpressionParser(ITokenStream stream, Map<String,String> properties) {
|
||||
return new UPCExpressionParser(stream, properties);
|
||||
}
|
||||
|
||||
public ISecondaryParser<IASTExpression> getNoCastExpressionParser(ITokenStream stream, Set<IParser.Options> options) {
|
||||
return new UPCNoCastExpressionParser(stream, options);
|
||||
public ISecondaryParser<IASTExpression> getNoCastExpressionParser(ITokenStream stream, Map<String,String> properties) {
|
||||
return new UPCNoCastExpressionParser(stream, properties);
|
||||
}
|
||||
|
||||
public ISecondaryParser<IASTExpression> getSizeofExpressionParser(ITokenStream stream, Set<IParser.Options> options) {
|
||||
return new UPCSizeofExpressionParser(stream, options);
|
||||
public ISecondaryParser<IASTExpression> getSizeofExpressionParser(ITokenStream stream, Map<String,String> properties) {
|
||||
return new UPCSizeofExpressionParser(stream, properties);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -10,14 +10,13 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.core.dom.upc;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ILinkage;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
|
||||
import org.eclipse.cdt.core.dom.lrparser.BaseExtensibleLanguage;
|
||||
import org.eclipse.cdt.core.dom.lrparser.IParser;
|
||||
import org.eclipse.cdt.core.dom.lrparser.ScannerExtensionConfiguration;
|
||||
import org.eclipse.cdt.core.dom.lrparser.IParser.Options;
|
||||
import org.eclipse.cdt.core.dom.parser.IBuiltinBindingsProvider;
|
||||
import org.eclipse.cdt.core.dom.parser.IScannerExtensionConfiguration;
|
||||
import org.eclipse.cdt.core.dom.parser.c.ANSICParserExtensionConfiguration;
|
||||
|
@ -46,8 +45,8 @@ public class UPCLanguage extends BaseExtensibleLanguage {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected IParser<IASTTranslationUnit> getParser(IScanner scanner, IIndex index, Set<Options> options) {
|
||||
return new UPCParser(scanner, new DOMToUPCTokenMap(), getBuiltinBindingsProvider(), index, options);
|
||||
protected IParser<IASTTranslationUnit> getParser(IScanner scanner, IIndex index, Map<String,String> properties) {
|
||||
return new UPCParser(scanner, new DOMToUPCTokenMap(), getBuiltinBindingsProvider(), index, properties);
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
|
|
|
@ -185,17 +185,17 @@ private UPCParserAction action;
|
|||
private IASTCompletionNode compNode;
|
||||
|
||||
|
||||
public UPCExpressionParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Set<IParser.Options> options) {
|
||||
initActions(options);
|
||||
public UPCExpressionParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Map<String,String> properties) {
|
||||
initActions(properties);
|
||||
action.initializeTranslationUnit(scanner, builtinBindingsProvider, index);
|
||||
CPreprocessorAdapter.runCPreprocessor(scanner, this, tokenMap);
|
||||
}
|
||||
|
||||
private void initActions(Set<IParser.Options> options) {
|
||||
private void initActions(Map<String,String> properties) {
|
||||
ScopedStack<Object> astStack = new ScopedStack<Object>();
|
||||
|
||||
action = new UPCParserAction (this, astStack, new UPCASTNodeFactory() , UPCSecondaryParserFactory.getDefault() );
|
||||
action.setParserOptions(options);
|
||||
action.setParserProperties(properties);
|
||||
|
||||
|
||||
}
|
||||
|
@ -252,8 +252,8 @@ public void setTokens(List<IToken> tokens) {
|
|||
addToken(new Token(null, 0, 0, UPCExpressionParsersym.TK_EOF_TOKEN));
|
||||
}
|
||||
|
||||
public UPCExpressionParser(ITokenStream stream, Set<IParser.Options> options) { // constructor for creating secondary parser
|
||||
initActions(options);
|
||||
public UPCExpressionParser(ITokenStream stream, Map<String,String> properties) { // constructor for creating secondary parser
|
||||
initActions(properties);
|
||||
tokenMap = new TokenMap(UPCExpressionParsersym.orderedTerminalSymbols, stream.getOrderedTerminalSymbols());
|
||||
}
|
||||
|
||||
|
@ -348,7 +348,7 @@ public UPCExpressionParser(ITokenStream stream, Set<IParser.Options> options) {
|
|||
}
|
||||
|
||||
//
|
||||
// Rule 28: postfix_expression ::= ( type_id ) { <openscope-ast> initializer_list comma_opt }
|
||||
// Rule 28: postfix_expression ::= ( type_id ) initializer_list
|
||||
//
|
||||
case 28: { action. consumeExpressionTypeIdInitializer(); break;
|
||||
}
|
||||
|
@ -1170,399 +1170,399 @@ public UPCExpressionParser(ITokenStream stream, Set<IParser.Options> options) {
|
|||
}
|
||||
|
||||
//
|
||||
// Rule 282: initializer ::= start_initializer_list { <openscope-ast> initializer_list comma_opt } end_initializer_list
|
||||
//
|
||||
case 282: { action. consumeInitializerList(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 283: initializer ::= { <openscope-ast> }
|
||||
// Rule 283: initializer_list ::= start_initializer_list { <openscope-ast> initializer_seq comma_opt } end_initializer_list
|
||||
//
|
||||
case 283: { action. consumeInitializerList(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 284: start_initializer_list ::= $Empty
|
||||
// Rule 284: initializer_list ::= { <openscope-ast> }
|
||||
//
|
||||
case 284: { action. initializerListStart(); break;
|
||||
case 284: { action. consumeInitializerList(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 285: end_initializer_list ::= $Empty
|
||||
// Rule 285: start_initializer_list ::= $Empty
|
||||
//
|
||||
case 285: { action. initializerListEnd(); break;
|
||||
case 285: { action. initializerListStart(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 290: designated_initializer ::= <openscope-ast> designation = initializer
|
||||
// Rule 286: end_initializer_list ::= $Empty
|
||||
//
|
||||
case 290: { action. consumeInitializerDesignated(); break;
|
||||
case 286: { action. initializerListEnd(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 294: designator_base ::= [ constant_expression ]
|
||||
// Rule 291: designated_initializer ::= <openscope-ast> designation = initializer
|
||||
//
|
||||
case 294: { action. consumeDesignatorArray(); break;
|
||||
case 291: { action. consumeInitializerDesignated(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 295: designator_base ::= . identifier_token
|
||||
// Rule 295: designator_base ::= [ constant_expression ]
|
||||
//
|
||||
case 295: { action. consumeDesignatorField(); break;
|
||||
case 295: { action. consumeDesignatorArray(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 296: designator ::= [ constant_expression ]
|
||||
// Rule 296: designator_base ::= . identifier_token
|
||||
//
|
||||
case 296: { action. consumeDesignatorArray(); break;
|
||||
case 296: { action. consumeDesignatorField(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 297: designator ::= . identifier_token
|
||||
// Rule 297: designator ::= [ constant_expression ]
|
||||
//
|
||||
case 297: { action. consumeDesignatorField(); break;
|
||||
case 297: { action. consumeDesignatorArray(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 298: translation_unit ::= external_declaration_list
|
||||
// Rule 298: designator ::= . identifier_token
|
||||
//
|
||||
case 298: { action. consumeTranslationUnit(); break;
|
||||
case 298: { action. consumeDesignatorField(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 299: translation_unit ::= external_declaration_list
|
||||
//
|
||||
case 299: { action. consumeTranslationUnit(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 299: translation_unit ::= $Empty
|
||||
// Rule 300: translation_unit ::= $Empty
|
||||
//
|
||||
case 299: { action. consumeTranslationUnit(); break;
|
||||
case 300: { action. consumeTranslationUnit(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 304: external_declaration ::= ;
|
||||
// Rule 305: external_declaration ::= ;
|
||||
//
|
||||
case 304: { action. consumeDeclarationEmpty(); break;
|
||||
case 305: { action. consumeDeclarationEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 305: external_declaration ::= ERROR_TOKEN
|
||||
// Rule 306: external_declaration ::= ERROR_TOKEN
|
||||
//
|
||||
case 305: { action. consumeDeclarationProblem(); break;
|
||||
case 306: { action. consumeDeclarationProblem(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 308: function_definition ::= declaration_specifiers <openscope-ast> function_declarator function_body
|
||||
// Rule 310: function_definition ::= <openscope-ast> function_declarator function_body
|
||||
//
|
||||
case 308: { action. consumeFunctionDefinition(true); break;
|
||||
case 310: { action. consumeFunctionDefinition(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 309: function_definition ::= <openscope-ast> function_declarator function_body
|
||||
// Rule 311: function_definition ::= declaration_specifiers <openscope-ast> knr_function_declarator <openscope-ast> declaration_list compound_statement
|
||||
//
|
||||
case 309: { action. consumeFunctionDefinition(false); break;
|
||||
case 311: { action. consumeFunctionDefinitionKnR(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 310: function_definition ::= declaration_specifiers <openscope-ast> knr_function_declarator <openscope-ast> declaration_list compound_statement
|
||||
// Rule 312: normal_function_definition ::= declaration_specifiers <openscope-ast> function_declarator function_body
|
||||
//
|
||||
case 310: { action. consumeFunctionDefinitionKnR(); break;
|
||||
case 312: { action. consumeFunctionDefinition(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 311: function_body ::= { }
|
||||
// Rule 313: function_body ::= { }
|
||||
//
|
||||
case 311: { action. consumeStatementCompoundStatement(false); break;
|
||||
case 313: { action. consumeStatementCompoundStatement(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 312: function_body ::= { <openscope-ast> block_item_list }
|
||||
// Rule 314: function_body ::= { <openscope-ast> block_item_list }
|
||||
//
|
||||
case 312: { action. consumeStatementCompoundStatement(true); break;
|
||||
case 314: { action. consumeStatementCompoundStatement(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 314: expression_parser_start ::= ERROR_TOKEN
|
||||
// Rule 316: expression_parser_start ::= ERROR_TOKEN
|
||||
//
|
||||
case 314: { action. consumeEmpty(); break;
|
||||
case 316: { action. consumeEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 315: literal ::= MYTHREAD
|
||||
// Rule 317: literal ::= MYTHREAD
|
||||
//
|
||||
case 315: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_mythread); break;
|
||||
case 317: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_mythread); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 316: literal ::= THREADS
|
||||
// Rule 318: literal ::= THREADS
|
||||
//
|
||||
case 316: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_threads); break;
|
||||
case 318: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_threads); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 317: literal ::= UPC_MAX_BLOCKSIZE
|
||||
// Rule 319: literal ::= UPC_MAX_BLOCKSIZE
|
||||
//
|
||||
case 317: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_upc_max_block_size); break;
|
||||
case 319: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_upc_max_block_size); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 318: unary_expression ::= upc_localsizeof unary_expression
|
||||
// Rule 320: unary_expression ::= upc_localsizeof unary_expression
|
||||
//
|
||||
case 318: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_localsizeof); break;
|
||||
case 320: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_localsizeof); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 319: unary_expression ::= upc_localsizeof ( type_id )
|
||||
// Rule 321: unary_expression ::= upc_localsizeof ( type_id )
|
||||
//
|
||||
case 319: { action. consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_localsizeof); break;
|
||||
case 321: { action. consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_localsizeof); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 320: unary_expression ::= upc_blocksizeof unary_expression
|
||||
// Rule 322: unary_expression ::= upc_blocksizeof unary_expression
|
||||
//
|
||||
case 320: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_blocksizeof); break;
|
||||
case 322: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_blocksizeof); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 321: unary_expression ::= upc_blocksizeof ( type_id )
|
||||
// Rule 323: unary_expression ::= upc_blocksizeof ( type_id )
|
||||
//
|
||||
case 321: { action. consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_blocksizeof); break;
|
||||
case 323: { action. consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_blocksizeof); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 322: unary_expression ::= upc_elemsizeof unary_expression
|
||||
// Rule 324: unary_expression ::= upc_elemsizeof unary_expression
|
||||
//
|
||||
case 322: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_elemsizeof); break;
|
||||
case 324: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_elemsizeof); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 323: unary_expression ::= upc_elemsizeof ( type_id )
|
||||
// Rule 325: unary_expression ::= upc_elemsizeof ( type_id )
|
||||
//
|
||||
case 323: { action. consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_elemsizeof); break;
|
||||
case 325: { action. consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_elemsizeof); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 327: shared_type_qualifier ::= shared
|
||||
//
|
||||
case 327: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 328: reference_type_qualifier ::= relaxed
|
||||
//
|
||||
case 328: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 329: reference_type_qualifier ::= strict
|
||||
// Rule 329: shared_type_qualifier ::= shared
|
||||
//
|
||||
case 329: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 330: layout_qualifier ::= [ constant_expression ]
|
||||
// Rule 330: reference_type_qualifier ::= relaxed
|
||||
//
|
||||
case 330: { action. consumeLayoutQualifier(true, false); break;
|
||||
case 330: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 331: layout_qualifier ::= [ * ]
|
||||
// Rule 331: reference_type_qualifier ::= strict
|
||||
//
|
||||
case 331: { action. consumeLayoutQualifier(false, true); break;
|
||||
case 331: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 332: layout_qualifier ::= [ ]
|
||||
// Rule 332: layout_qualifier ::= [ constant_expression ]
|
||||
//
|
||||
case 332: { action. consumeLayoutQualifier(false, false); break;
|
||||
case 332: { action. consumeLayoutQualifier(true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 334: synchronization_statement ::= upc_notify expression ;
|
||||
// Rule 333: layout_qualifier ::= [ * ]
|
||||
//
|
||||
case 334: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_notify, true); break;
|
||||
case 333: { action. consumeLayoutQualifier(false, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 335: synchronization_statement ::= upc_notify ;
|
||||
// Rule 334: layout_qualifier ::= [ ]
|
||||
//
|
||||
case 335: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_notify, false); break;
|
||||
case 334: { action. consumeLayoutQualifier(false, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 336: synchronization_statement ::= upc_wait expression ;
|
||||
// Rule 336: synchronization_statement ::= upc_notify expression ;
|
||||
//
|
||||
case 336: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_wait, true); break;
|
||||
case 336: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_notify, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 337: synchronization_statement ::= upc_wait ;
|
||||
// Rule 337: synchronization_statement ::= upc_notify ;
|
||||
//
|
||||
case 337: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_wait, false); break;
|
||||
case 337: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_notify, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 338: synchronization_statement ::= upc_barrier expression ;
|
||||
// Rule 338: synchronization_statement ::= upc_wait expression ;
|
||||
//
|
||||
case 338: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_barrier, true); break;
|
||||
case 338: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_wait, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 339: synchronization_statement ::= upc_barrier ;
|
||||
// Rule 339: synchronization_statement ::= upc_wait ;
|
||||
//
|
||||
case 339: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_barrier, false); break;
|
||||
case 339: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_wait, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 340: synchronization_statement ::= upc_fence ;
|
||||
// Rule 340: synchronization_statement ::= upc_barrier expression ;
|
||||
//
|
||||
case 340: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_fence, false); break;
|
||||
case 340: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_barrier, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 341: iteration_statement ::= upc_forall ( expression ; expression ; expression ; affinity ) statement
|
||||
// Rule 341: synchronization_statement ::= upc_barrier ;
|
||||
//
|
||||
case 341: { action. consumeStatementUPCForallLoop(true, true, true, true); break;
|
||||
case 341: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_barrier, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 342: iteration_statement ::= upc_forall ( expression ; expression ; expression ; ) statement
|
||||
// Rule 342: synchronization_statement ::= upc_fence ;
|
||||
//
|
||||
case 342: { action. consumeStatementUPCForallLoop(true, true, true, false); break;
|
||||
case 342: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_fence, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 343: iteration_statement ::= upc_forall ( expression ; expression ; ; affinity ) statement
|
||||
// Rule 343: iteration_statement ::= upc_forall ( expression ; expression ; expression ; affinity ) statement
|
||||
//
|
||||
case 343: { action. consumeStatementUPCForallLoop(true, true, false, true); break;
|
||||
case 343: { action. consumeStatementUPCForallLoop(true, true, true, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 344: iteration_statement ::= upc_forall ( expression ; expression ; ; ) statement
|
||||
// Rule 344: iteration_statement ::= upc_forall ( expression ; expression ; expression ; ) statement
|
||||
//
|
||||
case 344: { action. consumeStatementUPCForallLoop(true, true, false, false); break;
|
||||
case 344: { action. consumeStatementUPCForallLoop(true, true, true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 345: iteration_statement ::= upc_forall ( expression ; ; expression ; affinity ) statement
|
||||
// Rule 345: iteration_statement ::= upc_forall ( expression ; expression ; ; affinity ) statement
|
||||
//
|
||||
case 345: { action. consumeStatementUPCForallLoop(true, false, true, true); break;
|
||||
case 345: { action. consumeStatementUPCForallLoop(true, true, false, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 346: iteration_statement ::= upc_forall ( expression ; ; expression ; ) statement
|
||||
// Rule 346: iteration_statement ::= upc_forall ( expression ; expression ; ; ) statement
|
||||
//
|
||||
case 346: { action. consumeStatementUPCForallLoop(true, false, true, false); break;
|
||||
case 346: { action. consumeStatementUPCForallLoop(true, true, false, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 347: iteration_statement ::= upc_forall ( expression ; ; ; affinity ) statement
|
||||
// Rule 347: iteration_statement ::= upc_forall ( expression ; ; expression ; affinity ) statement
|
||||
//
|
||||
case 347: { action. consumeStatementUPCForallLoop(true, false, false, true); break;
|
||||
case 347: { action. consumeStatementUPCForallLoop(true, false, true, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 348: iteration_statement ::= upc_forall ( expression ; ; ; ) statement
|
||||
// Rule 348: iteration_statement ::= upc_forall ( expression ; ; expression ; ) statement
|
||||
//
|
||||
case 348: { action. consumeStatementUPCForallLoop(true, false, false, false); break;
|
||||
case 348: { action. consumeStatementUPCForallLoop(true, false, true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 349: iteration_statement ::= upc_forall ( ; expression ; expression ; affinity ) statement
|
||||
// Rule 349: iteration_statement ::= upc_forall ( expression ; ; ; affinity ) statement
|
||||
//
|
||||
case 349: { action. consumeStatementUPCForallLoop(false, true, true, true); break;
|
||||
case 349: { action. consumeStatementUPCForallLoop(true, false, false, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 350: iteration_statement ::= upc_forall ( ; expression ; expression ; ) statement
|
||||
// Rule 350: iteration_statement ::= upc_forall ( expression ; ; ; ) statement
|
||||
//
|
||||
case 350: { action. consumeStatementUPCForallLoop(false, true, true, false); break;
|
||||
case 350: { action. consumeStatementUPCForallLoop(true, false, false, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 351: iteration_statement ::= upc_forall ( ; expression ; ; affinity ) statement
|
||||
// Rule 351: iteration_statement ::= upc_forall ( ; expression ; expression ; affinity ) statement
|
||||
//
|
||||
case 351: { action. consumeStatementUPCForallLoop(false, true, false, true); break;
|
||||
case 351: { action. consumeStatementUPCForallLoop(false, true, true, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 352: iteration_statement ::= upc_forall ( ; expression ; ; ) statement
|
||||
// Rule 352: iteration_statement ::= upc_forall ( ; expression ; expression ; ) statement
|
||||
//
|
||||
case 352: { action. consumeStatementUPCForallLoop(false, true, false, false); break;
|
||||
case 352: { action. consumeStatementUPCForallLoop(false, true, true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 353: iteration_statement ::= upc_forall ( ; ; expression ; affinity ) statement
|
||||
// Rule 353: iteration_statement ::= upc_forall ( ; expression ; ; affinity ) statement
|
||||
//
|
||||
case 353: { action. consumeStatementUPCForallLoop(false, false, true, true); break;
|
||||
case 353: { action. consumeStatementUPCForallLoop(false, true, false, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 354: iteration_statement ::= upc_forall ( ; ; expression ; ) statement
|
||||
// Rule 354: iteration_statement ::= upc_forall ( ; expression ; ; ) statement
|
||||
//
|
||||
case 354: { action. consumeStatementUPCForallLoop(false, false, true, false); break;
|
||||
case 354: { action. consumeStatementUPCForallLoop(false, true, false, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 355: iteration_statement ::= upc_forall ( ; ; ; affinity ) statement
|
||||
// Rule 355: iteration_statement ::= upc_forall ( ; ; expression ; affinity ) statement
|
||||
//
|
||||
case 355: { action. consumeStatementUPCForallLoop(false, false, false, true); break;
|
||||
case 355: { action. consumeStatementUPCForallLoop(false, false, true, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 356: iteration_statement ::= upc_forall ( ; ; ; ) statement
|
||||
// Rule 356: iteration_statement ::= upc_forall ( ; ; expression ; ) statement
|
||||
//
|
||||
case 356: { action. consumeStatementUPCForallLoop(false, false, false, false); break;
|
||||
case 356: { action. consumeStatementUPCForallLoop(false, false, true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 357: iteration_statement ::= upc_forall ( declaration expression ; expression ; affinity ) statement
|
||||
// Rule 357: iteration_statement ::= upc_forall ( ; ; ; affinity ) statement
|
||||
//
|
||||
case 357: { action. consumeStatementUPCForallLoop(true, true, true, true); break;
|
||||
case 357: { action. consumeStatementUPCForallLoop(false, false, false, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 358: iteration_statement ::= upc_forall ( declaration expression ; expression ; ) statement
|
||||
// Rule 358: iteration_statement ::= upc_forall ( ; ; ; ) statement
|
||||
//
|
||||
case 358: { action. consumeStatementUPCForallLoop(true, true, true, false); break;
|
||||
case 358: { action. consumeStatementUPCForallLoop(false, false, false, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 359: iteration_statement ::= upc_forall ( declaration expression ; ; affinity ) statement
|
||||
// Rule 359: iteration_statement ::= upc_forall ( declaration expression ; expression ; affinity ) statement
|
||||
//
|
||||
case 359: { action. consumeStatementUPCForallLoop(true, true, false, true); break;
|
||||
case 359: { action. consumeStatementUPCForallLoop(true, true, true, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 360: iteration_statement ::= upc_forall ( declaration expression ; ; ) statement
|
||||
// Rule 360: iteration_statement ::= upc_forall ( declaration expression ; expression ; ) statement
|
||||
//
|
||||
case 360: { action. consumeStatementUPCForallLoop(true, true, false, false); break;
|
||||
case 360: { action. consumeStatementUPCForallLoop(true, true, true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 361: iteration_statement ::= upc_forall ( declaration ; expression ; affinity ) statement
|
||||
// Rule 361: iteration_statement ::= upc_forall ( declaration expression ; ; affinity ) statement
|
||||
//
|
||||
case 361: { action. consumeStatementUPCForallLoop(true, false, true, true); break;
|
||||
case 361: { action. consumeStatementUPCForallLoop(true, true, false, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 362: iteration_statement ::= upc_forall ( declaration ; expression ; ) statement
|
||||
// Rule 362: iteration_statement ::= upc_forall ( declaration expression ; ; ) statement
|
||||
//
|
||||
case 362: { action. consumeStatementUPCForallLoop(true, false, true, false); break;
|
||||
case 362: { action. consumeStatementUPCForallLoop(true, true, false, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 363: iteration_statement ::= upc_forall ( declaration ; ; affinity ) statement
|
||||
// Rule 363: iteration_statement ::= upc_forall ( declaration ; expression ; affinity ) statement
|
||||
//
|
||||
case 363: { action. consumeStatementUPCForallLoop(true, false, false, true); break;
|
||||
case 363: { action. consumeStatementUPCForallLoop(true, false, true, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 364: iteration_statement ::= upc_forall ( declaration ; ; ) statement
|
||||
// Rule 364: iteration_statement ::= upc_forall ( declaration ; expression ; ) statement
|
||||
//
|
||||
case 364: { action. consumeStatementUPCForallLoop(true, false, false, false); break;
|
||||
case 364: { action. consumeStatementUPCForallLoop(true, false, true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 366: affinity ::= continue
|
||||
// Rule 365: iteration_statement ::= upc_forall ( declaration ; ; affinity ) statement
|
||||
//
|
||||
case 366: { action. consumeToken(); break;
|
||||
case 365: { action. consumeStatementUPCForallLoop(true, false, false, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 366: iteration_statement ::= upc_forall ( declaration ; ; ) statement
|
||||
//
|
||||
case 366: { action. consumeStatementUPCForallLoop(true, false, false, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 368: affinity ::= continue
|
||||
//
|
||||
case 368: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -19,7 +19,7 @@ public interface UPCExpressionParsersym {
|
|||
TK_break = 90,
|
||||
TK_case = 91,
|
||||
TK_char = 40,
|
||||
TK_const = 25,
|
||||
TK_const = 11,
|
||||
TK_continue = 92,
|
||||
TK_default = 93,
|
||||
TK_do = 94,
|
||||
|
@ -35,11 +35,11 @@ public interface UPCExpressionParsersym {
|
|||
TK_int = 43,
|
||||
TK_long = 44,
|
||||
TK_register = 36,
|
||||
TK_restrict = 26,
|
||||
TK_restrict = 12,
|
||||
TK_return = 99,
|
||||
TK_short = 45,
|
||||
TK_signed = 46,
|
||||
TK_sizeof = 11,
|
||||
TK_sizeof = 13,
|
||||
TK_static = 32,
|
||||
TK_struct = 54,
|
||||
TK_switch = 100,
|
||||
|
@ -47,32 +47,32 @@ public interface UPCExpressionParsersym {
|
|||
TK_union = 55,
|
||||
TK_unsigned = 47,
|
||||
TK_void = 48,
|
||||
TK_volatile = 27,
|
||||
TK_volatile = 14,
|
||||
TK_while = 101,
|
||||
TK__Bool = 49,
|
||||
TK__Complex = 50,
|
||||
TK__Imaginary = 51,
|
||||
TK_integer = 12,
|
||||
TK_floating = 13,
|
||||
TK_charconst = 14,
|
||||
TK_stringlit = 15,
|
||||
TK_integer = 15,
|
||||
TK_floating = 16,
|
||||
TK_charconst = 17,
|
||||
TK_stringlit = 18,
|
||||
TK_identifier = 1,
|
||||
TK_Completion = 3,
|
||||
TK_EndOfCompletion = 7,
|
||||
TK_EndOfCompletion = 5,
|
||||
TK_Invalid = 102,
|
||||
TK_LeftBracket = 31,
|
||||
TK_LeftParen = 2,
|
||||
TK_LeftBrace = 16,
|
||||
TK_LeftBrace = 19,
|
||||
TK_Dot = 61,
|
||||
TK_Arrow = 76,
|
||||
TK_PlusPlus = 9,
|
||||
TK_MinusMinus = 10,
|
||||
TK_And = 8,
|
||||
TK_Star = 4,
|
||||
TK_Plus = 5,
|
||||
TK_Minus = 6,
|
||||
TK_Tilde = 17,
|
||||
TK_Bang = 18,
|
||||
TK_Plus = 6,
|
||||
TK_Minus = 7,
|
||||
TK_Tilde = 20,
|
||||
TK_Bang = 21,
|
||||
TK_Slash = 62,
|
||||
TK_Percent = 63,
|
||||
TK_RightShift = 56,
|
||||
|
@ -106,16 +106,16 @@ public interface UPCExpressionParsersym {
|
|||
TK_RightParen = 39,
|
||||
TK_RightBrace = 52,
|
||||
TK_SemiColon = 75,
|
||||
TK_MYTHREAD = 19,
|
||||
TK_THREADS = 20,
|
||||
TK_UPC_MAX_BLOCKSIZE = 21,
|
||||
TK_relaxed = 28,
|
||||
TK_shared = 29,
|
||||
TK_strict = 30,
|
||||
TK_MYTHREAD = 22,
|
||||
TK_THREADS = 23,
|
||||
TK_UPC_MAX_BLOCKSIZE = 24,
|
||||
TK_relaxed = 25,
|
||||
TK_shared = 26,
|
||||
TK_strict = 27,
|
||||
TK_upc_barrier = 103,
|
||||
TK_upc_localsizeof = 22,
|
||||
TK_upc_blocksizeof = 23,
|
||||
TK_upc_elemsizeof = 24,
|
||||
TK_upc_localsizeof = 28,
|
||||
TK_upc_blocksizeof = 29,
|
||||
TK_upc_elemsizeof = 30,
|
||||
TK_upc_notify = 104,
|
||||
TK_upc_fence = 105,
|
||||
TK_upc_wait = 106,
|
||||
|
@ -129,13 +129,16 @@ public interface UPCExpressionParsersym {
|
|||
"LeftParen",
|
||||
"Completion",
|
||||
"Star",
|
||||
"EndOfCompletion",
|
||||
"Plus",
|
||||
"Minus",
|
||||
"EndOfCompletion",
|
||||
"And",
|
||||
"PlusPlus",
|
||||
"MinusMinus",
|
||||
"const",
|
||||
"restrict",
|
||||
"sizeof",
|
||||
"volatile",
|
||||
"integer",
|
||||
"floating",
|
||||
"charconst",
|
||||
|
@ -146,15 +149,12 @@ public interface UPCExpressionParsersym {
|
|||
"MYTHREAD",
|
||||
"THREADS",
|
||||
"UPC_MAX_BLOCKSIZE",
|
||||
"upc_localsizeof",
|
||||
"upc_blocksizeof",
|
||||
"upc_elemsizeof",
|
||||
"const",
|
||||
"restrict",
|
||||
"volatile",
|
||||
"relaxed",
|
||||
"shared",
|
||||
"strict",
|
||||
"upc_localsizeof",
|
||||
"upc_blocksizeof",
|
||||
"upc_elemsizeof",
|
||||
"LeftBracket",
|
||||
"static",
|
||||
"auto",
|
||||
|
|
|
@ -185,17 +185,17 @@ private UPCParserAction action;
|
|||
private IASTCompletionNode compNode;
|
||||
|
||||
|
||||
public UPCNoCastExpressionParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Set<IParser.Options> options) {
|
||||
initActions(options);
|
||||
public UPCNoCastExpressionParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Map<String,String> properties) {
|
||||
initActions(properties);
|
||||
action.initializeTranslationUnit(scanner, builtinBindingsProvider, index);
|
||||
CPreprocessorAdapter.runCPreprocessor(scanner, this, tokenMap);
|
||||
}
|
||||
|
||||
private void initActions(Set<IParser.Options> options) {
|
||||
private void initActions(Map<String,String> properties) {
|
||||
ScopedStack<Object> astStack = new ScopedStack<Object>();
|
||||
|
||||
action = new UPCParserAction (this, astStack, new UPCASTNodeFactory() , UPCSecondaryParserFactory.getDefault() );
|
||||
action.setParserOptions(options);
|
||||
action.setParserProperties(properties);
|
||||
|
||||
|
||||
}
|
||||
|
@ -252,8 +252,8 @@ public void setTokens(List<IToken> tokens) {
|
|||
addToken(new Token(null, 0, 0, UPCNoCastExpressionParsersym.TK_EOF_TOKEN));
|
||||
}
|
||||
|
||||
public UPCNoCastExpressionParser(ITokenStream stream, Set<IParser.Options> options) { // constructor for creating secondary parser
|
||||
initActions(options);
|
||||
public UPCNoCastExpressionParser(ITokenStream stream, Map<String,String> properties) { // constructor for creating secondary parser
|
||||
initActions(properties);
|
||||
tokenMap = new TokenMap(UPCNoCastExpressionParsersym.orderedTerminalSymbols, stream.getOrderedTerminalSymbols());
|
||||
}
|
||||
|
||||
|
@ -348,7 +348,7 @@ public UPCNoCastExpressionParser(ITokenStream stream, Set<IParser.Options> optio
|
|||
}
|
||||
|
||||
//
|
||||
// Rule 28: postfix_expression ::= ( type_id ) { <openscope-ast> initializer_list comma_opt }
|
||||
// Rule 28: postfix_expression ::= ( type_id ) initializer_list
|
||||
//
|
||||
case 28: { action. consumeExpressionTypeIdInitializer(); break;
|
||||
}
|
||||
|
@ -1164,399 +1164,399 @@ public UPCNoCastExpressionParser(ITokenStream stream, Set<IParser.Options> optio
|
|||
}
|
||||
|
||||
//
|
||||
// Rule 281: initializer ::= start_initializer_list { <openscope-ast> initializer_list comma_opt } end_initializer_list
|
||||
//
|
||||
case 281: { action. consumeInitializerList(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 282: initializer ::= { <openscope-ast> }
|
||||
// Rule 282: initializer_list ::= start_initializer_list { <openscope-ast> initializer_seq comma_opt } end_initializer_list
|
||||
//
|
||||
case 282: { action. consumeInitializerList(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 283: start_initializer_list ::= $Empty
|
||||
// Rule 283: initializer_list ::= { <openscope-ast> }
|
||||
//
|
||||
case 283: { action. initializerListStart(); break;
|
||||
case 283: { action. consumeInitializerList(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 284: end_initializer_list ::= $Empty
|
||||
// Rule 284: start_initializer_list ::= $Empty
|
||||
//
|
||||
case 284: { action. initializerListEnd(); break;
|
||||
case 284: { action. initializerListStart(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 289: designated_initializer ::= <openscope-ast> designation = initializer
|
||||
// Rule 285: end_initializer_list ::= $Empty
|
||||
//
|
||||
case 289: { action. consumeInitializerDesignated(); break;
|
||||
case 285: { action. initializerListEnd(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 293: designator_base ::= [ constant_expression ]
|
||||
// Rule 290: designated_initializer ::= <openscope-ast> designation = initializer
|
||||
//
|
||||
case 293: { action. consumeDesignatorArray(); break;
|
||||
case 290: { action. consumeInitializerDesignated(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 294: designator_base ::= . identifier_token
|
||||
// Rule 294: designator_base ::= [ constant_expression ]
|
||||
//
|
||||
case 294: { action. consumeDesignatorField(); break;
|
||||
case 294: { action. consumeDesignatorArray(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 295: designator ::= [ constant_expression ]
|
||||
// Rule 295: designator_base ::= . identifier_token
|
||||
//
|
||||
case 295: { action. consumeDesignatorArray(); break;
|
||||
case 295: { action. consumeDesignatorField(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 296: designator ::= . identifier_token
|
||||
// Rule 296: designator ::= [ constant_expression ]
|
||||
//
|
||||
case 296: { action. consumeDesignatorField(); break;
|
||||
case 296: { action. consumeDesignatorArray(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 297: translation_unit ::= external_declaration_list
|
||||
// Rule 297: designator ::= . identifier_token
|
||||
//
|
||||
case 297: { action. consumeTranslationUnit(); break;
|
||||
case 297: { action. consumeDesignatorField(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 298: translation_unit ::= external_declaration_list
|
||||
//
|
||||
case 298: { action. consumeTranslationUnit(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 298: translation_unit ::= $Empty
|
||||
// Rule 299: translation_unit ::= $Empty
|
||||
//
|
||||
case 298: { action. consumeTranslationUnit(); break;
|
||||
case 299: { action. consumeTranslationUnit(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 303: external_declaration ::= ;
|
||||
// Rule 304: external_declaration ::= ;
|
||||
//
|
||||
case 303: { action. consumeDeclarationEmpty(); break;
|
||||
case 304: { action. consumeDeclarationEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 304: external_declaration ::= ERROR_TOKEN
|
||||
// Rule 305: external_declaration ::= ERROR_TOKEN
|
||||
//
|
||||
case 304: { action. consumeDeclarationProblem(); break;
|
||||
case 305: { action. consumeDeclarationProblem(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 307: function_definition ::= declaration_specifiers <openscope-ast> function_declarator function_body
|
||||
// Rule 309: function_definition ::= <openscope-ast> function_declarator function_body
|
||||
//
|
||||
case 307: { action. consumeFunctionDefinition(true); break;
|
||||
case 309: { action. consumeFunctionDefinition(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 308: function_definition ::= <openscope-ast> function_declarator function_body
|
||||
// Rule 310: function_definition ::= declaration_specifiers <openscope-ast> knr_function_declarator <openscope-ast> declaration_list compound_statement
|
||||
//
|
||||
case 308: { action. consumeFunctionDefinition(false); break;
|
||||
case 310: { action. consumeFunctionDefinitionKnR(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 309: function_definition ::= declaration_specifiers <openscope-ast> knr_function_declarator <openscope-ast> declaration_list compound_statement
|
||||
// Rule 311: normal_function_definition ::= declaration_specifiers <openscope-ast> function_declarator function_body
|
||||
//
|
||||
case 309: { action. consumeFunctionDefinitionKnR(); break;
|
||||
case 311: { action. consumeFunctionDefinition(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 310: function_body ::= { }
|
||||
// Rule 312: function_body ::= { }
|
||||
//
|
||||
case 310: { action. consumeStatementCompoundStatement(false); break;
|
||||
case 312: { action. consumeStatementCompoundStatement(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 311: function_body ::= { <openscope-ast> block_item_list }
|
||||
// Rule 313: function_body ::= { <openscope-ast> block_item_list }
|
||||
//
|
||||
case 311: { action. consumeStatementCompoundStatement(true); break;
|
||||
case 313: { action. consumeStatementCompoundStatement(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 313: no_cast_start ::= ERROR_TOKEN
|
||||
// Rule 315: no_cast_start ::= ERROR_TOKEN
|
||||
//
|
||||
case 313: { action. consumeEmpty(); break;
|
||||
case 315: { action. consumeEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 314: literal ::= MYTHREAD
|
||||
// Rule 316: literal ::= MYTHREAD
|
||||
//
|
||||
case 314: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_mythread); break;
|
||||
case 316: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_mythread); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 315: literal ::= THREADS
|
||||
// Rule 317: literal ::= THREADS
|
||||
//
|
||||
case 315: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_threads); break;
|
||||
case 317: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_threads); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 316: literal ::= UPC_MAX_BLOCKSIZE
|
||||
// Rule 318: literal ::= UPC_MAX_BLOCKSIZE
|
||||
//
|
||||
case 316: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_upc_max_block_size); break;
|
||||
case 318: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_upc_max_block_size); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 317: unary_expression ::= upc_localsizeof unary_expression
|
||||
// Rule 319: unary_expression ::= upc_localsizeof unary_expression
|
||||
//
|
||||
case 317: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_localsizeof); break;
|
||||
case 319: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_localsizeof); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 318: unary_expression ::= upc_localsizeof ( type_id )
|
||||
// Rule 320: unary_expression ::= upc_localsizeof ( type_id )
|
||||
//
|
||||
case 318: { action. consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_localsizeof); break;
|
||||
case 320: { action. consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_localsizeof); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 319: unary_expression ::= upc_blocksizeof unary_expression
|
||||
// Rule 321: unary_expression ::= upc_blocksizeof unary_expression
|
||||
//
|
||||
case 319: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_blocksizeof); break;
|
||||
case 321: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_blocksizeof); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 320: unary_expression ::= upc_blocksizeof ( type_id )
|
||||
// Rule 322: unary_expression ::= upc_blocksizeof ( type_id )
|
||||
//
|
||||
case 320: { action. consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_blocksizeof); break;
|
||||
case 322: { action. consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_blocksizeof); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 321: unary_expression ::= upc_elemsizeof unary_expression
|
||||
// Rule 323: unary_expression ::= upc_elemsizeof unary_expression
|
||||
//
|
||||
case 321: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_elemsizeof); break;
|
||||
case 323: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_elemsizeof); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 322: unary_expression ::= upc_elemsizeof ( type_id )
|
||||
// Rule 324: unary_expression ::= upc_elemsizeof ( type_id )
|
||||
//
|
||||
case 322: { action. consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_elemsizeof); break;
|
||||
case 324: { action. consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_elemsizeof); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 326: shared_type_qualifier ::= shared
|
||||
//
|
||||
case 326: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 327: reference_type_qualifier ::= relaxed
|
||||
//
|
||||
case 327: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 328: reference_type_qualifier ::= strict
|
||||
// Rule 328: shared_type_qualifier ::= shared
|
||||
//
|
||||
case 328: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 329: layout_qualifier ::= [ constant_expression ]
|
||||
// Rule 329: reference_type_qualifier ::= relaxed
|
||||
//
|
||||
case 329: { action. consumeLayoutQualifier(true, false); break;
|
||||
case 329: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 330: layout_qualifier ::= [ * ]
|
||||
// Rule 330: reference_type_qualifier ::= strict
|
||||
//
|
||||
case 330: { action. consumeLayoutQualifier(false, true); break;
|
||||
case 330: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 331: layout_qualifier ::= [ ]
|
||||
// Rule 331: layout_qualifier ::= [ constant_expression ]
|
||||
//
|
||||
case 331: { action. consumeLayoutQualifier(false, false); break;
|
||||
case 331: { action. consumeLayoutQualifier(true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 333: synchronization_statement ::= upc_notify expression ;
|
||||
// Rule 332: layout_qualifier ::= [ * ]
|
||||
//
|
||||
case 333: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_notify, true); break;
|
||||
case 332: { action. consumeLayoutQualifier(false, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 334: synchronization_statement ::= upc_notify ;
|
||||
// Rule 333: layout_qualifier ::= [ ]
|
||||
//
|
||||
case 334: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_notify, false); break;
|
||||
case 333: { action. consumeLayoutQualifier(false, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 335: synchronization_statement ::= upc_wait expression ;
|
||||
// Rule 335: synchronization_statement ::= upc_notify expression ;
|
||||
//
|
||||
case 335: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_wait, true); break;
|
||||
case 335: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_notify, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 336: synchronization_statement ::= upc_wait ;
|
||||
// Rule 336: synchronization_statement ::= upc_notify ;
|
||||
//
|
||||
case 336: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_wait, false); break;
|
||||
case 336: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_notify, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 337: synchronization_statement ::= upc_barrier expression ;
|
||||
// Rule 337: synchronization_statement ::= upc_wait expression ;
|
||||
//
|
||||
case 337: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_barrier, true); break;
|
||||
case 337: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_wait, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 338: synchronization_statement ::= upc_barrier ;
|
||||
// Rule 338: synchronization_statement ::= upc_wait ;
|
||||
//
|
||||
case 338: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_barrier, false); break;
|
||||
case 338: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_wait, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 339: synchronization_statement ::= upc_fence ;
|
||||
// Rule 339: synchronization_statement ::= upc_barrier expression ;
|
||||
//
|
||||
case 339: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_fence, false); break;
|
||||
case 339: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_barrier, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 340: iteration_statement ::= upc_forall ( expression ; expression ; expression ; affinity ) statement
|
||||
// Rule 340: synchronization_statement ::= upc_barrier ;
|
||||
//
|
||||
case 340: { action. consumeStatementUPCForallLoop(true, true, true, true); break;
|
||||
case 340: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_barrier, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 341: iteration_statement ::= upc_forall ( expression ; expression ; expression ; ) statement
|
||||
// Rule 341: synchronization_statement ::= upc_fence ;
|
||||
//
|
||||
case 341: { action. consumeStatementUPCForallLoop(true, true, true, false); break;
|
||||
case 341: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_fence, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 342: iteration_statement ::= upc_forall ( expression ; expression ; ; affinity ) statement
|
||||
// Rule 342: iteration_statement ::= upc_forall ( expression ; expression ; expression ; affinity ) statement
|
||||
//
|
||||
case 342: { action. consumeStatementUPCForallLoop(true, true, false, true); break;
|
||||
case 342: { action. consumeStatementUPCForallLoop(true, true, true, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 343: iteration_statement ::= upc_forall ( expression ; expression ; ; ) statement
|
||||
// Rule 343: iteration_statement ::= upc_forall ( expression ; expression ; expression ; ) statement
|
||||
//
|
||||
case 343: { action. consumeStatementUPCForallLoop(true, true, false, false); break;
|
||||
case 343: { action. consumeStatementUPCForallLoop(true, true, true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 344: iteration_statement ::= upc_forall ( expression ; ; expression ; affinity ) statement
|
||||
// Rule 344: iteration_statement ::= upc_forall ( expression ; expression ; ; affinity ) statement
|
||||
//
|
||||
case 344: { action. consumeStatementUPCForallLoop(true, false, true, true); break;
|
||||
case 344: { action. consumeStatementUPCForallLoop(true, true, false, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 345: iteration_statement ::= upc_forall ( expression ; ; expression ; ) statement
|
||||
// Rule 345: iteration_statement ::= upc_forall ( expression ; expression ; ; ) statement
|
||||
//
|
||||
case 345: { action. consumeStatementUPCForallLoop(true, false, true, false); break;
|
||||
case 345: { action. consumeStatementUPCForallLoop(true, true, false, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 346: iteration_statement ::= upc_forall ( expression ; ; ; affinity ) statement
|
||||
// Rule 346: iteration_statement ::= upc_forall ( expression ; ; expression ; affinity ) statement
|
||||
//
|
||||
case 346: { action. consumeStatementUPCForallLoop(true, false, false, true); break;
|
||||
case 346: { action. consumeStatementUPCForallLoop(true, false, true, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 347: iteration_statement ::= upc_forall ( expression ; ; ; ) statement
|
||||
// Rule 347: iteration_statement ::= upc_forall ( expression ; ; expression ; ) statement
|
||||
//
|
||||
case 347: { action. consumeStatementUPCForallLoop(true, false, false, false); break;
|
||||
case 347: { action. consumeStatementUPCForallLoop(true, false, true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 348: iteration_statement ::= upc_forall ( ; expression ; expression ; affinity ) statement
|
||||
// Rule 348: iteration_statement ::= upc_forall ( expression ; ; ; affinity ) statement
|
||||
//
|
||||
case 348: { action. consumeStatementUPCForallLoop(false, true, true, true); break;
|
||||
case 348: { action. consumeStatementUPCForallLoop(true, false, false, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 349: iteration_statement ::= upc_forall ( ; expression ; expression ; ) statement
|
||||
// Rule 349: iteration_statement ::= upc_forall ( expression ; ; ; ) statement
|
||||
//
|
||||
case 349: { action. consumeStatementUPCForallLoop(false, true, true, false); break;
|
||||
case 349: { action. consumeStatementUPCForallLoop(true, false, false, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 350: iteration_statement ::= upc_forall ( ; expression ; ; affinity ) statement
|
||||
// Rule 350: iteration_statement ::= upc_forall ( ; expression ; expression ; affinity ) statement
|
||||
//
|
||||
case 350: { action. consumeStatementUPCForallLoop(false, true, false, true); break;
|
||||
case 350: { action. consumeStatementUPCForallLoop(false, true, true, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 351: iteration_statement ::= upc_forall ( ; expression ; ; ) statement
|
||||
// Rule 351: iteration_statement ::= upc_forall ( ; expression ; expression ; ) statement
|
||||
//
|
||||
case 351: { action. consumeStatementUPCForallLoop(false, true, false, false); break;
|
||||
case 351: { action. consumeStatementUPCForallLoop(false, true, true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 352: iteration_statement ::= upc_forall ( ; ; expression ; affinity ) statement
|
||||
// Rule 352: iteration_statement ::= upc_forall ( ; expression ; ; affinity ) statement
|
||||
//
|
||||
case 352: { action. consumeStatementUPCForallLoop(false, false, true, true); break;
|
||||
case 352: { action. consumeStatementUPCForallLoop(false, true, false, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 353: iteration_statement ::= upc_forall ( ; ; expression ; ) statement
|
||||
// Rule 353: iteration_statement ::= upc_forall ( ; expression ; ; ) statement
|
||||
//
|
||||
case 353: { action. consumeStatementUPCForallLoop(false, false, true, false); break;
|
||||
case 353: { action. consumeStatementUPCForallLoop(false, true, false, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 354: iteration_statement ::= upc_forall ( ; ; ; affinity ) statement
|
||||
// Rule 354: iteration_statement ::= upc_forall ( ; ; expression ; affinity ) statement
|
||||
//
|
||||
case 354: { action. consumeStatementUPCForallLoop(false, false, false, true); break;
|
||||
case 354: { action. consumeStatementUPCForallLoop(false, false, true, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 355: iteration_statement ::= upc_forall ( ; ; ; ) statement
|
||||
// Rule 355: iteration_statement ::= upc_forall ( ; ; expression ; ) statement
|
||||
//
|
||||
case 355: { action. consumeStatementUPCForallLoop(false, false, false, false); break;
|
||||
case 355: { action. consumeStatementUPCForallLoop(false, false, true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 356: iteration_statement ::= upc_forall ( declaration expression ; expression ; affinity ) statement
|
||||
// Rule 356: iteration_statement ::= upc_forall ( ; ; ; affinity ) statement
|
||||
//
|
||||
case 356: { action. consumeStatementUPCForallLoop(true, true, true, true); break;
|
||||
case 356: { action. consumeStatementUPCForallLoop(false, false, false, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 357: iteration_statement ::= upc_forall ( declaration expression ; expression ; ) statement
|
||||
// Rule 357: iteration_statement ::= upc_forall ( ; ; ; ) statement
|
||||
//
|
||||
case 357: { action. consumeStatementUPCForallLoop(true, true, true, false); break;
|
||||
case 357: { action. consumeStatementUPCForallLoop(false, false, false, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 358: iteration_statement ::= upc_forall ( declaration expression ; ; affinity ) statement
|
||||
// Rule 358: iteration_statement ::= upc_forall ( declaration expression ; expression ; affinity ) statement
|
||||
//
|
||||
case 358: { action. consumeStatementUPCForallLoop(true, true, false, true); break;
|
||||
case 358: { action. consumeStatementUPCForallLoop(true, true, true, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 359: iteration_statement ::= upc_forall ( declaration expression ; ; ) statement
|
||||
// Rule 359: iteration_statement ::= upc_forall ( declaration expression ; expression ; ) statement
|
||||
//
|
||||
case 359: { action. consumeStatementUPCForallLoop(true, true, false, false); break;
|
||||
case 359: { action. consumeStatementUPCForallLoop(true, true, true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 360: iteration_statement ::= upc_forall ( declaration ; expression ; affinity ) statement
|
||||
// Rule 360: iteration_statement ::= upc_forall ( declaration expression ; ; affinity ) statement
|
||||
//
|
||||
case 360: { action. consumeStatementUPCForallLoop(true, false, true, true); break;
|
||||
case 360: { action. consumeStatementUPCForallLoop(true, true, false, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 361: iteration_statement ::= upc_forall ( declaration ; expression ; ) statement
|
||||
// Rule 361: iteration_statement ::= upc_forall ( declaration expression ; ; ) statement
|
||||
//
|
||||
case 361: { action. consumeStatementUPCForallLoop(true, false, true, false); break;
|
||||
case 361: { action. consumeStatementUPCForallLoop(true, true, false, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 362: iteration_statement ::= upc_forall ( declaration ; ; affinity ) statement
|
||||
// Rule 362: iteration_statement ::= upc_forall ( declaration ; expression ; affinity ) statement
|
||||
//
|
||||
case 362: { action. consumeStatementUPCForallLoop(true, false, false, true); break;
|
||||
case 362: { action. consumeStatementUPCForallLoop(true, false, true, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 363: iteration_statement ::= upc_forall ( declaration ; ; ) statement
|
||||
// Rule 363: iteration_statement ::= upc_forall ( declaration ; expression ; ) statement
|
||||
//
|
||||
case 363: { action. consumeStatementUPCForallLoop(true, false, false, false); break;
|
||||
case 363: { action. consumeStatementUPCForallLoop(true, false, true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 365: affinity ::= continue
|
||||
// Rule 364: iteration_statement ::= upc_forall ( declaration ; ; affinity ) statement
|
||||
//
|
||||
case 365: { action. consumeToken(); break;
|
||||
case 364: { action. consumeStatementUPCForallLoop(true, false, false, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 365: iteration_statement ::= upc_forall ( declaration ; ; ) statement
|
||||
//
|
||||
case 365: { action. consumeStatementUPCForallLoop(true, false, false, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 367: affinity ::= continue
|
||||
//
|
||||
case 367: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -19,7 +19,7 @@ public interface UPCNoCastExpressionParsersym {
|
|||
TK_break = 90,
|
||||
TK_case = 91,
|
||||
TK_char = 40,
|
||||
TK_const = 9,
|
||||
TK_const = 8,
|
||||
TK_continue = 92,
|
||||
TK_default = 93,
|
||||
TK_do = 94,
|
||||
|
@ -35,7 +35,7 @@ public interface UPCNoCastExpressionParsersym {
|
|||
TK_int = 43,
|
||||
TK_long = 44,
|
||||
TK_register = 36,
|
||||
TK_restrict = 10,
|
||||
TK_restrict = 9,
|
||||
TK_return = 99,
|
||||
TK_short = 45,
|
||||
TK_signed = 46,
|
||||
|
@ -47,7 +47,7 @@ public interface UPCNoCastExpressionParsersym {
|
|||
TK_union = 55,
|
||||
TK_unsigned = 47,
|
||||
TK_void = 48,
|
||||
TK_volatile = 11,
|
||||
TK_volatile = 10,
|
||||
TK_while = 101,
|
||||
TK__Bool = 49,
|
||||
TK__Complex = 50,
|
||||
|
@ -60,19 +60,19 @@ public interface UPCNoCastExpressionParsersym {
|
|||
TK_Completion = 3,
|
||||
TK_EndOfCompletion = 5,
|
||||
TK_Invalid = 102,
|
||||
TK_LeftBracket = 31,
|
||||
TK_LeftBracket = 23,
|
||||
TK_LeftParen = 2,
|
||||
TK_LeftBrace = 12,
|
||||
TK_LeftBrace = 15,
|
||||
TK_Dot = 61,
|
||||
TK_Arrow = 76,
|
||||
TK_PlusPlus = 13,
|
||||
TK_MinusMinus = 14,
|
||||
TK_And = 8,
|
||||
TK_PlusPlus = 16,
|
||||
TK_MinusMinus = 17,
|
||||
TK_And = 11,
|
||||
TK_Star = 4,
|
||||
TK_Plus = 6,
|
||||
TK_Minus = 7,
|
||||
TK_Tilde = 23,
|
||||
TK_Bang = 24,
|
||||
TK_Tilde = 24,
|
||||
TK_Bang = 25,
|
||||
TK_Slash = 62,
|
||||
TK_Percent = 63,
|
||||
TK_RightShift = 56,
|
||||
|
@ -106,16 +106,16 @@ public interface UPCNoCastExpressionParsersym {
|
|||
TK_RightParen = 39,
|
||||
TK_RightBrace = 52,
|
||||
TK_SemiColon = 75,
|
||||
TK_MYTHREAD = 25,
|
||||
TK_THREADS = 26,
|
||||
TK_UPC_MAX_BLOCKSIZE = 27,
|
||||
TK_relaxed = 15,
|
||||
TK_shared = 16,
|
||||
TK_strict = 17,
|
||||
TK_MYTHREAD = 26,
|
||||
TK_THREADS = 27,
|
||||
TK_UPC_MAX_BLOCKSIZE = 28,
|
||||
TK_relaxed = 12,
|
||||
TK_shared = 13,
|
||||
TK_strict = 14,
|
||||
TK_upc_barrier = 103,
|
||||
TK_upc_localsizeof = 28,
|
||||
TK_upc_blocksizeof = 29,
|
||||
TK_upc_elemsizeof = 30,
|
||||
TK_upc_localsizeof = 29,
|
||||
TK_upc_blocksizeof = 30,
|
||||
TK_upc_elemsizeof = 31,
|
||||
TK_upc_notify = 104,
|
||||
TK_upc_fence = 105,
|
||||
TK_upc_wait = 106,
|
||||
|
@ -132,21 +132,22 @@ public interface UPCNoCastExpressionParsersym {
|
|||
"EndOfCompletion",
|
||||
"Plus",
|
||||
"Minus",
|
||||
"And",
|
||||
"const",
|
||||
"restrict",
|
||||
"volatile",
|
||||
"LeftBrace",
|
||||
"PlusPlus",
|
||||
"MinusMinus",
|
||||
"And",
|
||||
"relaxed",
|
||||
"shared",
|
||||
"strict",
|
||||
"LeftBrace",
|
||||
"PlusPlus",
|
||||
"MinusMinus",
|
||||
"sizeof",
|
||||
"integer",
|
||||
"floating",
|
||||
"charconst",
|
||||
"stringlit",
|
||||
"LeftBracket",
|
||||
"Tilde",
|
||||
"Bang",
|
||||
"MYTHREAD",
|
||||
|
@ -155,7 +156,6 @@ public interface UPCNoCastExpressionParsersym {
|
|||
"upc_localsizeof",
|
||||
"upc_blocksizeof",
|
||||
"upc_elemsizeof",
|
||||
"LeftBracket",
|
||||
"static",
|
||||
"auto",
|
||||
"extern",
|
||||
|
|
|
@ -181,17 +181,17 @@ private UPCParserAction action;
|
|||
private IASTCompletionNode compNode;
|
||||
|
||||
|
||||
public UPCParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Set<IParser.Options> options) {
|
||||
initActions(options);
|
||||
public UPCParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Map<String,String> properties) {
|
||||
initActions(properties);
|
||||
action.initializeTranslationUnit(scanner, builtinBindingsProvider, index);
|
||||
CPreprocessorAdapter.runCPreprocessor(scanner, this, tokenMap);
|
||||
}
|
||||
|
||||
private void initActions(Set<IParser.Options> options) {
|
||||
private void initActions(Map<String,String> properties) {
|
||||
ScopedStack<Object> astStack = new ScopedStack<Object>();
|
||||
|
||||
action = new UPCParserAction (this, astStack, new UPCASTNodeFactory() , UPCSecondaryParserFactory.getDefault() );
|
||||
action.setParserOptions(options);
|
||||
action.setParserProperties(properties);
|
||||
|
||||
|
||||
}
|
||||
|
@ -325,7 +325,7 @@ public String getName() {
|
|||
}
|
||||
|
||||
//
|
||||
// Rule 28: postfix_expression ::= ( type_id ) { <openscope-ast> initializer_list comma_opt }
|
||||
// Rule 28: postfix_expression ::= ( type_id ) initializer_list
|
||||
//
|
||||
case 28: { action. consumeExpressionTypeIdInitializer(); break;
|
||||
}
|
||||
|
@ -1147,393 +1147,393 @@ public String getName() {
|
|||
}
|
||||
|
||||
//
|
||||
// Rule 282: initializer ::= start_initializer_list { <openscope-ast> initializer_list comma_opt } end_initializer_list
|
||||
//
|
||||
case 282: { action. consumeInitializerList(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 283: initializer ::= { <openscope-ast> }
|
||||
// Rule 283: initializer_list ::= start_initializer_list { <openscope-ast> initializer_seq comma_opt } end_initializer_list
|
||||
//
|
||||
case 283: { action. consumeInitializerList(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 284: start_initializer_list ::= $Empty
|
||||
// Rule 284: initializer_list ::= { <openscope-ast> }
|
||||
//
|
||||
case 284: { action. initializerListStart(); break;
|
||||
case 284: { action. consumeInitializerList(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 285: end_initializer_list ::= $Empty
|
||||
// Rule 285: start_initializer_list ::= $Empty
|
||||
//
|
||||
case 285: { action. initializerListEnd(); break;
|
||||
case 285: { action. initializerListStart(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 290: designated_initializer ::= <openscope-ast> designation = initializer
|
||||
// Rule 286: end_initializer_list ::= $Empty
|
||||
//
|
||||
case 290: { action. consumeInitializerDesignated(); break;
|
||||
case 286: { action. initializerListEnd(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 294: designator_base ::= [ constant_expression ]
|
||||
// Rule 291: designated_initializer ::= <openscope-ast> designation = initializer
|
||||
//
|
||||
case 294: { action. consumeDesignatorArray(); break;
|
||||
case 291: { action. consumeInitializerDesignated(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 295: designator_base ::= . identifier_token
|
||||
// Rule 295: designator_base ::= [ constant_expression ]
|
||||
//
|
||||
case 295: { action. consumeDesignatorField(); break;
|
||||
case 295: { action. consumeDesignatorArray(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 296: designator ::= [ constant_expression ]
|
||||
// Rule 296: designator_base ::= . identifier_token
|
||||
//
|
||||
case 296: { action. consumeDesignatorArray(); break;
|
||||
case 296: { action. consumeDesignatorField(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 297: designator ::= . identifier_token
|
||||
// Rule 297: designator ::= [ constant_expression ]
|
||||
//
|
||||
case 297: { action. consumeDesignatorField(); break;
|
||||
case 297: { action. consumeDesignatorArray(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 298: translation_unit ::= external_declaration_list
|
||||
// Rule 298: designator ::= . identifier_token
|
||||
//
|
||||
case 298: { action. consumeTranslationUnit(); break;
|
||||
case 298: { action. consumeDesignatorField(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 299: translation_unit ::= external_declaration_list
|
||||
//
|
||||
case 299: { action. consumeTranslationUnit(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 299: translation_unit ::= $Empty
|
||||
// Rule 300: translation_unit ::= $Empty
|
||||
//
|
||||
case 299: { action. consumeTranslationUnit(); break;
|
||||
case 300: { action. consumeTranslationUnit(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 304: external_declaration ::= ;
|
||||
// Rule 305: external_declaration ::= ;
|
||||
//
|
||||
case 304: { action. consumeDeclarationEmpty(); break;
|
||||
case 305: { action. consumeDeclarationEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 305: external_declaration ::= ERROR_TOKEN
|
||||
// Rule 306: external_declaration ::= ERROR_TOKEN
|
||||
//
|
||||
case 305: { action. consumeDeclarationProblem(); break;
|
||||
case 306: { action. consumeDeclarationProblem(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 308: function_definition ::= declaration_specifiers <openscope-ast> function_declarator function_body
|
||||
// Rule 310: function_definition ::= <openscope-ast> function_declarator function_body
|
||||
//
|
||||
case 308: { action. consumeFunctionDefinition(true); break;
|
||||
case 310: { action. consumeFunctionDefinition(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 309: function_definition ::= <openscope-ast> function_declarator function_body
|
||||
// Rule 311: function_definition ::= declaration_specifiers <openscope-ast> knr_function_declarator <openscope-ast> declaration_list compound_statement
|
||||
//
|
||||
case 309: { action. consumeFunctionDefinition(false); break;
|
||||
case 311: { action. consumeFunctionDefinitionKnR(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 310: function_definition ::= declaration_specifiers <openscope-ast> knr_function_declarator <openscope-ast> declaration_list compound_statement
|
||||
// Rule 312: normal_function_definition ::= declaration_specifiers <openscope-ast> function_declarator function_body
|
||||
//
|
||||
case 310: { action. consumeFunctionDefinitionKnR(); break;
|
||||
case 312: { action. consumeFunctionDefinition(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 311: function_body ::= { }
|
||||
// Rule 313: function_body ::= { }
|
||||
//
|
||||
case 311: { action. consumeStatementCompoundStatement(false); break;
|
||||
case 313: { action. consumeStatementCompoundStatement(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 312: function_body ::= { <openscope-ast> block_item_list }
|
||||
// Rule 314: function_body ::= { <openscope-ast> block_item_list }
|
||||
//
|
||||
case 312: { action. consumeStatementCompoundStatement(true); break;
|
||||
case 314: { action. consumeStatementCompoundStatement(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 313: literal ::= MYTHREAD
|
||||
// Rule 315: literal ::= MYTHREAD
|
||||
//
|
||||
case 313: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_mythread); break;
|
||||
case 315: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_mythread); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 314: literal ::= THREADS
|
||||
// Rule 316: literal ::= THREADS
|
||||
//
|
||||
case 314: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_threads); break;
|
||||
case 316: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_threads); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 315: literal ::= UPC_MAX_BLOCKSIZE
|
||||
// Rule 317: literal ::= UPC_MAX_BLOCKSIZE
|
||||
//
|
||||
case 315: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_upc_max_block_size); break;
|
||||
case 317: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_upc_max_block_size); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 316: unary_expression ::= upc_localsizeof unary_expression
|
||||
// Rule 318: unary_expression ::= upc_localsizeof unary_expression
|
||||
//
|
||||
case 316: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_localsizeof); break;
|
||||
case 318: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_localsizeof); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 317: unary_expression ::= upc_localsizeof ( type_id )
|
||||
// Rule 319: unary_expression ::= upc_localsizeof ( type_id )
|
||||
//
|
||||
case 317: { action. consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_localsizeof); break;
|
||||
case 319: { action. consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_localsizeof); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 318: unary_expression ::= upc_blocksizeof unary_expression
|
||||
// Rule 320: unary_expression ::= upc_blocksizeof unary_expression
|
||||
//
|
||||
case 318: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_blocksizeof); break;
|
||||
case 320: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_blocksizeof); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 319: unary_expression ::= upc_blocksizeof ( type_id )
|
||||
// Rule 321: unary_expression ::= upc_blocksizeof ( type_id )
|
||||
//
|
||||
case 319: { action. consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_blocksizeof); break;
|
||||
case 321: { action. consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_blocksizeof); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 320: unary_expression ::= upc_elemsizeof unary_expression
|
||||
// Rule 322: unary_expression ::= upc_elemsizeof unary_expression
|
||||
//
|
||||
case 320: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_elemsizeof); break;
|
||||
case 322: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_elemsizeof); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 321: unary_expression ::= upc_elemsizeof ( type_id )
|
||||
// Rule 323: unary_expression ::= upc_elemsizeof ( type_id )
|
||||
//
|
||||
case 321: { action. consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_elemsizeof); break;
|
||||
case 323: { action. consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_elemsizeof); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 325: shared_type_qualifier ::= shared
|
||||
//
|
||||
case 325: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 326: reference_type_qualifier ::= relaxed
|
||||
//
|
||||
case 326: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 327: reference_type_qualifier ::= strict
|
||||
// Rule 327: shared_type_qualifier ::= shared
|
||||
//
|
||||
case 327: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 328: layout_qualifier ::= [ constant_expression ]
|
||||
// Rule 328: reference_type_qualifier ::= relaxed
|
||||
//
|
||||
case 328: { action. consumeLayoutQualifier(true, false); break;
|
||||
case 328: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 329: layout_qualifier ::= [ * ]
|
||||
// Rule 329: reference_type_qualifier ::= strict
|
||||
//
|
||||
case 329: { action. consumeLayoutQualifier(false, true); break;
|
||||
case 329: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 330: layout_qualifier ::= [ ]
|
||||
// Rule 330: layout_qualifier ::= [ constant_expression ]
|
||||
//
|
||||
case 330: { action. consumeLayoutQualifier(false, false); break;
|
||||
case 330: { action. consumeLayoutQualifier(true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 332: synchronization_statement ::= upc_notify expression ;
|
||||
// Rule 331: layout_qualifier ::= [ * ]
|
||||
//
|
||||
case 332: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_notify, true); break;
|
||||
case 331: { action. consumeLayoutQualifier(false, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 333: synchronization_statement ::= upc_notify ;
|
||||
// Rule 332: layout_qualifier ::= [ ]
|
||||
//
|
||||
case 333: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_notify, false); break;
|
||||
case 332: { action. consumeLayoutQualifier(false, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 334: synchronization_statement ::= upc_wait expression ;
|
||||
// Rule 334: synchronization_statement ::= upc_notify expression ;
|
||||
//
|
||||
case 334: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_wait, true); break;
|
||||
case 334: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_notify, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 335: synchronization_statement ::= upc_wait ;
|
||||
// Rule 335: synchronization_statement ::= upc_notify ;
|
||||
//
|
||||
case 335: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_wait, false); break;
|
||||
case 335: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_notify, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 336: synchronization_statement ::= upc_barrier expression ;
|
||||
// Rule 336: synchronization_statement ::= upc_wait expression ;
|
||||
//
|
||||
case 336: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_barrier, true); break;
|
||||
case 336: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_wait, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 337: synchronization_statement ::= upc_barrier ;
|
||||
// Rule 337: synchronization_statement ::= upc_wait ;
|
||||
//
|
||||
case 337: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_barrier, false); break;
|
||||
case 337: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_wait, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 338: synchronization_statement ::= upc_fence ;
|
||||
// Rule 338: synchronization_statement ::= upc_barrier expression ;
|
||||
//
|
||||
case 338: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_fence, false); break;
|
||||
case 338: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_barrier, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 339: iteration_statement ::= upc_forall ( expression ; expression ; expression ; affinity ) statement
|
||||
// Rule 339: synchronization_statement ::= upc_barrier ;
|
||||
//
|
||||
case 339: { action. consumeStatementUPCForallLoop(true, true, true, true); break;
|
||||
case 339: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_barrier, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 340: iteration_statement ::= upc_forall ( expression ; expression ; expression ; ) statement
|
||||
// Rule 340: synchronization_statement ::= upc_fence ;
|
||||
//
|
||||
case 340: { action. consumeStatementUPCForallLoop(true, true, true, false); break;
|
||||
case 340: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_fence, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 341: iteration_statement ::= upc_forall ( expression ; expression ; ; affinity ) statement
|
||||
// Rule 341: iteration_statement ::= upc_forall ( expression ; expression ; expression ; affinity ) statement
|
||||
//
|
||||
case 341: { action. consumeStatementUPCForallLoop(true, true, false, true); break;
|
||||
case 341: { action. consumeStatementUPCForallLoop(true, true, true, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 342: iteration_statement ::= upc_forall ( expression ; expression ; ; ) statement
|
||||
// Rule 342: iteration_statement ::= upc_forall ( expression ; expression ; expression ; ) statement
|
||||
//
|
||||
case 342: { action. consumeStatementUPCForallLoop(true, true, false, false); break;
|
||||
case 342: { action. consumeStatementUPCForallLoop(true, true, true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 343: iteration_statement ::= upc_forall ( expression ; ; expression ; affinity ) statement
|
||||
// Rule 343: iteration_statement ::= upc_forall ( expression ; expression ; ; affinity ) statement
|
||||
//
|
||||
case 343: { action. consumeStatementUPCForallLoop(true, false, true, true); break;
|
||||
case 343: { action. consumeStatementUPCForallLoop(true, true, false, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 344: iteration_statement ::= upc_forall ( expression ; ; expression ; ) statement
|
||||
// Rule 344: iteration_statement ::= upc_forall ( expression ; expression ; ; ) statement
|
||||
//
|
||||
case 344: { action. consumeStatementUPCForallLoop(true, false, true, false); break;
|
||||
case 344: { action. consumeStatementUPCForallLoop(true, true, false, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 345: iteration_statement ::= upc_forall ( expression ; ; ; affinity ) statement
|
||||
// Rule 345: iteration_statement ::= upc_forall ( expression ; ; expression ; affinity ) statement
|
||||
//
|
||||
case 345: { action. consumeStatementUPCForallLoop(true, false, false, true); break;
|
||||
case 345: { action. consumeStatementUPCForallLoop(true, false, true, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 346: iteration_statement ::= upc_forall ( expression ; ; ; ) statement
|
||||
// Rule 346: iteration_statement ::= upc_forall ( expression ; ; expression ; ) statement
|
||||
//
|
||||
case 346: { action. consumeStatementUPCForallLoop(true, false, false, false); break;
|
||||
case 346: { action. consumeStatementUPCForallLoop(true, false, true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 347: iteration_statement ::= upc_forall ( ; expression ; expression ; affinity ) statement
|
||||
// Rule 347: iteration_statement ::= upc_forall ( expression ; ; ; affinity ) statement
|
||||
//
|
||||
case 347: { action. consumeStatementUPCForallLoop(false, true, true, true); break;
|
||||
case 347: { action. consumeStatementUPCForallLoop(true, false, false, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 348: iteration_statement ::= upc_forall ( ; expression ; expression ; ) statement
|
||||
// Rule 348: iteration_statement ::= upc_forall ( expression ; ; ; ) statement
|
||||
//
|
||||
case 348: { action. consumeStatementUPCForallLoop(false, true, true, false); break;
|
||||
case 348: { action. consumeStatementUPCForallLoop(true, false, false, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 349: iteration_statement ::= upc_forall ( ; expression ; ; affinity ) statement
|
||||
// Rule 349: iteration_statement ::= upc_forall ( ; expression ; expression ; affinity ) statement
|
||||
//
|
||||
case 349: { action. consumeStatementUPCForallLoop(false, true, false, true); break;
|
||||
case 349: { action. consumeStatementUPCForallLoop(false, true, true, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 350: iteration_statement ::= upc_forall ( ; expression ; ; ) statement
|
||||
// Rule 350: iteration_statement ::= upc_forall ( ; expression ; expression ; ) statement
|
||||
//
|
||||
case 350: { action. consumeStatementUPCForallLoop(false, true, false, false); break;
|
||||
case 350: { action. consumeStatementUPCForallLoop(false, true, true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 351: iteration_statement ::= upc_forall ( ; ; expression ; affinity ) statement
|
||||
// Rule 351: iteration_statement ::= upc_forall ( ; expression ; ; affinity ) statement
|
||||
//
|
||||
case 351: { action. consumeStatementUPCForallLoop(false, false, true, true); break;
|
||||
case 351: { action. consumeStatementUPCForallLoop(false, true, false, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 352: iteration_statement ::= upc_forall ( ; ; expression ; ) statement
|
||||
// Rule 352: iteration_statement ::= upc_forall ( ; expression ; ; ) statement
|
||||
//
|
||||
case 352: { action. consumeStatementUPCForallLoop(false, false, true, false); break;
|
||||
case 352: { action. consumeStatementUPCForallLoop(false, true, false, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 353: iteration_statement ::= upc_forall ( ; ; ; affinity ) statement
|
||||
// Rule 353: iteration_statement ::= upc_forall ( ; ; expression ; affinity ) statement
|
||||
//
|
||||
case 353: { action. consumeStatementUPCForallLoop(false, false, false, true); break;
|
||||
case 353: { action. consumeStatementUPCForallLoop(false, false, true, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 354: iteration_statement ::= upc_forall ( ; ; ; ) statement
|
||||
// Rule 354: iteration_statement ::= upc_forall ( ; ; expression ; ) statement
|
||||
//
|
||||
case 354: { action. consumeStatementUPCForallLoop(false, false, false, false); break;
|
||||
case 354: { action. consumeStatementUPCForallLoop(false, false, true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 355: iteration_statement ::= upc_forall ( declaration expression ; expression ; affinity ) statement
|
||||
// Rule 355: iteration_statement ::= upc_forall ( ; ; ; affinity ) statement
|
||||
//
|
||||
case 355: { action. consumeStatementUPCForallLoop(true, true, true, true); break;
|
||||
case 355: { action. consumeStatementUPCForallLoop(false, false, false, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 356: iteration_statement ::= upc_forall ( declaration expression ; expression ; ) statement
|
||||
// Rule 356: iteration_statement ::= upc_forall ( ; ; ; ) statement
|
||||
//
|
||||
case 356: { action. consumeStatementUPCForallLoop(true, true, true, false); break;
|
||||
case 356: { action. consumeStatementUPCForallLoop(false, false, false, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 357: iteration_statement ::= upc_forall ( declaration expression ; ; affinity ) statement
|
||||
// Rule 357: iteration_statement ::= upc_forall ( declaration expression ; expression ; affinity ) statement
|
||||
//
|
||||
case 357: { action. consumeStatementUPCForallLoop(true, true, false, true); break;
|
||||
case 357: { action. consumeStatementUPCForallLoop(true, true, true, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 358: iteration_statement ::= upc_forall ( declaration expression ; ; ) statement
|
||||
// Rule 358: iteration_statement ::= upc_forall ( declaration expression ; expression ; ) statement
|
||||
//
|
||||
case 358: { action. consumeStatementUPCForallLoop(true, true, false, false); break;
|
||||
case 358: { action. consumeStatementUPCForallLoop(true, true, true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 359: iteration_statement ::= upc_forall ( declaration ; expression ; affinity ) statement
|
||||
// Rule 359: iteration_statement ::= upc_forall ( declaration expression ; ; affinity ) statement
|
||||
//
|
||||
case 359: { action. consumeStatementUPCForallLoop(true, false, true, true); break;
|
||||
case 359: { action. consumeStatementUPCForallLoop(true, true, false, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 360: iteration_statement ::= upc_forall ( declaration ; expression ; ) statement
|
||||
// Rule 360: iteration_statement ::= upc_forall ( declaration expression ; ; ) statement
|
||||
//
|
||||
case 360: { action. consumeStatementUPCForallLoop(true, false, true, false); break;
|
||||
case 360: { action. consumeStatementUPCForallLoop(true, true, false, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 361: iteration_statement ::= upc_forall ( declaration ; ; affinity ) statement
|
||||
// Rule 361: iteration_statement ::= upc_forall ( declaration ; expression ; affinity ) statement
|
||||
//
|
||||
case 361: { action. consumeStatementUPCForallLoop(true, false, false, true); break;
|
||||
case 361: { action. consumeStatementUPCForallLoop(true, false, true, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 362: iteration_statement ::= upc_forall ( declaration ; ; ) statement
|
||||
// Rule 362: iteration_statement ::= upc_forall ( declaration ; expression ; ) statement
|
||||
//
|
||||
case 362: { action. consumeStatementUPCForallLoop(true, false, false, false); break;
|
||||
case 362: { action. consumeStatementUPCForallLoop(true, false, true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 364: affinity ::= continue
|
||||
// Rule 363: iteration_statement ::= upc_forall ( declaration ; ; affinity ) statement
|
||||
//
|
||||
case 364: { action. consumeToken(); break;
|
||||
case 363: { action. consumeStatementUPCForallLoop(true, false, false, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 364: iteration_statement ::= upc_forall ( declaration ; ; ) statement
|
||||
//
|
||||
case 364: { action. consumeStatementUPCForallLoop(true, false, false, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 366: affinity ::= continue
|
||||
//
|
||||
case 366: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -185,17 +185,17 @@ private UPCParserAction action;
|
|||
private IASTCompletionNode compNode;
|
||||
|
||||
|
||||
public UPCSizeofExpressionParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Set<IParser.Options> options) {
|
||||
initActions(options);
|
||||
public UPCSizeofExpressionParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Map<String,String> properties) {
|
||||
initActions(properties);
|
||||
action.initializeTranslationUnit(scanner, builtinBindingsProvider, index);
|
||||
CPreprocessorAdapter.runCPreprocessor(scanner, this, tokenMap);
|
||||
}
|
||||
|
||||
private void initActions(Set<IParser.Options> options) {
|
||||
private void initActions(Map<String,String> properties) {
|
||||
ScopedStack<Object> astStack = new ScopedStack<Object>();
|
||||
|
||||
action = new UPCParserAction (this, astStack, new UPCASTNodeFactory() , UPCSecondaryParserFactory.getDefault() );
|
||||
action.setParserOptions(options);
|
||||
action.setParserProperties(properties);
|
||||
|
||||
|
||||
}
|
||||
|
@ -252,8 +252,8 @@ public void setTokens(List<IToken> tokens) {
|
|||
addToken(new Token(null, 0, 0, UPCSizeofExpressionParsersym.TK_EOF_TOKEN));
|
||||
}
|
||||
|
||||
public UPCSizeofExpressionParser(ITokenStream stream, Set<IParser.Options> options) { // constructor for creating secondary parser
|
||||
initActions(options);
|
||||
public UPCSizeofExpressionParser(ITokenStream stream, Map<String,String> properties) { // constructor for creating secondary parser
|
||||
initActions(properties);
|
||||
tokenMap = new TokenMap(UPCSizeofExpressionParsersym.orderedTerminalSymbols, stream.getOrderedTerminalSymbols());
|
||||
}
|
||||
|
||||
|
@ -348,7 +348,7 @@ public UPCSizeofExpressionParser(ITokenStream stream, Set<IParser.Options> optio
|
|||
}
|
||||
|
||||
//
|
||||
// Rule 28: postfix_expression ::= ( type_id ) { <openscope-ast> initializer_list comma_opt }
|
||||
// Rule 28: postfix_expression ::= ( type_id ) initializer_list
|
||||
//
|
||||
case 28: { action. consumeExpressionTypeIdInitializer(); break;
|
||||
}
|
||||
|
@ -1164,381 +1164,381 @@ public UPCSizeofExpressionParser(ITokenStream stream, Set<IParser.Options> optio
|
|||
}
|
||||
|
||||
//
|
||||
// Rule 281: initializer ::= start_initializer_list { <openscope-ast> initializer_list comma_opt } end_initializer_list
|
||||
//
|
||||
case 281: { action. consumeInitializerList(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 282: initializer ::= { <openscope-ast> }
|
||||
// Rule 282: initializer_list ::= start_initializer_list { <openscope-ast> initializer_seq comma_opt } end_initializer_list
|
||||
//
|
||||
case 282: { action. consumeInitializerList(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 283: start_initializer_list ::= $Empty
|
||||
// Rule 283: initializer_list ::= { <openscope-ast> }
|
||||
//
|
||||
case 283: { action. initializerListStart(); break;
|
||||
case 283: { action. consumeInitializerList(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 284: end_initializer_list ::= $Empty
|
||||
// Rule 284: start_initializer_list ::= $Empty
|
||||
//
|
||||
case 284: { action. initializerListEnd(); break;
|
||||
case 284: { action. initializerListStart(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 289: designated_initializer ::= <openscope-ast> designation = initializer
|
||||
// Rule 285: end_initializer_list ::= $Empty
|
||||
//
|
||||
case 289: { action. consumeInitializerDesignated(); break;
|
||||
case 285: { action. initializerListEnd(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 293: designator_base ::= [ constant_expression ]
|
||||
// Rule 290: designated_initializer ::= <openscope-ast> designation = initializer
|
||||
//
|
||||
case 293: { action. consumeDesignatorArray(); break;
|
||||
case 290: { action. consumeInitializerDesignated(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 294: designator_base ::= . identifier_token
|
||||
// Rule 294: designator_base ::= [ constant_expression ]
|
||||
//
|
||||
case 294: { action. consumeDesignatorField(); break;
|
||||
case 294: { action. consumeDesignatorArray(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 295: designator ::= [ constant_expression ]
|
||||
// Rule 295: designator_base ::= . identifier_token
|
||||
//
|
||||
case 295: { action. consumeDesignatorArray(); break;
|
||||
case 295: { action. consumeDesignatorField(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 296: designator ::= . identifier_token
|
||||
// Rule 296: designator ::= [ constant_expression ]
|
||||
//
|
||||
case 296: { action. consumeDesignatorField(); break;
|
||||
case 296: { action. consumeDesignatorArray(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 297: translation_unit ::= external_declaration_list
|
||||
// Rule 297: designator ::= . identifier_token
|
||||
//
|
||||
case 297: { action. consumeTranslationUnit(); break;
|
||||
case 297: { action. consumeDesignatorField(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 298: translation_unit ::= external_declaration_list
|
||||
//
|
||||
case 298: { action. consumeTranslationUnit(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 298: translation_unit ::= $Empty
|
||||
// Rule 299: translation_unit ::= $Empty
|
||||
//
|
||||
case 298: { action. consumeTranslationUnit(); break;
|
||||
case 299: { action. consumeTranslationUnit(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 303: external_declaration ::= ;
|
||||
// Rule 304: external_declaration ::= ;
|
||||
//
|
||||
case 303: { action. consumeDeclarationEmpty(); break;
|
||||
case 304: { action. consumeDeclarationEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 304: external_declaration ::= ERROR_TOKEN
|
||||
// Rule 305: external_declaration ::= ERROR_TOKEN
|
||||
//
|
||||
case 304: { action. consumeDeclarationProblem(); break;
|
||||
case 305: { action. consumeDeclarationProblem(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 307: function_definition ::= declaration_specifiers <openscope-ast> function_declarator function_body
|
||||
// Rule 309: function_definition ::= <openscope-ast> function_declarator function_body
|
||||
//
|
||||
case 307: { action. consumeFunctionDefinition(true); break;
|
||||
case 309: { action. consumeFunctionDefinition(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 308: function_definition ::= <openscope-ast> function_declarator function_body
|
||||
// Rule 310: function_definition ::= declaration_specifiers <openscope-ast> knr_function_declarator <openscope-ast> declaration_list compound_statement
|
||||
//
|
||||
case 308: { action. consumeFunctionDefinition(false); break;
|
||||
case 310: { action. consumeFunctionDefinitionKnR(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 309: function_definition ::= declaration_specifiers <openscope-ast> knr_function_declarator <openscope-ast> declaration_list compound_statement
|
||||
// Rule 311: normal_function_definition ::= declaration_specifiers <openscope-ast> function_declarator function_body
|
||||
//
|
||||
case 309: { action. consumeFunctionDefinitionKnR(); break;
|
||||
case 311: { action. consumeFunctionDefinition(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 310: function_body ::= { }
|
||||
// Rule 312: function_body ::= { }
|
||||
//
|
||||
case 310: { action. consumeStatementCompoundStatement(false); break;
|
||||
case 312: { action. consumeStatementCompoundStatement(false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 311: function_body ::= { <openscope-ast> block_item_list }
|
||||
// Rule 313: function_body ::= { <openscope-ast> block_item_list }
|
||||
//
|
||||
case 311: { action. consumeStatementCompoundStatement(true); break;
|
||||
case 313: { action. consumeStatementCompoundStatement(true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 313: no_sizeof_type_id_start ::= ERROR_TOKEN
|
||||
// Rule 315: no_sizeof_type_id_start ::= ERROR_TOKEN
|
||||
//
|
||||
case 313: { action. consumeEmpty(); break;
|
||||
case 315: { action. consumeEmpty(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 314: literal ::= MYTHREAD
|
||||
// Rule 316: literal ::= MYTHREAD
|
||||
//
|
||||
case 314: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_mythread); break;
|
||||
case 316: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_mythread); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 315: literal ::= THREADS
|
||||
// Rule 317: literal ::= THREADS
|
||||
//
|
||||
case 315: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_threads); break;
|
||||
case 317: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_threads); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 316: literal ::= UPC_MAX_BLOCKSIZE
|
||||
// Rule 318: literal ::= UPC_MAX_BLOCKSIZE
|
||||
//
|
||||
case 316: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_upc_max_block_size); break;
|
||||
case 318: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_upc_max_block_size); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 317: unary_expression ::= upc_localsizeof unary_expression
|
||||
// Rule 319: unary_expression ::= upc_localsizeof unary_expression
|
||||
//
|
||||
case 317: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_localsizeof); break;
|
||||
case 319: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_localsizeof); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 318: unary_expression ::= upc_blocksizeof unary_expression
|
||||
// Rule 320: unary_expression ::= upc_blocksizeof unary_expression
|
||||
//
|
||||
case 318: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_blocksizeof); break;
|
||||
case 320: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_blocksizeof); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 319: unary_expression ::= upc_elemsizeof unary_expression
|
||||
// Rule 321: unary_expression ::= upc_elemsizeof unary_expression
|
||||
//
|
||||
case 319: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_elemsizeof); break;
|
||||
case 321: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_elemsizeof); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 323: shared_type_qualifier ::= shared
|
||||
//
|
||||
case 323: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 324: reference_type_qualifier ::= relaxed
|
||||
//
|
||||
case 324: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 325: reference_type_qualifier ::= strict
|
||||
// Rule 325: shared_type_qualifier ::= shared
|
||||
//
|
||||
case 325: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 326: layout_qualifier ::= [ constant_expression ]
|
||||
// Rule 326: reference_type_qualifier ::= relaxed
|
||||
//
|
||||
case 326: { action. consumeLayoutQualifier(true, false); break;
|
||||
case 326: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 327: layout_qualifier ::= [ * ]
|
||||
// Rule 327: reference_type_qualifier ::= strict
|
||||
//
|
||||
case 327: { action. consumeLayoutQualifier(false, true); break;
|
||||
case 327: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 328: layout_qualifier ::= [ ]
|
||||
// Rule 328: layout_qualifier ::= [ constant_expression ]
|
||||
//
|
||||
case 328: { action. consumeLayoutQualifier(false, false); break;
|
||||
case 328: { action. consumeLayoutQualifier(true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 330: synchronization_statement ::= upc_notify expression ;
|
||||
// Rule 329: layout_qualifier ::= [ * ]
|
||||
//
|
||||
case 330: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_notify, true); break;
|
||||
case 329: { action. consumeLayoutQualifier(false, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 331: synchronization_statement ::= upc_notify ;
|
||||
// Rule 330: layout_qualifier ::= [ ]
|
||||
//
|
||||
case 331: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_notify, false); break;
|
||||
case 330: { action. consumeLayoutQualifier(false, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 332: synchronization_statement ::= upc_wait expression ;
|
||||
// Rule 332: synchronization_statement ::= upc_notify expression ;
|
||||
//
|
||||
case 332: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_wait, true); break;
|
||||
case 332: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_notify, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 333: synchronization_statement ::= upc_wait ;
|
||||
// Rule 333: synchronization_statement ::= upc_notify ;
|
||||
//
|
||||
case 333: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_wait, false); break;
|
||||
case 333: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_notify, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 334: synchronization_statement ::= upc_barrier expression ;
|
||||
// Rule 334: synchronization_statement ::= upc_wait expression ;
|
||||
//
|
||||
case 334: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_barrier, true); break;
|
||||
case 334: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_wait, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 335: synchronization_statement ::= upc_barrier ;
|
||||
// Rule 335: synchronization_statement ::= upc_wait ;
|
||||
//
|
||||
case 335: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_barrier, false); break;
|
||||
case 335: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_wait, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 336: synchronization_statement ::= upc_fence ;
|
||||
// Rule 336: synchronization_statement ::= upc_barrier expression ;
|
||||
//
|
||||
case 336: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_fence, false); break;
|
||||
case 336: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_barrier, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 337: iteration_statement ::= upc_forall ( expression ; expression ; expression ; affinity ) statement
|
||||
// Rule 337: synchronization_statement ::= upc_barrier ;
|
||||
//
|
||||
case 337: { action. consumeStatementUPCForallLoop(true, true, true, true); break;
|
||||
case 337: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_barrier, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 338: iteration_statement ::= upc_forall ( expression ; expression ; expression ; ) statement
|
||||
// Rule 338: synchronization_statement ::= upc_fence ;
|
||||
//
|
||||
case 338: { action. consumeStatementUPCForallLoop(true, true, true, false); break;
|
||||
case 338: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_fence, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 339: iteration_statement ::= upc_forall ( expression ; expression ; ; affinity ) statement
|
||||
// Rule 339: iteration_statement ::= upc_forall ( expression ; expression ; expression ; affinity ) statement
|
||||
//
|
||||
case 339: { action. consumeStatementUPCForallLoop(true, true, false, true); break;
|
||||
case 339: { action. consumeStatementUPCForallLoop(true, true, true, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 340: iteration_statement ::= upc_forall ( expression ; expression ; ; ) statement
|
||||
// Rule 340: iteration_statement ::= upc_forall ( expression ; expression ; expression ; ) statement
|
||||
//
|
||||
case 340: { action. consumeStatementUPCForallLoop(true, true, false, false); break;
|
||||
case 340: { action. consumeStatementUPCForallLoop(true, true, true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 341: iteration_statement ::= upc_forall ( expression ; ; expression ; affinity ) statement
|
||||
// Rule 341: iteration_statement ::= upc_forall ( expression ; expression ; ; affinity ) statement
|
||||
//
|
||||
case 341: { action. consumeStatementUPCForallLoop(true, false, true, true); break;
|
||||
case 341: { action. consumeStatementUPCForallLoop(true, true, false, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 342: iteration_statement ::= upc_forall ( expression ; ; expression ; ) statement
|
||||
// Rule 342: iteration_statement ::= upc_forall ( expression ; expression ; ; ) statement
|
||||
//
|
||||
case 342: { action. consumeStatementUPCForallLoop(true, false, true, false); break;
|
||||
case 342: { action. consumeStatementUPCForallLoop(true, true, false, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 343: iteration_statement ::= upc_forall ( expression ; ; ; affinity ) statement
|
||||
// Rule 343: iteration_statement ::= upc_forall ( expression ; ; expression ; affinity ) statement
|
||||
//
|
||||
case 343: { action. consumeStatementUPCForallLoop(true, false, false, true); break;
|
||||
case 343: { action. consumeStatementUPCForallLoop(true, false, true, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 344: iteration_statement ::= upc_forall ( expression ; ; ; ) statement
|
||||
// Rule 344: iteration_statement ::= upc_forall ( expression ; ; expression ; ) statement
|
||||
//
|
||||
case 344: { action. consumeStatementUPCForallLoop(true, false, false, false); break;
|
||||
case 344: { action. consumeStatementUPCForallLoop(true, false, true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 345: iteration_statement ::= upc_forall ( ; expression ; expression ; affinity ) statement
|
||||
// Rule 345: iteration_statement ::= upc_forall ( expression ; ; ; affinity ) statement
|
||||
//
|
||||
case 345: { action. consumeStatementUPCForallLoop(false, true, true, true); break;
|
||||
case 345: { action. consumeStatementUPCForallLoop(true, false, false, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 346: iteration_statement ::= upc_forall ( ; expression ; expression ; ) statement
|
||||
// Rule 346: iteration_statement ::= upc_forall ( expression ; ; ; ) statement
|
||||
//
|
||||
case 346: { action. consumeStatementUPCForallLoop(false, true, true, false); break;
|
||||
case 346: { action. consumeStatementUPCForallLoop(true, false, false, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 347: iteration_statement ::= upc_forall ( ; expression ; ; affinity ) statement
|
||||
// Rule 347: iteration_statement ::= upc_forall ( ; expression ; expression ; affinity ) statement
|
||||
//
|
||||
case 347: { action. consumeStatementUPCForallLoop(false, true, false, true); break;
|
||||
case 347: { action. consumeStatementUPCForallLoop(false, true, true, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 348: iteration_statement ::= upc_forall ( ; expression ; ; ) statement
|
||||
// Rule 348: iteration_statement ::= upc_forall ( ; expression ; expression ; ) statement
|
||||
//
|
||||
case 348: { action. consumeStatementUPCForallLoop(false, true, false, false); break;
|
||||
case 348: { action. consumeStatementUPCForallLoop(false, true, true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 349: iteration_statement ::= upc_forall ( ; ; expression ; affinity ) statement
|
||||
// Rule 349: iteration_statement ::= upc_forall ( ; expression ; ; affinity ) statement
|
||||
//
|
||||
case 349: { action. consumeStatementUPCForallLoop(false, false, true, true); break;
|
||||
case 349: { action. consumeStatementUPCForallLoop(false, true, false, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 350: iteration_statement ::= upc_forall ( ; ; expression ; ) statement
|
||||
// Rule 350: iteration_statement ::= upc_forall ( ; expression ; ; ) statement
|
||||
//
|
||||
case 350: { action. consumeStatementUPCForallLoop(false, false, true, false); break;
|
||||
case 350: { action. consumeStatementUPCForallLoop(false, true, false, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 351: iteration_statement ::= upc_forall ( ; ; ; affinity ) statement
|
||||
// Rule 351: iteration_statement ::= upc_forall ( ; ; expression ; affinity ) statement
|
||||
//
|
||||
case 351: { action. consumeStatementUPCForallLoop(false, false, false, true); break;
|
||||
case 351: { action. consumeStatementUPCForallLoop(false, false, true, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 352: iteration_statement ::= upc_forall ( ; ; ; ) statement
|
||||
// Rule 352: iteration_statement ::= upc_forall ( ; ; expression ; ) statement
|
||||
//
|
||||
case 352: { action. consumeStatementUPCForallLoop(false, false, false, false); break;
|
||||
case 352: { action. consumeStatementUPCForallLoop(false, false, true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 353: iteration_statement ::= upc_forall ( declaration expression ; expression ; affinity ) statement
|
||||
// Rule 353: iteration_statement ::= upc_forall ( ; ; ; affinity ) statement
|
||||
//
|
||||
case 353: { action. consumeStatementUPCForallLoop(true, true, true, true); break;
|
||||
case 353: { action. consumeStatementUPCForallLoop(false, false, false, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 354: iteration_statement ::= upc_forall ( declaration expression ; expression ; ) statement
|
||||
// Rule 354: iteration_statement ::= upc_forall ( ; ; ; ) statement
|
||||
//
|
||||
case 354: { action. consumeStatementUPCForallLoop(true, true, true, false); break;
|
||||
case 354: { action. consumeStatementUPCForallLoop(false, false, false, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 355: iteration_statement ::= upc_forall ( declaration expression ; ; affinity ) statement
|
||||
// Rule 355: iteration_statement ::= upc_forall ( declaration expression ; expression ; affinity ) statement
|
||||
//
|
||||
case 355: { action. consumeStatementUPCForallLoop(true, true, false, true); break;
|
||||
case 355: { action. consumeStatementUPCForallLoop(true, true, true, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 356: iteration_statement ::= upc_forall ( declaration expression ; ; ) statement
|
||||
// Rule 356: iteration_statement ::= upc_forall ( declaration expression ; expression ; ) statement
|
||||
//
|
||||
case 356: { action. consumeStatementUPCForallLoop(true, true, false, false); break;
|
||||
case 356: { action. consumeStatementUPCForallLoop(true, true, true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 357: iteration_statement ::= upc_forall ( declaration ; expression ; affinity ) statement
|
||||
// Rule 357: iteration_statement ::= upc_forall ( declaration expression ; ; affinity ) statement
|
||||
//
|
||||
case 357: { action. consumeStatementUPCForallLoop(true, false, true, true); break;
|
||||
case 357: { action. consumeStatementUPCForallLoop(true, true, false, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 358: iteration_statement ::= upc_forall ( declaration ; expression ; ) statement
|
||||
// Rule 358: iteration_statement ::= upc_forall ( declaration expression ; ; ) statement
|
||||
//
|
||||
case 358: { action. consumeStatementUPCForallLoop(true, false, true, false); break;
|
||||
case 358: { action. consumeStatementUPCForallLoop(true, true, false, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 359: iteration_statement ::= upc_forall ( declaration ; ; affinity ) statement
|
||||
// Rule 359: iteration_statement ::= upc_forall ( declaration ; expression ; affinity ) statement
|
||||
//
|
||||
case 359: { action. consumeStatementUPCForallLoop(true, false, false, true); break;
|
||||
case 359: { action. consumeStatementUPCForallLoop(true, false, true, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 360: iteration_statement ::= upc_forall ( declaration ; ; ) statement
|
||||
// Rule 360: iteration_statement ::= upc_forall ( declaration ; expression ; ) statement
|
||||
//
|
||||
case 360: { action. consumeStatementUPCForallLoop(true, false, false, false); break;
|
||||
case 360: { action. consumeStatementUPCForallLoop(true, false, true, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 362: affinity ::= continue
|
||||
// Rule 361: iteration_statement ::= upc_forall ( declaration ; ; affinity ) statement
|
||||
//
|
||||
case 362: { action. consumeToken(); break;
|
||||
case 361: { action. consumeStatementUPCForallLoop(true, false, false, true); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 362: iteration_statement ::= upc_forall ( declaration ; ; ) statement
|
||||
//
|
||||
case 362: { action. consumeStatementUPCForallLoop(true, false, false, false); break;
|
||||
}
|
||||
|
||||
//
|
||||
// Rule 364: affinity ::= continue
|
||||
//
|
||||
case 364: { action. consumeToken(); break;
|
||||
}
|
||||
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -40,7 +40,7 @@ public interface UPCSizeofExpressionParsersym {
|
|||
TK_short = 45,
|
||||
TK_signed = 46,
|
||||
TK_sizeof = 18,
|
||||
TK_static = 32,
|
||||
TK_static = 19,
|
||||
TK_struct = 54,
|
||||
TK_switch = 100,
|
||||
TK_typedef = 37,
|
||||
|
@ -52,27 +52,27 @@ public interface UPCSizeofExpressionParsersym {
|
|||
TK__Bool = 49,
|
||||
TK__Complex = 50,
|
||||
TK__Imaginary = 51,
|
||||
TK_integer = 19,
|
||||
TK_floating = 20,
|
||||
TK_charconst = 21,
|
||||
TK_stringlit = 22,
|
||||
TK_integer = 20,
|
||||
TK_floating = 21,
|
||||
TK_charconst = 22,
|
||||
TK_stringlit = 23,
|
||||
TK_identifier = 1,
|
||||
TK_Completion = 3,
|
||||
TK_EndOfCompletion = 5,
|
||||
TK_Invalid = 102,
|
||||
TK_LeftBracket = 15,
|
||||
TK_LeftBracket = 14,
|
||||
TK_LeftParen = 2,
|
||||
TK_LeftBrace = 23,
|
||||
TK_LeftBrace = 24,
|
||||
TK_Dot = 61,
|
||||
TK_Arrow = 76,
|
||||
TK_PlusPlus = 16,
|
||||
TK_MinusMinus = 17,
|
||||
TK_And = 14,
|
||||
TK_And = 15,
|
||||
TK_Star = 4,
|
||||
TK_Plus = 9,
|
||||
TK_Minus = 10,
|
||||
TK_Tilde = 24,
|
||||
TK_Bang = 25,
|
||||
TK_Plus = 12,
|
||||
TK_Minus = 13,
|
||||
TK_Tilde = 25,
|
||||
TK_Bang = 26,
|
||||
TK_Slash = 62,
|
||||
TK_Percent = 63,
|
||||
TK_RightShift = 56,
|
||||
|
@ -106,16 +106,16 @@ public interface UPCSizeofExpressionParsersym {
|
|||
TK_RightParen = 39,
|
||||
TK_RightBrace = 52,
|
||||
TK_SemiColon = 75,
|
||||
TK_MYTHREAD = 26,
|
||||
TK_THREADS = 27,
|
||||
TK_UPC_MAX_BLOCKSIZE = 28,
|
||||
TK_relaxed = 11,
|
||||
TK_shared = 12,
|
||||
TK_strict = 13,
|
||||
TK_MYTHREAD = 27,
|
||||
TK_THREADS = 28,
|
||||
TK_UPC_MAX_BLOCKSIZE = 29,
|
||||
TK_relaxed = 9,
|
||||
TK_shared = 10,
|
||||
TK_strict = 11,
|
||||
TK_upc_barrier = 103,
|
||||
TK_upc_localsizeof = 29,
|
||||
TK_upc_blocksizeof = 30,
|
||||
TK_upc_elemsizeof = 31,
|
||||
TK_upc_localsizeof = 30,
|
||||
TK_upc_blocksizeof = 31,
|
||||
TK_upc_elemsizeof = 32,
|
||||
TK_upc_notify = 104,
|
||||
TK_upc_fence = 105,
|
||||
TK_upc_wait = 106,
|
||||
|
@ -133,16 +133,17 @@ public interface UPCSizeofExpressionParsersym {
|
|||
"const",
|
||||
"restrict",
|
||||
"volatile",
|
||||
"Plus",
|
||||
"Minus",
|
||||
"relaxed",
|
||||
"shared",
|
||||
"strict",
|
||||
"And",
|
||||
"Plus",
|
||||
"Minus",
|
||||
"LeftBracket",
|
||||
"And",
|
||||
"PlusPlus",
|
||||
"MinusMinus",
|
||||
"sizeof",
|
||||
"static",
|
||||
"integer",
|
||||
"floating",
|
||||
"charconst",
|
||||
|
@ -156,7 +157,6 @@ public interface UPCSizeofExpressionParsersym {
|
|||
"upc_localsizeof",
|
||||
"upc_blocksizeof",
|
||||
"upc_elemsizeof",
|
||||
"static",
|
||||
"auto",
|
||||
"extern",
|
||||
"inline",
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
|
||||
XlcLanguageOptionsPreferencePage_link=These settings are project-specific. The settings listed here override <a href="org.eclipse.cdt.core.lrparser.xlc.ui.XlcLanguagePreferencePage">workspace-wide</a> language settings.
|
||||
XlcLanguageOptionsPreferencePage_group=Support For XL C/C++ Language Extensions
|
||||
XlcLanguageOptionsPreferencePage_preference_vectors=Support vector types
|
||||
|
||||
XlcLanguageOptionsPreferencePage_preference_vectors=Allow vector type declarations
|
||||
XlcLanguageOptionsPreferencePage_preference_decimals=Allow decimal floating-point types (_Decimal32, _Decimal64, _Decimal128)
|
||||
|
||||
|
|
|
@ -39,25 +39,10 @@ public class XlcLanguageOptionsPreferencePage extends PreferencePage implements
|
|||
|
||||
private IAdaptable element;
|
||||
|
||||
private Button button_vectors;
|
||||
private Button buttonVectors;
|
||||
private Button buttonDecimals;
|
||||
|
||||
|
||||
public IAdaptable getElement() {
|
||||
return element;
|
||||
}
|
||||
|
||||
public void setElement(IAdaptable element) {
|
||||
this.element = element;
|
||||
}
|
||||
|
||||
public boolean isPropertyPage() {
|
||||
return element != null;
|
||||
}
|
||||
|
||||
public void init(IWorkbench workbench) {
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Control createContents(Composite parent) {
|
||||
Composite page = ControlFactory.createComposite(parent, 1);
|
||||
|
@ -74,8 +59,8 @@ public class XlcLanguageOptionsPreferencePage extends PreferencePage implements
|
|||
|
||||
Composite group = ControlFactory.createGroup(page, PreferenceMessages.XlcLanguageOptionsPreferencePage_group, 1);
|
||||
|
||||
button_vectors = ControlFactory.createCheckBox(group, PreferenceMessages.XlcLanguageOptionsPreferencePage_preference_vectors);
|
||||
initCheckbox(button_vectors, XlcPreferenceKeys.KEY_SUPPORT_VECTOR_TYPES);
|
||||
buttonVectors = ControlFactory.createCheckBox(group, PreferenceMessages.XlcLanguageOptionsPreferencePage_preference_vectors);
|
||||
initCheckbox(buttonVectors, XlcPreferenceKeys.KEY_SUPPORT_VECTOR_TYPES);
|
||||
|
||||
return page;
|
||||
}
|
||||
|
@ -103,14 +88,14 @@ public class XlcLanguageOptionsPreferencePage extends PreferencePage implements
|
|||
|
||||
@Override
|
||||
protected void performDefaults() {
|
||||
button_vectors.setSelection(Boolean.valueOf(XlcLanguagePreferences.getDefaultPreference(XlcPreferenceKeys.KEY_SUPPORT_VECTOR_TYPES)));
|
||||
buttonVectors.setSelection(Boolean.valueOf(XlcLanguagePreferences.getDefaultPreference(XlcPreferenceKeys.KEY_SUPPORT_VECTOR_TYPES)));
|
||||
|
||||
super.performDefaults();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean performOk() {
|
||||
setPreference(XlcPreferenceKeys.KEY_SUPPORT_VECTOR_TYPES, button_vectors.getSelection(), getProject());
|
||||
setPreference(XlcPreferenceKeys.KEY_SUPPORT_VECTOR_TYPES, buttonVectors.getSelection(), getProject());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -126,5 +111,22 @@ public class XlcLanguageOptionsPreferencePage extends PreferencePage implements
|
|||
XlcLanguagePreferences.setWorkspacePreference(key, String.valueOf(val));
|
||||
}
|
||||
|
||||
|
||||
|
||||
public IAdaptable getElement() {
|
||||
return element;
|
||||
}
|
||||
|
||||
public void setElement(IAdaptable element) {
|
||||
this.element = element;
|
||||
}
|
||||
|
||||
public boolean isPropertyPage() {
|
||||
return element != null;
|
||||
}
|
||||
|
||||
public void init(IWorkbench workbench) {
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue