diff options
author | Andrew Gvozdev | 2011-11-17 22:34:21 +0000 |
---|---|---|
committer | Andrew Gvozdev | 2011-11-17 22:34:21 +0000 |
commit | 2a1cddd71635c39ae336ba43bb89cecbfb09e21f (patch) | |
tree | c7a504d11610c16c23c34e29bba23ba0b280bb81 /upc | |
parent | e47db971decd8fd15ce52984be3de50b6eaa24de (diff) | |
download | org.eclipse.cdt-2a1cddd71635c39ae336ba43bb89cecbfb09e21f.tar.gz org.eclipse.cdt-2a1cddd71635c39ae336ba43bb89cecbfb09e21f.tar.xz org.eclipse.cdt-2a1cddd71635c39ae336ba43bb89cecbfb09e21f.zip |
auto-clean: @Override annotations + organize imports + unnecessary
casts/$NON-NLS + trailing white spaces
Diffstat (limited to 'upc')
35 files changed, 2712 insertions, 2307 deletions
diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/parser/upc/DOMToUPCTokenMap.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/parser/upc/DOMToUPCTokenMap.java index 4db9edffacb..dc986360ea5 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/parser/upc/DOMToUPCTokenMap.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/parser/upc/DOMToUPCTokenMap.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -21,30 +21,33 @@ import org.eclipse.cdt.core.parser.IToken; /** * Maps token kinds from CPreprocessor to the tokens kinds * created by LPG. - * + * * TODO UPC keywords need to be syntax highlighted - * + * * @author Mike Kucera */ @SuppressWarnings("nls") public class DOMToUPCTokenMap implements IDOMTokenMap { - + + @Override public int getEOFTokenKind() { return TK_EOF_TOKEN; } + @Override public int getEOCTokenKind() { return TK_EndOfCompletion; } - + + @Override public int mapKind(IToken token) { - + switch(token.getType()) { - case tIDENTIFIER : + case tIDENTIFIER : Integer keywordKind = UPCKeyword.getTokenKind(token.getCharImage()); return keywordKind == null ? TK_identifier : keywordKind; - + case tINTEGER : return TK_integer; case tCOLON : return TK_Colon; case tSEMI : return TK_SemiColon; @@ -93,11 +96,11 @@ public class DOMToUPCTokenMap implements IDOMTokenMap { case tDOT : return TK_Dot; case tDIVASSIGN : return TK_SlashAssign; case tDIV : return TK_Slash; - + case t_auto : return TK_auto; case t_break : return TK_break; case t_case : return TK_case; - case t_char : return TK_char; + case t_char : return TK_char; case t_const : return TK_const; case t_continue : return TK_continue; case t_default : return TK_default; @@ -141,15 +144,15 @@ public class DOMToUPCTokenMap implements IDOMTokenMap { case t__Imaginary : return TK__Imaginary; case t_restrict : return TK_restrict; case tCOMPLETION : return TK_Completion; - case tEOC : return TK_EndOfCompletion; + case tEOC : return TK_EndOfCompletion; case tEND_OF_INPUT : return TK_EOF_TOKEN; - + default: - assert false : "token not recognized by the UPC parser: " + token.getType(); + assert false : "token not recognized by the UPC parser: " + token.getType(); return TK_Invalid; } } - + } diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/parser/upc/IUPCNodeFactory.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/parser/upc/IUPCNodeFactory.java index 5e855c0a6e9..e79423a48dd 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/parser/upc/IUPCNodeFactory.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/parser/upc/IUPCNodeFactory.java @@ -26,7 +26,7 @@ import org.eclipse.cdt.core.dom.upc.ast.IUPCASTTypedefNameSpecifier; public interface IUPCNodeFactory extends ICNodeFactory { public void setUseUPCSizeofExpressions(int op); - + public void setUseC99SizeofExpressions(); public IUPCASTKeywordExpression newKeywordExpression(int keywordKind); @@ -38,16 +38,21 @@ public interface IUPCNodeFactory extends ICNodeFactory { IASTExpression condition, IASTExpression iterationExpression, IASTStatement body, IASTExpression affinity); + @Override public IUPCASTSimpleDeclSpecifier newSimpleDeclSpecifier(); + @Override public IUPCASTCompositeTypeSpecifier newCompositeTypeSpecifier(int key, IASTName name); + @Override public IUPCASTElaboratedTypeSpecifier newElaboratedTypeSpecifier(int kind, IASTName name); + @Override public IUPCASTEnumerationSpecifier newEnumerationSpecifier(IASTName name); + @Override public IUPCASTTypedefNameSpecifier newTypedefNameSpecifier(IASTName name); }
\ No newline at end of file diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/parser/upc/UPCASTNodeFactory.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/parser/upc/UPCASTNodeFactory.java index 395a2f88aec..3eb5bf80e43 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/parser/upc/UPCASTNodeFactory.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/parser/upc/UPCASTNodeFactory.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -39,7 +39,7 @@ import org.eclipse.cdt.internal.core.dom.parser.upc.ast.UPCASTUnarySizeofExpress /** * Creates AST nodes that are specific to the UPC parser. - * + * * The methods in ASTNodeFactory that build nodes for declaration * specifiers are overridden here to replace those nodes with the UPC nodes for * declaration specifiers. These UPC specific nodes add support @@ -48,32 +48,34 @@ import org.eclipse.cdt.internal.core.dom.parser.upc.ast.UPCASTUnarySizeofExpress @SuppressWarnings("restriction") public class UPCASTNodeFactory extends CNodeFactory implements IUPCNodeFactory { - + private boolean useUPCSizeofExpressions = false; private int currentUPCSizofExpressionOperator = 0; - - + + + @Override public void setUseUPCSizeofExpressions(int op) { useUPCSizeofExpressions = true; currentUPCSizofExpressionOperator = op; } - + + @Override public void setUseC99SizeofExpressions() { useUPCSizeofExpressions = false; } - - - + + + @Override public IASTTypeIdExpression newTypeIdExpression(int operator, IASTTypeId typeId) { if(useUPCSizeofExpressions) { assert operator == IASTTypeIdExpression.op_sizeof; return new UPCASTTypeIdSizeofExpression(currentUPCSizofExpressionOperator, typeId); } - + return super.newTypeIdExpression(operator, typeId); } - + @Override public IASTUnaryExpression newUnaryExpression(int operator, IASTExpression operand) { @@ -81,21 +83,24 @@ public class UPCASTNodeFactory extends CNodeFactory implements IUPCNodeFactory { assert operator == IASTUnaryExpression.op_sizeof; return new UPCASTUnarySizeofExpression(currentUPCSizofExpressionOperator, operand); } - + return super.newUnaryExpression(operator, operand); } - + + @Override public IUPCASTKeywordExpression newKeywordExpression(int keywordKind) { return new UPCASTKeywordExpression(keywordKind); } - + + @Override public IUPCASTSynchronizationStatement newSyncronizationStatment(IASTExpression barrierExpression, int statmentKind) { return new UPCASTSynchronizationStatement(barrierExpression, statmentKind); } - + + @Override public IUPCASTForallStatement newForallStatement(IASTStatement init, IASTExpression condition, IASTExpression iterationExpression, IASTStatement body, IASTExpression affinity) { return new UPCASTForallStatement(init, condition, iterationExpression, body, affinity); @@ -106,25 +111,25 @@ public class UPCASTNodeFactory extends CNodeFactory implements IUPCNodeFactory { public IUPCASTSimpleDeclSpecifier newSimpleDeclSpecifier() { return new UPCASTSimpleDeclSpecifier(); } - + @Override public IUPCASTCompositeTypeSpecifier newCompositeTypeSpecifier(int key, IASTName name) { return new UPCASTCompositeTypeSpecifier(key, name); } - + @Override public IUPCASTElaboratedTypeSpecifier newElaboratedTypeSpecifier(int kind, IASTName name) { return new UPCASTElaboratedTypeSpecifier(kind, name); } - + @Override public IUPCASTEnumerationSpecifier newEnumerationSpecifier(IASTName name) { return new UPCASTEnumerationSpecifier(name); } - + @Override public IUPCASTTypedefNameSpecifier newTypedefNameSpecifier(IASTName name) { diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/parser/upc/UPCSecondaryParserFactory.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/parser/upc/UPCSecondaryParserFactory.java index de52c1b1d3f..0bf9c13c630 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/parser/upc/UPCSecondaryParserFactory.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/parser/upc/UPCSecondaryParserFactory.java @@ -24,21 +24,24 @@ import org.eclipse.cdt.internal.core.dom.parser.upc.UPCSizeofExpressionParser; public class UPCSecondaryParserFactory implements ISecondaryParserFactory{ private static final UPCSecondaryParserFactory DEFAULT_INSTANCE = new UPCSecondaryParserFactory(); - + public static UPCSecondaryParserFactory getDefault() { return DEFAULT_INSTANCE; } + @Override public ISecondaryParser<IASTExpression> getExpressionParser(ITokenStream stream, Map<String,String> properties) { return new UPCExpressionParser(stream, properties); } + @Override public ISecondaryParser<IASTExpression> getNoCastExpressionParser(ITokenStream stream, Map<String,String> properties) { return new UPCNoCastExpressionParser(stream, properties); } + @Override public ISecondaryParser<IASTExpression> getSizeofExpressionParser(ITokenStream stream, Map<String,String> properties) { return new UPCSizeofExpressionParser(stream, properties); } - + } diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/UPCLanguage.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/UPCLanguage.java index 47b8b199e40..4a31edbda78 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/UPCLanguage.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/UPCLanguage.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -31,46 +31,48 @@ import org.eclipse.cdt.internal.core.dom.parser.upc.UPCParser; /** * Implementation of the ILanguage extension point, adds UPC as a language to CDT. - * + * * @author Mike Kucera */ public class UPCLanguage extends BaseExtensibleLanguage { - - public static final String ID = "org.eclipse.cdt.core.parser.upc.upc"; //$NON-NLS-1$ - + + public static final String ID = "org.eclipse.cdt.core.parser.upc.upc"; //$NON-NLS-1$ + public static final String UPC_CONTENT_TYPE_ID = "org.eclipse.cdt.core.parser.upc.upcSource"; //$NON-NLS-1$ - + private static final UPCLanguage myDefault = new UPCLanguage(); public static UPCLanguage getDefault() { return myDefault; } - + @Override protected IParser<IASTTranslationUnit> getParser(IScanner scanner, IIndex index, Map<String,String> properties) { return new UPCParser(scanner, new DOMToUPCTokenMap(), getBuiltinBindingsProvider(), index, properties); } - + + @Override public String getId() { return ID; } - + + @Override public int getLinkageID() { return ILinkage.C_LINKAGE_ID; } private static final ICLanguageKeywords upcKeywords = new UPCLanguageKeywords(ScannerExtensionConfiguration.createC()); - + @SuppressWarnings("unchecked") @Override public Object getAdapter(Class adapter) { if(ICLanguageKeywords.class.equals(adapter)) return upcKeywords; - + return super.getAdapter(adapter); } - + @Override protected ParserLanguage getParserLanguage() { return ParserLanguage.C; diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTCompositeTypeSpecifier.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTCompositeTypeSpecifier.java index c32ae852d46..b616ef01193 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTCompositeTypeSpecifier.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTCompositeTypeSpecifier.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -12,9 +12,10 @@ package org.eclipse.cdt.core.dom.upc.ast; import org.eclipse.cdt.core.dom.ast.c.ICASTCompositeTypeSpecifier; -public interface IUPCASTCompositeTypeSpecifier extends +public interface IUPCASTCompositeTypeSpecifier extends IUPCASTDeclSpecifier, ICASTCompositeTypeSpecifier { + @Override public IUPCASTCompositeTypeSpecifier copy(); } diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTDeclSpecifier.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTDeclSpecifier.java index 303e867ae13..c275a34bb76 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTDeclSpecifier.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTDeclSpecifier.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -19,43 +19,44 @@ public interface IUPCASTDeclSpecifier extends ICASTDeclSpecifier { public static final ASTNodeProperty BLOCK_SIZE_EXPRESSION = new ASTNodeProperty( "IUPCASTDeclSpecifier.BLOCK_SIZE_EXPRESSION - IUPCASTDeclSpecifier block size expression"); //$NON-NLS-1$ - + public static final int rt_unspecified = 0; - + public static final int rt_strict = 1; - + public static final int rt_relaxed = 2; - + public static final int sh_not_shared = 0; - + public static final int sh_shared_default_block_size = 1; - + public static final int sh_shared_pure_allocation = 2; - + public static final int sh_shared_indefinite_allocation = 3; - + public static final int sh_shared_constant_expression = 4; - - - + + + public int getReferenceType(); - + public void setReferenceType(int referenceType); - - - + + + public int getSharedQualifier(); - + public void setSharedQualifier(int shared); - - - + + + public IASTExpression getBlockSizeExpression(); public void setBlockSizeExpression(IASTExpression expr); - - + + + @Override public IUPCASTDeclSpecifier copy(); } diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTElaboratedTypeSpecifier.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTElaboratedTypeSpecifier.java index 46484842954..2419b8795ea 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTElaboratedTypeSpecifier.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTElaboratedTypeSpecifier.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -16,5 +16,6 @@ public interface IUPCASTElaboratedTypeSpecifier extends IUPCASTDeclSpecifier, ICASTElaboratedTypeSpecifier { + @Override public IUPCASTElaboratedTypeSpecifier copy(); } diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTEnumerationSpecifier.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTEnumerationSpecifier.java index 4636704e1ce..533e09468e6 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTEnumerationSpecifier.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTEnumerationSpecifier.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -16,5 +16,6 @@ public interface IUPCASTEnumerationSpecifier extends IUPCASTDeclSpecifier, ICASTEnumerationSpecifier { + @Override public IUPCASTEnumerationSpecifier copy(); } diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTForallStatement.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTForallStatement.java index 5871d39af73..577e19d2ff0 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTForallStatement.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTForallStatement.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -15,36 +15,45 @@ import org.eclipse.cdt.core.dom.ast.IASTExpression; import org.eclipse.cdt.core.dom.ast.IASTForStatement; import org.eclipse.cdt.core.dom.ast.IASTStatement; -public interface IUPCASTForallStatement extends IASTForStatement { +public interface IUPCASTForallStatement extends IASTForStatement { public static final ASTNodeProperty AFFINITY = new ASTNodeProperty( "IUPCASTForallStatement.AFFINITY - IASTExpression affinity for IUPCASTForallStatement"); //$NON-NLS-1$ - - - public IASTStatement getInitializerStatement(); - public void setInitializerStatement( IASTStatement statement ); - + + @Override + public IASTStatement getInitializerStatement(); + + @Override + public void setInitializerStatement( IASTStatement statement ); + + @Override public IASTExpression getConditionExpression(); + @Override public void setConditionExpression(IASTExpression condition); + @Override public IASTExpression getIterationExpression(); + @Override public void setIterationExpression(IASTExpression iterator); - + public IASTExpression getAffinityExpresiion(); - + public void setAffinityExpression(IASTExpression affinity); - + public boolean isAffinityContinue(); - + public void setAffinityContinue(boolean affinityContinue); + @Override public IASTStatement getBody(); + @Override public void setBody(IASTStatement statement); - + + @Override public IUPCASTForallStatement copy(); } diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTKeywordExpression.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTKeywordExpression.java index 5da4548d6cb..2a81b0e3ca2 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTKeywordExpression.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTKeywordExpression.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -15,16 +15,17 @@ import org.eclipse.cdt.core.dom.ast.IASTExpression; public interface IUPCASTKeywordExpression extends IASTExpression { public static final int kw_threads = 1; - + public static final int kw_mythread = 2; - + public static final int kw_upc_max_block_size = 3; - - + + public int getKeywordKind(); - + public void setKeywordKind(int kind); - + + @Override public IUPCASTKeywordExpression copy(); } diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTSimpleDeclSpecifier.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTSimpleDeclSpecifier.java index f6d78fb520b..4129fe40c9f 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTSimpleDeclSpecifier.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTSimpleDeclSpecifier.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -16,5 +16,6 @@ public interface IUPCASTSimpleDeclSpecifier extends IUPCASTDeclSpecifier, ICASTSimpleDeclSpecifier { + @Override public IUPCASTSimpleDeclSpecifier copy(); } diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTSynchronizationStatement.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTSynchronizationStatement.java index fd0c6a4c467..633603dce27 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTSynchronizationStatement.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTSynchronizationStatement.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -16,28 +16,29 @@ import org.eclipse.cdt.core.dom.ast.IASTStatement; public interface IUPCASTSynchronizationStatement extends IASTStatement { - + public static final ASTNodeProperty BARRIER_EXPRESSION = new ASTNodeProperty( "IUPCASTSynchronizationStatement.BARRIER_EXPRESSION - IASTExpression barrier for IUPCASTSynchronizationStatement"); //$NON-NLS-1$ - - + + public final int st_upc_notify = 1; - + public final int st_upc_wait = 2; - + public final int st_upc_barrier = 3; - + public final int st_upc_fence = 4; - - + + public IASTExpression getBarrierExpression(); - + public void setBarrierExpression(IASTExpression expr); - + public int getStatementKind(); - + public void setStatementKind(int kind); - + + @Override public IUPCASTSynchronizationStatement copy(); } diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTTypeIdSizeofExpression.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTTypeIdSizeofExpression.java index 0ab17aced8a..b571a094e06 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTTypeIdSizeofExpression.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTTypeIdSizeofExpression.java @@ -13,18 +13,19 @@ package org.eclipse.cdt.core.dom.upc.ast; import org.eclipse.cdt.core.dom.ast.IASTTypeIdExpression; public interface IUPCASTTypeIdSizeofExpression extends IASTTypeIdExpression { - + public final int upc_localsizeof = 1; - + public final int upc_blocksizeof = 2; - + public final int upc_elemsizeof = 3; - + public int getUPCSizeofOperator(); public void setUPCSizeofOperator(int upcSizeofOperator); - - + + + @Override public IUPCASTTypeIdSizeofExpression copy(); } diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTTypedefNameSpecifier.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTTypedefNameSpecifier.java index b345cb8a878..47a6cb60855 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTTypedefNameSpecifier.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTTypedefNameSpecifier.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -14,8 +14,9 @@ import org.eclipse.cdt.core.dom.ast.c.ICASTTypedefNameSpecifier; public interface IUPCASTTypedefNameSpecifier extends IUPCASTDeclSpecifier, ICASTTypedefNameSpecifier { - + + @Override public IUPCASTTypedefNameSpecifier copy(); } diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTUnarySizeofExpression.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTUnarySizeofExpression.java index 9a69f9304a8..de3eadd9c80 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTUnarySizeofExpression.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/ast/IUPCASTUnarySizeofExpression.java @@ -15,16 +15,17 @@ import org.eclipse.cdt.core.dom.ast.IASTUnaryExpression; public interface IUPCASTUnarySizeofExpression extends IASTUnaryExpression { public final int upc_localsizeof = 1; - + public final int upc_blocksizeof = 2; - + public final int upc_elemsizeof = 3; - - + + public int getUPCSizeofOperator(); public void setUPCSizeofOperator(int upcSizeofOperator); - - + + + @Override public IUPCASTUnarySizeofExpression copy(); }
\ No newline at end of file diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCExpressionParser.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCExpressionParser.java index 1a2c5f6f8d6..3264530023e 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCExpressionParser.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCExpressionParser.java @@ -13,40 +13,59 @@ package org.eclipse.cdt.internal.core.dom.parser.upc; -import lpg.lpgjavaruntime.*; +import java.util.List; +import java.util.Map; -import java.util.*; -import org.eclipse.cdt.core.dom.ast.*; +import lpg.lpgjavaruntime.BadParseException; +import lpg.lpgjavaruntime.BadParseSymFileException; +import lpg.lpgjavaruntime.DiagnoseParser; +import lpg.lpgjavaruntime.ErrorToken; +import lpg.lpgjavaruntime.IToken; +import lpg.lpgjavaruntime.LexStream; +import lpg.lpgjavaruntime.Monitor; +import lpg.lpgjavaruntime.NotBacktrackParseTableException; +import lpg.lpgjavaruntime.NullExportedSymbolsException; +import lpg.lpgjavaruntime.NullTerminalSymbolsException; +import lpg.lpgjavaruntime.ParseErrorCodes; +import lpg.lpgjavaruntime.ParseTable; +import lpg.lpgjavaruntime.PrsStream; +import lpg.lpgjavaruntime.RuleAction; +import lpg.lpgjavaruntime.Token; +import lpg.lpgjavaruntime.UndefinedEofSymbolException; +import lpg.lpgjavaruntime.UnimplementedTerminalsException; + +import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression; +import org.eclipse.cdt.core.dom.ast.IASTCastExpression; +import org.eclipse.cdt.core.dom.ast.IASTCompletionNode; +import org.eclipse.cdt.core.dom.ast.IASTCompositeTypeSpecifier; +import org.eclipse.cdt.core.dom.ast.IASTElaboratedTypeSpecifier; +import org.eclipse.cdt.core.dom.ast.IASTExpression; +import org.eclipse.cdt.core.dom.ast.IASTLiteralExpression; +import org.eclipse.cdt.core.dom.ast.IASTTypeIdExpression; +import org.eclipse.cdt.core.dom.ast.IASTUnaryExpression; +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.ISecondaryParser; import org.eclipse.cdt.core.dom.lrparser.ITokenCollector; -import org.eclipse.cdt.core.dom.lrparser.CPreprocessorAdapter; +import org.eclipse.cdt.core.dom.lrparser.action.ITokenMap; 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.ITokenMap; import org.eclipse.cdt.core.dom.lrparser.action.TokenMap; -import org.eclipse.cdt.core.dom.lrparser.ISecondaryParser; - -import org.eclipse.cdt.internal.core.dom.parser.c.CNodeFactory; -import org.eclipse.cdt.core.dom.lrparser.action.c99.C99BuildASTParserAction; -import org.eclipse.cdt.core.dom.lrparser.action.c99.C99SecondaryParserFactory; - +import org.eclipse.cdt.core.dom.lrparser.lpgextensions.FixedBacktrackingParser; +import org.eclipse.cdt.core.dom.parser.IBuiltinBindingsProvider; import org.eclipse.cdt.core.dom.parser.upc.UPCASTNodeFactory; -import org.eclipse.cdt.core.dom.parser.upc.UPCSecondaryParserFactory; import org.eclipse.cdt.core.dom.parser.upc.UPCParserAction; +import org.eclipse.cdt.core.dom.parser.upc.UPCSecondaryParserFactory; import org.eclipse.cdt.core.dom.upc.ast.IUPCASTKeywordExpression; import org.eclipse.cdt.core.dom.upc.ast.IUPCASTSynchronizationStatement; import org.eclipse.cdt.core.dom.upc.ast.IUPCASTUnarySizeofExpression; -import org.eclipse.cdt.core.dom.lrparser.lpgextensions.FixedBacktrackingParser; +import org.eclipse.cdt.core.index.IIndex; +import org.eclipse.cdt.core.parser.IScanner; -public class UPCExpressionParser extends PrsStream implements RuleAction, ITokenStream, - ITokenCollector, IParser< IASTExpression > - , ISecondaryParser< IASTExpression > +public class UPCExpressionParser extends PrsStream implements RuleAction, ITokenStream, + ITokenCollector, IParser< IASTExpression > + , ISecondaryParser< IASTExpression > { private static ParseTable prs = new UPCExpressionParserprs(); private FixedBacktrackingParser btParser; @@ -57,7 +76,7 @@ public class UPCExpressionParser extends PrsStream implements RuleAction, IToken public int getRhsTokenIndex(int i) { return btParser.getToken(i); } public IToken getRhsIToken(int i) { return super.getIToken(getRhsTokenIndex(i)); } - + public int getRhsFirstTokenIndex(int i) { return btParser.getFirstToken(i); } public IToken getRhsFirstIToken(int i) { return super.getIToken(getRhsFirstTokenIndex(i)); } @@ -65,10 +84,12 @@ public class UPCExpressionParser extends PrsStream implements RuleAction, IToken public IToken getRhsLastIToken(int i) { return super.getIToken(getRhsLastTokenIndex(i)); } public int getLeftSpan() { return btParser.getFirstToken(); } - public IToken getLeftIToken() { return super.getIToken(getLeftSpan()); } + @Override + public IToken getLeftIToken() { return super.getIToken(getLeftSpan()); } public int getRightSpan() { return btParser.getLastToken(); } - public IToken getRightIToken() { return super.getIToken(getRightSpan()); } + @Override + public IToken getRightIToken() { return super.getIToken(getRightSpan()); } public int getRhsErrorTokenIndex(int i) { @@ -102,23 +123,24 @@ public class UPCExpressionParser extends PrsStream implements RuleAction, IToken for (int i = 0; i < unimplemented_symbols.size(); i++) { Integer id = (Integer) unimplemented_symbols.get(i); - System.out.println(" " + UPCExpressionParsersym.orderedTerminalSymbols[id.intValue()]); + System.out.println(" " + UPCExpressionParsersym.orderedTerminalSymbols[id.intValue()]); } - System.out.println(); + System.out.println(); } catch(UndefinedEofSymbolException e) { throw new Error(new UndefinedEofSymbolException ("The Lexer does not implement the Eof symbol " + UPCExpressionParsersym.orderedTerminalSymbols[UPCExpressionParserprs.EOFT_SYMBOL])); - } + } } - public String[] orderedTerminalSymbols() { return UPCExpressionParsersym.orderedTerminalSymbols; } + @Override + public String[] orderedTerminalSymbols() { return UPCExpressionParsersym.orderedTerminalSymbols; } public String getTokenKindName(int kind) { return UPCExpressionParsersym.orderedTerminalSymbols[kind]; } public int getEOFTokenKind() { return UPCExpressionParserprs.EOFT_SYMBOL; } - public PrsStream getParseStream() { return (PrsStream) this; } - + public PrsStream getParseStream() { return this; } + // // Report error message for given error_token. // @@ -141,12 +163,12 @@ public class UPCExpressionParser extends PrsStream implements RuleAction, IToken { parser(null, 0); } - + public void parser(Monitor monitor) { parser(monitor, 0); } - + public void parser(int error_repair_count) { parser(null, error_repair_count); @@ -156,7 +178,7 @@ public class UPCExpressionParser extends PrsStream implements RuleAction, IToken { try { - btParser = new FixedBacktrackingParser(monitor, (TokenStream) this, prs, (RuleAction) this); + btParser = new FixedBacktrackingParser(monitor, this, prs, this); } catch (NotBacktrackParseTableException e) { @@ -193,24 +215,26 @@ public UPCExpressionParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBind private void initActions(Map<String,String> properties) { ScopedStack<Object> astStack = new ScopedStack<Object>(); - + action = new UPCParserAction (this, astStack, new UPCASTNodeFactory() , UPCSecondaryParserFactory.getDefault() ); action.setParserProperties(properties); - - + + } +@Override public void addToken(IToken token) { token.setKind(mapKind(token.getKind())); // TODO does mapKind need to be called? super.addToken(token); } +@Override public IASTExpression parse() { // this has to be done, or... kaboom! setStreamLength(getSize()); - + final int errorRepairCount = -1; // -1 means full error handling parser(null, errorRepairCount); // do the actual parse super.resetTokenStream(); // allow tokens to be garbage collected @@ -220,19 +244,23 @@ public IASTExpression parse() { } +@Override public IASTCompletionNode getCompletionNode() { return compNode; } // uncomment this method to use with backtracking parser +@Override public List<IToken> getRuleTokens() { return getTokens().subList(getLeftSpan(), getRightSpan() + 1); } +@Override public String[] getOrderedTerminalSymbols() { return UPCExpressionParsersym.orderedTerminalSymbols; } +@Override @SuppressWarnings("nls") public String getName() { return "UPCExpressionParser"; @@ -242,6 +270,7 @@ public String getName() { private ITokenMap tokenMap = null; +@Override public void setTokens(List<IToken> tokens) { resetTokenStream(); addToken(new Token(null, 0, 0, 0)); // dummy token @@ -255,1329 +284,1330 @@ public void setTokens(List<IToken> tokens) { public UPCExpressionParser(ITokenStream stream, Map<String,String> properties) { // constructor for creating secondary parser initActions(properties); tokenMap = new TokenMap(UPCExpressionParsersym.orderedTerminalSymbols, stream.getOrderedTerminalSymbols()); -} +} - public void ruleAction(int ruleNumber) + @Override + public void ruleAction(int ruleNumber) { switch (ruleNumber) { - + // // Rule 1: <openscope-ast> ::= $Empty // case 1: { action. openASTScope(); break; - } - + } + // // Rule 2: <empty> ::= $Empty // case 2: { action. consumeEmpty(); break; - } - + } + // // Rule 13: literal ::= integer // case 13: { action. consumeExpressionLiteral(IASTLiteralExpression.lk_integer_constant); break; - } - + } + // // Rule 14: literal ::= floating // case 14: { action. consumeExpressionLiteral(IASTLiteralExpression.lk_float_constant); break; - } - + } + // // Rule 15: literal ::= charconst // case 15: { action. consumeExpressionLiteral(IASTLiteralExpression.lk_char_constant); break; - } - + } + // // Rule 16: literal ::= stringlit // case 16: { action. consumeExpressionLiteral(IASTLiteralExpression.lk_string_literal); break; - } - + } + // // Rule 18: primary_expression ::= primary_expression_id // case 18: { action. consumeExpressionID(); break; - } - + } + // // Rule 19: primary_expression ::= ( expression ) // case 19: { action. consumeExpressionBracketed(); break; - } - + } + // // Rule 22: postfix_expression ::= postfix_expression [ expression ] // case 22: { action. consumeExpressionArraySubscript(); break; - } - + } + // // Rule 23: postfix_expression ::= postfix_expression ( expression_list_opt ) // case 23: { action. consumeExpressionFunctionCall(); break; - } - + } + // // Rule 24: postfix_expression ::= postfix_expression . member_name // case 24: { action. consumeExpressionFieldReference(false); break; - } - + } + // // Rule 25: postfix_expression ::= postfix_expression -> member_name // case 25: { action. consumeExpressionFieldReference(true); break; - } - + } + // // Rule 26: postfix_expression ::= postfix_expression ++ // case 26: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_postFixIncr); break; - } - + } + // // Rule 27: postfix_expression ::= postfix_expression -- // case 27: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_postFixDecr); break; - } - + } + // // Rule 28: postfix_expression ::= ( type_id ) initializer_list // case 28: { action. consumeExpressionTypeIdInitializer(); break; - } - + } + // // Rule 33: unary_expression ::= ++ unary_expression // case 33: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_prefixIncr); break; - } - + } + // // Rule 34: unary_expression ::= -- unary_expression // case 34: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_prefixDecr); break; - } - + } + // // Rule 35: unary_expression ::= & cast_expression // case 35: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_amper); break; - } - + } + // // Rule 36: unary_expression ::= * cast_expression // case 36: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_star); break; - } - + } + // // Rule 37: unary_expression ::= + cast_expression // case 37: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_plus); break; - } - + } + // // Rule 38: unary_expression ::= - cast_expression // case 38: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_minus); break; - } - + } + // // Rule 39: unary_expression ::= ~ cast_expression // case 39: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_tilde); break; - } - + } + // // Rule 40: unary_expression ::= ! cast_expression // case 40: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_not); break; - } - + } + // // Rule 41: unary_expression ::= sizeof unary_expression // case 41: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_sizeof); break; - } - + } + // // Rule 42: unary_expression ::= sizeof ( type_id ) // case 42: { action. consumeExpressionTypeId(IASTTypeIdExpression.op_sizeof); break; - } - + } + // // Rule 44: cast_expression ::= ( type_id ) cast_expression // case 44: { action. consumeExpressionCast(IASTCastExpression.op_cast); break; - } - + } + // // Rule 46: multiplicative_expression ::= multiplicative_expression * cast_expression // case 46: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_multiply); break; - } - + } + // // Rule 47: multiplicative_expression ::= multiplicative_expression / cast_expression // case 47: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_divide); break; - } - + } + // // Rule 48: multiplicative_expression ::= multiplicative_expression % cast_expression // case 48: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_modulo); break; - } - + } + // // Rule 50: additive_expression ::= additive_expression + multiplicative_expression // case 50: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_plus); break; - } - + } + // // Rule 51: additive_expression ::= additive_expression - multiplicative_expression // case 51: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_minus); break; - } - + } + // // Rule 53: shift_expression ::= shift_expression << additive_expression // case 53: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_shiftLeft); break; - } - + } + // // Rule 54: shift_expression ::= shift_expression >> additive_expression // case 54: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_shiftRight); break; - } - + } + // // Rule 56: relational_expression ::= relational_expression < shift_expression // case 56: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_lessThan); break; - } - + } + // // Rule 57: relational_expression ::= relational_expression > shift_expression // case 57: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_greaterThan); break; - } - + } + // // Rule 58: relational_expression ::= relational_expression <= shift_expression // case 58: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_lessEqual); break; - } - + } + // // Rule 59: relational_expression ::= relational_expression >= shift_expression // case 59: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_greaterEqual); break; - } - + } + // // Rule 61: equality_expression ::= equality_expression == relational_expression // case 61: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_equals); break; - } - + } + // // Rule 62: equality_expression ::= equality_expression != relational_expression // case 62: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_notequals); break; - } - + } + // // Rule 64: and_expression ::= and_expression & equality_expression // case 64: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_binaryAnd); break; - } - + } + // // Rule 66: exclusive_or_expression ::= exclusive_or_expression ^ and_expression // case 66: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_binaryXor); break; - } - + } + // // Rule 68: inclusive_or_expression ::= inclusive_or_expression | exclusive_or_expression // case 68: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_binaryOr); break; - } - + } + // // Rule 70: logical_and_expression ::= logical_and_expression && inclusive_or_expression // case 70: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_logicalAnd); break; - } - + } + // // Rule 72: logical_or_expression ::= logical_or_expression || logical_and_expression // case 72: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_logicalOr); break; - } - + } + // // Rule 74: conditional_expression ::= logical_or_expression ? expression : assignment_expression // case 74: { action. consumeExpressionConditional(); break; - } - + } + // // Rule 76: assignment_expression ::= unary_expression = assignment_expression // case 76: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_assign); break; - } - + } + // // Rule 77: assignment_expression ::= unary_expression *= assignment_expression // case 77: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_multiplyAssign); break; - } - + } + // // Rule 78: assignment_expression ::= unary_expression /= assignment_expression // case 78: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_divideAssign); break; - } - + } + // // Rule 79: assignment_expression ::= unary_expression %= assignment_expression // case 79: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_moduloAssign); break; - } - + } + // // Rule 80: assignment_expression ::= unary_expression += assignment_expression // case 80: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_plusAssign); break; - } - + } + // // Rule 81: assignment_expression ::= unary_expression -= assignment_expression // case 81: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_minusAssign); break; - } - + } + // // Rule 82: assignment_expression ::= unary_expression <<= assignment_expression // case 82: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_shiftLeftAssign); break; - } - + } + // // Rule 83: assignment_expression ::= unary_expression >>= assignment_expression // case 83: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_shiftRightAssign); break; - } - + } + // // Rule 84: assignment_expression ::= unary_expression &= assignment_expression // case 84: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_binaryAndAssign); break; - } - + } + // // Rule 85: assignment_expression ::= unary_expression ^= assignment_expression // case 85: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_binaryXorAssign); break; - } - + } + // // Rule 86: assignment_expression ::= unary_expression |= assignment_expression // case 86: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_binaryOrAssign); break; - } - + } + // // Rule 89: expression_list ::= <openscope-ast> expression_list_actual // case 89: { action. consumeExpressionList(); break; - } - + } + // // Rule 91: expression_list_opt ::= $Empty // case 91: { action. consumeEmpty(); break; - } - + } + // // Rule 101: statement ::= ERROR_TOKEN // case 101: { action. consumeStatementProblem(); break; - } - + } + // // Rule 102: labeled_statement ::= identifier_token : statement // case 102: { action. consumeStatementLabeled(); break; - } - + } + // // Rule 103: labeled_statement ::= case constant_expression : statement // case 103: { action. consumeStatementCase(); break; - } - + } + // // Rule 104: labeled_statement ::= default : statement // case 104: { action. consumeStatementDefault(); break; - } - + } + // // Rule 105: compound_statement ::= { } // case 105: { action. consumeStatementCompoundStatement(false); break; - } - + } + // // Rule 106: compound_statement ::= { <openscope-ast> block_item_list } // case 106: { action. consumeStatementCompoundStatement(true); break; - } - + } + // // Rule 110: block_item ::= declaration // case 110: { action. consumeStatementDeclarationWithDisambiguation(); break; - } - + } + // // Rule 111: expression_statement ::= ; // case 111: { action. consumeStatementNull(); break; - } - + } + // // Rule 112: expression_statement ::= expression_in_statement ; // case 112: { action. consumeStatementExpression(); break; - } - + } + // // Rule 113: selection_statement ::= if ( expression ) statement // case 113: { action. consumeStatementIf(false); break; - } - + } + // // Rule 114: selection_statement ::= if ( expression ) statement else statement // case 114: { action. consumeStatementIf(true); break; - } - + } + // // Rule 115: selection_statement ::= switch ( expression ) statement // case 115: { action. consumeStatementSwitch(); break; - } - + } + // // Rule 117: expression_opt ::= $Empty // case 117: { action. consumeEmpty(); break; - } - + } + // // Rule 118: iteration_statement ::= do statement while ( expression ) ; // case 118: { action. consumeStatementDoLoop(true); break; - } - + } + // // Rule 119: iteration_statement ::= do statement // case 119: { action. consumeStatementDoLoop(false); break; - } - + } + // // Rule 120: iteration_statement ::= while ( expression ) statement // case 120: { action. consumeStatementWhileLoop(); break; - } - + } + // // Rule 121: iteration_statement ::= for ( expression_opt ; expression_opt ; expression_opt ) statement // case 121: { action. consumeStatementForLoop(); break; - } - + } + // // Rule 122: iteration_statement ::= for ( declaration expression_opt ; expression_opt ) statement // case 122: { action. consumeStatementForLoop(); break; - } - + } + // // Rule 123: jump_statement ::= goto identifier_token ; // case 123: { action. consumeStatementGoto(); break; - } - + } + // // Rule 124: jump_statement ::= continue ; // case 124: { action. consumeStatementContinue(); break; - } - + } + // // Rule 125: jump_statement ::= break ; // case 125: { action. consumeStatementBreak(); break; - } - + } + // // Rule 126: jump_statement ::= return ; // case 126: { action. consumeStatementReturn(false); break; - } - + } + // // Rule 127: jump_statement ::= return expression ; // case 127: { action. consumeStatementReturn(true); break; - } - + } + // // Rule 128: declaration ::= declaration_specifiers ; // case 128: { action. consumeDeclarationSimple(false); break; - } - + } + // // Rule 129: declaration ::= declaration_specifiers <openscope-ast> init_declarator_list ; // case 129: { action. consumeDeclarationSimple(true); break; - } - + } + // // Rule 130: declaration_specifiers ::= <openscope-ast> simple_declaration_specifiers // case 130: { action. consumeDeclarationSpecifiersSimple(); break; - } - + } + // // Rule 131: declaration_specifiers ::= <openscope-ast> struct_or_union_declaration_specifiers // case 131: { action. consumeDeclarationSpecifiersStructUnionEnum(); break; - } - + } + // // Rule 132: declaration_specifiers ::= <openscope-ast> elaborated_declaration_specifiers // case 132: { action. consumeDeclarationSpecifiersStructUnionEnum(); break; - } - + } + // // Rule 133: declaration_specifiers ::= <openscope-ast> enum_declaration_specifiers // case 133: { action. consumeDeclarationSpecifiersStructUnionEnum(); break; - } - + } + // // Rule 134: declaration_specifiers ::= <openscope-ast> typdef_name_declaration_specifiers // case 134: { action. consumeDeclarationSpecifiersTypedefName(); break; - } - + } + // // Rule 159: init_declarator ::= complete_declarator = initializer // case 159: { action. consumeDeclaratorWithInitializer(true); break; - } - + } + // // Rule 161: storage_class_specifier ::= storage_class_specifier_token // case 161: { action. consumeToken(); break; - } - + } + // // Rule 167: simple_type_specifier ::= simple_type_specifier_token // case 167: { action. consumeToken(); break; - } - + } + // // Rule 180: type_name_specifier ::= identifier_token // case 180: { action. consumeToken(); break; - } - + } + // // Rule 181: struct_or_union_specifier ::= struct_or_union struct_or_union_specifier_hook { <openscope-ast> struct_declaration_list_opt } // case 181: { action. consumeTypeSpecifierComposite(false); break; - } - + } + // // Rule 182: struct_or_union_specifier ::= struct_or_union struct_or_union_specifier_hook identifier_token struct_or_union_specifier_suffix_hook { <openscope-ast> struct_declaration_list_opt } // case 182: { action. consumeTypeSpecifierComposite(true); break; - } - + } + // // Rule 187: elaborated_specifier ::= struct elaborated_specifier_hook identifier_token // case 187: { action. consumeTypeSpecifierElaborated(IASTCompositeTypeSpecifier.k_struct); break; - } - + } + // // Rule 188: elaborated_specifier ::= union elaborated_specifier_hook identifier_token // case 188: { action. consumeTypeSpecifierElaborated(IASTCompositeTypeSpecifier.k_union); break; - } - + } + // // Rule 189: elaborated_specifier ::= enum elaborated_specifier_hook identifier_token // case 189: { action. consumeTypeSpecifierElaborated(IASTElaboratedTypeSpecifier.k_enum); break; - } - + } + // // Rule 195: struct_declaration ::= specifier_qualifier_list <openscope-ast> struct_declarator_list ; // case 195: { action. consumeStructDeclaration(true); break; - } - + } + // // Rule 196: struct_declaration ::= specifier_qualifier_list ; // case 196: { action. consumeStructDeclaration(false); break; - } - + } + // // Rule 197: struct_declaration ::= ERROR_TOKEN // case 197: { action. consumeDeclarationProblem(); break; - } - + } + // // Rule 203: struct_declarator ::= : constant_expression // case 203: { action. consumeBitField(false); break; - } - + } + // // Rule 204: struct_declarator ::= declarator : constant_expression // case 204: { action. consumeBitField(true); break; - } - + } + // // Rule 205: enum_specifier ::= enum enum_specifier_hook { <openscope-ast> enumerator_list_opt comma_opt } // case 205: { action. consumeTypeSpecifierEnumeration(false); break; - } - + } + // // Rule 206: enum_specifier ::= enum enum_specifier_hook identifier_token { <openscope-ast> enumerator_list_opt comma_opt } // case 206: { action. consumeTypeSpecifierEnumeration(true); break; - } - + } + // // Rule 212: enumerator ::= identifier_token // case 212: { action. consumeEnumerator(false); break; - } - + } + // // Rule 213: enumerator ::= identifier_token = constant_expression // case 213: { action. consumeEnumerator(true); break; - } - + } + // // Rule 214: type_qualifier ::= type_qualifier_token // case 214: { action. consumeToken(); break; - } - + } + // // Rule 218: function_specifier ::= inline // case 218: { action. consumeToken(); break; - } - + } + // // Rule 220: declarator ::= <openscope-ast> pointer_seq direct_declarator // case 220: { action. consumeDeclaratorWithPointer(true); break; - } - + } + // // Rule 225: basic_direct_declarator ::= declarator_id_name // case 225: { action. consumeDirectDeclaratorIdentifier(); break; - } - + } + // // Rule 226: basic_direct_declarator ::= ( declarator ) // case 226: { action. consumeDirectDeclaratorBracketed(); break; - } - + } + // // Rule 227: declarator_id_name ::= identifier // case 227: { action. consumeIdentifierName(); break; - } - + } + // // Rule 228: array_direct_declarator ::= basic_direct_declarator array_modifier // case 228: { action. consumeDirectDeclaratorArrayDeclarator(true); break; - } - + } + // // Rule 229: array_direct_declarator ::= array_direct_declarator array_modifier // case 229: { action. consumeDirectDeclaratorArrayDeclarator(true); break; - } - + } + // // Rule 231: function_direct_declarator ::= basic_direct_declarator ( <openscope-ast> parameter_type_list ) // case 231: { action. consumeDirectDeclaratorFunctionDeclarator(true, true); break; - } - + } + // // Rule 232: function_direct_declarator ::= basic_direct_declarator ( ) // case 232: { action. consumeDirectDeclaratorFunctionDeclarator(true, false); break; - } - + } + // // Rule 234: function_declarator ::= <openscope-ast> pointer_seq function_direct_declarator // case 234: { action. consumeDeclaratorWithPointer(true); break; - } - + } + // // Rule 235: knr_direct_declarator ::= basic_direct_declarator ( <openscope-ast> identifier_list ) // case 235: { action. consumeDirectDeclaratorFunctionDeclaratorKnR(); break; - } - + } + // // Rule 237: knr_function_declarator ::= <openscope-ast> pointer_seq knr_direct_declarator // case 237: { action. consumeDeclaratorWithPointer(true); break; - } - + } + // // Rule 238: identifier_list ::= identifier // case 238: { action. consumeIdentifierKnR(); break; - } - + } + // // Rule 239: identifier_list ::= identifier_list , identifier // case 239: { action. consumeIdentifierKnR(); break; - } - + } + // // Rule 240: array_modifier ::= [ ] // case 240: { action. consumeDirectDeclaratorArrayModifier(false); break; - } - + } + // // Rule 241: array_modifier ::= [ <openscope-ast> array_modifier_type_qualifiers ] // case 241: { action. consumeDirectDeclaratorModifiedArrayModifier(false, false, true, false); break; - } - + } + // // Rule 242: array_modifier ::= [ assignment_expression ] // case 242: { action. consumeDirectDeclaratorArrayModifier(true); break; - } - + } + // // Rule 243: array_modifier ::= [ <openscope-ast> array_modifier_type_qualifiers assignment_expression ] // case 243: { action. consumeDirectDeclaratorModifiedArrayModifier(false, false, true, true); break; - } - + } + // // Rule 244: array_modifier ::= [ static assignment_expression ] // case 244: { action. consumeDirectDeclaratorModifiedArrayModifier(true, false, false, true); break; - } - + } + // // Rule 245: array_modifier ::= [ static <openscope-ast> array_modifier_type_qualifiers assignment_expression ] // case 245: { action. consumeDirectDeclaratorModifiedArrayModifier(true, false, true, true); break; - } - + } + // // Rule 246: array_modifier ::= [ <openscope-ast> array_modifier_type_qualifiers static assignment_expression ] // case 246: { action. consumeDirectDeclaratorModifiedArrayModifier(true, false, true, true); break; - } - + } + // // Rule 247: array_modifier ::= [ * ] // case 247: { action. consumeDirectDeclaratorModifiedArrayModifier(false, true, false, false); break; - } - + } + // // Rule 248: array_modifier ::= [ <openscope-ast> array_modifier_type_qualifiers * ] // case 248: { action. consumeDirectDeclaratorModifiedArrayModifier(false, true, true, false); break; - } - + } + // // Rule 250: pointer_seq ::= pointer_hook * pointer_hook // case 250: { action. consumePointer(); break; - } - + } + // // Rule 251: pointer_seq ::= pointer_seq pointer_hook * pointer_hook // case 251: { action. consumePointer(); break; - } - + } + // // Rule 252: pointer_seq ::= pointer_hook * pointer_hook <openscope-ast> type_qualifier_list // case 252: { action. consumePointerTypeQualifierList(); break; - } - + } + // // Rule 253: pointer_seq ::= pointer_seq pointer_hook * pointer_hook <openscope-ast> type_qualifier_list // case 253: { action. consumePointerTypeQualifierList(); break; - } - + } + // // Rule 257: parameter_type_list ::= parameter_list // case 257: { action. consumeEmpty(); break; - } - + } + // // Rule 258: parameter_type_list ::= parameter_list , ... // case 258: { action. consumePlaceHolder(); break; - } - + } + // // Rule 259: parameter_type_list ::= ... // case 259: { action. consumePlaceHolder(); break; - } - + } + // // Rule 262: parameter_declaration ::= declaration_specifiers complete_parameter_declarator // case 262: { action. consumeParameterDeclaration(); break; - } - + } + // // Rule 263: parameter_declaration ::= declaration_specifiers // case 263: { action. consumeParameterDeclarationWithoutDeclarator(); break; - } - + } + // // Rule 266: type_id ::= specifier_qualifier_list // case 266: { action. consumeTypeId(false); break; - } - + } + // // Rule 267: type_id ::= specifier_qualifier_list abstract_declarator // case 267: { action. consumeTypeId(true); break; - } - + } + // // Rule 269: abstract_declarator ::= <openscope-ast> pointer_seq // case 269: { action. consumeDeclaratorWithPointer(false); break; - } - + } + // // Rule 270: abstract_declarator ::= <openscope-ast> pointer_seq direct_abstract_declarator // case 270: { action. consumeDeclaratorWithPointer(true); break; - } - + } + // // Rule 274: basic_direct_abstract_declarator ::= ( abstract_declarator ) // case 274: { action. consumeDirectDeclaratorBracketed(); break; - } - + } + // // Rule 275: array_direct_abstract_declarator ::= array_modifier // case 275: { action. consumeDirectDeclaratorArrayDeclarator(false); break; - } - + } + // // Rule 276: array_direct_abstract_declarator ::= array_direct_abstract_declarator array_modifier // case 276: { action. consumeDirectDeclaratorArrayDeclarator(true); break; - } - + } + // // Rule 277: array_direct_abstract_declarator ::= basic_direct_abstract_declarator array_modifier // case 277: { action. consumeDirectDeclaratorArrayDeclarator(true); break; - } - + } + // // Rule 278: function_direct_abstract_declarator ::= ( ) // case 278: { action. consumeDirectDeclaratorFunctionDeclarator(false, false); break; - } - + } + // // Rule 279: function_direct_abstract_declarator ::= basic_direct_abstract_declarator ( ) // case 279: { action. consumeDirectDeclaratorFunctionDeclarator(true, false); break; - } - + } + // // Rule 280: function_direct_abstract_declarator ::= ( <openscope-ast> parameter_type_list ) // case 280: { action. consumeDirectDeclaratorFunctionDeclarator(false, true); break; - } - + } + // // Rule 281: function_direct_abstract_declarator ::= basic_direct_abstract_declarator ( <openscope-ast> parameter_type_list ) // case 281: { action. consumeDirectDeclaratorFunctionDeclarator(true, true); break; - } - + } + // // Rule 282: initializer ::= assignment_expression // case 282: { action. consumeInitializer(); break; - } - + } + // // Rule 283: initializer ::= initializer_list // case 283: { action. consumeInitializer(); break; - } - + } + // // Rule 284: initializer_list ::= start_initializer_list { <openscope-ast> initializer_seq comma_opt } end_initializer_list // case 284: { action. consumeInitializerList(); break; - } - + } + // // Rule 285: initializer_list ::= { <openscope-ast> } // case 285: { action. consumeInitializerList(); break; - } - + } + // // Rule 286: start_initializer_list ::= $Empty // case 286: { action. initializerListStart(); break; - } - + } + // // Rule 287: end_initializer_list ::= $Empty // case 287: { action. initializerListEnd(); break; - } - + } + // // Rule 292: designated_initializer ::= <openscope-ast> designation = initializer // case 292: { action. consumeInitializerDesignated(); break; - } - + } + // // Rule 296: designator_base ::= [ constant_expression ] // case 296: { action. consumeDesignatorArray(); break; - } - + } + // // Rule 297: designator_base ::= . identifier_token // case 297: { action. consumeDesignatorField(); break; - } - + } + // // Rule 298: designator ::= [ constant_expression ] // case 298: { action. consumeDesignatorArray(); break; - } - + } + // // Rule 299: designator ::= . identifier_token // case 299: { action. consumeDesignatorField(); break; - } - + } + // // Rule 300: translation_unit ::= external_declaration_list // case 300: { action. consumeTranslationUnit(); break; - } - + } + // // Rule 301: translation_unit ::= $Empty // case 301: { action. consumeTranslationUnit(); break; - } - + } + // // Rule 306: external_declaration ::= ; // case 306: { action. consumeDeclarationEmpty(); break; - } - + } + // // Rule 307: external_declaration ::= ERROR_TOKEN // case 307: { action. consumeDeclarationProblem(); break; - } - + } + // // Rule 311: function_definition ::= <openscope-ast> function_declarator function_body // case 311: { action. consumeFunctionDefinition(false); break; - } - + } + // // Rule 312: function_definition ::= declaration_specifiers <openscope-ast> knr_function_declarator <openscope-ast> declaration_list compound_statement // case 312: { action. consumeFunctionDefinitionKnR(); break; - } - + } + // // Rule 313: normal_function_definition ::= declaration_specifiers <openscope-ast> function_declarator function_body // case 313: { action. consumeFunctionDefinition(true); break; - } - + } + // // Rule 314: function_body ::= { } // case 314: { action. consumeStatementCompoundStatement(false); break; - } - + } + // // Rule 315: function_body ::= { <openscope-ast> block_item_list } // case 315: { action. consumeStatementCompoundStatement(true); break; - } - + } + // // Rule 317: expression_parser_start ::= ERROR_TOKEN // case 317: { action. consumeEmpty(); break; - } - + } + // // Rule 318: literal ::= MYTHREAD // case 318: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_mythread); break; - } - + } + // // Rule 319: literal ::= THREADS // case 319: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_threads); break; - } - + } + // // Rule 320: literal ::= UPC_MAX_BLOCKSIZE // case 320: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_upc_max_block_size); break; - } - + } + // // Rule 321: unary_expression ::= upc_localsizeof unary_expression // case 321: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_localsizeof); break; - } - + } + // // Rule 322: unary_expression ::= upc_localsizeof ( type_id ) // case 322: { action. consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_localsizeof); break; - } - + } + // // Rule 323: unary_expression ::= upc_blocksizeof unary_expression // case 323: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_blocksizeof); break; - } - + } + // // Rule 324: unary_expression ::= upc_blocksizeof ( type_id ) // case 324: { action. consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_blocksizeof); break; - } - + } + // // Rule 325: unary_expression ::= upc_elemsizeof unary_expression // case 325: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_elemsizeof); break; - } - + } + // // Rule 326: unary_expression ::= upc_elemsizeof ( type_id ) // case 326: { action. consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_elemsizeof); break; - } - + } + // // Rule 330: shared_type_qualifier ::= shared // case 330: { action. consumeToken(); break; - } - + } + // // Rule 331: reference_type_qualifier ::= relaxed // case 331: { action. consumeToken(); break; - } - + } + // // Rule 332: reference_type_qualifier ::= strict // case 332: { action. consumeToken(); break; - } - + } + // // Rule 333: layout_qualifier ::= [ constant_expression ] // case 333: { action. consumeLayoutQualifier(true, false); break; - } - + } + // // Rule 334: layout_qualifier ::= [ * ] // case 334: { action. consumeLayoutQualifier(false, true); break; - } - + } + // // Rule 335: layout_qualifier ::= [ ] // case 335: { action. consumeLayoutQualifier(false, false); break; - } - + } + // // Rule 337: synchronization_statement ::= upc_notify expression ; // case 337: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_notify, true); break; - } - + } + // // Rule 338: synchronization_statement ::= upc_notify ; // case 338: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_notify, false); break; - } - + } + // // Rule 339: synchronization_statement ::= upc_wait expression ; // case 339: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_wait, true); break; - } - + } + // // Rule 340: synchronization_statement ::= upc_wait ; // case 340: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_wait, false); break; - } - + } + // // Rule 341: synchronization_statement ::= upc_barrier expression ; // case 341: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_barrier, true); break; - } - + } + // // Rule 342: synchronization_statement ::= upc_barrier ; // case 342: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_barrier, false); break; - } - + } + // // Rule 343: synchronization_statement ::= upc_fence ; // case 343: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_fence, false); break; - } - + } + // // Rule 344: iteration_statement ::= upc_forall ( expression ; expression ; expression ; affinity ) statement // case 344: { action. consumeStatementUPCForallLoop(true, true, true, true); break; - } - + } + // // Rule 345: iteration_statement ::= upc_forall ( expression ; expression ; expression ; ) statement // case 345: { action. consumeStatementUPCForallLoop(true, true, true, false); break; - } - + } + // // Rule 346: iteration_statement ::= upc_forall ( expression ; expression ; ; affinity ) statement // case 346: { action. consumeStatementUPCForallLoop(true, true, false, true); break; - } - + } + // // Rule 347: iteration_statement ::= upc_forall ( expression ; expression ; ; ) statement // case 347: { action. consumeStatementUPCForallLoop(true, true, false, false); break; - } - + } + // // Rule 348: iteration_statement ::= upc_forall ( expression ; ; expression ; affinity ) statement // case 348: { action. consumeStatementUPCForallLoop(true, false, true, true); break; - } - + } + // // Rule 349: iteration_statement ::= upc_forall ( expression ; ; expression ; ) statement // case 349: { action. consumeStatementUPCForallLoop(true, false, true, false); break; - } - + } + // // Rule 350: iteration_statement ::= upc_forall ( expression ; ; ; affinity ) statement // case 350: { action. consumeStatementUPCForallLoop(true, false, false, true); break; - } - + } + // // Rule 351: iteration_statement ::= upc_forall ( expression ; ; ; ) statement // case 351: { action. consumeStatementUPCForallLoop(true, false, false, false); break; - } - + } + // // Rule 352: iteration_statement ::= upc_forall ( ; expression ; expression ; affinity ) statement // case 352: { action. consumeStatementUPCForallLoop(false, true, true, true); break; - } - + } + // // Rule 353: iteration_statement ::= upc_forall ( ; expression ; expression ; ) statement // case 353: { action. consumeStatementUPCForallLoop(false, true, true, false); break; - } - + } + // // Rule 354: iteration_statement ::= upc_forall ( ; expression ; ; affinity ) statement // case 354: { action. consumeStatementUPCForallLoop(false, true, false, true); break; - } - + } + // // Rule 355: iteration_statement ::= upc_forall ( ; expression ; ; ) statement // case 355: { action. consumeStatementUPCForallLoop(false, true, false, false); break; - } - + } + // // Rule 356: iteration_statement ::= upc_forall ( ; ; expression ; affinity ) statement // case 356: { action. consumeStatementUPCForallLoop(false, false, true, true); break; - } - + } + // // Rule 357: iteration_statement ::= upc_forall ( ; ; expression ; ) statement // case 357: { action. consumeStatementUPCForallLoop(false, false, true, false); break; - } - + } + // // Rule 358: iteration_statement ::= upc_forall ( ; ; ; affinity ) statement // case 358: { action. consumeStatementUPCForallLoop(false, false, false, true); break; - } - + } + // // Rule 359: iteration_statement ::= upc_forall ( ; ; ; ) statement // case 359: { action. consumeStatementUPCForallLoop(false, false, false, false); break; - } - + } + // // Rule 360: iteration_statement ::= upc_forall ( declaration expression ; expression ; affinity ) statement // case 360: { action. consumeStatementUPCForallLoop(true, true, true, true); break; - } - + } + // // Rule 361: iteration_statement ::= upc_forall ( declaration expression ; expression ; ) statement // case 361: { action. consumeStatementUPCForallLoop(true, true, true, false); break; - } - + } + // // Rule 362: iteration_statement ::= upc_forall ( declaration expression ; ; affinity ) statement // case 362: { action. consumeStatementUPCForallLoop(true, true, false, true); break; - } - + } + // // Rule 363: iteration_statement ::= upc_forall ( declaration expression ; ; ) statement // case 363: { action. consumeStatementUPCForallLoop(true, true, false, false); break; - } - + } + // // Rule 364: iteration_statement ::= upc_forall ( declaration ; expression ; affinity ) statement // case 364: { action. consumeStatementUPCForallLoop(true, false, true, true); break; - } - + } + // // Rule 365: iteration_statement ::= upc_forall ( declaration ; expression ; ) statement // case 365: { action. consumeStatementUPCForallLoop(true, false, true, false); break; - } - + } + // // Rule 366: iteration_statement ::= upc_forall ( declaration ; ; affinity ) statement // case 366: { action. consumeStatementUPCForallLoop(true, false, false, true); break; - } - + } + // // Rule 367: iteration_statement ::= upc_forall ( declaration ; ; ) statement // case 367: { action. consumeStatementUPCForallLoop(true, false, false, false); break; - } - + } + // // Rule 369: affinity ::= continue // case 369: { action. consumeToken(); break; - } + } + - default: break; } diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCExpressionParserprs.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCExpressionParserprs.java index 0200ba75c2b..d12ea390a6e 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCExpressionParserprs.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCExpressionParserprs.java @@ -231,9 +231,11 @@ public class UPCExpressionParserprs implements lpg.lpgjavaruntime.ParseTable, UP }; }; public final static short baseCheck[] = BaseCheck.baseCheck; - public final int baseCheck(int index) { return baseCheck[index]; } + @Override + public final int baseCheck(int index) { return baseCheck[index]; } public final static short rhs[] = baseCheck; - public final int rhs(int index) { return rhs[index]; }; + @Override + public final int rhs(int index) { return rhs[index]; }; public interface BaseAction { public final static char baseAction[] = { @@ -434,9 +436,11 @@ public class UPCExpressionParserprs implements lpg.lpgjavaruntime.ParseTable, UP }; }; public final static char baseAction[] = BaseAction.baseAction; - public final int baseAction(int index) { return baseAction[index]; } + @Override + public final int baseAction(int index) { return baseAction[index]; } public final static char lhs[] = baseAction; - public final int lhs(int index) { return lhs[index]; }; + @Override + public final int lhs(int index) { return lhs[index]; }; public interface TermCheck { public final static byte termCheck[] = {0, @@ -557,7 +561,8 @@ public class UPCExpressionParserprs implements lpg.lpgjavaruntime.ParseTable, UP }; }; public final static byte termCheck[] = TermCheck.termCheck; - public final int termCheck(int index) { return termCheck[index]; } + @Override + public final int termCheck(int index) { return termCheck[index]; } public interface TermAction { public final static char termAction[] = {0, @@ -673,7 +678,8 @@ public class UPCExpressionParserprs implements lpg.lpgjavaruntime.ParseTable, UP }; }; public final static char termAction[] = TermAction.termAction; - public final int termAction(int index) { return termAction[index]; } + @Override + public final int termAction(int index) { return termAction[index]; } public interface Asb { public final static char asb[] = {0, @@ -703,7 +709,8 @@ public class UPCExpressionParserprs implements lpg.lpgjavaruntime.ParseTable, UP }; }; public final static char asb[] = Asb.asb; - public final int asb(int index) { return asb[index]; } + @Override + public final int asb(int index) { return asb[index]; } public interface Asr { public final static byte asr[] = {0, @@ -760,7 +767,8 @@ public class UPCExpressionParserprs implements lpg.lpgjavaruntime.ParseTable, UP }; }; public final static byte asr[] = Asr.asr; - public final int asr(int index) { return asr[index]; } + @Override + public final int asr(int index) { return asr[index]; } public interface Nasb { public final static byte nasb[] = {0, @@ -790,7 +798,8 @@ public class UPCExpressionParserprs implements lpg.lpgjavaruntime.ParseTable, UP }; }; public final static byte nasb[] = Nasb.nasb; - public final int nasb(int index) { return nasb[index]; } + @Override + public final int nasb(int index) { return nasb[index]; } public interface Nasr { public final static char nasr[] = {0, @@ -810,7 +819,8 @@ public class UPCExpressionParserprs implements lpg.lpgjavaruntime.ParseTable, UP }; }; public final static char nasr[] = Nasr.nasr; - public final int nasr(int index) { return nasr[index]; } + @Override + public final int nasr(int index) { return nasr[index]; } public interface TerminalIndex { public final static char terminalIndex[] = {0, @@ -828,7 +838,8 @@ public class UPCExpressionParserprs implements lpg.lpgjavaruntime.ParseTable, UP }; }; public final static char terminalIndex[] = TerminalIndex.terminalIndex; - public final int terminalIndex(int index) { return terminalIndex[index]; } + @Override + public final int terminalIndex(int index) { return terminalIndex[index]; } public interface NonterminalIndex { public final static char nonterminalIndex[] = {0, @@ -849,7 +860,8 @@ public class UPCExpressionParserprs implements lpg.lpgjavaruntime.ParseTable, UP }; }; public final static char nonterminalIndex[] = NonterminalIndex.nonterminalIndex; - public final int nonterminalIndex(int index) { return nonterminalIndex[index]; } + @Override + public final int nonterminalIndex(int index) { return nonterminalIndex[index]; } public interface ScopePrefix { public final static char scopePrefix[] = { @@ -861,7 +873,8 @@ public class UPCExpressionParserprs implements lpg.lpgjavaruntime.ParseTable, UP }; }; public final static char scopePrefix[] = ScopePrefix.scopePrefix; - public final int scopePrefix(int index) { return scopePrefix[index]; } + @Override + public final int scopePrefix(int index) { return scopePrefix[index]; } public interface ScopeSuffix { public final static char scopeSuffix[] = { @@ -873,7 +886,8 @@ public class UPCExpressionParserprs implements lpg.lpgjavaruntime.ParseTable, UP }; }; public final static char scopeSuffix[] = ScopeSuffix.scopeSuffix; - public final int scopeSuffix(int index) { return scopeSuffix[index]; } + @Override + public final int scopeSuffix(int index) { return scopeSuffix[index]; } public interface ScopeLhs { public final static char scopeLhs[] = { @@ -885,7 +899,8 @@ public class UPCExpressionParserprs implements lpg.lpgjavaruntime.ParseTable, UP }; }; public final static char scopeLhs[] = ScopeLhs.scopeLhs; - public final int scopeLhs(int index) { return scopeLhs[index]; } + @Override + public final int scopeLhs(int index) { return scopeLhs[index]; } public interface ScopeLa { public final static byte scopeLa[] = { @@ -897,7 +912,8 @@ public class UPCExpressionParserprs implements lpg.lpgjavaruntime.ParseTable, UP }; }; public final static byte scopeLa[] = ScopeLa.scopeLa; - public final int scopeLa(int index) { return scopeLa[index]; } + @Override + public final int scopeLa(int index) { return scopeLa[index]; } public interface ScopeStateSet { public final static byte scopeStateSet[] = { @@ -909,7 +925,8 @@ public class UPCExpressionParserprs implements lpg.lpgjavaruntime.ParseTable, UP }; }; public final static byte scopeStateSet[] = ScopeStateSet.scopeStateSet; - public final int scopeStateSet(int index) { return scopeStateSet[index]; } + @Override + public final int scopeStateSet(int index) { return scopeStateSet[index]; } public interface ScopeRhs { public final static char scopeRhs[] = {0, @@ -939,7 +956,8 @@ public class UPCExpressionParserprs implements lpg.lpgjavaruntime.ParseTable, UP }; }; public final static char scopeRhs[] = ScopeRhs.scopeRhs; - public final int scopeRhs(int index) { return scopeRhs[index]; } + @Override + public final int scopeRhs(int index) { return scopeRhs[index]; } public interface ScopeState { public final static char scopeState[] = {0, @@ -957,7 +975,8 @@ public class UPCExpressionParserprs implements lpg.lpgjavaruntime.ParseTable, UP }; }; public final static char scopeState[] = ScopeState.scopeState; - public final int scopeState(int index) { return scopeState[index]; } + @Override + public final int scopeState(int index) { return scopeState[index]; } public interface InSymb { public final static char inSymb[] = {0, @@ -987,7 +1006,8 @@ public class UPCExpressionParserprs implements lpg.lpgjavaruntime.ParseTable, UP }; }; public final static char inSymb[] = InSymb.inSymb; - public final int inSymb(int index) { return inSymb[index]; } + @Override + public final int inSymb(int index) { return inSymb[index]; } public interface Name { public final static String name[] = { @@ -1180,7 +1200,8 @@ public class UPCExpressionParserprs implements lpg.lpgjavaruntime.ParseTable, UP }; }; public final static String name[] = Name.name; - public final String name(int index) { return name[index]; } + @Override + public final String name(int index) { return name[index]; } public final static int ERROR_SYMBOL = 60, @@ -1188,10 +1209,14 @@ public class UPCExpressionParserprs implements lpg.lpgjavaruntime.ParseTable, UP SCOPE_SIZE = 49, MAX_NAME_LENGTH = 38; - public final int getErrorSymbol() { return ERROR_SYMBOL; } - public final int getScopeUbound() { return SCOPE_UBOUND; } - public final int getScopeSize() { return SCOPE_SIZE; } - public final int getMaxNameLength() { return MAX_NAME_LENGTH; } + @Override + public final int getErrorSymbol() { return ERROR_SYMBOL; } + @Override + public final int getScopeUbound() { return SCOPE_UBOUND; } + @Override + public final int getScopeSize() { return SCOPE_SIZE; } + @Override + public final int getMaxNameLength() { return MAX_NAME_LENGTH; } public final static int NUM_STATES = 226, @@ -1211,47 +1236,70 @@ public class UPCExpressionParserprs implements lpg.lpgjavaruntime.ParseTable, UP public final static boolean BACKTRACK = true; - public final int getNumStates() { return NUM_STATES; } - public final int getNtOffset() { return NT_OFFSET; } - public final int getLaStateOffset() { return LA_STATE_OFFSET; } - public final int getMaxLa() { return MAX_LA; } - public final int getNumRules() { return NUM_RULES; } - public final int getNumNonterminals() { return NUM_NONTERMINALS; } - public final int getNumSymbols() { return NUM_SYMBOLS; } - public final int getSegmentSize() { return SEGMENT_SIZE; } - public final int getStartState() { return START_STATE; } - public final int getStartSymbol() { return lhs[0]; } + @Override + public final int getNumStates() { return NUM_STATES; } + @Override + public final int getNtOffset() { return NT_OFFSET; } + @Override + public final int getLaStateOffset() { return LA_STATE_OFFSET; } + @Override + public final int getMaxLa() { return MAX_LA; } + @Override + public final int getNumRules() { return NUM_RULES; } + @Override + public final int getNumNonterminals() { return NUM_NONTERMINALS; } + @Override + public final int getNumSymbols() { return NUM_SYMBOLS; } + @Override + public final int getSegmentSize() { return SEGMENT_SIZE; } + @Override + public final int getStartState() { return START_STATE; } + @Override + public final int getStartSymbol() { return lhs[0]; } public final int getIdentifierSymbol() { return IDENTIFIER_SYMBOL; } - public final int getEoftSymbol() { return EOFT_SYMBOL; } - public final int getEoltSymbol() { return EOLT_SYMBOL; } - public final int getAcceptAction() { return ACCEPT_ACTION; } - public final int getErrorAction() { return ERROR_ACTION; } - public final boolean isValidForParser() { return isValidForParser; } - public final boolean getBacktrack() { return BACKTRACK; } + @Override + public final int getEoftSymbol() { return EOFT_SYMBOL; } + @Override + public final int getEoltSymbol() { return EOLT_SYMBOL; } + @Override + public final int getAcceptAction() { return ACCEPT_ACTION; } + @Override + public final int getErrorAction() { return ERROR_ACTION; } + @Override + public final boolean isValidForParser() { return isValidForParser; } + @Override + public final boolean getBacktrack() { return BACKTRACK; } - public final int originalState(int state) { + @Override + public final int originalState(int state) { return -baseCheck[state]; } - public final int asi(int state) { + @Override + public final int asi(int state) { return asb[originalState(state)]; } - public final int nasi(int state) { + @Override + public final int nasi(int state) { return nasb[originalState(state)]; } - public final int inSymbol(int state) { + @Override + public final int inSymbol(int state) { return inSymb[originalState(state)]; } - public final int ntAction(int state, int sym) { + @Override + public final int ntAction(int state, int sym) { return baseAction[state + sym]; } - public final int tAction(int state, int sym) { + @Override + public final int tAction(int state, int sym) { int i = baseAction[state], k = i + sym; return termAction[termCheck[k] == sym ? k : i]; } - public final int lookAhead(int la_state, int sym) { + @Override + public final int lookAhead(int la_state, int sym) { int k = la_state + sym; return termAction[termCheck[k] == sym ? k : la_state]; } diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCNoCastExpressionParser.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCNoCastExpressionParser.java index 5f8cb815fa5..c9d8520000e 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCNoCastExpressionParser.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCNoCastExpressionParser.java @@ -13,40 +13,58 @@ package org.eclipse.cdt.internal.core.dom.parser.upc; -import lpg.lpgjavaruntime.*; +import java.util.List; +import java.util.Map; -import java.util.*; -import org.eclipse.cdt.core.dom.ast.*; +import lpg.lpgjavaruntime.BadParseException; +import lpg.lpgjavaruntime.BadParseSymFileException; +import lpg.lpgjavaruntime.DiagnoseParser; +import lpg.lpgjavaruntime.ErrorToken; +import lpg.lpgjavaruntime.IToken; +import lpg.lpgjavaruntime.LexStream; +import lpg.lpgjavaruntime.Monitor; +import lpg.lpgjavaruntime.NotBacktrackParseTableException; +import lpg.lpgjavaruntime.NullExportedSymbolsException; +import lpg.lpgjavaruntime.NullTerminalSymbolsException; +import lpg.lpgjavaruntime.ParseErrorCodes; +import lpg.lpgjavaruntime.ParseTable; +import lpg.lpgjavaruntime.PrsStream; +import lpg.lpgjavaruntime.RuleAction; +import lpg.lpgjavaruntime.Token; +import lpg.lpgjavaruntime.UndefinedEofSymbolException; +import lpg.lpgjavaruntime.UnimplementedTerminalsException; + +import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression; +import org.eclipse.cdt.core.dom.ast.IASTCompletionNode; +import org.eclipse.cdt.core.dom.ast.IASTCompositeTypeSpecifier; +import org.eclipse.cdt.core.dom.ast.IASTElaboratedTypeSpecifier; +import org.eclipse.cdt.core.dom.ast.IASTExpression; +import org.eclipse.cdt.core.dom.ast.IASTLiteralExpression; +import org.eclipse.cdt.core.dom.ast.IASTTypeIdExpression; +import org.eclipse.cdt.core.dom.ast.IASTUnaryExpression; +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.ISecondaryParser; import org.eclipse.cdt.core.dom.lrparser.ITokenCollector; -import org.eclipse.cdt.core.dom.lrparser.CPreprocessorAdapter; +import org.eclipse.cdt.core.dom.lrparser.action.ITokenMap; 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.ITokenMap; import org.eclipse.cdt.core.dom.lrparser.action.TokenMap; -import org.eclipse.cdt.core.dom.lrparser.ISecondaryParser; - -import org.eclipse.cdt.internal.core.dom.parser.c.CNodeFactory; -import org.eclipse.cdt.core.dom.lrparser.action.c99.C99BuildASTParserAction; -import org.eclipse.cdt.core.dom.lrparser.action.c99.C99SecondaryParserFactory; - +import org.eclipse.cdt.core.dom.lrparser.lpgextensions.FixedBacktrackingParser; +import org.eclipse.cdt.core.dom.parser.IBuiltinBindingsProvider; import org.eclipse.cdt.core.dom.parser.upc.UPCASTNodeFactory; -import org.eclipse.cdt.core.dom.parser.upc.UPCSecondaryParserFactory; import org.eclipse.cdt.core.dom.parser.upc.UPCParserAction; +import org.eclipse.cdt.core.dom.parser.upc.UPCSecondaryParserFactory; import org.eclipse.cdt.core.dom.upc.ast.IUPCASTKeywordExpression; import org.eclipse.cdt.core.dom.upc.ast.IUPCASTSynchronizationStatement; import org.eclipse.cdt.core.dom.upc.ast.IUPCASTUnarySizeofExpression; -import org.eclipse.cdt.core.dom.lrparser.lpgextensions.FixedBacktrackingParser; +import org.eclipse.cdt.core.index.IIndex; +import org.eclipse.cdt.core.parser.IScanner; -public class UPCNoCastExpressionParser extends PrsStream implements RuleAction, ITokenStream, - ITokenCollector, IParser< IASTExpression > - , ISecondaryParser< IASTExpression > +public class UPCNoCastExpressionParser extends PrsStream implements RuleAction, ITokenStream, + ITokenCollector, IParser< IASTExpression > + , ISecondaryParser< IASTExpression > { private static ParseTable prs = new UPCNoCastExpressionParserprs(); private FixedBacktrackingParser btParser; @@ -57,7 +75,7 @@ public class UPCNoCastExpressionParser extends PrsStream implements RuleAction, public int getRhsTokenIndex(int i) { return btParser.getToken(i); } public IToken getRhsIToken(int i) { return super.getIToken(getRhsTokenIndex(i)); } - + public int getRhsFirstTokenIndex(int i) { return btParser.getFirstToken(i); } public IToken getRhsFirstIToken(int i) { return super.getIToken(getRhsFirstTokenIndex(i)); } @@ -65,10 +83,12 @@ public class UPCNoCastExpressionParser extends PrsStream implements RuleAction, public IToken getRhsLastIToken(int i) { return super.getIToken(getRhsLastTokenIndex(i)); } public int getLeftSpan() { return btParser.getFirstToken(); } - public IToken getLeftIToken() { return super.getIToken(getLeftSpan()); } + @Override + public IToken getLeftIToken() { return super.getIToken(getLeftSpan()); } public int getRightSpan() { return btParser.getLastToken(); } - public IToken getRightIToken() { return super.getIToken(getRightSpan()); } + @Override + public IToken getRightIToken() { return super.getIToken(getRightSpan()); } public int getRhsErrorTokenIndex(int i) { @@ -102,23 +122,24 @@ public class UPCNoCastExpressionParser extends PrsStream implements RuleAction, for (int i = 0; i < unimplemented_symbols.size(); i++) { Integer id = (Integer) unimplemented_symbols.get(i); - System.out.println(" " + UPCNoCastExpressionParsersym.orderedTerminalSymbols[id.intValue()]); + System.out.println(" " + UPCNoCastExpressionParsersym.orderedTerminalSymbols[id.intValue()]); } - System.out.println(); + System.out.println(); } catch(UndefinedEofSymbolException e) { throw new Error(new UndefinedEofSymbolException ("The Lexer does not implement the Eof symbol " + UPCNoCastExpressionParsersym.orderedTerminalSymbols[UPCNoCastExpressionParserprs.EOFT_SYMBOL])); - } + } } - public String[] orderedTerminalSymbols() { return UPCNoCastExpressionParsersym.orderedTerminalSymbols; } + @Override + public String[] orderedTerminalSymbols() { return UPCNoCastExpressionParsersym.orderedTerminalSymbols; } public String getTokenKindName(int kind) { return UPCNoCastExpressionParsersym.orderedTerminalSymbols[kind]; } public int getEOFTokenKind() { return UPCNoCastExpressionParserprs.EOFT_SYMBOL; } - public PrsStream getParseStream() { return (PrsStream) this; } - + public PrsStream getParseStream() { return this; } + // // Report error message for given error_token. // @@ -141,12 +162,12 @@ public class UPCNoCastExpressionParser extends PrsStream implements RuleAction, { parser(null, 0); } - + public void parser(Monitor monitor) { parser(monitor, 0); } - + public void parser(int error_repair_count) { parser(null, error_repair_count); @@ -156,7 +177,7 @@ public class UPCNoCastExpressionParser extends PrsStream implements RuleAction, { try { - btParser = new FixedBacktrackingParser(monitor, (TokenStream) this, prs, (RuleAction) this); + btParser = new FixedBacktrackingParser(monitor, this, prs, this); } catch (NotBacktrackParseTableException e) { @@ -193,24 +214,26 @@ public UPCNoCastExpressionParser(IScanner scanner, IDOMTokenMap tokenMap, IBuilt private void initActions(Map<String,String> properties) { ScopedStack<Object> astStack = new ScopedStack<Object>(); - + action = new UPCParserAction (this, astStack, new UPCASTNodeFactory() , UPCSecondaryParserFactory.getDefault() ); action.setParserProperties(properties); - - + + } +@Override public void addToken(IToken token) { token.setKind(mapKind(token.getKind())); // TODO does mapKind need to be called? super.addToken(token); } +@Override public IASTExpression parse() { // this has to be done, or... kaboom! setStreamLength(getSize()); - + final int errorRepairCount = -1; // -1 means full error handling parser(null, errorRepairCount); // do the actual parse super.resetTokenStream(); // allow tokens to be garbage collected @@ -220,19 +243,23 @@ public IASTExpression parse() { } +@Override public IASTCompletionNode getCompletionNode() { return compNode; } // uncomment this method to use with backtracking parser +@Override public List<IToken> getRuleTokens() { return getTokens().subList(getLeftSpan(), getRightSpan() + 1); } +@Override public String[] getOrderedTerminalSymbols() { return UPCNoCastExpressionParsersym.orderedTerminalSymbols; } +@Override @SuppressWarnings("nls") public String getName() { return "UPCNoCastExpressionParser"; @@ -242,6 +269,7 @@ public String getName() { private ITokenMap tokenMap = null; +@Override public void setTokens(List<IToken> tokens) { resetTokenStream(); addToken(new Token(null, 0, 0, 0)); // dummy token @@ -255,1323 +283,1324 @@ public void setTokens(List<IToken> tokens) { public UPCNoCastExpressionParser(ITokenStream stream, Map<String,String> properties) { // constructor for creating secondary parser initActions(properties); tokenMap = new TokenMap(UPCNoCastExpressionParsersym.orderedTerminalSymbols, stream.getOrderedTerminalSymbols()); -} +} - public void ruleAction(int ruleNumber) + @Override + public void ruleAction(int ruleNumber) { switch (ruleNumber) { - + // // Rule 1: <openscope-ast> ::= $Empty // case 1: { action. openASTScope(); break; - } - + } + // // Rule 2: <empty> ::= $Empty // case 2: { action. consumeEmpty(); break; - } - + } + // // Rule 13: literal ::= integer // case 13: { action. consumeExpressionLiteral(IASTLiteralExpression.lk_integer_constant); break; - } - + } + // // Rule 14: literal ::= floating // case 14: { action. consumeExpressionLiteral(IASTLiteralExpression.lk_float_constant); break; - } - + } + // // Rule 15: literal ::= charconst // case 15: { action. consumeExpressionLiteral(IASTLiteralExpression.lk_char_constant); break; - } - + } + // // Rule 16: literal ::= stringlit // case 16: { action. consumeExpressionLiteral(IASTLiteralExpression.lk_string_literal); break; - } - + } + // // Rule 18: primary_expression ::= primary_expression_id // case 18: { action. consumeExpressionID(); break; - } - + } + // // Rule 19: primary_expression ::= ( expression ) // case 19: { action. consumeExpressionBracketed(); break; - } - + } + // // Rule 22: postfix_expression ::= postfix_expression [ expression ] // case 22: { action. consumeExpressionArraySubscript(); break; - } - + } + // // Rule 23: postfix_expression ::= postfix_expression ( expression_list_opt ) // case 23: { action. consumeExpressionFunctionCall(); break; - } - + } + // // Rule 24: postfix_expression ::= postfix_expression . member_name // case 24: { action. consumeExpressionFieldReference(false); break; - } - + } + // // Rule 25: postfix_expression ::= postfix_expression -> member_name // case 25: { action. consumeExpressionFieldReference(true); break; - } - + } + // // Rule 26: postfix_expression ::= postfix_expression ++ // case 26: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_postFixIncr); break; - } - + } + // // Rule 27: postfix_expression ::= postfix_expression -- // case 27: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_postFixDecr); break; - } - + } + // // Rule 28: postfix_expression ::= ( type_id ) initializer_list // case 28: { action. consumeExpressionTypeIdInitializer(); break; - } - + } + // // Rule 33: unary_expression ::= ++ unary_expression // case 33: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_prefixIncr); break; - } - + } + // // Rule 34: unary_expression ::= -- unary_expression // case 34: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_prefixDecr); break; - } - + } + // // Rule 35: unary_expression ::= & cast_expression // case 35: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_amper); break; - } - + } + // // Rule 36: unary_expression ::= * cast_expression // case 36: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_star); break; - } - + } + // // Rule 37: unary_expression ::= + cast_expression // case 37: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_plus); break; - } - + } + // // Rule 38: unary_expression ::= - cast_expression // case 38: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_minus); break; - } - + } + // // Rule 39: unary_expression ::= ~ cast_expression // case 39: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_tilde); break; - } - + } + // // Rule 40: unary_expression ::= ! cast_expression // case 40: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_not); break; - } - + } + // // Rule 41: unary_expression ::= sizeof unary_expression // case 41: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_sizeof); break; - } - + } + // // Rule 42: unary_expression ::= sizeof ( type_id ) // case 42: { action. consumeExpressionTypeId(IASTTypeIdExpression.op_sizeof); break; - } - + } + // // Rule 45: multiplicative_expression ::= multiplicative_expression * cast_expression // case 45: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_multiply); break; - } - + } + // // Rule 46: multiplicative_expression ::= multiplicative_expression / cast_expression // case 46: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_divide); break; - } - + } + // // Rule 47: multiplicative_expression ::= multiplicative_expression % cast_expression // case 47: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_modulo); break; - } - + } + // // Rule 49: additive_expression ::= additive_expression + multiplicative_expression // case 49: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_plus); break; - } - + } + // // Rule 50: additive_expression ::= additive_expression - multiplicative_expression // case 50: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_minus); break; - } - + } + // // Rule 52: shift_expression ::= shift_expression << additive_expression // case 52: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_shiftLeft); break; - } - + } + // // Rule 53: shift_expression ::= shift_expression >> additive_expression // case 53: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_shiftRight); break; - } - + } + // // Rule 55: relational_expression ::= relational_expression < shift_expression // case 55: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_lessThan); break; - } - + } + // // Rule 56: relational_expression ::= relational_expression > shift_expression // case 56: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_greaterThan); break; - } - + } + // // Rule 57: relational_expression ::= relational_expression <= shift_expression // case 57: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_lessEqual); break; - } - + } + // // Rule 58: relational_expression ::= relational_expression >= shift_expression // case 58: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_greaterEqual); break; - } - + } + // // Rule 60: equality_expression ::= equality_expression == relational_expression // case 60: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_equals); break; - } - + } + // // Rule 61: equality_expression ::= equality_expression != relational_expression // case 61: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_notequals); break; - } - + } + // // Rule 63: and_expression ::= and_expression & equality_expression // case 63: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_binaryAnd); break; - } - + } + // // Rule 65: exclusive_or_expression ::= exclusive_or_expression ^ and_expression // case 65: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_binaryXor); break; - } - + } + // // Rule 67: inclusive_or_expression ::= inclusive_or_expression | exclusive_or_expression // case 67: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_binaryOr); break; - } - + } + // // Rule 69: logical_and_expression ::= logical_and_expression && inclusive_or_expression // case 69: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_logicalAnd); break; - } - + } + // // Rule 71: logical_or_expression ::= logical_or_expression || logical_and_expression // case 71: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_logicalOr); break; - } - + } + // // Rule 73: conditional_expression ::= logical_or_expression ? expression : assignment_expression // case 73: { action. consumeExpressionConditional(); break; - } - + } + // // Rule 75: assignment_expression ::= unary_expression = assignment_expression // case 75: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_assign); break; - } - + } + // // Rule 76: assignment_expression ::= unary_expression *= assignment_expression // case 76: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_multiplyAssign); break; - } - + } + // // Rule 77: assignment_expression ::= unary_expression /= assignment_expression // case 77: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_divideAssign); break; - } - + } + // // Rule 78: assignment_expression ::= unary_expression %= assignment_expression // case 78: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_moduloAssign); break; - } - + } + // // Rule 79: assignment_expression ::= unary_expression += assignment_expression // case 79: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_plusAssign); break; - } - + } + // // Rule 80: assignment_expression ::= unary_expression -= assignment_expression // case 80: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_minusAssign); break; - } - + } + // // Rule 81: assignment_expression ::= unary_expression <<= assignment_expression // case 81: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_shiftLeftAssign); break; - } - + } + // // Rule 82: assignment_expression ::= unary_expression >>= assignment_expression // case 82: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_shiftRightAssign); break; - } - + } + // // Rule 83: assignment_expression ::= unary_expression &= assignment_expression // case 83: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_binaryAndAssign); break; - } - + } + // // Rule 84: assignment_expression ::= unary_expression ^= assignment_expression // case 84: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_binaryXorAssign); break; - } - + } + // // Rule 85: assignment_expression ::= unary_expression |= assignment_expression // case 85: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_binaryOrAssign); break; - } - + } + // // Rule 88: expression_list ::= <openscope-ast> expression_list_actual // case 88: { action. consumeExpressionList(); break; - } - + } + // // Rule 90: expression_list_opt ::= $Empty // case 90: { action. consumeEmpty(); break; - } - + } + // // Rule 100: statement ::= ERROR_TOKEN // case 100: { action. consumeStatementProblem(); break; - } - + } + // // Rule 101: labeled_statement ::= identifier_token : statement // case 101: { action. consumeStatementLabeled(); break; - } - + } + // // Rule 102: labeled_statement ::= case constant_expression : statement // case 102: { action. consumeStatementCase(); break; - } - + } + // // Rule 103: labeled_statement ::= default : statement // case 103: { action. consumeStatementDefault(); break; - } - + } + // // Rule 104: compound_statement ::= { } // case 104: { action. consumeStatementCompoundStatement(false); break; - } - + } + // // Rule 105: compound_statement ::= { <openscope-ast> block_item_list } // case 105: { action. consumeStatementCompoundStatement(true); break; - } - + } + // // Rule 109: block_item ::= declaration // case 109: { action. consumeStatementDeclarationWithDisambiguation(); break; - } - + } + // // Rule 110: expression_statement ::= ; // case 110: { action. consumeStatementNull(); break; - } - + } + // // Rule 111: expression_statement ::= expression_in_statement ; // case 111: { action. consumeStatementExpression(); break; - } - + } + // // Rule 112: selection_statement ::= if ( expression ) statement // case 112: { action. consumeStatementIf(false); break; - } - + } + // // Rule 113: selection_statement ::= if ( expression ) statement else statement // case 113: { action. consumeStatementIf(true); break; - } - + } + // // Rule 114: selection_statement ::= switch ( expression ) statement // case 114: { action. consumeStatementSwitch(); break; - } - + } + // // Rule 116: expression_opt ::= $Empty // case 116: { action. consumeEmpty(); break; - } - + } + // // Rule 117: iteration_statement ::= do statement while ( expression ) ; // case 117: { action. consumeStatementDoLoop(true); break; - } - + } + // // Rule 118: iteration_statement ::= do statement // case 118: { action. consumeStatementDoLoop(false); break; - } - + } + // // Rule 119: iteration_statement ::= while ( expression ) statement // case 119: { action. consumeStatementWhileLoop(); break; - } - + } + // // Rule 120: iteration_statement ::= for ( expression_opt ; expression_opt ; expression_opt ) statement // case 120: { action. consumeStatementForLoop(); break; - } - + } + // // Rule 121: iteration_statement ::= for ( declaration expression_opt ; expression_opt ) statement // case 121: { action. consumeStatementForLoop(); break; - } - + } + // // Rule 122: jump_statement ::= goto identifier_token ; // case 122: { action. consumeStatementGoto(); break; - } - + } + // // Rule 123: jump_statement ::= continue ; // case 123: { action. consumeStatementContinue(); break; - } - + } + // // Rule 124: jump_statement ::= break ; // case 124: { action. consumeStatementBreak(); break; - } - + } + // // Rule 125: jump_statement ::= return ; // case 125: { action. consumeStatementReturn(false); break; - } - + } + // // Rule 126: jump_statement ::= return expression ; // case 126: { action. consumeStatementReturn(true); break; - } - + } + // // Rule 127: declaration ::= declaration_specifiers ; // case 127: { action. consumeDeclarationSimple(false); break; - } - + } + // // Rule 128: declaration ::= declaration_specifiers <openscope-ast> init_declarator_list ; // case 128: { action. consumeDeclarationSimple(true); break; - } - + } + // // Rule 129: declaration_specifiers ::= <openscope-ast> simple_declaration_specifiers // case 129: { action. consumeDeclarationSpecifiersSimple(); break; - } - + } + // // Rule 130: declaration_specifiers ::= <openscope-ast> struct_or_union_declaration_specifiers // case 130: { action. consumeDeclarationSpecifiersStructUnionEnum(); break; - } - + } + // // Rule 131: declaration_specifiers ::= <openscope-ast> elaborated_declaration_specifiers // case 131: { action. consumeDeclarationSpecifiersStructUnionEnum(); break; - } - + } + // // Rule 132: declaration_specifiers ::= <openscope-ast> enum_declaration_specifiers // case 132: { action. consumeDeclarationSpecifiersStructUnionEnum(); break; - } - + } + // // Rule 133: declaration_specifiers ::= <openscope-ast> typdef_name_declaration_specifiers // case 133: { action. consumeDeclarationSpecifiersTypedefName(); break; - } - + } + // // Rule 158: init_declarator ::= complete_declarator = initializer // case 158: { action. consumeDeclaratorWithInitializer(true); break; - } - + } + // // Rule 160: storage_class_specifier ::= storage_class_specifier_token // case 160: { action. consumeToken(); break; - } - + } + // // Rule 166: simple_type_specifier ::= simple_type_specifier_token // case 166: { action. consumeToken(); break; - } - + } + // // Rule 179: type_name_specifier ::= identifier_token // case 179: { action. consumeToken(); break; - } - + } + // // Rule 180: struct_or_union_specifier ::= struct_or_union struct_or_union_specifier_hook { <openscope-ast> struct_declaration_list_opt } // case 180: { action. consumeTypeSpecifierComposite(false); break; - } - + } + // // Rule 181: struct_or_union_specifier ::= struct_or_union struct_or_union_specifier_hook identifier_token struct_or_union_specifier_suffix_hook { <openscope-ast> struct_declaration_list_opt } // case 181: { action. consumeTypeSpecifierComposite(true); break; - } - + } + // // Rule 186: elaborated_specifier ::= struct elaborated_specifier_hook identifier_token // case 186: { action. consumeTypeSpecifierElaborated(IASTCompositeTypeSpecifier.k_struct); break; - } - + } + // // Rule 187: elaborated_specifier ::= union elaborated_specifier_hook identifier_token // case 187: { action. consumeTypeSpecifierElaborated(IASTCompositeTypeSpecifier.k_union); break; - } - + } + // // Rule 188: elaborated_specifier ::= enum elaborated_specifier_hook identifier_token // case 188: { action. consumeTypeSpecifierElaborated(IASTElaboratedTypeSpecifier.k_enum); break; - } - + } + // // Rule 194: struct_declaration ::= specifier_qualifier_list <openscope-ast> struct_declarator_list ; // case 194: { action. consumeStructDeclaration(true); break; - } - + } + // // Rule 195: struct_declaration ::= specifier_qualifier_list ; // case 195: { action. consumeStructDeclaration(false); break; - } - + } + // // Rule 196: struct_declaration ::= ERROR_TOKEN // case 196: { action. consumeDeclarationProblem(); break; - } - + } + // // Rule 202: struct_declarator ::= : constant_expression // case 202: { action. consumeBitField(false); break; - } - + } + // // Rule 203: struct_declarator ::= declarator : constant_expression // case 203: { action. consumeBitField(true); break; - } - + } + // // Rule 204: enum_specifier ::= enum enum_specifier_hook { <openscope-ast> enumerator_list_opt comma_opt } // case 204: { action. consumeTypeSpecifierEnumeration(false); break; - } - + } + // // Rule 205: enum_specifier ::= enum enum_specifier_hook identifier_token { <openscope-ast> enumerator_list_opt comma_opt } // case 205: { action. consumeTypeSpecifierEnumeration(true); break; - } - + } + // // Rule 211: enumerator ::= identifier_token // case 211: { action. consumeEnumerator(false); break; - } - + } + // // Rule 212: enumerator ::= identifier_token = constant_expression // case 212: { action. consumeEnumerator(true); break; - } - + } + // // Rule 213: type_qualifier ::= type_qualifier_token // case 213: { action. consumeToken(); break; - } - + } + // // Rule 217: function_specifier ::= inline // case 217: { action. consumeToken(); break; - } - + } + // // Rule 219: declarator ::= <openscope-ast> pointer_seq direct_declarator // case 219: { action. consumeDeclaratorWithPointer(true); break; - } - + } + // // Rule 224: basic_direct_declarator ::= declarator_id_name // case 224: { action. consumeDirectDeclaratorIdentifier(); break; - } - + } + // // Rule 225: basic_direct_declarator ::= ( declarator ) // case 225: { action. consumeDirectDeclaratorBracketed(); break; - } - + } + // // Rule 226: declarator_id_name ::= identifier // case 226: { action. consumeIdentifierName(); break; - } - + } + // // Rule 227: array_direct_declarator ::= basic_direct_declarator array_modifier // case 227: { action. consumeDirectDeclaratorArrayDeclarator(true); break; - } - + } + // // Rule 228: array_direct_declarator ::= array_direct_declarator array_modifier // case 228: { action. consumeDirectDeclaratorArrayDeclarator(true); break; - } - + } + // // Rule 230: function_direct_declarator ::= basic_direct_declarator ( <openscope-ast> parameter_type_list ) // case 230: { action. consumeDirectDeclaratorFunctionDeclarator(true, true); break; - } - + } + // // Rule 231: function_direct_declarator ::= basic_direct_declarator ( ) // case 231: { action. consumeDirectDeclaratorFunctionDeclarator(true, false); break; - } - + } + // // Rule 233: function_declarator ::= <openscope-ast> pointer_seq function_direct_declarator // case 233: { action. consumeDeclaratorWithPointer(true); break; - } - + } + // // Rule 234: knr_direct_declarator ::= basic_direct_declarator ( <openscope-ast> identifier_list ) // case 234: { action. consumeDirectDeclaratorFunctionDeclaratorKnR(); break; - } - + } + // // Rule 236: knr_function_declarator ::= <openscope-ast> pointer_seq knr_direct_declarator // case 236: { action. consumeDeclaratorWithPointer(true); break; - } - + } + // // Rule 237: identifier_list ::= identifier // case 237: { action. consumeIdentifierKnR(); break; - } - + } + // // Rule 238: identifier_list ::= identifier_list , identifier // case 238: { action. consumeIdentifierKnR(); break; - } - + } + // // Rule 239: array_modifier ::= [ ] // case 239: { action. consumeDirectDeclaratorArrayModifier(false); break; - } - + } + // // Rule 240: array_modifier ::= [ <openscope-ast> array_modifier_type_qualifiers ] // case 240: { action. consumeDirectDeclaratorModifiedArrayModifier(false, false, true, false); break; - } - + } + // // Rule 241: array_modifier ::= [ assignment_expression ] // case 241: { action. consumeDirectDeclaratorArrayModifier(true); break; - } - + } + // // Rule 242: array_modifier ::= [ <openscope-ast> array_modifier_type_qualifiers assignment_expression ] // case 242: { action. consumeDirectDeclaratorModifiedArrayModifier(false, false, true, true); break; - } - + } + // // Rule 243: array_modifier ::= [ static assignment_expression ] // case 243: { action. consumeDirectDeclaratorModifiedArrayModifier(true, false, false, true); break; - } - + } + // // Rule 244: array_modifier ::= [ static <openscope-ast> array_modifier_type_qualifiers assignment_expression ] // case 244: { action. consumeDirectDeclaratorModifiedArrayModifier(true, false, true, true); break; - } - + } + // // Rule 245: array_modifier ::= [ <openscope-ast> array_modifier_type_qualifiers static assignment_expression ] // case 245: { action. consumeDirectDeclaratorModifiedArrayModifier(true, false, true, true); break; - } - + } + // // Rule 246: array_modifier ::= [ * ] // case 246: { action. consumeDirectDeclaratorModifiedArrayModifier(false, true, false, false); break; - } - + } + // // Rule 247: array_modifier ::= [ <openscope-ast> array_modifier_type_qualifiers * ] // case 247: { action. consumeDirectDeclaratorModifiedArrayModifier(false, true, true, false); break; - } - + } + // // Rule 249: pointer_seq ::= pointer_hook * pointer_hook // case 249: { action. consumePointer(); break; - } - + } + // // Rule 250: pointer_seq ::= pointer_seq pointer_hook * pointer_hook // case 250: { action. consumePointer(); break; - } - + } + // // Rule 251: pointer_seq ::= pointer_hook * pointer_hook <openscope-ast> type_qualifier_list // case 251: { action. consumePointerTypeQualifierList(); break; - } - + } + // // Rule 252: pointer_seq ::= pointer_seq pointer_hook * pointer_hook <openscope-ast> type_qualifier_list // case 252: { action. consumePointerTypeQualifierList(); break; - } - + } + // // Rule 256: parameter_type_list ::= parameter_list // case 256: { action. consumeEmpty(); break; - } - + } + // // Rule 257: parameter_type_list ::= parameter_list , ... // case 257: { action. consumePlaceHolder(); break; - } - + } + // // Rule 258: parameter_type_list ::= ... // case 258: { action. consumePlaceHolder(); break; - } - + } + // // Rule 261: parameter_declaration ::= declaration_specifiers complete_parameter_declarator // case 261: { action. consumeParameterDeclaration(); break; - } - + } + // // Rule 262: parameter_declaration ::= declaration_specifiers // case 262: { action. consumeParameterDeclarationWithoutDeclarator(); break; - } - + } + // // Rule 265: type_id ::= specifier_qualifier_list // case 265: { action. consumeTypeId(false); break; - } - + } + // // Rule 266: type_id ::= specifier_qualifier_list abstract_declarator // case 266: { action. consumeTypeId(true); break; - } - + } + // // Rule 268: abstract_declarator ::= <openscope-ast> pointer_seq // case 268: { action. consumeDeclaratorWithPointer(false); break; - } - + } + // // Rule 269: abstract_declarator ::= <openscope-ast> pointer_seq direct_abstract_declarator // case 269: { action. consumeDeclaratorWithPointer(true); break; - } - + } + // // Rule 273: basic_direct_abstract_declarator ::= ( abstract_declarator ) // case 273: { action. consumeDirectDeclaratorBracketed(); break; - } - + } + // // Rule 274: array_direct_abstract_declarator ::= array_modifier // case 274: { action. consumeDirectDeclaratorArrayDeclarator(false); break; - } - + } + // // Rule 275: array_direct_abstract_declarator ::= array_direct_abstract_declarator array_modifier // case 275: { action. consumeDirectDeclaratorArrayDeclarator(true); break; - } - + } + // // Rule 276: array_direct_abstract_declarator ::= basic_direct_abstract_declarator array_modifier // case 276: { action. consumeDirectDeclaratorArrayDeclarator(true); break; - } - + } + // // Rule 277: function_direct_abstract_declarator ::= ( ) // case 277: { action. consumeDirectDeclaratorFunctionDeclarator(false, false); break; - } - + } + // // Rule 278: function_direct_abstract_declarator ::= basic_direct_abstract_declarator ( ) // case 278: { action. consumeDirectDeclaratorFunctionDeclarator(true, false); break; - } - + } + // // Rule 279: function_direct_abstract_declarator ::= ( <openscope-ast> parameter_type_list ) // case 279: { action. consumeDirectDeclaratorFunctionDeclarator(false, true); break; - } - + } + // // Rule 280: function_direct_abstract_declarator ::= basic_direct_abstract_declarator ( <openscope-ast> parameter_type_list ) // case 280: { action. consumeDirectDeclaratorFunctionDeclarator(true, true); break; - } - + } + // // Rule 281: initializer ::= assignment_expression // case 281: { action. consumeInitializer(); break; - } - + } + // // Rule 282: initializer ::= initializer_list // case 282: { action. consumeInitializer(); break; - } - + } + // // Rule 283: initializer_list ::= start_initializer_list { <openscope-ast> initializer_seq comma_opt } end_initializer_list // case 283: { action. consumeInitializerList(); break; - } - + } + // // Rule 284: initializer_list ::= { <openscope-ast> } // case 284: { action. consumeInitializerList(); break; - } - + } + // // Rule 285: start_initializer_list ::= $Empty // case 285: { action. initializerListStart(); break; - } - + } + // // Rule 286: end_initializer_list ::= $Empty // case 286: { action. initializerListEnd(); break; - } - + } + // // Rule 291: designated_initializer ::= <openscope-ast> designation = initializer // case 291: { action. consumeInitializerDesignated(); break; - } - + } + // // Rule 295: designator_base ::= [ constant_expression ] // case 295: { action. consumeDesignatorArray(); break; - } - + } + // // Rule 296: designator_base ::= . identifier_token // case 296: { action. consumeDesignatorField(); break; - } - + } + // // Rule 297: designator ::= [ constant_expression ] // case 297: { action. consumeDesignatorArray(); break; - } - + } + // // Rule 298: designator ::= . identifier_token // case 298: { action. consumeDesignatorField(); break; - } - + } + // // Rule 299: translation_unit ::= external_declaration_list // case 299: { action. consumeTranslationUnit(); break; - } - + } + // // Rule 300: translation_unit ::= $Empty // case 300: { action. consumeTranslationUnit(); break; - } - + } + // // Rule 305: external_declaration ::= ; // case 305: { action. consumeDeclarationEmpty(); break; - } - + } + // // Rule 306: external_declaration ::= ERROR_TOKEN // case 306: { action. consumeDeclarationProblem(); break; - } - + } + // // Rule 310: function_definition ::= <openscope-ast> function_declarator function_body // case 310: { action. consumeFunctionDefinition(false); break; - } - + } + // // Rule 311: function_definition ::= declaration_specifiers <openscope-ast> knr_function_declarator <openscope-ast> declaration_list compound_statement // case 311: { action. consumeFunctionDefinitionKnR(); break; - } - + } + // // Rule 312: normal_function_definition ::= declaration_specifiers <openscope-ast> function_declarator function_body // case 312: { action. consumeFunctionDefinition(true); break; - } - + } + // // Rule 313: function_body ::= { } // case 313: { action. consumeStatementCompoundStatement(false); break; - } - + } + // // Rule 314: function_body ::= { <openscope-ast> block_item_list } // case 314: { action. consumeStatementCompoundStatement(true); break; - } - + } + // // Rule 316: no_cast_start ::= ERROR_TOKEN // case 316: { action. consumeEmpty(); break; - } - + } + // // Rule 317: literal ::= MYTHREAD // case 317: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_mythread); break; - } - + } + // // Rule 318: literal ::= THREADS // case 318: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_threads); break; - } - + } + // // Rule 319: literal ::= UPC_MAX_BLOCKSIZE // case 319: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_upc_max_block_size); break; - } - + } + // // Rule 320: unary_expression ::= upc_localsizeof unary_expression // case 320: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_localsizeof); break; - } - + } + // // Rule 321: unary_expression ::= upc_localsizeof ( type_id ) // case 321: { action. consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_localsizeof); break; - } - + } + // // Rule 322: unary_expression ::= upc_blocksizeof unary_expression // case 322: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_blocksizeof); break; - } - + } + // // Rule 323: unary_expression ::= upc_blocksizeof ( type_id ) // case 323: { action. consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_blocksizeof); break; - } - + } + // // Rule 324: unary_expression ::= upc_elemsizeof unary_expression // case 324: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_elemsizeof); break; - } - + } + // // Rule 325: unary_expression ::= upc_elemsizeof ( type_id ) // case 325: { action. consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_elemsizeof); break; - } - + } + // // Rule 329: shared_type_qualifier ::= shared // case 329: { action. consumeToken(); break; - } - + } + // // Rule 330: reference_type_qualifier ::= relaxed // case 330: { action. consumeToken(); break; - } - + } + // // Rule 331: reference_type_qualifier ::= strict // case 331: { action. consumeToken(); break; - } - + } + // // Rule 332: layout_qualifier ::= [ constant_expression ] // case 332: { action. consumeLayoutQualifier(true, false); break; - } - + } + // // Rule 333: layout_qualifier ::= [ * ] // case 333: { action. consumeLayoutQualifier(false, true); break; - } - + } + // // Rule 334: layout_qualifier ::= [ ] // case 334: { action. consumeLayoutQualifier(false, false); break; - } - + } + // // Rule 336: synchronization_statement ::= upc_notify expression ; // case 336: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_notify, true); break; - } - + } + // // Rule 337: synchronization_statement ::= upc_notify ; // case 337: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_notify, false); break; - } - + } + // // Rule 338: synchronization_statement ::= upc_wait expression ; // case 338: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_wait, true); break; - } - + } + // // Rule 339: synchronization_statement ::= upc_wait ; // case 339: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_wait, false); break; - } - + } + // // Rule 340: synchronization_statement ::= upc_barrier expression ; // case 340: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_barrier, true); break; - } - + } + // // Rule 341: synchronization_statement ::= upc_barrier ; // case 341: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_barrier, false); break; - } - + } + // // Rule 342: synchronization_statement ::= upc_fence ; // case 342: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_fence, false); break; - } - + } + // // Rule 343: iteration_statement ::= upc_forall ( expression ; expression ; expression ; affinity ) statement // case 343: { action. consumeStatementUPCForallLoop(true, true, true, true); break; - } - + } + // // Rule 344: iteration_statement ::= upc_forall ( expression ; expression ; expression ; ) statement // case 344: { action. consumeStatementUPCForallLoop(true, true, true, false); break; - } - + } + // // Rule 345: iteration_statement ::= upc_forall ( expression ; expression ; ; affinity ) statement // case 345: { action. consumeStatementUPCForallLoop(true, true, false, true); break; - } - + } + // // Rule 346: iteration_statement ::= upc_forall ( expression ; expression ; ; ) statement // case 346: { action. consumeStatementUPCForallLoop(true, true, false, false); break; - } - + } + // // Rule 347: iteration_statement ::= upc_forall ( expression ; ; expression ; affinity ) statement // case 347: { action. consumeStatementUPCForallLoop(true, false, true, true); break; - } - + } + // // Rule 348: iteration_statement ::= upc_forall ( expression ; ; expression ; ) statement // case 348: { action. consumeStatementUPCForallLoop(true, false, true, false); break; - } - + } + // // Rule 349: iteration_statement ::= upc_forall ( expression ; ; ; affinity ) statement // case 349: { action. consumeStatementUPCForallLoop(true, false, false, true); break; - } - + } + // // Rule 350: iteration_statement ::= upc_forall ( expression ; ; ; ) statement // case 350: { action. consumeStatementUPCForallLoop(true, false, false, false); break; - } - + } + // // Rule 351: iteration_statement ::= upc_forall ( ; expression ; expression ; affinity ) statement // case 351: { action. consumeStatementUPCForallLoop(false, true, true, true); break; - } - + } + // // Rule 352: iteration_statement ::= upc_forall ( ; expression ; expression ; ) statement // case 352: { action. consumeStatementUPCForallLoop(false, true, true, false); break; - } - + } + // // Rule 353: iteration_statement ::= upc_forall ( ; expression ; ; affinity ) statement // case 353: { action. consumeStatementUPCForallLoop(false, true, false, true); break; - } - + } + // // Rule 354: iteration_statement ::= upc_forall ( ; expression ; ; ) statement // case 354: { action. consumeStatementUPCForallLoop(false, true, false, false); break; - } - + } + // // Rule 355: iteration_statement ::= upc_forall ( ; ; expression ; affinity ) statement // case 355: { action. consumeStatementUPCForallLoop(false, false, true, true); break; - } - + } + // // Rule 356: iteration_statement ::= upc_forall ( ; ; expression ; ) statement // case 356: { action. consumeStatementUPCForallLoop(false, false, true, false); break; - } - + } + // // Rule 357: iteration_statement ::= upc_forall ( ; ; ; affinity ) statement // case 357: { action. consumeStatementUPCForallLoop(false, false, false, true); break; - } - + } + // // Rule 358: iteration_statement ::= upc_forall ( ; ; ; ) statement // case 358: { action. consumeStatementUPCForallLoop(false, false, false, false); break; - } - + } + // // Rule 359: iteration_statement ::= upc_forall ( declaration expression ; expression ; affinity ) statement // case 359: { action. consumeStatementUPCForallLoop(true, true, true, true); break; - } - + } + // // Rule 360: iteration_statement ::= upc_forall ( declaration expression ; expression ; ) statement // case 360: { action. consumeStatementUPCForallLoop(true, true, true, false); break; - } - + } + // // Rule 361: iteration_statement ::= upc_forall ( declaration expression ; ; affinity ) statement // case 361: { action. consumeStatementUPCForallLoop(true, true, false, true); break; - } - + } + // // Rule 362: iteration_statement ::= upc_forall ( declaration expression ; ; ) statement // case 362: { action. consumeStatementUPCForallLoop(true, true, false, false); break; - } - + } + // // Rule 363: iteration_statement ::= upc_forall ( declaration ; expression ; affinity ) statement // case 363: { action. consumeStatementUPCForallLoop(true, false, true, true); break; - } - + } + // // Rule 364: iteration_statement ::= upc_forall ( declaration ; expression ; ) statement // case 364: { action. consumeStatementUPCForallLoop(true, false, true, false); break; - } - + } + // // Rule 365: iteration_statement ::= upc_forall ( declaration ; ; affinity ) statement // 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; - } + } + - default: break; } diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCNoCastExpressionParserprs.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCNoCastExpressionParserprs.java index 3bf55cd1e7e..f8486ae3285 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCNoCastExpressionParserprs.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCNoCastExpressionParserprs.java @@ -229,9 +229,11 @@ public class UPCNoCastExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static short baseCheck[] = BaseCheck.baseCheck; - public final int baseCheck(int index) { return baseCheck[index]; } + @Override + public final int baseCheck(int index) { return baseCheck[index]; } public final static short rhs[] = baseCheck; - public final int rhs(int index) { return rhs[index]; }; + @Override + public final int rhs(int index) { return rhs[index]; }; public interface BaseAction { public final static char baseAction[] = { @@ -431,9 +433,11 @@ public class UPCNoCastExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static char baseAction[] = BaseAction.baseAction; - public final int baseAction(int index) { return baseAction[index]; } + @Override + public final int baseAction(int index) { return baseAction[index]; } public final static char lhs[] = baseAction; - public final int lhs(int index) { return lhs[index]; }; + @Override + public final int lhs(int index) { return lhs[index]; }; public interface TermCheck { public final static byte termCheck[] = {0, @@ -546,7 +550,8 @@ public class UPCNoCastExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static byte termCheck[] = TermCheck.termCheck; - public final int termCheck(int index) { return termCheck[index]; } + @Override + public final int termCheck(int index) { return termCheck[index]; } public interface TermAction { public final static char termAction[] = {0, @@ -651,7 +656,8 @@ public class UPCNoCastExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static char termAction[] = TermAction.termAction; - public final int termAction(int index) { return termAction[index]; } + @Override + public final int termAction(int index) { return termAction[index]; } public interface Asb { public final static char asb[] = {0, @@ -681,7 +687,8 @@ public class UPCNoCastExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static char asb[] = Asb.asb; - public final int asb(int index) { return asb[index]; } + @Override + public final int asb(int index) { return asb[index]; } public interface Asr { public final static byte asr[] = {0, @@ -738,7 +745,8 @@ public class UPCNoCastExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static byte asr[] = Asr.asr; - public final int asr(int index) { return asr[index]; } + @Override + public final int asr(int index) { return asr[index]; } public interface Nasb { public final static byte nasb[] = {0, @@ -768,7 +776,8 @@ public class UPCNoCastExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static byte nasb[] = Nasb.nasb; - public final int nasb(int index) { return nasb[index]; } + @Override + public final int nasb(int index) { return nasb[index]; } public interface Nasr { public final static char nasr[] = {0, @@ -788,7 +797,8 @@ public class UPCNoCastExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static char nasr[] = Nasr.nasr; - public final int nasr(int index) { return nasr[index]; } + @Override + public final int nasr(int index) { return nasr[index]; } public interface TerminalIndex { public final static char terminalIndex[] = {0, @@ -806,7 +816,8 @@ public class UPCNoCastExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static char terminalIndex[] = TerminalIndex.terminalIndex; - public final int terminalIndex(int index) { return terminalIndex[index]; } + @Override + public final int terminalIndex(int index) { return terminalIndex[index]; } public interface NonterminalIndex { public final static char nonterminalIndex[] = {0, @@ -827,7 +838,8 @@ public class UPCNoCastExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static char nonterminalIndex[] = NonterminalIndex.nonterminalIndex; - public final int nonterminalIndex(int index) { return nonterminalIndex[index]; } + @Override + public final int nonterminalIndex(int index) { return nonterminalIndex[index]; } public interface ScopePrefix { public final static char scopePrefix[] = { @@ -839,7 +851,8 @@ public class UPCNoCastExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static char scopePrefix[] = ScopePrefix.scopePrefix; - public final int scopePrefix(int index) { return scopePrefix[index]; } + @Override + public final int scopePrefix(int index) { return scopePrefix[index]; } public interface ScopeSuffix { public final static char scopeSuffix[] = { @@ -851,7 +864,8 @@ public class UPCNoCastExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static char scopeSuffix[] = ScopeSuffix.scopeSuffix; - public final int scopeSuffix(int index) { return scopeSuffix[index]; } + @Override + public final int scopeSuffix(int index) { return scopeSuffix[index]; } public interface ScopeLhs { public final static char scopeLhs[] = { @@ -863,7 +877,8 @@ public class UPCNoCastExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static char scopeLhs[] = ScopeLhs.scopeLhs; - public final int scopeLhs(int index) { return scopeLhs[index]; } + @Override + public final int scopeLhs(int index) { return scopeLhs[index]; } public interface ScopeLa { public final static byte scopeLa[] = { @@ -875,7 +890,8 @@ public class UPCNoCastExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static byte scopeLa[] = ScopeLa.scopeLa; - public final int scopeLa(int index) { return scopeLa[index]; } + @Override + public final int scopeLa(int index) { return scopeLa[index]; } public interface ScopeStateSet { public final static byte scopeStateSet[] = { @@ -887,7 +903,8 @@ public class UPCNoCastExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static byte scopeStateSet[] = ScopeStateSet.scopeStateSet; - public final int scopeStateSet(int index) { return scopeStateSet[index]; } + @Override + public final int scopeStateSet(int index) { return scopeStateSet[index]; } public interface ScopeRhs { public final static char scopeRhs[] = {0, @@ -917,7 +934,8 @@ public class UPCNoCastExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static char scopeRhs[] = ScopeRhs.scopeRhs; - public final int scopeRhs(int index) { return scopeRhs[index]; } + @Override + public final int scopeRhs(int index) { return scopeRhs[index]; } public interface ScopeState { public final static char scopeState[] = {0, @@ -935,7 +953,8 @@ public class UPCNoCastExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static char scopeState[] = ScopeState.scopeState; - public final int scopeState(int index) { return scopeState[index]; } + @Override + public final int scopeState(int index) { return scopeState[index]; } public interface InSymb { public final static char inSymb[] = {0, @@ -965,7 +984,8 @@ public class UPCNoCastExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static char inSymb[] = InSymb.inSymb; - public final int inSymb(int index) { return inSymb[index]; } + @Override + public final int inSymb(int index) { return inSymb[index]; } public interface Name { public final static String name[] = { @@ -1158,7 +1178,8 @@ public class UPCNoCastExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static String name[] = Name.name; - public final String name(int index) { return name[index]; } + @Override + public final String name(int index) { return name[index]; } public final static int ERROR_SYMBOL = 60, @@ -1166,10 +1187,14 @@ public class UPCNoCastExpressionParserprs implements lpg.lpgjavaruntime.ParseTab SCOPE_SIZE = 48, MAX_NAME_LENGTH = 38; - public final int getErrorSymbol() { return ERROR_SYMBOL; } - public final int getScopeUbound() { return SCOPE_UBOUND; } - public final int getScopeSize() { return SCOPE_SIZE; } - public final int getMaxNameLength() { return MAX_NAME_LENGTH; } + @Override + public final int getErrorSymbol() { return ERROR_SYMBOL; } + @Override + public final int getScopeUbound() { return SCOPE_UBOUND; } + @Override + public final int getScopeSize() { return SCOPE_SIZE; } + @Override + public final int getMaxNameLength() { return MAX_NAME_LENGTH; } public final static int NUM_STATES = 223, @@ -1189,47 +1214,70 @@ public class UPCNoCastExpressionParserprs implements lpg.lpgjavaruntime.ParseTab public final static boolean BACKTRACK = true; - public final int getNumStates() { return NUM_STATES; } - public final int getNtOffset() { return NT_OFFSET; } - public final int getLaStateOffset() { return LA_STATE_OFFSET; } - public final int getMaxLa() { return MAX_LA; } - public final int getNumRules() { return NUM_RULES; } - public final int getNumNonterminals() { return NUM_NONTERMINALS; } - public final int getNumSymbols() { return NUM_SYMBOLS; } - public final int getSegmentSize() { return SEGMENT_SIZE; } - public final int getStartState() { return START_STATE; } - public final int getStartSymbol() { return lhs[0]; } + @Override + public final int getNumStates() { return NUM_STATES; } + @Override + public final int getNtOffset() { return NT_OFFSET; } + @Override + public final int getLaStateOffset() { return LA_STATE_OFFSET; } + @Override + public final int getMaxLa() { return MAX_LA; } + @Override + public final int getNumRules() { return NUM_RULES; } + @Override + public final int getNumNonterminals() { return NUM_NONTERMINALS; } + @Override + public final int getNumSymbols() { return NUM_SYMBOLS; } + @Override + public final int getSegmentSize() { return SEGMENT_SIZE; } + @Override + public final int getStartState() { return START_STATE; } + @Override + public final int getStartSymbol() { return lhs[0]; } public final int getIdentifierSymbol() { return IDENTIFIER_SYMBOL; } - public final int getEoftSymbol() { return EOFT_SYMBOL; } - public final int getEoltSymbol() { return EOLT_SYMBOL; } - public final int getAcceptAction() { return ACCEPT_ACTION; } - public final int getErrorAction() { return ERROR_ACTION; } - public final boolean isValidForParser() { return isValidForParser; } - public final boolean getBacktrack() { return BACKTRACK; } + @Override + public final int getEoftSymbol() { return EOFT_SYMBOL; } + @Override + public final int getEoltSymbol() { return EOLT_SYMBOL; } + @Override + public final int getAcceptAction() { return ACCEPT_ACTION; } + @Override + public final int getErrorAction() { return ERROR_ACTION; } + @Override + public final boolean isValidForParser() { return isValidForParser; } + @Override + public final boolean getBacktrack() { return BACKTRACK; } - public final int originalState(int state) { + @Override + public final int originalState(int state) { return -baseCheck[state]; } - public final int asi(int state) { + @Override + public final int asi(int state) { return asb[originalState(state)]; } - public final int nasi(int state) { + @Override + public final int nasi(int state) { return nasb[originalState(state)]; } - public final int inSymbol(int state) { + @Override + public final int inSymbol(int state) { return inSymb[originalState(state)]; } - public final int ntAction(int state, int sym) { + @Override + public final int ntAction(int state, int sym) { return baseAction[state + sym]; } - public final int tAction(int state, int sym) { + @Override + public final int tAction(int state, int sym) { int i = baseAction[state], k = i + sym; return termAction[termCheck[k] == sym ? k : i]; } - public final int lookAhead(int la_state, int sym) { + @Override + public final int lookAhead(int la_state, int sym) { int k = la_state + sym; return termAction[termCheck[k] == sym ? k : la_state]; } diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCParser.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCParser.java index a9cb5d1231e..8a5663cd0ef 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCParser.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCParser.java @@ -13,36 +13,55 @@ package org.eclipse.cdt.internal.core.dom.parser.upc; -import lpg.lpgjavaruntime.*; +import java.util.List; +import java.util.Map; -import java.util.*; -import org.eclipse.cdt.core.dom.ast.*; +import lpg.lpgjavaruntime.BadParseException; +import lpg.lpgjavaruntime.BadParseSymFileException; +import lpg.lpgjavaruntime.DiagnoseParser; +import lpg.lpgjavaruntime.ErrorToken; +import lpg.lpgjavaruntime.IToken; +import lpg.lpgjavaruntime.LexStream; +import lpg.lpgjavaruntime.Monitor; +import lpg.lpgjavaruntime.NotBacktrackParseTableException; +import lpg.lpgjavaruntime.NullExportedSymbolsException; +import lpg.lpgjavaruntime.NullTerminalSymbolsException; +import lpg.lpgjavaruntime.ParseErrorCodes; +import lpg.lpgjavaruntime.ParseTable; +import lpg.lpgjavaruntime.PrsStream; +import lpg.lpgjavaruntime.RuleAction; +import lpg.lpgjavaruntime.UndefinedEofSymbolException; +import lpg.lpgjavaruntime.UnimplementedTerminalsException; + +import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression; +import org.eclipse.cdt.core.dom.ast.IASTCastExpression; +import org.eclipse.cdt.core.dom.ast.IASTCompletionNode; +import org.eclipse.cdt.core.dom.ast.IASTCompositeTypeSpecifier; +import org.eclipse.cdt.core.dom.ast.IASTElaboratedTypeSpecifier; +import org.eclipse.cdt.core.dom.ast.IASTLiteralExpression; +import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; +import org.eclipse.cdt.core.dom.ast.IASTTypeIdExpression; +import org.eclipse.cdt.core.dom.ast.IASTUnaryExpression; +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.lrparser.lpgextensions.FixedBacktrackingParser; import org.eclipse.cdt.core.dom.parser.IBuiltinBindingsProvider; -import org.eclipse.cdt.core.index.IIndex; - -import org.eclipse.cdt.internal.core.dom.parser.c.CNodeFactory; -import org.eclipse.cdt.core.dom.lrparser.action.c99.C99BuildASTParserAction; -import org.eclipse.cdt.core.dom.lrparser.action.c99.C99SecondaryParserFactory; - import org.eclipse.cdt.core.dom.parser.upc.UPCASTNodeFactory; -import org.eclipse.cdt.core.dom.parser.upc.UPCSecondaryParserFactory; import org.eclipse.cdt.core.dom.parser.upc.UPCParserAction; +import org.eclipse.cdt.core.dom.parser.upc.UPCSecondaryParserFactory; import org.eclipse.cdt.core.dom.upc.ast.IUPCASTKeywordExpression; import org.eclipse.cdt.core.dom.upc.ast.IUPCASTSynchronizationStatement; import org.eclipse.cdt.core.dom.upc.ast.IUPCASTUnarySizeofExpression; -import org.eclipse.cdt.core.dom.lrparser.lpgextensions.FixedBacktrackingParser; +import org.eclipse.cdt.core.index.IIndex; +import org.eclipse.cdt.core.parser.IScanner; + +public class UPCParser extends PrsStream implements RuleAction, ITokenStream, + ITokenCollector, IParser< IASTTranslationUnit > -public class UPCParser extends PrsStream implements RuleAction, ITokenStream, - ITokenCollector, IParser< IASTTranslationUnit > - { private static ParseTable prs = new UPCParserprs(); private FixedBacktrackingParser btParser; @@ -53,7 +72,7 @@ public class UPCParser extends PrsStream implements RuleAction, ITokenStream, public int getRhsTokenIndex(int i) { return btParser.getToken(i); } public IToken getRhsIToken(int i) { return super.getIToken(getRhsTokenIndex(i)); } - + public int getRhsFirstTokenIndex(int i) { return btParser.getFirstToken(i); } public IToken getRhsFirstIToken(int i) { return super.getIToken(getRhsFirstTokenIndex(i)); } @@ -61,10 +80,12 @@ public class UPCParser extends PrsStream implements RuleAction, ITokenStream, public IToken getRhsLastIToken(int i) { return super.getIToken(getRhsLastTokenIndex(i)); } public int getLeftSpan() { return btParser.getFirstToken(); } - public IToken getLeftIToken() { return super.getIToken(getLeftSpan()); } + @Override + public IToken getLeftIToken() { return super.getIToken(getLeftSpan()); } public int getRightSpan() { return btParser.getLastToken(); } - public IToken getRightIToken() { return super.getIToken(getRightSpan()); } + @Override + public IToken getRightIToken() { return super.getIToken(getRightSpan()); } public int getRhsErrorTokenIndex(int i) { @@ -98,23 +119,24 @@ public class UPCParser extends PrsStream implements RuleAction, ITokenStream, for (int i = 0; i < unimplemented_symbols.size(); i++) { Integer id = (Integer) unimplemented_symbols.get(i); - System.out.println(" " + UPCParsersym.orderedTerminalSymbols[id.intValue()]); + System.out.println(" " + UPCParsersym.orderedTerminalSymbols[id.intValue()]); } - System.out.println(); + System.out.println(); } catch(UndefinedEofSymbolException e) { throw new Error(new UndefinedEofSymbolException ("The Lexer does not implement the Eof symbol " + UPCParsersym.orderedTerminalSymbols[UPCParserprs.EOFT_SYMBOL])); - } + } } - public String[] orderedTerminalSymbols() { return UPCParsersym.orderedTerminalSymbols; } + @Override + public String[] orderedTerminalSymbols() { return UPCParsersym.orderedTerminalSymbols; } public String getTokenKindName(int kind) { return UPCParsersym.orderedTerminalSymbols[kind]; } public int getEOFTokenKind() { return UPCParserprs.EOFT_SYMBOL; } - public PrsStream getParseStream() { return (PrsStream) this; } - + public PrsStream getParseStream() { return this; } + // // Report error message for given error_token. // @@ -137,12 +159,12 @@ public class UPCParser extends PrsStream implements RuleAction, ITokenStream, { parser(null, 0); } - + public void parser(Monitor monitor) { parser(monitor, 0); } - + public void parser(int error_repair_count) { parser(null, error_repair_count); @@ -152,7 +174,7 @@ public class UPCParser extends PrsStream implements RuleAction, ITokenStream, { try { - btParser = new FixedBacktrackingParser(monitor, (TokenStream) this, prs, (RuleAction) this); + btParser = new FixedBacktrackingParser(monitor, this, prs, this); } catch (NotBacktrackParseTableException e) { @@ -189,24 +211,26 @@ public UPCParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvid private void initActions(Map<String,String> properties) { ScopedStack<Object> astStack = new ScopedStack<Object>(); - + action = new UPCParserAction (this, astStack, new UPCASTNodeFactory() , UPCSecondaryParserFactory.getDefault() ); action.setParserProperties(properties); - - + + } +@Override public void addToken(IToken token) { token.setKind(mapKind(token.getKind())); // TODO does mapKind need to be called? super.addToken(token); } +@Override public IASTTranslationUnit parse() { // this has to be done, or... kaboom! setStreamLength(getSize()); - + final int errorRepairCount = -1; // -1 means full error handling parser(null, errorRepairCount); // do the actual parse super.resetTokenStream(); // allow tokens to be garbage collected @@ -216,1339 +240,1344 @@ public IASTTranslationUnit parse() { } +@Override public IASTCompletionNode getCompletionNode() { return compNode; } // uncomment this method to use with backtracking parser +@Override public List<IToken> getRuleTokens() { return getTokens().subList(getLeftSpan(), getRightSpan() + 1); } +@Override public String[] getOrderedTerminalSymbols() { return UPCParsersym.orderedTerminalSymbols; } +@Override @SuppressWarnings("nls") public String getName() { return "UPCParser"; } - public void ruleAction(int ruleNumber) + @Override + public void ruleAction(int ruleNumber) { switch (ruleNumber) { - + // // Rule 1: <openscope-ast> ::= $Empty // case 1: { action. openASTScope(); break; - } - + } + // // Rule 2: <empty> ::= $Empty // case 2: { action. consumeEmpty(); break; - } - + } + // // Rule 13: literal ::= integer // case 13: { action. consumeExpressionLiteral(IASTLiteralExpression.lk_integer_constant); break; - } - + } + // // Rule 14: literal ::= floating // case 14: { action. consumeExpressionLiteral(IASTLiteralExpression.lk_float_constant); break; - } - + } + // // Rule 15: literal ::= charconst // case 15: { action. consumeExpressionLiteral(IASTLiteralExpression.lk_char_constant); break; - } - + } + // // Rule 16: literal ::= stringlit // case 16: { action. consumeExpressionLiteral(IASTLiteralExpression.lk_string_literal); break; - } - + } + // // Rule 18: primary_expression ::= primary_expression_id // case 18: { action. consumeExpressionID(); break; - } - + } + // // Rule 19: primary_expression ::= ( expression ) // case 19: { action. consumeExpressionBracketed(); break; - } - + } + // // Rule 22: postfix_expression ::= postfix_expression [ expression ] // case 22: { action. consumeExpressionArraySubscript(); break; - } - + } + // // Rule 23: postfix_expression ::= postfix_expression ( expression_list_opt ) // case 23: { action. consumeExpressionFunctionCall(); break; - } - + } + // // Rule 24: postfix_expression ::= postfix_expression . member_name // case 24: { action. consumeExpressionFieldReference(false); break; - } - + } + // // Rule 25: postfix_expression ::= postfix_expression -> member_name // case 25: { action. consumeExpressionFieldReference(true); break; - } - + } + // // Rule 26: postfix_expression ::= postfix_expression ++ // case 26: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_postFixIncr); break; - } - + } + // // Rule 27: postfix_expression ::= postfix_expression -- // case 27: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_postFixDecr); break; - } - + } + // // Rule 28: postfix_expression ::= ( type_id ) initializer_list // case 28: { action. consumeExpressionTypeIdInitializer(); break; - } - + } + // // Rule 33: unary_expression ::= ++ unary_expression // case 33: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_prefixIncr); break; - } - + } + // // Rule 34: unary_expression ::= -- unary_expression // case 34: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_prefixDecr); break; - } - + } + // // Rule 35: unary_expression ::= & cast_expression // case 35: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_amper); break; - } - + } + // // Rule 36: unary_expression ::= * cast_expression // case 36: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_star); break; - } - + } + // // Rule 37: unary_expression ::= + cast_expression // case 37: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_plus); break; - } - + } + // // Rule 38: unary_expression ::= - cast_expression // case 38: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_minus); break; - } - + } + // // Rule 39: unary_expression ::= ~ cast_expression // case 39: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_tilde); break; - } - + } + // // Rule 40: unary_expression ::= ! cast_expression // case 40: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_not); break; - } - + } + // // Rule 41: unary_expression ::= sizeof unary_expression // case 41: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_sizeof); break; - } - + } + // // Rule 42: unary_expression ::= sizeof ( type_id ) // case 42: { action. consumeExpressionTypeId(IASTTypeIdExpression.op_sizeof); break; - } - + } + // // Rule 44: cast_expression ::= ( type_id ) cast_expression // case 44: { action. consumeExpressionCast(IASTCastExpression.op_cast); break; - } - + } + // // Rule 46: multiplicative_expression ::= multiplicative_expression * cast_expression // case 46: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_multiply); break; - } - + } + // // Rule 47: multiplicative_expression ::= multiplicative_expression / cast_expression // case 47: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_divide); break; - } - + } + // // Rule 48: multiplicative_expression ::= multiplicative_expression % cast_expression // case 48: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_modulo); break; - } - + } + // // Rule 50: additive_expression ::= additive_expression + multiplicative_expression // case 50: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_plus); break; - } - + } + // // Rule 51: additive_expression ::= additive_expression - multiplicative_expression // case 51: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_minus); break; - } - + } + // // Rule 53: shift_expression ::= shift_expression << additive_expression // case 53: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_shiftLeft); break; - } - + } + // // Rule 54: shift_expression ::= shift_expression >> additive_expression // case 54: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_shiftRight); break; - } - + } + // // Rule 56: relational_expression ::= relational_expression < shift_expression // case 56: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_lessThan); break; - } - + } + // // Rule 57: relational_expression ::= relational_expression > shift_expression // case 57: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_greaterThan); break; - } - + } + // // Rule 58: relational_expression ::= relational_expression <= shift_expression // case 58: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_lessEqual); break; - } - + } + // // Rule 59: relational_expression ::= relational_expression >= shift_expression // case 59: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_greaterEqual); break; - } - + } + // // Rule 61: equality_expression ::= equality_expression == relational_expression // case 61: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_equals); break; - } - + } + // // Rule 62: equality_expression ::= equality_expression != relational_expression // case 62: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_notequals); break; - } - + } + // // Rule 64: and_expression ::= and_expression & equality_expression // case 64: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_binaryAnd); break; - } - + } + // // Rule 66: exclusive_or_expression ::= exclusive_or_expression ^ and_expression // case 66: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_binaryXor); break; - } - + } + // // Rule 68: inclusive_or_expression ::= inclusive_or_expression | exclusive_or_expression // case 68: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_binaryOr); break; - } - + } + // // Rule 70: logical_and_expression ::= logical_and_expression && inclusive_or_expression // case 70: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_logicalAnd); break; - } - + } + // // Rule 72: logical_or_expression ::= logical_or_expression || logical_and_expression // case 72: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_logicalOr); break; - } - + } + // // Rule 74: conditional_expression ::= logical_or_expression ? expression : assignment_expression // case 74: { action. consumeExpressionConditional(); break; - } - + } + // // Rule 76: assignment_expression ::= unary_expression = assignment_expression // case 76: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_assign); break; - } - + } + // // Rule 77: assignment_expression ::= unary_expression *= assignment_expression // case 77: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_multiplyAssign); break; - } - + } + // // Rule 78: assignment_expression ::= unary_expression /= assignment_expression // case 78: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_divideAssign); break; - } - + } + // // Rule 79: assignment_expression ::= unary_expression %= assignment_expression // case 79: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_moduloAssign); break; - } - + } + // // Rule 80: assignment_expression ::= unary_expression += assignment_expression // case 80: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_plusAssign); break; - } - + } + // // Rule 81: assignment_expression ::= unary_expression -= assignment_expression // case 81: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_minusAssign); break; - } - + } + // // Rule 82: assignment_expression ::= unary_expression <<= assignment_expression // case 82: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_shiftLeftAssign); break; - } - + } + // // Rule 83: assignment_expression ::= unary_expression >>= assignment_expression // case 83: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_shiftRightAssign); break; - } - + } + // // Rule 84: assignment_expression ::= unary_expression &= assignment_expression // case 84: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_binaryAndAssign); break; - } - + } + // // Rule 85: assignment_expression ::= unary_expression ^= assignment_expression // case 85: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_binaryXorAssign); break; - } - + } + // // Rule 86: assignment_expression ::= unary_expression |= assignment_expression // case 86: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_binaryOrAssign); break; - } - + } + // // Rule 89: expression_list ::= <openscope-ast> expression_list_actual // case 89: { action. consumeExpressionList(); break; - } - + } + // // Rule 91: expression_list_opt ::= $Empty // case 91: { action. consumeEmpty(); break; - } - + } + // // Rule 101: statement ::= ERROR_TOKEN // case 101: { action. consumeStatementProblem(); break; - } - + } + // // Rule 102: labeled_statement ::= identifier_token : statement // case 102: { action. consumeStatementLabeled(); break; - } - + } + // // Rule 103: labeled_statement ::= case constant_expression : statement // case 103: { action. consumeStatementCase(); break; - } - + } + // // Rule 104: labeled_statement ::= default : statement // case 104: { action. consumeStatementDefault(); break; - } - + } + // // Rule 105: compound_statement ::= { } // case 105: { action. consumeStatementCompoundStatement(false); break; - } - + } + // // Rule 106: compound_statement ::= { <openscope-ast> block_item_list } // case 106: { action. consumeStatementCompoundStatement(true); break; - } - + } + // // Rule 110: block_item ::= declaration // case 110: { action. consumeStatementDeclarationWithDisambiguation(); break; - } - + } + // // Rule 111: expression_statement ::= ; // case 111: { action. consumeStatementNull(); break; - } - + } + // // Rule 112: expression_statement ::= expression_in_statement ; // case 112: { action. consumeStatementExpression(); break; - } - + } + // // Rule 113: selection_statement ::= if ( expression ) statement // case 113: { action. consumeStatementIf(false); break; - } - + } + // // Rule 114: selection_statement ::= if ( expression ) statement else statement // case 114: { action. consumeStatementIf(true); break; - } - + } + // // Rule 115: selection_statement ::= switch ( expression ) statement // case 115: { action. consumeStatementSwitch(); break; - } - + } + // // Rule 117: expression_opt ::= $Empty // case 117: { action. consumeEmpty(); break; - } - + } + // // Rule 118: iteration_statement ::= do statement while ( expression ) ; // case 118: { action. consumeStatementDoLoop(true); break; - } - + } + // // Rule 119: iteration_statement ::= do statement // case 119: { action. consumeStatementDoLoop(false); break; - } - + } + // // Rule 120: iteration_statement ::= while ( expression ) statement // case 120: { action. consumeStatementWhileLoop(); break; - } - + } + // // Rule 121: iteration_statement ::= for ( expression_opt ; expression_opt ; expression_opt ) statement // case 121: { action. consumeStatementForLoop(); break; - } - + } + // // Rule 122: iteration_statement ::= for ( declaration expression_opt ; expression_opt ) statement // case 122: { action. consumeStatementForLoop(); break; - } - + } + // // Rule 123: jump_statement ::= goto identifier_token ; // case 123: { action. consumeStatementGoto(); break; - } - + } + // // Rule 124: jump_statement ::= continue ; // case 124: { action. consumeStatementContinue(); break; - } - + } + // // Rule 125: jump_statement ::= break ; // case 125: { action. consumeStatementBreak(); break; - } - + } + // // Rule 126: jump_statement ::= return ; // case 126: { action. consumeStatementReturn(false); break; - } - + } + // // Rule 127: jump_statement ::= return expression ; // case 127: { action. consumeStatementReturn(true); break; - } - + } + // // Rule 128: declaration ::= declaration_specifiers ; // case 128: { action. consumeDeclarationSimple(false); break; - } - + } + // // Rule 129: declaration ::= declaration_specifiers <openscope-ast> init_declarator_list ; // case 129: { action. consumeDeclarationSimple(true); break; - } - + } + // // Rule 130: declaration_specifiers ::= <openscope-ast> simple_declaration_specifiers // case 130: { action. consumeDeclarationSpecifiersSimple(); break; - } - + } + // // Rule 131: declaration_specifiers ::= <openscope-ast> struct_or_union_declaration_specifiers // case 131: { action. consumeDeclarationSpecifiersStructUnionEnum(); break; - } - + } + // // Rule 132: declaration_specifiers ::= <openscope-ast> elaborated_declaration_specifiers // case 132: { action. consumeDeclarationSpecifiersStructUnionEnum(); break; - } - + } + // // Rule 133: declaration_specifiers ::= <openscope-ast> enum_declaration_specifiers // case 133: { action. consumeDeclarationSpecifiersStructUnionEnum(); break; - } - + } + // // Rule 134: declaration_specifiers ::= <openscope-ast> typdef_name_declaration_specifiers // case 134: { action. consumeDeclarationSpecifiersTypedefName(); break; - } - + } + // // Rule 159: init_declarator ::= complete_declarator = initializer // case 159: { action. consumeDeclaratorWithInitializer(true); break; - } - + } + // // Rule 161: storage_class_specifier ::= storage_class_specifier_token // case 161: { action. consumeToken(); break; - } - + } + // // Rule 167: simple_type_specifier ::= simple_type_specifier_token // case 167: { action. consumeToken(); break; - } - + } + // // Rule 180: type_name_specifier ::= identifier_token // case 180: { action. consumeToken(); break; - } - + } + // // Rule 181: struct_or_union_specifier ::= struct_or_union struct_or_union_specifier_hook { <openscope-ast> struct_declaration_list_opt } // case 181: { action. consumeTypeSpecifierComposite(false); break; - } - + } + // // Rule 182: struct_or_union_specifier ::= struct_or_union struct_or_union_specifier_hook identifier_token struct_or_union_specifier_suffix_hook { <openscope-ast> struct_declaration_list_opt } // case 182: { action. consumeTypeSpecifierComposite(true); break; - } - + } + // // Rule 187: elaborated_specifier ::= struct elaborated_specifier_hook identifier_token // case 187: { action. consumeTypeSpecifierElaborated(IASTCompositeTypeSpecifier.k_struct); break; - } - + } + // // Rule 188: elaborated_specifier ::= union elaborated_specifier_hook identifier_token // case 188: { action. consumeTypeSpecifierElaborated(IASTCompositeTypeSpecifier.k_union); break; - } - + } + // // Rule 189: elaborated_specifier ::= enum elaborated_specifier_hook identifier_token // case 189: { action. consumeTypeSpecifierElaborated(IASTElaboratedTypeSpecifier.k_enum); break; - } - + } + // // Rule 195: struct_declaration ::= specifier_qualifier_list <openscope-ast> struct_declarator_list ; // case 195: { action. consumeStructDeclaration(true); break; - } - + } + // // Rule 196: struct_declaration ::= specifier_qualifier_list ; // case 196: { action. consumeStructDeclaration(false); break; - } - + } + // // Rule 197: struct_declaration ::= ERROR_TOKEN // case 197: { action. consumeDeclarationProblem(); break; - } - + } + // // Rule 203: struct_declarator ::= : constant_expression // case 203: { action. consumeBitField(false); break; - } - + } + // // Rule 204: struct_declarator ::= declarator : constant_expression // case 204: { action. consumeBitField(true); break; - } - + } + // // Rule 205: enum_specifier ::= enum enum_specifier_hook { <openscope-ast> enumerator_list_opt comma_opt } // case 205: { action. consumeTypeSpecifierEnumeration(false); break; - } - + } + // // Rule 206: enum_specifier ::= enum enum_specifier_hook identifier_token { <openscope-ast> enumerator_list_opt comma_opt } // case 206: { action. consumeTypeSpecifierEnumeration(true); break; - } - + } + // // Rule 212: enumerator ::= identifier_token // case 212: { action. consumeEnumerator(false); break; - } - + } + // // Rule 213: enumerator ::= identifier_token = constant_expression // case 213: { action. consumeEnumerator(true); break; - } - + } + // // Rule 214: type_qualifier ::= type_qualifier_token // case 214: { action. consumeToken(); break; - } - + } + // // Rule 218: function_specifier ::= inline // case 218: { action. consumeToken(); break; - } - + } + // // Rule 220: declarator ::= <openscope-ast> pointer_seq direct_declarator // case 220: { action. consumeDeclaratorWithPointer(true); break; - } - + } + // // Rule 225: basic_direct_declarator ::= declarator_id_name // case 225: { action. consumeDirectDeclaratorIdentifier(); break; - } - + } + // // Rule 226: basic_direct_declarator ::= ( declarator ) // case 226: { action. consumeDirectDeclaratorBracketed(); break; - } - + } + // // Rule 227: declarator_id_name ::= identifier // case 227: { action. consumeIdentifierName(); break; - } - + } + // // Rule 228: array_direct_declarator ::= basic_direct_declarator array_modifier // case 228: { action. consumeDirectDeclaratorArrayDeclarator(true); break; - } - + } + // // Rule 229: array_direct_declarator ::= array_direct_declarator array_modifier // case 229: { action. consumeDirectDeclaratorArrayDeclarator(true); break; - } - + } + // // Rule 231: function_direct_declarator ::= basic_direct_declarator ( <openscope-ast> parameter_type_list ) // case 231: { action. consumeDirectDeclaratorFunctionDeclarator(true, true); break; - } - + } + // // Rule 232: function_direct_declarator ::= basic_direct_declarator ( ) // case 232: { action. consumeDirectDeclaratorFunctionDeclarator(true, false); break; - } - + } + // // Rule 234: function_declarator ::= <openscope-ast> pointer_seq function_direct_declarator // case 234: { action. consumeDeclaratorWithPointer(true); break; - } - + } + // // Rule 235: knr_direct_declarator ::= basic_direct_declarator ( <openscope-ast> identifier_list ) // case 235: { action. consumeDirectDeclaratorFunctionDeclaratorKnR(); break; - } - + } + // // Rule 237: knr_function_declarator ::= <openscope-ast> pointer_seq knr_direct_declarator // case 237: { action. consumeDeclaratorWithPointer(true); break; - } - + } + // // Rule 238: identifier_list ::= identifier // case 238: { action. consumeIdentifierKnR(); break; - } - + } + // // Rule 239: identifier_list ::= identifier_list , identifier // case 239: { action. consumeIdentifierKnR(); break; - } - + } + // // Rule 240: array_modifier ::= [ ] // case 240: { action. consumeDirectDeclaratorArrayModifier(false); break; - } - + } + // // Rule 241: array_modifier ::= [ <openscope-ast> array_modifier_type_qualifiers ] // case 241: { action. consumeDirectDeclaratorModifiedArrayModifier(false, false, true, false); break; - } - + } + // // Rule 242: array_modifier ::= [ assignment_expression ] // case 242: { action. consumeDirectDeclaratorArrayModifier(true); break; - } - + } + // // Rule 243: array_modifier ::= [ <openscope-ast> array_modifier_type_qualifiers assignment_expression ] // case 243: { action. consumeDirectDeclaratorModifiedArrayModifier(false, false, true, true); break; - } - + } + // // Rule 244: array_modifier ::= [ static assignment_expression ] // case 244: { action. consumeDirectDeclaratorModifiedArrayModifier(true, false, false, true); break; - } - + } + // // Rule 245: array_modifier ::= [ static <openscope-ast> array_modifier_type_qualifiers assignment_expression ] // case 245: { action. consumeDirectDeclaratorModifiedArrayModifier(true, false, true, true); break; - } - + } + // // Rule 246: array_modifier ::= [ <openscope-ast> array_modifier_type_qualifiers static assignment_expression ] // case 246: { action. consumeDirectDeclaratorModifiedArrayModifier(true, false, true, true); break; - } - + } + // // Rule 247: array_modifier ::= [ * ] // case 247: { action. consumeDirectDeclaratorModifiedArrayModifier(false, true, false, false); break; - } - + } + // // Rule 248: array_modifier ::= [ <openscope-ast> array_modifier_type_qualifiers * ] // case 248: { action. consumeDirectDeclaratorModifiedArrayModifier(false, true, true, false); break; - } - + } + // // Rule 250: pointer_seq ::= pointer_hook * pointer_hook // case 250: { action. consumePointer(); break; - } - + } + // // Rule 251: pointer_seq ::= pointer_seq pointer_hook * pointer_hook // case 251: { action. consumePointer(); break; - } - + } + // // Rule 252: pointer_seq ::= pointer_hook * pointer_hook <openscope-ast> type_qualifier_list // case 252: { action. consumePointerTypeQualifierList(); break; - } - + } + // // Rule 253: pointer_seq ::= pointer_seq pointer_hook * pointer_hook <openscope-ast> type_qualifier_list // case 253: { action. consumePointerTypeQualifierList(); break; - } - + } + // // Rule 257: parameter_type_list ::= parameter_list // case 257: { action. consumeEmpty(); break; - } - + } + // // Rule 258: parameter_type_list ::= parameter_list , ... // case 258: { action. consumePlaceHolder(); break; - } - + } + // // Rule 259: parameter_type_list ::= ... // case 259: { action. consumePlaceHolder(); break; - } - + } + // // Rule 262: parameter_declaration ::= declaration_specifiers complete_parameter_declarator // case 262: { action. consumeParameterDeclaration(); break; - } - + } + // // Rule 263: parameter_declaration ::= declaration_specifiers // case 263: { action. consumeParameterDeclarationWithoutDeclarator(); break; - } - + } + // // Rule 266: type_id ::= specifier_qualifier_list // case 266: { action. consumeTypeId(false); break; - } - + } + // // Rule 267: type_id ::= specifier_qualifier_list abstract_declarator // case 267: { action. consumeTypeId(true); break; - } - + } + // // Rule 269: abstract_declarator ::= <openscope-ast> pointer_seq // case 269: { action. consumeDeclaratorWithPointer(false); break; - } - + } + // // Rule 270: abstract_declarator ::= <openscope-ast> pointer_seq direct_abstract_declarator // case 270: { action. consumeDeclaratorWithPointer(true); break; - } - + } + // // Rule 274: basic_direct_abstract_declarator ::= ( abstract_declarator ) // case 274: { action. consumeDirectDeclaratorBracketed(); break; - } - + } + // // Rule 275: array_direct_abstract_declarator ::= array_modifier // case 275: { action. consumeDirectDeclaratorArrayDeclarator(false); break; - } - + } + // // Rule 276: array_direct_abstract_declarator ::= array_direct_abstract_declarator array_modifier // case 276: { action. consumeDirectDeclaratorArrayDeclarator(true); break; - } - + } + // // Rule 277: array_direct_abstract_declarator ::= basic_direct_abstract_declarator array_modifier // case 277: { action. consumeDirectDeclaratorArrayDeclarator(true); break; - } - + } + // // Rule 278: function_direct_abstract_declarator ::= ( ) // case 278: { action. consumeDirectDeclaratorFunctionDeclarator(false, false); break; - } - + } + // // Rule 279: function_direct_abstract_declarator ::= basic_direct_abstract_declarator ( ) // case 279: { action. consumeDirectDeclaratorFunctionDeclarator(true, false); break; - } - + } + // // Rule 280: function_direct_abstract_declarator ::= ( <openscope-ast> parameter_type_list ) // case 280: { action. consumeDirectDeclaratorFunctionDeclarator(false, true); break; - } - + } + // // Rule 281: function_direct_abstract_declarator ::= basic_direct_abstract_declarator ( <openscope-ast> parameter_type_list ) // case 281: { action. consumeDirectDeclaratorFunctionDeclarator(true, true); break; - } - + } + // // Rule 282: initializer ::= assignment_expression // case 282: { action. consumeInitializer(); break; - } - + } + // // Rule 283: initializer ::= initializer_list // case 283: { action. consumeInitializer(); break; - } - + } + // // Rule 284: initializer_list ::= start_initializer_list { <openscope-ast> initializer_seq comma_opt } end_initializer_list // case 284: { action. consumeInitializerList(); break; - } - + } + // // Rule 285: initializer_list ::= { <openscope-ast> } // case 285: { action. consumeInitializerList(); break; - } - + } + // // Rule 286: start_initializer_list ::= $Empty // case 286: { action. initializerListStart(); break; - } - + } + // // Rule 287: end_initializer_list ::= $Empty // case 287: { action. initializerListEnd(); break; - } - + } + // // Rule 292: designated_initializer ::= <openscope-ast> designation = initializer // case 292: { action. consumeInitializerDesignated(); break; - } - + } + // // Rule 296: designator_base ::= [ constant_expression ] // case 296: { action. consumeDesignatorArray(); break; - } - + } + // // Rule 297: designator_base ::= . identifier_token // case 297: { action. consumeDesignatorField(); break; - } - + } + // // Rule 298: designator ::= [ constant_expression ] // case 298: { action. consumeDesignatorArray(); break; - } - + } + // // Rule 299: designator ::= . identifier_token // case 299: { action. consumeDesignatorField(); break; - } - + } + // // Rule 300: translation_unit ::= external_declaration_list // case 300: { action. consumeTranslationUnit(); break; - } - + } + // // Rule 301: translation_unit ::= $Empty // case 301: { action. consumeTranslationUnit(); break; - } - + } + // // Rule 306: external_declaration ::= ; // case 306: { action. consumeDeclarationEmpty(); break; - } - + } + // // Rule 307: external_declaration ::= ERROR_TOKEN // case 307: { action. consumeDeclarationProblem(); break; - } - + } + // // Rule 311: function_definition ::= <openscope-ast> function_declarator function_body // case 311: { action. consumeFunctionDefinition(false); break; - } - + } + // // Rule 312: function_definition ::= declaration_specifiers <openscope-ast> knr_function_declarator <openscope-ast> declaration_list compound_statement // case 312: { action. consumeFunctionDefinitionKnR(); break; - } - + } + // // Rule 313: normal_function_definition ::= declaration_specifiers <openscope-ast> function_declarator function_body // case 313: { action. consumeFunctionDefinition(true); break; - } - + } + // // Rule 314: function_body ::= { } // case 314: { action. consumeStatementCompoundStatement(false); break; - } - + } + // // Rule 315: function_body ::= { <openscope-ast> block_item_list } // case 315: { action. consumeStatementCompoundStatement(true); break; - } - + } + // // Rule 316: literal ::= MYTHREAD // case 316: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_mythread); break; - } - + } + // // Rule 317: literal ::= THREADS // case 317: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_threads); break; - } - + } + // // Rule 318: literal ::= UPC_MAX_BLOCKSIZE // case 318: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_upc_max_block_size); break; - } - + } + // // Rule 319: unary_expression ::= upc_localsizeof unary_expression // case 319: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_localsizeof); break; - } - + } + // // Rule 320: unary_expression ::= upc_localsizeof ( type_id ) // case 320: { action. consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_localsizeof); break; - } - + } + // // Rule 321: unary_expression ::= upc_blocksizeof unary_expression // case 321: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_blocksizeof); break; - } - + } + // // Rule 322: unary_expression ::= upc_blocksizeof ( type_id ) // case 322: { action. consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_blocksizeof); break; - } - + } + // // Rule 323: unary_expression ::= upc_elemsizeof unary_expression // case 323: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_elemsizeof); break; - } - + } + // // Rule 324: unary_expression ::= upc_elemsizeof ( type_id ) // case 324: { action. consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_elemsizeof); break; - } - + } + // // Rule 328: shared_type_qualifier ::= shared // case 328: { action. consumeToken(); break; - } - + } + // // Rule 329: reference_type_qualifier ::= relaxed // case 329: { action. consumeToken(); break; - } - + } + // // Rule 330: reference_type_qualifier ::= strict // case 330: { action. consumeToken(); break; - } - + } + // // Rule 331: layout_qualifier ::= [ constant_expression ] // case 331: { action. consumeLayoutQualifier(true, false); break; - } - + } + // // Rule 332: layout_qualifier ::= [ * ] // case 332: { action. consumeLayoutQualifier(false, true); break; - } - + } + // // Rule 333: layout_qualifier ::= [ ] // case 333: { action. consumeLayoutQualifier(false, false); break; - } - + } + // // Rule 335: synchronization_statement ::= upc_notify expression ; // case 335: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_notify, true); break; - } - + } + // // Rule 336: synchronization_statement ::= upc_notify ; // case 336: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_notify, false); break; - } - + } + // // Rule 337: synchronization_statement ::= upc_wait expression ; // case 337: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_wait, true); break; - } - + } + // // Rule 338: synchronization_statement ::= upc_wait ; // case 338: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_wait, false); break; - } - + } + // // Rule 339: synchronization_statement ::= upc_barrier expression ; // case 339: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_barrier, true); break; - } - + } + // // Rule 340: synchronization_statement ::= upc_barrier ; // case 340: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_barrier, false); break; - } - + } + // // Rule 341: synchronization_statement ::= upc_fence ; // case 341: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_fence, false); break; - } - + } + // // Rule 342: iteration_statement ::= upc_forall ( expression ; expression ; expression ; affinity ) statement // case 342: { action. consumeStatementUPCForallLoop(true, true, true, true); break; - } - + } + // // Rule 343: iteration_statement ::= upc_forall ( expression ; expression ; expression ; ) statement // case 343: { action. consumeStatementUPCForallLoop(true, true, true, false); break; - } - + } + // // Rule 344: iteration_statement ::= upc_forall ( expression ; expression ; ; affinity ) statement // case 344: { action. consumeStatementUPCForallLoop(true, true, false, true); break; - } - + } + // // Rule 345: iteration_statement ::= upc_forall ( expression ; expression ; ; ) statement // case 345: { action. consumeStatementUPCForallLoop(true, true, false, false); break; - } - + } + // // Rule 346: iteration_statement ::= upc_forall ( expression ; ; expression ; affinity ) statement // case 346: { action. consumeStatementUPCForallLoop(true, false, true, true); break; - } - + } + // // Rule 347: iteration_statement ::= upc_forall ( expression ; ; expression ; ) statement // case 347: { action. consumeStatementUPCForallLoop(true, false, true, false); break; - } - + } + // // Rule 348: iteration_statement ::= upc_forall ( expression ; ; ; affinity ) statement // case 348: { action. consumeStatementUPCForallLoop(true, false, false, true); break; - } - + } + // // Rule 349: iteration_statement ::= upc_forall ( expression ; ; ; ) statement // case 349: { action. consumeStatementUPCForallLoop(true, false, false, false); break; - } - + } + // // Rule 350: iteration_statement ::= upc_forall ( ; expression ; expression ; affinity ) statement // case 350: { action. consumeStatementUPCForallLoop(false, true, true, true); break; - } - + } + // // Rule 351: iteration_statement ::= upc_forall ( ; expression ; expression ; ) statement // case 351: { action. consumeStatementUPCForallLoop(false, true, true, false); break; - } - + } + // // Rule 352: iteration_statement ::= upc_forall ( ; expression ; ; affinity ) statement // case 352: { action. consumeStatementUPCForallLoop(false, true, false, true); break; - } - + } + // // Rule 353: iteration_statement ::= upc_forall ( ; expression ; ; ) statement // case 353: { action. consumeStatementUPCForallLoop(false, true, false, false); break; - } - + } + // // Rule 354: iteration_statement ::= upc_forall ( ; ; expression ; affinity ) statement // case 354: { action. consumeStatementUPCForallLoop(false, false, true, true); break; - } - + } + // // Rule 355: iteration_statement ::= upc_forall ( ; ; expression ; ) statement // case 355: { action. consumeStatementUPCForallLoop(false, false, true, false); break; - } - + } + // // Rule 356: iteration_statement ::= upc_forall ( ; ; ; affinity ) statement // case 356: { action. consumeStatementUPCForallLoop(false, false, false, true); break; - } - + } + // // Rule 357: iteration_statement ::= upc_forall ( ; ; ; ) statement // case 357: { action. consumeStatementUPCForallLoop(false, false, false, false); break; - } - + } + // // Rule 358: iteration_statement ::= upc_forall ( declaration expression ; expression ; affinity ) statement // case 358: { action. consumeStatementUPCForallLoop(true, true, true, true); break; - } - + } + // // Rule 359: iteration_statement ::= upc_forall ( declaration expression ; expression ; ) statement // case 359: { action. consumeStatementUPCForallLoop(true, true, true, false); break; - } - + } + // // Rule 360: iteration_statement ::= upc_forall ( declaration expression ; ; affinity ) statement // case 360: { action. consumeStatementUPCForallLoop(true, true, false, true); break; - } - + } + // // Rule 361: iteration_statement ::= upc_forall ( declaration expression ; ; ) statement // case 361: { action. consumeStatementUPCForallLoop(true, true, false, false); break; - } - + } + // // Rule 362: iteration_statement ::= upc_forall ( declaration ; expression ; affinity ) statement // case 362: { action. consumeStatementUPCForallLoop(true, false, true, true); break; - } - + } + // // Rule 363: iteration_statement ::= upc_forall ( declaration ; expression ; ) statement // case 363: { action. consumeStatementUPCForallLoop(true, false, true, false); break; - } - + } + // // Rule 364: iteration_statement ::= upc_forall ( declaration ; ; affinity ) statement // 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; - } + } + - default: break; } diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCParserprs.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCParserprs.java index 9bee3801312..1cef1417961 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCParserprs.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCParserprs.java @@ -362,9 +362,11 @@ public class UPCParserprs implements lpg.lpgjavaruntime.ParseTable, UPCParsersym }; }; public final static short baseCheck[] = BaseCheck.baseCheck; - public final int baseCheck(int index) { return baseCheck[index]; } + @Override + public final int baseCheck(int index) { return baseCheck[index]; } public final static short rhs[] = baseCheck; - public final int rhs(int index) { return rhs[index]; }; + @Override + public final int rhs(int index) { return rhs[index]; }; public interface BaseAction { public final static char baseAction[] = { @@ -698,9 +700,11 @@ public class UPCParserprs implements lpg.lpgjavaruntime.ParseTable, UPCParsersym }; }; public final static char baseAction[] = BaseAction.baseAction; - public final int baseAction(int index) { return baseAction[index]; } + @Override + public final int baseAction(int index) { return baseAction[index]; } public final static char lhs[] = baseAction; - public final int lhs(int index) { return lhs[index]; }; + @Override + public final int lhs(int index) { return lhs[index]; }; public interface TermCheck { public final static byte termCheck[] = {0, @@ -1015,7 +1019,8 @@ public class UPCParserprs implements lpg.lpgjavaruntime.ParseTable, UPCParsersym }; }; public final static byte termCheck[] = TermCheck.termCheck; - public final int termCheck(int index) { return termCheck[index]; } + @Override + public final int termCheck(int index) { return termCheck[index]; } public interface TermAction { public final static char termAction[] = {0, @@ -1327,7 +1332,8 @@ public class UPCParserprs implements lpg.lpgjavaruntime.ParseTable, UPCParsersym }; }; public final static char termAction[] = TermAction.termAction; - public final int termAction(int index) { return termAction[index]; } + @Override + public final int termAction(int index) { return termAction[index]; } public interface Asb { public final static char asb[] = {0, @@ -1373,7 +1379,8 @@ public class UPCParserprs implements lpg.lpgjavaruntime.ParseTable, UPCParsersym }; }; public final static char asb[] = Asb.asb; - public final int asb(int index) { return asb[index]; } + @Override + public final int asb(int index) { return asb[index]; } public interface Asr { public final static byte asr[] = {0, @@ -1447,7 +1454,8 @@ public class UPCParserprs implements lpg.lpgjavaruntime.ParseTable, UPCParsersym }; }; public final static byte asr[] = Asr.asr; - public final int asr(int index) { return asr[index]; } + @Override + public final int asr(int index) { return asr[index]; } public interface Nasb { public final static char nasb[] = {0, @@ -1493,7 +1501,8 @@ public class UPCParserprs implements lpg.lpgjavaruntime.ParseTable, UPCParsersym }; }; public final static char nasb[] = Nasb.nasb; - public final int nasb(int index) { return nasb[index]; } + @Override + public final int nasb(int index) { return nasb[index]; } public interface Nasr { public final static char nasr[] = {0, @@ -1519,7 +1528,8 @@ public class UPCParserprs implements lpg.lpgjavaruntime.ParseTable, UPCParsersym }; }; public final static char nasr[] = Nasr.nasr; - public final int nasr(int index) { return nasr[index]; } + @Override + public final int nasr(int index) { return nasr[index]; } public interface TerminalIndex { public final static char terminalIndex[] = {0, @@ -1537,7 +1547,8 @@ public class UPCParserprs implements lpg.lpgjavaruntime.ParseTable, UPCParsersym }; }; public final static char terminalIndex[] = TerminalIndex.terminalIndex; - public final int terminalIndex(int index) { return terminalIndex[index]; } + @Override + public final int terminalIndex(int index) { return terminalIndex[index]; } public interface NonterminalIndex { public final static char nonterminalIndex[] = {0, @@ -1557,7 +1568,8 @@ public class UPCParserprs implements lpg.lpgjavaruntime.ParseTable, UPCParsersym }; }; public final static char nonterminalIndex[] = NonterminalIndex.nonterminalIndex; - public final int nonterminalIndex(int index) { return nonterminalIndex[index]; } + @Override + public final int nonterminalIndex(int index) { return nonterminalIndex[index]; } public interface ScopePrefix { public final static char scopePrefix[] = { @@ -1569,7 +1581,8 @@ public class UPCParserprs implements lpg.lpgjavaruntime.ParseTable, UPCParsersym }; }; public final static char scopePrefix[] = ScopePrefix.scopePrefix; - public final int scopePrefix(int index) { return scopePrefix[index]; } + @Override + public final int scopePrefix(int index) { return scopePrefix[index]; } public interface ScopeSuffix { public final static char scopeSuffix[] = { @@ -1581,7 +1594,8 @@ public class UPCParserprs implements lpg.lpgjavaruntime.ParseTable, UPCParsersym }; }; public final static char scopeSuffix[] = ScopeSuffix.scopeSuffix; - public final int scopeSuffix(int index) { return scopeSuffix[index]; } + @Override + public final int scopeSuffix(int index) { return scopeSuffix[index]; } public interface ScopeLhs { public final static char scopeLhs[] = { @@ -1593,7 +1607,8 @@ public class UPCParserprs implements lpg.lpgjavaruntime.ParseTable, UPCParsersym }; }; public final static char scopeLhs[] = ScopeLhs.scopeLhs; - public final int scopeLhs(int index) { return scopeLhs[index]; } + @Override + public final int scopeLhs(int index) { return scopeLhs[index]; } public interface ScopeLa { public final static byte scopeLa[] = { @@ -1605,7 +1620,8 @@ public class UPCParserprs implements lpg.lpgjavaruntime.ParseTable, UPCParsersym }; }; public final static byte scopeLa[] = ScopeLa.scopeLa; - public final int scopeLa(int index) { return scopeLa[index]; } + @Override + public final int scopeLa(int index) { return scopeLa[index]; } public interface ScopeStateSet { public final static char scopeStateSet[] = { @@ -1617,7 +1633,8 @@ public class UPCParserprs implements lpg.lpgjavaruntime.ParseTable, UPCParsersym }; }; public final static char scopeStateSet[] = ScopeStateSet.scopeStateSet; - public final int scopeStateSet(int index) { return scopeStateSet[index]; } + @Override + public final int scopeStateSet(int index) { return scopeStateSet[index]; } public interface ScopeRhs { public final static char scopeRhs[] = {0, @@ -1647,7 +1664,8 @@ public class UPCParserprs implements lpg.lpgjavaruntime.ParseTable, UPCParsersym }; }; public final static char scopeRhs[] = ScopeRhs.scopeRhs; - public final int scopeRhs(int index) { return scopeRhs[index]; } + @Override + public final int scopeRhs(int index) { return scopeRhs[index]; } public interface ScopeState { public final static char scopeState[] = {0, @@ -1670,7 +1688,8 @@ public class UPCParserprs implements lpg.lpgjavaruntime.ParseTable, UPCParsersym }; }; public final static char scopeState[] = ScopeState.scopeState; - public final int scopeState(int index) { return scopeState[index]; } + @Override + public final int scopeState(int index) { return scopeState[index]; } public interface InSymb { public final static char inSymb[] = {0, @@ -1716,7 +1735,8 @@ public class UPCParserprs implements lpg.lpgjavaruntime.ParseTable, UPCParsersym }; }; public final static char inSymb[] = InSymb.inSymb; - public final int inSymb(int index) { return inSymb[index]; } + @Override + public final int inSymb(int index) { return inSymb[index]; } public interface Name { public final static String name[] = { @@ -1926,7 +1946,8 @@ public class UPCParserprs implements lpg.lpgjavaruntime.ParseTable, UPCParsersym }; }; public final static String name[] = Name.name; - public final String name(int index) { return name[index]; } + @Override + public final String name(int index) { return name[index]; } public final static int ERROR_SYMBOL = 26, @@ -1934,10 +1955,14 @@ public class UPCParserprs implements lpg.lpgjavaruntime.ParseTable, UPCParsersym SCOPE_SIZE = 50, MAX_NAME_LENGTH = 38; - public final int getErrorSymbol() { return ERROR_SYMBOL; } - public final int getScopeUbound() { return SCOPE_UBOUND; } - public final int getScopeSize() { return SCOPE_SIZE; } - public final int getMaxNameLength() { return MAX_NAME_LENGTH; } + @Override + public final int getErrorSymbol() { return ERROR_SYMBOL; } + @Override + public final int getScopeUbound() { return SCOPE_UBOUND; } + @Override + public final int getScopeSize() { return SCOPE_SIZE; } + @Override + public final int getMaxNameLength() { return MAX_NAME_LENGTH; } public final static int NUM_STATES = 383, @@ -1957,47 +1982,70 @@ public class UPCParserprs implements lpg.lpgjavaruntime.ParseTable, UPCParsersym public final static boolean BACKTRACK = true; - public final int getNumStates() { return NUM_STATES; } - public final int getNtOffset() { return NT_OFFSET; } - public final int getLaStateOffset() { return LA_STATE_OFFSET; } - public final int getMaxLa() { return MAX_LA; } - public final int getNumRules() { return NUM_RULES; } - public final int getNumNonterminals() { return NUM_NONTERMINALS; } - public final int getNumSymbols() { return NUM_SYMBOLS; } - public final int getSegmentSize() { return SEGMENT_SIZE; } - public final int getStartState() { return START_STATE; } - public final int getStartSymbol() { return lhs[0]; } + @Override + public final int getNumStates() { return NUM_STATES; } + @Override + public final int getNtOffset() { return NT_OFFSET; } + @Override + public final int getLaStateOffset() { return LA_STATE_OFFSET; } + @Override + public final int getMaxLa() { return MAX_LA; } + @Override + public final int getNumRules() { return NUM_RULES; } + @Override + public final int getNumNonterminals() { return NUM_NONTERMINALS; } + @Override + public final int getNumSymbols() { return NUM_SYMBOLS; } + @Override + public final int getSegmentSize() { return SEGMENT_SIZE; } + @Override + public final int getStartState() { return START_STATE; } + @Override + public final int getStartSymbol() { return lhs[0]; } public final int getIdentifierSymbol() { return IDENTIFIER_SYMBOL; } - public final int getEoftSymbol() { return EOFT_SYMBOL; } - public final int getEoltSymbol() { return EOLT_SYMBOL; } - public final int getAcceptAction() { return ACCEPT_ACTION; } - public final int getErrorAction() { return ERROR_ACTION; } - public final boolean isValidForParser() { return isValidForParser; } - public final boolean getBacktrack() { return BACKTRACK; } + @Override + public final int getEoftSymbol() { return EOFT_SYMBOL; } + @Override + public final int getEoltSymbol() { return EOLT_SYMBOL; } + @Override + public final int getAcceptAction() { return ACCEPT_ACTION; } + @Override + public final int getErrorAction() { return ERROR_ACTION; } + @Override + public final boolean isValidForParser() { return isValidForParser; } + @Override + public final boolean getBacktrack() { return BACKTRACK; } - public final int originalState(int state) { + @Override + public final int originalState(int state) { return -baseCheck[state]; } - public final int asi(int state) { + @Override + public final int asi(int state) { return asb[originalState(state)]; } - public final int nasi(int state) { + @Override + public final int nasi(int state) { return nasb[originalState(state)]; } - public final int inSymbol(int state) { + @Override + public final int inSymbol(int state) { return inSymb[originalState(state)]; } - public final int ntAction(int state, int sym) { + @Override + public final int ntAction(int state, int sym) { return baseAction[state + sym]; } - public final int tAction(int state, int sym) { + @Override + public final int tAction(int state, int sym) { int i = baseAction[state], k = i + sym; return termAction[termCheck[k] == sym ? k : i]; } - public final int lookAhead(int la_state, int sym) { + @Override + public final int lookAhead(int la_state, int sym) { int k = la_state + sym; return termAction[termCheck[k] == sym ? k : la_state]; } diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCSizeofExpressionParser.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCSizeofExpressionParser.java index ae3a9cb1ad4..2e70eb7222b 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCSizeofExpressionParser.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCSizeofExpressionParser.java @@ -13,40 +13,58 @@ package org.eclipse.cdt.internal.core.dom.parser.upc; -import lpg.lpgjavaruntime.*; +import java.util.List; +import java.util.Map; -import java.util.*; -import org.eclipse.cdt.core.dom.ast.*; +import lpg.lpgjavaruntime.BadParseException; +import lpg.lpgjavaruntime.BadParseSymFileException; +import lpg.lpgjavaruntime.DiagnoseParser; +import lpg.lpgjavaruntime.ErrorToken; +import lpg.lpgjavaruntime.IToken; +import lpg.lpgjavaruntime.LexStream; +import lpg.lpgjavaruntime.Monitor; +import lpg.lpgjavaruntime.NotBacktrackParseTableException; +import lpg.lpgjavaruntime.NullExportedSymbolsException; +import lpg.lpgjavaruntime.NullTerminalSymbolsException; +import lpg.lpgjavaruntime.ParseErrorCodes; +import lpg.lpgjavaruntime.ParseTable; +import lpg.lpgjavaruntime.PrsStream; +import lpg.lpgjavaruntime.RuleAction; +import lpg.lpgjavaruntime.Token; +import lpg.lpgjavaruntime.UndefinedEofSymbolException; +import lpg.lpgjavaruntime.UnimplementedTerminalsException; + +import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression; +import org.eclipse.cdt.core.dom.ast.IASTCastExpression; +import org.eclipse.cdt.core.dom.ast.IASTCompletionNode; +import org.eclipse.cdt.core.dom.ast.IASTCompositeTypeSpecifier; +import org.eclipse.cdt.core.dom.ast.IASTElaboratedTypeSpecifier; +import org.eclipse.cdt.core.dom.ast.IASTExpression; +import org.eclipse.cdt.core.dom.ast.IASTLiteralExpression; +import org.eclipse.cdt.core.dom.ast.IASTUnaryExpression; +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.ISecondaryParser; import org.eclipse.cdt.core.dom.lrparser.ITokenCollector; -import org.eclipse.cdt.core.dom.lrparser.CPreprocessorAdapter; +import org.eclipse.cdt.core.dom.lrparser.action.ITokenMap; 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.ITokenMap; import org.eclipse.cdt.core.dom.lrparser.action.TokenMap; -import org.eclipse.cdt.core.dom.lrparser.ISecondaryParser; - -import org.eclipse.cdt.internal.core.dom.parser.c.CNodeFactory; -import org.eclipse.cdt.core.dom.lrparser.action.c99.C99BuildASTParserAction; -import org.eclipse.cdt.core.dom.lrparser.action.c99.C99SecondaryParserFactory; - +import org.eclipse.cdt.core.dom.lrparser.lpgextensions.FixedBacktrackingParser; +import org.eclipse.cdt.core.dom.parser.IBuiltinBindingsProvider; import org.eclipse.cdt.core.dom.parser.upc.UPCASTNodeFactory; -import org.eclipse.cdt.core.dom.parser.upc.UPCSecondaryParserFactory; import org.eclipse.cdt.core.dom.parser.upc.UPCParserAction; +import org.eclipse.cdt.core.dom.parser.upc.UPCSecondaryParserFactory; import org.eclipse.cdt.core.dom.upc.ast.IUPCASTKeywordExpression; import org.eclipse.cdt.core.dom.upc.ast.IUPCASTSynchronizationStatement; import org.eclipse.cdt.core.dom.upc.ast.IUPCASTUnarySizeofExpression; -import org.eclipse.cdt.core.dom.lrparser.lpgextensions.FixedBacktrackingParser; +import org.eclipse.cdt.core.index.IIndex; +import org.eclipse.cdt.core.parser.IScanner; -public class UPCSizeofExpressionParser extends PrsStream implements RuleAction, ITokenStream, - ITokenCollector, IParser< IASTExpression > - , ISecondaryParser< IASTExpression > +public class UPCSizeofExpressionParser extends PrsStream implements RuleAction, ITokenStream, + ITokenCollector, IParser< IASTExpression > + , ISecondaryParser< IASTExpression > { private static ParseTable prs = new UPCSizeofExpressionParserprs(); private FixedBacktrackingParser btParser; @@ -57,7 +75,7 @@ public class UPCSizeofExpressionParser extends PrsStream implements RuleAction, public int getRhsTokenIndex(int i) { return btParser.getToken(i); } public IToken getRhsIToken(int i) { return super.getIToken(getRhsTokenIndex(i)); } - + public int getRhsFirstTokenIndex(int i) { return btParser.getFirstToken(i); } public IToken getRhsFirstIToken(int i) { return super.getIToken(getRhsFirstTokenIndex(i)); } @@ -65,10 +83,12 @@ public class UPCSizeofExpressionParser extends PrsStream implements RuleAction, public IToken getRhsLastIToken(int i) { return super.getIToken(getRhsLastTokenIndex(i)); } public int getLeftSpan() { return btParser.getFirstToken(); } - public IToken getLeftIToken() { return super.getIToken(getLeftSpan()); } + @Override + public IToken getLeftIToken() { return super.getIToken(getLeftSpan()); } public int getRightSpan() { return btParser.getLastToken(); } - public IToken getRightIToken() { return super.getIToken(getRightSpan()); } + @Override + public IToken getRightIToken() { return super.getIToken(getRightSpan()); } public int getRhsErrorTokenIndex(int i) { @@ -102,23 +122,24 @@ public class UPCSizeofExpressionParser extends PrsStream implements RuleAction, for (int i = 0; i < unimplemented_symbols.size(); i++) { Integer id = (Integer) unimplemented_symbols.get(i); - System.out.println(" " + UPCSizeofExpressionParsersym.orderedTerminalSymbols[id.intValue()]); + System.out.println(" " + UPCSizeofExpressionParsersym.orderedTerminalSymbols[id.intValue()]); } - System.out.println(); + System.out.println(); } catch(UndefinedEofSymbolException e) { throw new Error(new UndefinedEofSymbolException ("The Lexer does not implement the Eof symbol " + UPCSizeofExpressionParsersym.orderedTerminalSymbols[UPCSizeofExpressionParserprs.EOFT_SYMBOL])); - } + } } - public String[] orderedTerminalSymbols() { return UPCSizeofExpressionParsersym.orderedTerminalSymbols; } + @Override + public String[] orderedTerminalSymbols() { return UPCSizeofExpressionParsersym.orderedTerminalSymbols; } public String getTokenKindName(int kind) { return UPCSizeofExpressionParsersym.orderedTerminalSymbols[kind]; } public int getEOFTokenKind() { return UPCSizeofExpressionParserprs.EOFT_SYMBOL; } - public PrsStream getParseStream() { return (PrsStream) this; } - + public PrsStream getParseStream() { return this; } + // // Report error message for given error_token. // @@ -141,12 +162,12 @@ public class UPCSizeofExpressionParser extends PrsStream implements RuleAction, { parser(null, 0); } - + public void parser(Monitor monitor) { parser(monitor, 0); } - + public void parser(int error_repair_count) { parser(null, error_repair_count); @@ -156,7 +177,7 @@ public class UPCSizeofExpressionParser extends PrsStream implements RuleAction, { try { - btParser = new FixedBacktrackingParser(monitor, (TokenStream) this, prs, (RuleAction) this); + btParser = new FixedBacktrackingParser(monitor, this, prs, this); } catch (NotBacktrackParseTableException e) { @@ -193,24 +214,26 @@ public UPCSizeofExpressionParser(IScanner scanner, IDOMTokenMap tokenMap, IBuilt private void initActions(Map<String,String> properties) { ScopedStack<Object> astStack = new ScopedStack<Object>(); - + action = new UPCParserAction (this, astStack, new UPCASTNodeFactory() , UPCSecondaryParserFactory.getDefault() ); action.setParserProperties(properties); - - + + } +@Override public void addToken(IToken token) { token.setKind(mapKind(token.getKind())); // TODO does mapKind need to be called? super.addToken(token); } +@Override public IASTExpression parse() { // this has to be done, or... kaboom! setStreamLength(getSize()); - + final int errorRepairCount = -1; // -1 means full error handling parser(null, errorRepairCount); // do the actual parse super.resetTokenStream(); // allow tokens to be garbage collected @@ -220,19 +243,23 @@ public IASTExpression parse() { } +@Override public IASTCompletionNode getCompletionNode() { return compNode; } // uncomment this method to use with backtracking parser +@Override public List<IToken> getRuleTokens() { return getTokens().subList(getLeftSpan(), getRightSpan() + 1); } +@Override public String[] getOrderedTerminalSymbols() { return UPCSizeofExpressionParsersym.orderedTerminalSymbols; } +@Override @SuppressWarnings("nls") public String getName() { return "UPCSizeofExpressionParser"; @@ -242,6 +269,7 @@ public String getName() { private ITokenMap tokenMap = null; +@Override public void setTokens(List<IToken> tokens) { resetTokenStream(); addToken(new Token(null, 0, 0, 0)); // dummy token @@ -255,1305 +283,1306 @@ public void setTokens(List<IToken> tokens) { public UPCSizeofExpressionParser(ITokenStream stream, Map<String,String> properties) { // constructor for creating secondary parser initActions(properties); tokenMap = new TokenMap(UPCSizeofExpressionParsersym.orderedTerminalSymbols, stream.getOrderedTerminalSymbols()); -} +} - public void ruleAction(int ruleNumber) + @Override + public void ruleAction(int ruleNumber) { switch (ruleNumber) { - + // // Rule 1: <openscope-ast> ::= $Empty // case 1: { action. openASTScope(); break; - } - + } + // // Rule 2: <empty> ::= $Empty // case 2: { action. consumeEmpty(); break; - } - + } + // // Rule 13: literal ::= integer // case 13: { action. consumeExpressionLiteral(IASTLiteralExpression.lk_integer_constant); break; - } - + } + // // Rule 14: literal ::= floating // case 14: { action. consumeExpressionLiteral(IASTLiteralExpression.lk_float_constant); break; - } - + } + // // Rule 15: literal ::= charconst // case 15: { action. consumeExpressionLiteral(IASTLiteralExpression.lk_char_constant); break; - } - + } + // // Rule 16: literal ::= stringlit // case 16: { action. consumeExpressionLiteral(IASTLiteralExpression.lk_string_literal); break; - } - + } + // // Rule 18: primary_expression ::= primary_expression_id // case 18: { action. consumeExpressionID(); break; - } - + } + // // Rule 19: primary_expression ::= ( expression ) // case 19: { action. consumeExpressionBracketed(); break; - } - + } + // // Rule 22: postfix_expression ::= postfix_expression [ expression ] // case 22: { action. consumeExpressionArraySubscript(); break; - } - + } + // // Rule 23: postfix_expression ::= postfix_expression ( expression_list_opt ) // case 23: { action. consumeExpressionFunctionCall(); break; - } - + } + // // Rule 24: postfix_expression ::= postfix_expression . member_name // case 24: { action. consumeExpressionFieldReference(false); break; - } - + } + // // Rule 25: postfix_expression ::= postfix_expression -> member_name // case 25: { action. consumeExpressionFieldReference(true); break; - } - + } + // // Rule 26: postfix_expression ::= postfix_expression ++ // case 26: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_postFixIncr); break; - } - + } + // // Rule 27: postfix_expression ::= postfix_expression -- // case 27: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_postFixDecr); break; - } - + } + // // Rule 28: postfix_expression ::= ( type_id ) initializer_list // case 28: { action. consumeExpressionTypeIdInitializer(); break; - } - + } + // // Rule 33: unary_expression ::= ++ unary_expression // case 33: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_prefixIncr); break; - } - + } + // // Rule 34: unary_expression ::= -- unary_expression // case 34: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_prefixDecr); break; - } - + } + // // Rule 35: unary_expression ::= & cast_expression // case 35: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_amper); break; - } - + } + // // Rule 36: unary_expression ::= * cast_expression // case 36: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_star); break; - } - + } + // // Rule 37: unary_expression ::= + cast_expression // case 37: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_plus); break; - } - + } + // // Rule 38: unary_expression ::= - cast_expression // case 38: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_minus); break; - } - + } + // // Rule 39: unary_expression ::= ~ cast_expression // case 39: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_tilde); break; - } - + } + // // Rule 40: unary_expression ::= ! cast_expression // case 40: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_not); break; - } - + } + // // Rule 41: unary_expression ::= sizeof unary_expression // case 41: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_sizeof); break; - } - + } + // // Rule 43: cast_expression ::= ( type_id ) cast_expression // case 43: { action. consumeExpressionCast(IASTCastExpression.op_cast); break; - } - + } + // // Rule 45: multiplicative_expression ::= multiplicative_expression * cast_expression // case 45: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_multiply); break; - } - + } + // // Rule 46: multiplicative_expression ::= multiplicative_expression / cast_expression // case 46: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_divide); break; - } - + } + // // Rule 47: multiplicative_expression ::= multiplicative_expression % cast_expression // case 47: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_modulo); break; - } - + } + // // Rule 49: additive_expression ::= additive_expression + multiplicative_expression // case 49: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_plus); break; - } - + } + // // Rule 50: additive_expression ::= additive_expression - multiplicative_expression // case 50: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_minus); break; - } - + } + // // Rule 52: shift_expression ::= shift_expression << additive_expression // case 52: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_shiftLeft); break; - } - + } + // // Rule 53: shift_expression ::= shift_expression >> additive_expression // case 53: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_shiftRight); break; - } - + } + // // Rule 55: relational_expression ::= relational_expression < shift_expression // case 55: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_lessThan); break; - } - + } + // // Rule 56: relational_expression ::= relational_expression > shift_expression // case 56: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_greaterThan); break; - } - + } + // // Rule 57: relational_expression ::= relational_expression <= shift_expression // case 57: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_lessEqual); break; - } - + } + // // Rule 58: relational_expression ::= relational_expression >= shift_expression // case 58: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_greaterEqual); break; - } - + } + // // Rule 60: equality_expression ::= equality_expression == relational_expression // case 60: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_equals); break; - } - + } + // // Rule 61: equality_expression ::= equality_expression != relational_expression // case 61: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_notequals); break; - } - + } + // // Rule 63: and_expression ::= and_expression & equality_expression // case 63: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_binaryAnd); break; - } - + } + // // Rule 65: exclusive_or_expression ::= exclusive_or_expression ^ and_expression // case 65: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_binaryXor); break; - } - + } + // // Rule 67: inclusive_or_expression ::= inclusive_or_expression | exclusive_or_expression // case 67: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_binaryOr); break; - } - + } + // // Rule 69: logical_and_expression ::= logical_and_expression && inclusive_or_expression // case 69: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_logicalAnd); break; - } - + } + // // Rule 71: logical_or_expression ::= logical_or_expression || logical_and_expression // case 71: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_logicalOr); break; - } - + } + // // Rule 73: conditional_expression ::= logical_or_expression ? expression : assignment_expression // case 73: { action. consumeExpressionConditional(); break; - } - + } + // // Rule 75: assignment_expression ::= unary_expression = assignment_expression // case 75: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_assign); break; - } - + } + // // Rule 76: assignment_expression ::= unary_expression *= assignment_expression // case 76: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_multiplyAssign); break; - } - + } + // // Rule 77: assignment_expression ::= unary_expression /= assignment_expression // case 77: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_divideAssign); break; - } - + } + // // Rule 78: assignment_expression ::= unary_expression %= assignment_expression // case 78: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_moduloAssign); break; - } - + } + // // Rule 79: assignment_expression ::= unary_expression += assignment_expression // case 79: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_plusAssign); break; - } - + } + // // Rule 80: assignment_expression ::= unary_expression -= assignment_expression // case 80: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_minusAssign); break; - } - + } + // // Rule 81: assignment_expression ::= unary_expression <<= assignment_expression // case 81: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_shiftLeftAssign); break; - } - + } + // // Rule 82: assignment_expression ::= unary_expression >>= assignment_expression // case 82: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_shiftRightAssign); break; - } - + } + // // Rule 83: assignment_expression ::= unary_expression &= assignment_expression // case 83: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_binaryAndAssign); break; - } - + } + // // Rule 84: assignment_expression ::= unary_expression ^= assignment_expression // case 84: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_binaryXorAssign); break; - } - + } + // // Rule 85: assignment_expression ::= unary_expression |= assignment_expression // case 85: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_binaryOrAssign); break; - } - + } + // // Rule 88: expression_list ::= <openscope-ast> expression_list_actual // case 88: { action. consumeExpressionList(); break; - } - + } + // // Rule 90: expression_list_opt ::= $Empty // case 90: { action. consumeEmpty(); break; - } - + } + // // Rule 100: statement ::= ERROR_TOKEN // case 100: { action. consumeStatementProblem(); break; - } - + } + // // Rule 101: labeled_statement ::= identifier_token : statement // case 101: { action. consumeStatementLabeled(); break; - } - + } + // // Rule 102: labeled_statement ::= case constant_expression : statement // case 102: { action. consumeStatementCase(); break; - } - + } + // // Rule 103: labeled_statement ::= default : statement // case 103: { action. consumeStatementDefault(); break; - } - + } + // // Rule 104: compound_statement ::= { } // case 104: { action. consumeStatementCompoundStatement(false); break; - } - + } + // // Rule 105: compound_statement ::= { <openscope-ast> block_item_list } // case 105: { action. consumeStatementCompoundStatement(true); break; - } - + } + // // Rule 109: block_item ::= declaration // case 109: { action. consumeStatementDeclarationWithDisambiguation(); break; - } - + } + // // Rule 110: expression_statement ::= ; // case 110: { action. consumeStatementNull(); break; - } - + } + // // Rule 111: expression_statement ::= expression_in_statement ; // case 111: { action. consumeStatementExpression(); break; - } - + } + // // Rule 112: selection_statement ::= if ( expression ) statement // case 112: { action. consumeStatementIf(false); break; - } - + } + // // Rule 113: selection_statement ::= if ( expression ) statement else statement // case 113: { action. consumeStatementIf(true); break; - } - + } + // // Rule 114: selection_statement ::= switch ( expression ) statement // case 114: { action. consumeStatementSwitch(); break; - } - + } + // // Rule 116: expression_opt ::= $Empty // case 116: { action. consumeEmpty(); break; - } - + } + // // Rule 117: iteration_statement ::= do statement while ( expression ) ; // case 117: { action. consumeStatementDoLoop(true); break; - } - + } + // // Rule 118: iteration_statement ::= do statement // case 118: { action. consumeStatementDoLoop(false); break; - } - + } + // // Rule 119: iteration_statement ::= while ( expression ) statement // case 119: { action. consumeStatementWhileLoop(); break; - } - + } + // // Rule 120: iteration_statement ::= for ( expression_opt ; expression_opt ; expression_opt ) statement // case 120: { action. consumeStatementForLoop(); break; - } - + } + // // Rule 121: iteration_statement ::= for ( declaration expression_opt ; expression_opt ) statement // case 121: { action. consumeStatementForLoop(); break; - } - + } + // // Rule 122: jump_statement ::= goto identifier_token ; // case 122: { action. consumeStatementGoto(); break; - } - + } + // // Rule 123: jump_statement ::= continue ; // case 123: { action. consumeStatementContinue(); break; - } - + } + // // Rule 124: jump_statement ::= break ; // case 124: { action. consumeStatementBreak(); break; - } - + } + // // Rule 125: jump_statement ::= return ; // case 125: { action. consumeStatementReturn(false); break; - } - + } + // // Rule 126: jump_statement ::= return expression ; // case 126: { action. consumeStatementReturn(true); break; - } - + } + // // Rule 127: declaration ::= declaration_specifiers ; // case 127: { action. consumeDeclarationSimple(false); break; - } - + } + // // Rule 128: declaration ::= declaration_specifiers <openscope-ast> init_declarator_list ; // case 128: { action. consumeDeclarationSimple(true); break; - } - + } + // // Rule 129: declaration_specifiers ::= <openscope-ast> simple_declaration_specifiers // case 129: { action. consumeDeclarationSpecifiersSimple(); break; - } - + } + // // Rule 130: declaration_specifiers ::= <openscope-ast> struct_or_union_declaration_specifiers // case 130: { action. consumeDeclarationSpecifiersStructUnionEnum(); break; - } - + } + // // Rule 131: declaration_specifiers ::= <openscope-ast> elaborated_declaration_specifiers // case 131: { action. consumeDeclarationSpecifiersStructUnionEnum(); break; - } - + } + // // Rule 132: declaration_specifiers ::= <openscope-ast> enum_declaration_specifiers // case 132: { action. consumeDeclarationSpecifiersStructUnionEnum(); break; - } - + } + // // Rule 133: declaration_specifiers ::= <openscope-ast> typdef_name_declaration_specifiers // case 133: { action. consumeDeclarationSpecifiersTypedefName(); break; - } - + } + // // Rule 158: init_declarator ::= complete_declarator = initializer // case 158: { action. consumeDeclaratorWithInitializer(true); break; - } - + } + // // Rule 160: storage_class_specifier ::= storage_class_specifier_token // case 160: { action. consumeToken(); break; - } - + } + // // Rule 166: simple_type_specifier ::= simple_type_specifier_token // case 166: { action. consumeToken(); break; - } - + } + // // Rule 179: type_name_specifier ::= identifier_token // case 179: { action. consumeToken(); break; - } - + } + // // Rule 180: struct_or_union_specifier ::= struct_or_union struct_or_union_specifier_hook { <openscope-ast> struct_declaration_list_opt } // case 180: { action. consumeTypeSpecifierComposite(false); break; - } - + } + // // Rule 181: struct_or_union_specifier ::= struct_or_union struct_or_union_specifier_hook identifier_token struct_or_union_specifier_suffix_hook { <openscope-ast> struct_declaration_list_opt } // case 181: { action. consumeTypeSpecifierComposite(true); break; - } - + } + // // Rule 186: elaborated_specifier ::= struct elaborated_specifier_hook identifier_token // case 186: { action. consumeTypeSpecifierElaborated(IASTCompositeTypeSpecifier.k_struct); break; - } - + } + // // Rule 187: elaborated_specifier ::= union elaborated_specifier_hook identifier_token // case 187: { action. consumeTypeSpecifierElaborated(IASTCompositeTypeSpecifier.k_union); break; - } - + } + // // Rule 188: elaborated_specifier ::= enum elaborated_specifier_hook identifier_token // case 188: { action. consumeTypeSpecifierElaborated(IASTElaboratedTypeSpecifier.k_enum); break; - } - + } + // // Rule 194: struct_declaration ::= specifier_qualifier_list <openscope-ast> struct_declarator_list ; // case 194: { action. consumeStructDeclaration(true); break; - } - + } + // // Rule 195: struct_declaration ::= specifier_qualifier_list ; // case 195: { action. consumeStructDeclaration(false); break; - } - + } + // // Rule 196: struct_declaration ::= ERROR_TOKEN // case 196: { action. consumeDeclarationProblem(); break; - } - + } + // // Rule 202: struct_declarator ::= : constant_expression // case 202: { action. consumeBitField(false); break; - } - + } + // // Rule 203: struct_declarator ::= declarator : constant_expression // case 203: { action. consumeBitField(true); break; - } - + } + // // Rule 204: enum_specifier ::= enum enum_specifier_hook { <openscope-ast> enumerator_list_opt comma_opt } // case 204: { action. consumeTypeSpecifierEnumeration(false); break; - } - + } + // // Rule 205: enum_specifier ::= enum enum_specifier_hook identifier_token { <openscope-ast> enumerator_list_opt comma_opt } // case 205: { action. consumeTypeSpecifierEnumeration(true); break; - } - + } + // // Rule 211: enumerator ::= identifier_token // case 211: { action. consumeEnumerator(false); break; - } - + } + // // Rule 212: enumerator ::= identifier_token = constant_expression // case 212: { action. consumeEnumerator(true); break; - } - + } + // // Rule 213: type_qualifier ::= type_qualifier_token // case 213: { action. consumeToken(); break; - } - + } + // // Rule 217: function_specifier ::= inline // case 217: { action. consumeToken(); break; - } - + } + // // Rule 219: declarator ::= <openscope-ast> pointer_seq direct_declarator // case 219: { action. consumeDeclaratorWithPointer(true); break; - } - + } + // // Rule 224: basic_direct_declarator ::= declarator_id_name // case 224: { action. consumeDirectDeclaratorIdentifier(); break; - } - + } + // // Rule 225: basic_direct_declarator ::= ( declarator ) // case 225: { action. consumeDirectDeclaratorBracketed(); break; - } - + } + // // Rule 226: declarator_id_name ::= identifier // case 226: { action. consumeIdentifierName(); break; - } - + } + // // Rule 227: array_direct_declarator ::= basic_direct_declarator array_modifier // case 227: { action. consumeDirectDeclaratorArrayDeclarator(true); break; - } - + } + // // Rule 228: array_direct_declarator ::= array_direct_declarator array_modifier // case 228: { action. consumeDirectDeclaratorArrayDeclarator(true); break; - } - + } + // // Rule 230: function_direct_declarator ::= basic_direct_declarator ( <openscope-ast> parameter_type_list ) // case 230: { action. consumeDirectDeclaratorFunctionDeclarator(true, true); break; - } - + } + // // Rule 231: function_direct_declarator ::= basic_direct_declarator ( ) // case 231: { action. consumeDirectDeclaratorFunctionDeclarator(true, false); break; - } - + } + // // Rule 233: function_declarator ::= <openscope-ast> pointer_seq function_direct_declarator // case 233: { action. consumeDeclaratorWithPointer(true); break; - } - + } + // // Rule 234: knr_direct_declarator ::= basic_direct_declarator ( <openscope-ast> identifier_list ) // case 234: { action. consumeDirectDeclaratorFunctionDeclaratorKnR(); break; - } - + } + // // Rule 236: knr_function_declarator ::= <openscope-ast> pointer_seq knr_direct_declarator // case 236: { action. consumeDeclaratorWithPointer(true); break; - } - + } + // // Rule 237: identifier_list ::= identifier // case 237: { action. consumeIdentifierKnR(); break; - } - + } + // // Rule 238: identifier_list ::= identifier_list , identifier // case 238: { action. consumeIdentifierKnR(); break; - } - + } + // // Rule 239: array_modifier ::= [ ] // case 239: { action. consumeDirectDeclaratorArrayModifier(false); break; - } - + } + // // Rule 240: array_modifier ::= [ <openscope-ast> array_modifier_type_qualifiers ] // case 240: { action. consumeDirectDeclaratorModifiedArrayModifier(false, false, true, false); break; - } - + } + // // Rule 241: array_modifier ::= [ assignment_expression ] // case 241: { action. consumeDirectDeclaratorArrayModifier(true); break; - } - + } + // // Rule 242: array_modifier ::= [ <openscope-ast> array_modifier_type_qualifiers assignment_expression ] // case 242: { action. consumeDirectDeclaratorModifiedArrayModifier(false, false, true, true); break; - } - + } + // // Rule 243: array_modifier ::= [ static assignment_expression ] // case 243: { action. consumeDirectDeclaratorModifiedArrayModifier(true, false, false, true); break; - } - + } + // // Rule 244: array_modifier ::= [ static <openscope-ast> array_modifier_type_qualifiers assignment_expression ] // case 244: { action. consumeDirectDeclaratorModifiedArrayModifier(true, false, true, true); break; - } - + } + // // Rule 245: array_modifier ::= [ <openscope-ast> array_modifier_type_qualifiers static assignment_expression ] // case 245: { action. consumeDirectDeclaratorModifiedArrayModifier(true, false, true, true); break; - } - + } + // // Rule 246: array_modifier ::= [ * ] // case 246: { action. consumeDirectDeclaratorModifiedArrayModifier(false, true, false, false); break; - } - + } + // // Rule 247: array_modifier ::= [ <openscope-ast> array_modifier_type_qualifiers * ] // case 247: { action. consumeDirectDeclaratorModifiedArrayModifier(false, true, true, false); break; - } - + } + // // Rule 249: pointer_seq ::= pointer_hook * pointer_hook // case 249: { action. consumePointer(); break; - } - + } + // // Rule 250: pointer_seq ::= pointer_seq pointer_hook * pointer_hook // case 250: { action. consumePointer(); break; - } - + } + // // Rule 251: pointer_seq ::= pointer_hook * pointer_hook <openscope-ast> type_qualifier_list // case 251: { action. consumePointerTypeQualifierList(); break; - } - + } + // // Rule 252: pointer_seq ::= pointer_seq pointer_hook * pointer_hook <openscope-ast> type_qualifier_list // case 252: { action. consumePointerTypeQualifierList(); break; - } - + } + // // Rule 256: parameter_type_list ::= parameter_list // case 256: { action. consumeEmpty(); break; - } - + } + // // Rule 257: parameter_type_list ::= parameter_list , ... // case 257: { action. consumePlaceHolder(); break; - } - + } + // // Rule 258: parameter_type_list ::= ... // case 258: { action. consumePlaceHolder(); break; - } - + } + // // Rule 261: parameter_declaration ::= declaration_specifiers complete_parameter_declarator // case 261: { action. consumeParameterDeclaration(); break; - } - + } + // // Rule 262: parameter_declaration ::= declaration_specifiers // case 262: { action. consumeParameterDeclarationWithoutDeclarator(); break; - } - + } + // // Rule 265: type_id ::= specifier_qualifier_list // case 265: { action. consumeTypeId(false); break; - } - + } + // // Rule 266: type_id ::= specifier_qualifier_list abstract_declarator // case 266: { action. consumeTypeId(true); break; - } - + } + // // Rule 268: abstract_declarator ::= <openscope-ast> pointer_seq // case 268: { action. consumeDeclaratorWithPointer(false); break; - } - + } + // // Rule 269: abstract_declarator ::= <openscope-ast> pointer_seq direct_abstract_declarator // case 269: { action. consumeDeclaratorWithPointer(true); break; - } - + } + // // Rule 273: basic_direct_abstract_declarator ::= ( abstract_declarator ) // case 273: { action. consumeDirectDeclaratorBracketed(); break; - } - + } + // // Rule 274: array_direct_abstract_declarator ::= array_modifier // case 274: { action. consumeDirectDeclaratorArrayDeclarator(false); break; - } - + } + // // Rule 275: array_direct_abstract_declarator ::= array_direct_abstract_declarator array_modifier // case 275: { action. consumeDirectDeclaratorArrayDeclarator(true); break; - } - + } + // // Rule 276: array_direct_abstract_declarator ::= basic_direct_abstract_declarator array_modifier // case 276: { action. consumeDirectDeclaratorArrayDeclarator(true); break; - } - + } + // // Rule 277: function_direct_abstract_declarator ::= ( ) // case 277: { action. consumeDirectDeclaratorFunctionDeclarator(false, false); break; - } - + } + // // Rule 278: function_direct_abstract_declarator ::= basic_direct_abstract_declarator ( ) // case 278: { action. consumeDirectDeclaratorFunctionDeclarator(true, false); break; - } - + } + // // Rule 279: function_direct_abstract_declarator ::= ( <openscope-ast> parameter_type_list ) // case 279: { action. consumeDirectDeclaratorFunctionDeclarator(false, true); break; - } - + } + // // Rule 280: function_direct_abstract_declarator ::= basic_direct_abstract_declarator ( <openscope-ast> parameter_type_list ) // case 280: { action. consumeDirectDeclaratorFunctionDeclarator(true, true); break; - } - + } + // // Rule 281: initializer ::= assignment_expression // case 281: { action. consumeInitializer(); break; - } - + } + // // Rule 282: initializer ::= initializer_list // case 282: { action. consumeInitializer(); break; - } - + } + // // Rule 283: initializer_list ::= start_initializer_list { <openscope-ast> initializer_seq comma_opt } end_initializer_list // case 283: { action. consumeInitializerList(); break; - } - + } + // // Rule 284: initializer_list ::= { <openscope-ast> } // case 284: { action. consumeInitializerList(); break; - } - + } + // // Rule 285: start_initializer_list ::= $Empty // case 285: { action. initializerListStart(); break; - } - + } + // // Rule 286: end_initializer_list ::= $Empty // case 286: { action. initializerListEnd(); break; - } - + } + // // Rule 291: designated_initializer ::= <openscope-ast> designation = initializer // case 291: { action. consumeInitializerDesignated(); break; - } - + } + // // Rule 295: designator_base ::= [ constant_expression ] // case 295: { action. consumeDesignatorArray(); break; - } - + } + // // Rule 296: designator_base ::= . identifier_token // case 296: { action. consumeDesignatorField(); break; - } - + } + // // Rule 297: designator ::= [ constant_expression ] // case 297: { action. consumeDesignatorArray(); break; - } - + } + // // Rule 298: designator ::= . identifier_token // case 298: { action. consumeDesignatorField(); break; - } - + } + // // Rule 299: translation_unit ::= external_declaration_list // case 299: { action. consumeTranslationUnit(); break; - } - + } + // // Rule 300: translation_unit ::= $Empty // case 300: { action. consumeTranslationUnit(); break; - } - + } + // // Rule 305: external_declaration ::= ; // case 305: { action. consumeDeclarationEmpty(); break; - } - + } + // // Rule 306: external_declaration ::= ERROR_TOKEN // case 306: { action. consumeDeclarationProblem(); break; - } - + } + // // Rule 310: function_definition ::= <openscope-ast> function_declarator function_body // case 310: { action. consumeFunctionDefinition(false); break; - } - + } + // // Rule 311: function_definition ::= declaration_specifiers <openscope-ast> knr_function_declarator <openscope-ast> declaration_list compound_statement // case 311: { action. consumeFunctionDefinitionKnR(); break; - } - + } + // // Rule 312: normal_function_definition ::= declaration_specifiers <openscope-ast> function_declarator function_body // case 312: { action. consumeFunctionDefinition(true); break; - } - + } + // // Rule 313: function_body ::= { } // case 313: { action. consumeStatementCompoundStatement(false); break; - } - + } + // // Rule 314: function_body ::= { <openscope-ast> block_item_list } // case 314: { action. consumeStatementCompoundStatement(true); break; - } - + } + // // Rule 316: no_sizeof_type_id_start ::= ERROR_TOKEN // case 316: { action. consumeEmpty(); break; - } - + } + // // Rule 317: literal ::= MYTHREAD // case 317: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_mythread); break; - } - + } + // // Rule 318: literal ::= THREADS // case 318: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_threads); break; - } - + } + // // Rule 319: literal ::= UPC_MAX_BLOCKSIZE // case 319: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_upc_max_block_size); break; - } - + } + // // Rule 320: unary_expression ::= upc_localsizeof unary_expression // case 320: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_localsizeof); break; - } - + } + // // Rule 321: unary_expression ::= upc_blocksizeof unary_expression // case 321: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_blocksizeof); break; - } - + } + // // Rule 322: unary_expression ::= upc_elemsizeof unary_expression // case 322: { action. consumeExpressionUnarySizeofOperator(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 // case 328: { action. consumeToken(); break; - } - + } + // // Rule 329: layout_qualifier ::= [ constant_expression ] // case 329: { action. consumeLayoutQualifier(true, false); break; - } - + } + // // Rule 330: layout_qualifier ::= [ * ] // case 330: { action. consumeLayoutQualifier(false, true); break; - } - + } + // // Rule 331: layout_qualifier ::= [ ] // case 331: { action. consumeLayoutQualifier(false, false); break; - } - + } + // // Rule 333: synchronization_statement ::= upc_notify expression ; // case 333: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_notify, true); break; - } - + } + // // Rule 334: synchronization_statement ::= upc_notify ; // case 334: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_notify, false); break; - } - + } + // // Rule 335: synchronization_statement ::= upc_wait expression ; // case 335: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_wait, true); break; - } - + } + // // Rule 336: synchronization_statement ::= upc_wait ; // case 336: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_wait, false); break; - } - + } + // // Rule 337: synchronization_statement ::= upc_barrier expression ; // case 337: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_barrier, true); break; - } - + } + // // Rule 338: synchronization_statement ::= upc_barrier ; // case 338: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_barrier, false); break; - } - + } + // // Rule 339: synchronization_statement ::= upc_fence ; // case 339: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_fence, false); break; - } - + } + // // Rule 340: iteration_statement ::= upc_forall ( expression ; expression ; expression ; affinity ) statement // case 340: { action. consumeStatementUPCForallLoop(true, true, true, true); break; - } - + } + // // Rule 341: iteration_statement ::= upc_forall ( expression ; expression ; expression ; ) statement // case 341: { action. consumeStatementUPCForallLoop(true, true, true, false); break; - } - + } + // // Rule 342: iteration_statement ::= upc_forall ( expression ; expression ; ; affinity ) statement // case 342: { action. consumeStatementUPCForallLoop(true, true, false, true); break; - } - + } + // // Rule 343: iteration_statement ::= upc_forall ( expression ; expression ; ; ) statement // case 343: { action. consumeStatementUPCForallLoop(true, true, false, false); break; - } - + } + // // Rule 344: iteration_statement ::= upc_forall ( expression ; ; expression ; affinity ) statement // case 344: { action. consumeStatementUPCForallLoop(true, false, true, true); break; - } - + } + // // Rule 345: iteration_statement ::= upc_forall ( expression ; ; expression ; ) statement // case 345: { action. consumeStatementUPCForallLoop(true, false, true, false); break; - } - + } + // // Rule 346: iteration_statement ::= upc_forall ( expression ; ; ; affinity ) statement // case 346: { action. consumeStatementUPCForallLoop(true, false, false, true); break; - } - + } + // // Rule 347: iteration_statement ::= upc_forall ( expression ; ; ; ) statement // case 347: { action. consumeStatementUPCForallLoop(true, false, false, false); break; - } - + } + // // Rule 348: iteration_statement ::= upc_forall ( ; expression ; expression ; affinity ) statement // case 348: { action. consumeStatementUPCForallLoop(false, true, true, true); break; - } - + } + // // Rule 349: iteration_statement ::= upc_forall ( ; expression ; expression ; ) statement // case 349: { action. consumeStatementUPCForallLoop(false, true, true, false); break; - } - + } + // // Rule 350: iteration_statement ::= upc_forall ( ; expression ; ; affinity ) statement // case 350: { action. consumeStatementUPCForallLoop(false, true, false, true); break; - } - + } + // // Rule 351: iteration_statement ::= upc_forall ( ; expression ; ; ) statement // case 351: { action. consumeStatementUPCForallLoop(false, true, false, false); break; - } - + } + // // Rule 352: iteration_statement ::= upc_forall ( ; ; expression ; affinity ) statement // case 352: { action. consumeStatementUPCForallLoop(false, false, true, true); break; - } - + } + // // Rule 353: iteration_statement ::= upc_forall ( ; ; expression ; ) statement // case 353: { action. consumeStatementUPCForallLoop(false, false, true, false); break; - } - + } + // // Rule 354: iteration_statement ::= upc_forall ( ; ; ; affinity ) statement // case 354: { action. consumeStatementUPCForallLoop(false, false, false, true); break; - } - + } + // // Rule 355: iteration_statement ::= upc_forall ( ; ; ; ) statement // case 355: { action. consumeStatementUPCForallLoop(false, false, false, false); break; - } - + } + // // Rule 356: iteration_statement ::= upc_forall ( declaration expression ; expression ; affinity ) statement // case 356: { action. consumeStatementUPCForallLoop(true, true, true, true); break; - } - + } + // // Rule 357: iteration_statement ::= upc_forall ( declaration expression ; expression ; ) statement // case 357: { action. consumeStatementUPCForallLoop(true, true, true, false); break; - } - + } + // // Rule 358: iteration_statement ::= upc_forall ( declaration expression ; ; affinity ) statement // case 358: { action. consumeStatementUPCForallLoop(true, true, false, true); break; - } - + } + // // Rule 359: iteration_statement ::= upc_forall ( declaration expression ; ; ) statement // case 359: { action. consumeStatementUPCForallLoop(true, true, false, false); break; - } - + } + // // Rule 360: iteration_statement ::= upc_forall ( declaration ; expression ; affinity ) statement // case 360: { action. consumeStatementUPCForallLoop(true, false, true, true); break; - } - + } + // // Rule 361: iteration_statement ::= upc_forall ( declaration ; expression ; ) statement // case 361: { action. consumeStatementUPCForallLoop(true, false, true, false); break; - } - + } + // // Rule 362: iteration_statement ::= upc_forall ( declaration ; ; affinity ) statement // case 362: { action. consumeStatementUPCForallLoop(true, false, false, true); break; - } - + } + // // Rule 363: iteration_statement ::= upc_forall ( declaration ; ; ) statement // case 363: { action. consumeStatementUPCForallLoop(true, false, false, false); break; - } - + } + // // Rule 365: affinity ::= continue // case 365: { action. consumeToken(); break; - } + } + - default: break; } diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCSizeofExpressionParserprs.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCSizeofExpressionParserprs.java index 3d09443cb23..70fcf08fcce 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCSizeofExpressionParserprs.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCSizeofExpressionParserprs.java @@ -228,9 +228,11 @@ public class UPCSizeofExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static short baseCheck[] = BaseCheck.baseCheck; - public final int baseCheck(int index) { return baseCheck[index]; } + @Override + public final int baseCheck(int index) { return baseCheck[index]; } public final static short rhs[] = baseCheck; - public final int rhs(int index) { return rhs[index]; }; + @Override + public final int rhs(int index) { return rhs[index]; }; public interface BaseAction { public final static char baseAction[] = { @@ -428,9 +430,11 @@ public class UPCSizeofExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static char baseAction[] = BaseAction.baseAction; - public final int baseAction(int index) { return baseAction[index]; } + @Override + public final int baseAction(int index) { return baseAction[index]; } public final static char lhs[] = baseAction; - public final int lhs(int index) { return lhs[index]; }; + @Override + public final int lhs(int index) { return lhs[index]; }; public interface TermCheck { public final static byte termCheck[] = {0, @@ -536,7 +540,8 @@ public class UPCSizeofExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static byte termCheck[] = TermCheck.termCheck; - public final int termCheck(int index) { return termCheck[index]; } + @Override + public final int termCheck(int index) { return termCheck[index]; } public interface TermAction { public final static char termAction[] = {0, @@ -635,7 +640,8 @@ public class UPCSizeofExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static char termAction[] = TermAction.termAction; - public final int termAction(int index) { return termAction[index]; } + @Override + public final int termAction(int index) { return termAction[index]; } public interface Asb { public final static char asb[] = {0, @@ -664,7 +670,8 @@ public class UPCSizeofExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static char asb[] = Asb.asb; - public final int asb(int index) { return asb[index]; } + @Override + public final int asb(int index) { return asb[index]; } public interface Asr { public final static byte asr[] = {0, @@ -717,7 +724,8 @@ public class UPCSizeofExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static byte asr[] = Asr.asr; - public final int asr(int index) { return asr[index]; } + @Override + public final int asr(int index) { return asr[index]; } public interface Nasb { public final static byte nasb[] = {0, @@ -746,7 +754,8 @@ public class UPCSizeofExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static byte nasb[] = Nasb.nasb; - public final int nasb(int index) { return nasb[index]; } + @Override + public final int nasb(int index) { return nasb[index]; } public interface Nasr { public final static char nasr[] = {0, @@ -766,7 +775,8 @@ public class UPCSizeofExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static char nasr[] = Nasr.nasr; - public final int nasr(int index) { return nasr[index]; } + @Override + public final int nasr(int index) { return nasr[index]; } public interface TerminalIndex { public final static char terminalIndex[] = {0, @@ -784,7 +794,8 @@ public class UPCSizeofExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static char terminalIndex[] = TerminalIndex.terminalIndex; - public final int terminalIndex(int index) { return terminalIndex[index]; } + @Override + public final int terminalIndex(int index) { return terminalIndex[index]; } public interface NonterminalIndex { public final static char nonterminalIndex[] = {0, @@ -805,7 +816,8 @@ public class UPCSizeofExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static char nonterminalIndex[] = NonterminalIndex.nonterminalIndex; - public final int nonterminalIndex(int index) { return nonterminalIndex[index]; } + @Override + public final int nonterminalIndex(int index) { return nonterminalIndex[index]; } public interface ScopePrefix { public final static char scopePrefix[] = { @@ -817,7 +829,8 @@ public class UPCSizeofExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static char scopePrefix[] = ScopePrefix.scopePrefix; - public final int scopePrefix(int index) { return scopePrefix[index]; } + @Override + public final int scopePrefix(int index) { return scopePrefix[index]; } public interface ScopeSuffix { public final static char scopeSuffix[] = { @@ -829,7 +842,8 @@ public class UPCSizeofExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static char scopeSuffix[] = ScopeSuffix.scopeSuffix; - public final int scopeSuffix(int index) { return scopeSuffix[index]; } + @Override + public final int scopeSuffix(int index) { return scopeSuffix[index]; } public interface ScopeLhs { public final static char scopeLhs[] = { @@ -841,7 +855,8 @@ public class UPCSizeofExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static char scopeLhs[] = ScopeLhs.scopeLhs; - public final int scopeLhs(int index) { return scopeLhs[index]; } + @Override + public final int scopeLhs(int index) { return scopeLhs[index]; } public interface ScopeLa { public final static byte scopeLa[] = { @@ -853,7 +868,8 @@ public class UPCSizeofExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static byte scopeLa[] = ScopeLa.scopeLa; - public final int scopeLa(int index) { return scopeLa[index]; } + @Override + public final int scopeLa(int index) { return scopeLa[index]; } public interface ScopeStateSet { public final static byte scopeStateSet[] = { @@ -865,7 +881,8 @@ public class UPCSizeofExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static byte scopeStateSet[] = ScopeStateSet.scopeStateSet; - public final int scopeStateSet(int index) { return scopeStateSet[index]; } + @Override + public final int scopeStateSet(int index) { return scopeStateSet[index]; } public interface ScopeRhs { public final static char scopeRhs[] = {0, @@ -893,7 +910,8 @@ public class UPCSizeofExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static char scopeRhs[] = ScopeRhs.scopeRhs; - public final int scopeRhs(int index) { return scopeRhs[index]; } + @Override + public final int scopeRhs(int index) { return scopeRhs[index]; } public interface ScopeState { public final static char scopeState[] = {0, @@ -911,7 +929,8 @@ public class UPCSizeofExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static char scopeState[] = ScopeState.scopeState; - public final int scopeState(int index) { return scopeState[index]; } + @Override + public final int scopeState(int index) { return scopeState[index]; } public interface InSymb { public final static char inSymb[] = {0, @@ -940,7 +959,8 @@ public class UPCSizeofExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static char inSymb[] = InSymb.inSymb; - public final int inSymb(int index) { return inSymb[index]; } + @Override + public final int inSymb(int index) { return inSymb[index]; } public interface Name { public final static String name[] = { @@ -1133,7 +1153,8 @@ public class UPCSizeofExpressionParserprs implements lpg.lpgjavaruntime.ParseTab }; }; public final static String name[] = Name.name; - public final String name(int index) { return name[index]; } + @Override + public final String name(int index) { return name[index]; } public final static int ERROR_SYMBOL = 60, @@ -1141,10 +1162,14 @@ public class UPCSizeofExpressionParserprs implements lpg.lpgjavaruntime.ParseTab SCOPE_SIZE = 45, MAX_NAME_LENGTH = 38; - public final int getErrorSymbol() { return ERROR_SYMBOL; } - public final int getScopeUbound() { return SCOPE_UBOUND; } - public final int getScopeSize() { return SCOPE_SIZE; } - public final int getMaxNameLength() { return MAX_NAME_LENGTH; } + @Override + public final int getErrorSymbol() { return ERROR_SYMBOL; } + @Override + public final int getScopeUbound() { return SCOPE_UBOUND; } + @Override + public final int getScopeSize() { return SCOPE_SIZE; } + @Override + public final int getMaxNameLength() { return MAX_NAME_LENGTH; } public final static int NUM_STATES = 214, @@ -1164,47 +1189,70 @@ public class UPCSizeofExpressionParserprs implements lpg.lpgjavaruntime.ParseTab public final static boolean BACKTRACK = true; - public final int getNumStates() { return NUM_STATES; } - public final int getNtOffset() { return NT_OFFSET; } - public final int getLaStateOffset() { return LA_STATE_OFFSET; } - public final int getMaxLa() { return MAX_LA; } - public final int getNumRules() { return NUM_RULES; } - public final int getNumNonterminals() { return NUM_NONTERMINALS; } - public final int getNumSymbols() { return NUM_SYMBOLS; } - public final int getSegmentSize() { return SEGMENT_SIZE; } - public final int getStartState() { return START_STATE; } - public final int getStartSymbol() { return lhs[0]; } + @Override + public final int getNumStates() { return NUM_STATES; } + @Override + public final int getNtOffset() { return NT_OFFSET; } + @Override + public final int getLaStateOffset() { return LA_STATE_OFFSET; } + @Override + public final int getMaxLa() { return MAX_LA; } + @Override + public final int getNumRules() { return NUM_RULES; } + @Override + public final int getNumNonterminals() { return NUM_NONTERMINALS; } + @Override + public final int getNumSymbols() { return NUM_SYMBOLS; } + @Override + public final int getSegmentSize() { return SEGMENT_SIZE; } + @Override + public final int getStartState() { return START_STATE; } + @Override + public final int getStartSymbol() { return lhs[0]; } public final int getIdentifierSymbol() { return IDENTIFIER_SYMBOL; } - public final int getEoftSymbol() { return EOFT_SYMBOL; } - public final int getEoltSymbol() { return EOLT_SYMBOL; } - public final int getAcceptAction() { return ACCEPT_ACTION; } - public final int getErrorAction() { return ERROR_ACTION; } - public final boolean isValidForParser() { return isValidForParser; } - public final boolean getBacktrack() { return BACKTRACK; } + @Override + public final int getEoftSymbol() { return EOFT_SYMBOL; } + @Override + public final int getEoltSymbol() { return EOLT_SYMBOL; } + @Override + public final int getAcceptAction() { return ACCEPT_ACTION; } + @Override + public final int getErrorAction() { return ERROR_ACTION; } + @Override + public final boolean isValidForParser() { return isValidForParser; } + @Override + public final boolean getBacktrack() { return BACKTRACK; } - public final int originalState(int state) { + @Override + public final int originalState(int state) { return -baseCheck[state]; } - public final int asi(int state) { + @Override + public final int asi(int state) { return asb[originalState(state)]; } - public final int nasi(int state) { + @Override + public final int nasi(int state) { return nasb[originalState(state)]; } - public final int inSymbol(int state) { + @Override + public final int inSymbol(int state) { return inSymb[originalState(state)]; } - public final int ntAction(int state, int sym) { + @Override + public final int ntAction(int state, int sym) { return baseAction[state + sym]; } - public final int tAction(int state, int sym) { + @Override + public final int tAction(int state, int sym) { int i = baseAction[state], k = i + sym; return termAction[termCheck[k] == sym ? k : i]; } - public final int lookAhead(int la_state, int sym) { + @Override + public final int lookAhead(int la_state, int sym) { int k = la_state + sym; return termAction[termCheck[k] == sym ? k : la_state]; } diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTCompositeTypeSpecifier.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTCompositeTypeSpecifier.java index 11aaaff7e47..0ae87dd2132 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTCompositeTypeSpecifier.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTCompositeTypeSpecifier.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -19,23 +19,23 @@ import org.eclipse.cdt.internal.core.dom.parser.c.CASTCompositeTypeSpecifier; @SuppressWarnings("restriction") public class UPCASTCompositeTypeSpecifier extends CASTCompositeTypeSpecifier implements IUPCASTCompositeTypeSpecifier { - + private int referenceType; private int sharedQualifier; private IASTExpression blockSizeExpression; - + public UPCASTCompositeTypeSpecifier() { } public UPCASTCompositeTypeSpecifier(int key, IASTName name) { super(key, name); } - + public UPCASTCompositeTypeSpecifier(int key, IASTName name, IASTExpression blockSizeExpression) { super(key, name); setBlockSizeExpression(blockSizeExpression); } - + @Override public UPCASTCompositeTypeSpecifier copy() { return copy(CopyStyle.withoutLocations); @@ -54,36 +54,42 @@ public class UPCASTCompositeTypeSpecifier extends CASTCompositeTypeSpecifier imp return copy; } + @Override public IASTExpression getBlockSizeExpression() { return blockSizeExpression; } + @Override public int getReferenceType() { return referenceType; } + @Override public int getSharedQualifier() { return sharedQualifier; } + @Override public void setBlockSizeExpression(IASTExpression expr) { this.blockSizeExpression = expr; if(expr != null) { expr.setParent(this); expr.setPropertyInParent(BLOCK_SIZE_EXPRESSION); } - + } + @Override public void setReferenceType(int referenceType) { this.referenceType = referenceType; } + @Override public void setSharedQualifier(int shared) { this.sharedQualifier = shared; } - + @Override public boolean accept( ASTVisitor action ){ if( action.shouldVisitDeclSpecifiers ){ @@ -94,12 +100,12 @@ public class UPCASTCompositeTypeSpecifier extends CASTCompositeTypeSpecifier imp } } if( getName() != null ) if( !getName().accept( action ) ) return false; - if( blockSizeExpression != null) if( !blockSizeExpression.accept( action ) ) return false; - + if( blockSizeExpression != null) if( !blockSizeExpression.accept( action ) ) return false; + IASTDeclaration [] decls = getMembers(); for( int i = 0; i < decls.length; i++ ) if( !decls[i].accept( action ) ) return false; - + if( action.shouldVisitDeclSpecifiers ){ switch( action.leave( this ) ){ case ASTVisitor.PROCESS_ABORT : return false; diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTElaboratedTypeSpecifier.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTElaboratedTypeSpecifier.java index 66097baee9f..7bac8fa46d4 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTElaboratedTypeSpecifier.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTElaboratedTypeSpecifier.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -22,15 +22,15 @@ public class UPCASTElaboratedTypeSpecifier extends CASTElaboratedTypeSpecifier i private int referenceType; private int sharedQualifier; private IASTExpression blockSizeExpression; - - + + public UPCASTElaboratedTypeSpecifier() { } public UPCASTElaboratedTypeSpecifier(int kind, IASTName name) { super(kind, name); } - + public UPCASTElaboratedTypeSpecifier(int kind, IASTName name, IASTExpression blockSizeExpression) { super(kind, name); setBlockSizeExpression(blockSizeExpression); @@ -40,7 +40,7 @@ public class UPCASTElaboratedTypeSpecifier extends CASTElaboratedTypeSpecifier i public UPCASTElaboratedTypeSpecifier copy() { return copy(CopyStyle.withoutLocations); } - + @Override public UPCASTElaboratedTypeSpecifier copy(CopyStyle style) { IASTName name = getName(); @@ -55,18 +55,22 @@ public class UPCASTElaboratedTypeSpecifier extends CASTElaboratedTypeSpecifier i return copy; } + @Override public IASTExpression getBlockSizeExpression() { return blockSizeExpression; } + @Override public int getReferenceType() { return referenceType; } + @Override public int getSharedQualifier() { return sharedQualifier; } + @Override public void setBlockSizeExpression(IASTExpression expr) { this.blockSizeExpression = expr; if(expr != null) { @@ -75,15 +79,17 @@ public class UPCASTElaboratedTypeSpecifier extends CASTElaboratedTypeSpecifier i } } + @Override public void setReferenceType(int referenceType) { this.referenceType = referenceType; } + @Override public void setSharedQualifier(int shared) { this.sharedQualifier = shared; } - - + + @Override public boolean accept( ASTVisitor action ){ if( action.shouldVisitDeclSpecifiers ){ @@ -94,8 +100,8 @@ public class UPCASTElaboratedTypeSpecifier extends CASTElaboratedTypeSpecifier i } } if( getName() != null ) if( !getName().accept( action ) ) return false; - if( blockSizeExpression != null) if( !blockSizeExpression.accept( action ) ) return false; - + if( blockSizeExpression != null) if( !blockSizeExpression.accept( action ) ) return false; + if( action.shouldVisitDeclSpecifiers ){ switch( action.leave( this ) ){ case ASTVisitor.PROCESS_ABORT : return false; @@ -106,6 +112,6 @@ public class UPCASTElaboratedTypeSpecifier extends CASTElaboratedTypeSpecifier i return true; } - - + + } diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTEnumerationSpecifier.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTEnumerationSpecifier.java index 1333e4c5634..fa3a6d3f51a 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTEnumerationSpecifier.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTEnumerationSpecifier.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -22,15 +22,15 @@ public class UPCASTEnumerationSpecifier extends CASTEnumerationSpecifier impleme private int referenceType; private int sharedQualifier; private IASTExpression blockSizeExpression; - - + + public UPCASTEnumerationSpecifier() { } public UPCASTEnumerationSpecifier(IASTName name) { super(name); } - + public UPCASTEnumerationSpecifier(IASTName name, IASTExpression blockSizeExpression) { super(name); setBlockSizeExpression(blockSizeExpression); @@ -40,7 +40,7 @@ public class UPCASTEnumerationSpecifier extends CASTEnumerationSpecifier impleme public UPCASTEnumerationSpecifier copy() { return copy(CopyStyle.withoutLocations); } - + @Override public UPCASTEnumerationSpecifier copy(CopyStyle style) { UPCASTEnumerationSpecifier copy = new UPCASTEnumerationSpecifier(); @@ -54,18 +54,22 @@ public class UPCASTEnumerationSpecifier extends CASTEnumerationSpecifier impleme return copy; } + @Override public IASTExpression getBlockSizeExpression() { return blockSizeExpression; } + @Override public int getReferenceType() { return referenceType; } + @Override public int getSharedQualifier() { return sharedQualifier; } + @Override public void setBlockSizeExpression(IASTExpression expr) { this.blockSizeExpression = expr; if(expr != null) { @@ -74,10 +78,12 @@ public class UPCASTEnumerationSpecifier extends CASTEnumerationSpecifier impleme } } + @Override public void setReferenceType(int referenceType) { this.referenceType = referenceType; } + @Override public void setSharedQualifier(int shared) { this.sharedQualifier = shared; } @@ -92,8 +98,8 @@ public class UPCASTEnumerationSpecifier extends CASTEnumerationSpecifier impleme } } if( getName() != null ) if( !getName().accept( action ) ) return false; - if( blockSizeExpression != null) if( !blockSizeExpression.accept( action ) ) return false; - + if( blockSizeExpression != null) if( !blockSizeExpression.accept( action ) ) return false; + IASTEnumerator[] etors = getEnumerators(); for ( int i = 0; i < etors.length; i++ ) { if( !etors[i].accept( action ) ) return false; @@ -107,5 +113,5 @@ public class UPCASTEnumerationSpecifier extends CASTEnumerationSpecifier impleme } return true; } - + } diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTForallStatement.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTForallStatement.java index b7344e41c18..1fb52781b78 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTForallStatement.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTForallStatement.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -21,7 +21,7 @@ public class UPCASTForallStatement extends CASTForStatement implements IUPCASTFo private IASTExpression affinity; private boolean affinityContinue; - + public UPCASTForallStatement() { } @@ -36,7 +36,7 @@ public class UPCASTForallStatement extends CASTForStatement implements IUPCASTFo public UPCASTForallStatement copy() { return copy(CopyStyle.withoutLocations); } - + @Override public UPCASTForallStatement copy(CopyStyle style) { UPCASTForallStatement copy = new UPCASTForallStatement(); @@ -47,16 +47,19 @@ public class UPCASTForallStatement extends CASTForStatement implements IUPCASTFo } return copy; } - - + + + @Override public boolean isAffinityContinue() { return affinityContinue; } - + + @Override public IASTExpression getAffinityExpresiion() { return affinity; } + @Override public void setAffinityExpression(IASTExpression affinity) { if(affinity != null) this.affinityContinue = false; @@ -67,12 +70,13 @@ public class UPCASTForallStatement extends CASTForStatement implements IUPCASTFo } } + @Override public void setAffinityContinue(boolean affinityContinue) { if(affinityContinue) this.affinity = null; this.affinityContinue = affinityContinue; } - + @Override public boolean accept(ASTVisitor visitor) { @@ -82,28 +86,28 @@ public class UPCASTForallStatement extends CASTForStatement implements IUPCASTFo case ASTVisitor.PROCESS_SKIP : return true; } } - + IASTStatement initializer = super.getInitializerStatement(); if(initializer != null) if(!initializer.accept(visitor)) return false; - + IASTExpression condition = super.getConditionExpression(); if(condition != null) if(!condition.accept(visitor)) return false; - + IASTExpression iteration = super.getIterationExpression(); if(iteration != null) if(!iteration.accept(visitor)) return false; - + if(affinity != null) if(!affinity.accept(visitor)) return false; - + IASTStatement body = super.getBody(); if(body != null) if(!body.accept(visitor)) return false; - + if(visitor.shouldVisitStatements) { switch(visitor.leave(this)){ case ASTVisitor.PROCESS_ABORT : return false; case ASTVisitor.PROCESS_SKIP : return true; } } - + return true; } diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTKeywordExpression.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTKeywordExpression.java index fb9329fc84c..049b8186fa0 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTKeywordExpression.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTKeywordExpression.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -20,20 +20,22 @@ import org.eclipse.cdt.internal.core.dom.parser.c.CBasicType; @SuppressWarnings("restriction") public class UPCASTKeywordExpression extends ASTNode implements IUPCASTKeywordExpression { - + private int keywordKind; - + public UPCASTKeywordExpression() { } public UPCASTKeywordExpression(int keywordKind) { this.keywordKind = keywordKind; } - + + @Override public UPCASTKeywordExpression copy() { return copy(CopyStyle.withoutLocations); } - + + @Override public UPCASTKeywordExpression copy(CopyStyle style) { UPCASTKeywordExpression copy = new UPCASTKeywordExpression(keywordKind); copy.setOffsetAndLength(this); @@ -43,27 +45,32 @@ public class UPCASTKeywordExpression extends ASTNode implements IUPCASTKeywordEx return copy; } + @Override public int getKeywordKind() { return keywordKind; } + @Override public void setKeywordKind(int kind) { this.keywordKind = kind; - + } + @Override public IType getExpressionType() { return new CBasicType(Kind.eInt, 0, this); } + @Override public boolean isLValue() { return false; } + @Override public ValueCategory getValueCategory() { return ValueCategory.PRVALUE; } - + @Override public boolean accept(ASTVisitor visitor) { if(visitor.shouldVisitExpressions) { @@ -80,5 +87,5 @@ public class UPCASTKeywordExpression extends ASTNode implements IUPCASTKeywordEx } return true; } - + } diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTLayoutQualifier.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTLayoutQualifier.java index 06bee18edeb..d36ec1be589 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTLayoutQualifier.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTLayoutQualifier.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -17,15 +17,17 @@ import org.eclipse.cdt.internal.core.dom.parser.ASTNode; @SuppressWarnings("restriction") public class UPCASTLayoutQualifier extends ASTNode implements IUPCASTLayoutQualifier { - + private boolean isPure; private boolean isIndefinite; private IASTExpression blockSizeExpression; - + + @Override public UPCASTLayoutQualifier copy() { return copy(CopyStyle.withoutLocations); } - + + @Override public UPCASTLayoutQualifier copy(CopyStyle style) { UPCASTLayoutQualifier copy = new UPCASTLayoutQualifier(); copy.isPure = isPure; @@ -37,37 +39,43 @@ public class UPCASTLayoutQualifier extends ASTNode implements IUPCASTLayoutQuali } return copy; } - + + @Override public IASTExpression getBlockSizeExpression() { return blockSizeExpression; } - + + @Override public boolean isIndefiniteBlockAllocation() { return isIndefinite; } - + + @Override public boolean isPureBlockAllocation() { return isPure; } - + + @Override public void setBlockSizeExpression(IASTExpression expr) { this.blockSizeExpression = expr; } - + + @Override public void setIndefiniteBlockAllocation(boolean allocation) { this.isIndefinite = allocation; - + } - + + @Override public void setPureBlockAllocation(boolean allocation) { this.isPure = allocation; } - + } diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTSimpleDeclSpecifier.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTSimpleDeclSpecifier.java index 0d2dff9ba72..4111cc32a2b 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTSimpleDeclSpecifier.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTSimpleDeclSpecifier.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -18,12 +18,12 @@ import org.eclipse.cdt.internal.core.dom.parser.c.CASTSimpleDeclSpecifier; @SuppressWarnings("restriction") public class UPCASTSimpleDeclSpecifier extends CASTSimpleDeclSpecifier implements IUPCASTSimpleDeclSpecifier { - + private int referenceType; private int sharedQualifier; private IASTExpression blockSizeExpression; - - + + public UPCASTSimpleDeclSpecifier() { } @@ -35,7 +35,7 @@ public class UPCASTSimpleDeclSpecifier extends CASTSimpleDeclSpecifier public UPCASTSimpleDeclSpecifier copy() { return copy(CopyStyle.withoutLocations); } - + @Override public UPCASTSimpleDeclSpecifier copy(CopyStyle style) { UPCASTSimpleDeclSpecifier copy = new UPCASTSimpleDeclSpecifier(); @@ -49,18 +49,22 @@ public class UPCASTSimpleDeclSpecifier extends CASTSimpleDeclSpecifier return copy; } + @Override public IASTExpression getBlockSizeExpression() { return blockSizeExpression; } + @Override public int getReferenceType() { return referenceType; } + @Override public int getSharedQualifier() { return sharedQualifier; } + @Override public void setBlockSizeExpression(IASTExpression expr) { this.blockSizeExpression = expr; if(expr != null) { @@ -69,15 +73,17 @@ public class UPCASTSimpleDeclSpecifier extends CASTSimpleDeclSpecifier } } + @Override public void setReferenceType(int referenceType) { this.referenceType = referenceType; } + @Override public void setSharedQualifier(int shared) { this.sharedQualifier = shared; } - - + + @Override public boolean accept(ASTVisitor action) { if( action.shouldVisitDeclSpecifiers ){ @@ -87,8 +93,8 @@ public class UPCASTSimpleDeclSpecifier extends CASTSimpleDeclSpecifier default : break; } } - if( blockSizeExpression != null) if( !blockSizeExpression.accept( action ) ) return false; - + if( blockSizeExpression != null) if( !blockSizeExpression.accept( action ) ) return false; + if( action.shouldVisitDeclSpecifiers ){ switch( action.leave( this ) ){ case ASTVisitor.PROCESS_ABORT : return false; diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTSynchronizationStatement.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTSynchronizationStatement.java index cbca37d63bc..7af6f97da17 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTSynchronizationStatement.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTSynchronizationStatement.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -20,8 +20,8 @@ public class UPCASTSynchronizationStatement extends ASTNode implements IUPCASTSy private int statmentKind; private IASTExpression barrierExpression = null; - - + + public UPCASTSynchronizationStatement() { } @@ -29,11 +29,13 @@ public class UPCASTSynchronizationStatement extends ASTNode implements IUPCASTSy setBarrierExpression(barrierExpression); this.statmentKind = statmentKind; } - + + @Override public UPCASTSynchronizationStatement copy() { return copy(CopyStyle.withoutLocations); } - + + @Override public UPCASTSynchronizationStatement copy(CopyStyle style) { UPCASTSynchronizationStatement copy = new UPCASTSynchronizationStatement(); copy.statmentKind = statmentKind; @@ -45,14 +47,17 @@ public class UPCASTSynchronizationStatement extends ASTNode implements IUPCASTSy return copy; } + @Override public IASTExpression getBarrierExpression() { return barrierExpression; } + @Override public int getStatementKind() { return statmentKind; } + @Override public void setBarrierExpression(IASTExpression expr) { this.barrierExpression = expr; if(expr != null) { @@ -61,11 +66,12 @@ public class UPCASTSynchronizationStatement extends ASTNode implements IUPCASTSy } } + @Override public void setStatementKind(int kind) { this.statmentKind = kind; } - - + + @Override public boolean accept(ASTVisitor visitor) { if(visitor.shouldVisitStatements) { @@ -74,20 +80,20 @@ public class UPCASTSynchronizationStatement extends ASTNode implements IUPCASTSy case ASTVisitor.PROCESS_SKIP : return true; } } - + if(barrierExpression != null) { boolean abort = !barrierExpression.accept(visitor); if(abort) return false; } - + if(visitor.shouldVisitStatements) { switch(visitor.leave(this)) { case ASTVisitor.PROCESS_ABORT : return false; case ASTVisitor.PROCESS_SKIP : return true; } } - + return true; } diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTTypeIdSizeofExpression.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTTypeIdSizeofExpression.java index a1693f06922..592e87d2948 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTTypeIdSizeofExpression.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTTypeIdSizeofExpression.java @@ -19,7 +19,7 @@ import org.eclipse.cdt.internal.core.dom.parser.c.CASTTypeIdExpression; public class UPCASTTypeIdSizeofExpression extends CASTTypeIdExpression implements IUPCASTTypeIdSizeofExpression { private int upcSizeofOperator; - + public UPCASTTypeIdSizeofExpression() { this(null); } @@ -27,17 +27,17 @@ public class UPCASTTypeIdSizeofExpression extends CASTTypeIdExpression implement public UPCASTTypeIdSizeofExpression(IASTTypeId typeId) { super(IASTTypeIdExpression.op_sizeof, typeId); } - + public UPCASTTypeIdSizeofExpression(int upcSizeofOperator, IASTTypeId typeId) { super(IASTTypeIdExpression.op_sizeof, typeId); this.upcSizeofOperator = upcSizeofOperator; } - + @Override public UPCASTTypeIdSizeofExpression copy() { return copy(CopyStyle.withoutLocations); } - + @Override public UPCASTTypeIdSizeofExpression copy(CopyStyle style) { UPCASTTypeIdSizeofExpression copy = new UPCASTTypeIdSizeofExpression(); @@ -51,12 +51,14 @@ public class UPCASTTypeIdSizeofExpression extends CASTTypeIdExpression implement return copy; } + @Override public int getUPCSizeofOperator() { return upcSizeofOperator; } + @Override public void setUPCSizeofOperator(int upcSizeofOperator) { this.upcSizeofOperator = upcSizeofOperator; } - + } diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTTypedefNameSpecifier.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTTypedefNameSpecifier.java index 3adc1986619..79506e438e9 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTTypedefNameSpecifier.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTTypedefNameSpecifier.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -18,12 +18,12 @@ import org.eclipse.cdt.internal.core.dom.parser.c.CASTTypedefNameSpecifier; @SuppressWarnings("restriction") public class UPCASTTypedefNameSpecifier extends CASTTypedefNameSpecifier implements IUPCASTTypedefNameSpecifier { - + private int referenceType; private int sharedQualifier; private IASTExpression blockSizeExpression; - - + + public UPCASTTypedefNameSpecifier() { } @@ -40,7 +40,7 @@ public class UPCASTTypedefNameSpecifier extends CASTTypedefNameSpecifier impleme public UPCASTTypedefNameSpecifier copy() { return copy(CopyStyle.withoutLocations); } - + @Override public UPCASTTypedefNameSpecifier copy(CopyStyle style) { IASTName name = getName(); @@ -55,18 +55,22 @@ public class UPCASTTypedefNameSpecifier extends CASTTypedefNameSpecifier impleme return copy; } + @Override public IASTExpression getBlockSizeExpression() { return blockSizeExpression; } + @Override public int getReferenceType() { return referenceType; } + @Override public int getSharedQualifier() { return sharedQualifier; } + @Override public void setBlockSizeExpression(IASTExpression expr) { this.blockSizeExpression = expr; if(expr != null) { @@ -75,15 +79,17 @@ public class UPCASTTypedefNameSpecifier extends CASTTypedefNameSpecifier impleme } } + @Override public void setReferenceType(int referenceType) { this.referenceType = referenceType; } + @Override public void setSharedQualifier(int shared) { this.sharedQualifier = shared; } - + @Override public boolean accept( ASTVisitor action ){ if( action.shouldVisitDeclSpecifiers ){ @@ -95,7 +101,7 @@ public class UPCASTTypedefNameSpecifier extends CASTTypedefNameSpecifier impleme } if( getName() != null ) if( !getName().accept( action ) ) return false; if( blockSizeExpression != null) if( !blockSizeExpression.accept( action ) ) return false; - + if( action.shouldVisitDeclSpecifiers ){ switch( action.leave( this ) ){ case ASTVisitor.PROCESS_ABORT : return false; @@ -105,5 +111,5 @@ public class UPCASTTypedefNameSpecifier extends CASTTypedefNameSpecifier impleme } return true; } - + } diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTUnarySizeofExpression.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTUnarySizeofExpression.java index 2685d32a4d7..135b626112d 100644 --- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTUnarySizeofExpression.java +++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/ast/UPCASTUnarySizeofExpression.java @@ -19,8 +19,8 @@ import org.eclipse.cdt.internal.core.dom.parser.c.CASTUnaryExpression; public class UPCASTUnarySizeofExpression extends CASTUnaryExpression implements IUPCASTUnarySizeofExpression { private int upcSizeofOperator; - - + + public UPCASTUnarySizeofExpression() { this(null); } @@ -28,7 +28,7 @@ public class UPCASTUnarySizeofExpression extends CASTUnaryExpression implements public UPCASTUnarySizeofExpression(IASTExpression operand) { super(IASTUnaryExpression.op_sizeof, operand); } - + public UPCASTUnarySizeofExpression(int upcSizeofOperator, IASTExpression operand) { super(IASTUnaryExpression.op_sizeof, operand); this.upcSizeofOperator = upcSizeofOperator; @@ -38,7 +38,7 @@ public class UPCASTUnarySizeofExpression extends CASTUnaryExpression implements public UPCASTUnarySizeofExpression copy() { return copy(CopyStyle.withoutLocations); } - + @Override public UPCASTUnarySizeofExpression copy(CopyStyle style) { UPCASTUnarySizeofExpression copy = new UPCASTUnarySizeofExpression(); @@ -52,10 +52,12 @@ public class UPCASTUnarySizeofExpression extends CASTUnaryExpression implements return copy; } + @Override public int getUPCSizeofOperator() { return upcSizeofOperator; } + @Override public void setUPCSizeofOperator(int upcSizeofOperator) { this.upcSizeofOperator = upcSizeofOperator; } |