diff options
author | Mike Kucera | 2009-04-20 18:24:34 +0000 |
---|---|---|
committer | Mike Kucera | 2009-04-20 18:24:34 +0000 |
commit | 0a80b06634e712cbe7c7a5e3256e87db8b464594 (patch) | |
tree | 86faef3455a40a88a9843f4819cb14588f4aed92 /upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCParser.java | |
parent | 21e1364cb500e824afcec492012db84094d92db5 (diff) | |
download | org.eclipse.cdt-0a80b06634e712cbe7c7a5e3256e87db8b464594.tar.gz org.eclipse.cdt-0a80b06634e712cbe7c7a5e3256e87db8b464594.tar.xz org.eclipse.cdt-0a80b06634e712cbe7c7a5e3256e87db8b464594.zip |
[272950] [LR Parser] Add ability to pass properties to extending parsers and update (regenerate) the parsers to support this.
Diffstat (limited to 'upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCParser.java')
-rw-r--r-- | upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCParser.java | 270 |
1 files changed, 135 insertions, 135 deletions
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 2ea043384da..de99366e15b 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 @@ -181,17 +181,17 @@ private UPCParserAction action; private IASTCompletionNode compNode; -public UPCParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Set<IParser.Options> options) { - initActions(options); +public UPCParser(IScanner scanner, IDOMTokenMap tokenMap, IBuiltinBindingsProvider builtinBindingsProvider, IIndex index, Map<String,String> properties) { + initActions(properties); action.initializeTranslationUnit(scanner, builtinBindingsProvider, index); CPreprocessorAdapter.runCPreprocessor(scanner, this, tokenMap); } -private void initActions(Set<IParser.Options> options) { +private void initActions(Map<String,String> properties) { ScopedStack<Object> astStack = new ScopedStack<Object>(); action = new UPCParserAction (this, astStack, new UPCASTNodeFactory() , UPCSecondaryParserFactory.getDefault() ); - action.setParserOptions(options); + action.setParserProperties(properties); } @@ -325,7 +325,7 @@ public String getName() { } // - // Rule 28: postfix_expression ::= ( type_id ) { <openscope-ast> initializer_list comma_opt } + // Rule 28: postfix_expression ::= ( type_id ) initializer_list // case 28: { action. consumeExpressionTypeIdInitializer(); break; } @@ -1147,393 +1147,393 @@ public String getName() { } // - // Rule 282: initializer ::= start_initializer_list { <openscope-ast> initializer_list comma_opt } end_initializer_list + // Rule 283: initializer_list ::= start_initializer_list { <openscope-ast> initializer_seq comma_opt } end_initializer_list // - case 282: { action. consumeInitializerList(); break; + case 283: { action. consumeInitializerList(); break; } // - // Rule 283: initializer ::= { <openscope-ast> } + // Rule 284: initializer_list ::= { <openscope-ast> } // - case 283: { action. consumeInitializerList(); break; + case 284: { action. consumeInitializerList(); break; } // - // Rule 284: start_initializer_list ::= $Empty + // Rule 285: start_initializer_list ::= $Empty // - case 284: { action. initializerListStart(); break; + case 285: { action. initializerListStart(); break; } // - // Rule 285: end_initializer_list ::= $Empty + // Rule 286: end_initializer_list ::= $Empty // - case 285: { action. initializerListEnd(); break; + case 286: { action. initializerListEnd(); break; } // - // Rule 290: designated_initializer ::= <openscope-ast> designation = initializer + // Rule 291: designated_initializer ::= <openscope-ast> designation = initializer // - case 290: { action. consumeInitializerDesignated(); break; + case 291: { action. consumeInitializerDesignated(); break; } // - // Rule 294: designator_base ::= [ constant_expression ] + // Rule 295: designator_base ::= [ constant_expression ] // - case 294: { action. consumeDesignatorArray(); break; + case 295: { action. consumeDesignatorArray(); break; } // - // Rule 295: designator_base ::= . identifier_token + // Rule 296: designator_base ::= . identifier_token // - case 295: { action. consumeDesignatorField(); break; + case 296: { action. consumeDesignatorField(); break; } // - // Rule 296: designator ::= [ constant_expression ] + // Rule 297: designator ::= [ constant_expression ] // - case 296: { action. consumeDesignatorArray(); break; + case 297: { action. consumeDesignatorArray(); break; } // - // Rule 297: designator ::= . identifier_token + // Rule 298: designator ::= . identifier_token // - case 297: { action. consumeDesignatorField(); break; + case 298: { action. consumeDesignatorField(); break; } // - // Rule 298: translation_unit ::= external_declaration_list + // Rule 299: translation_unit ::= external_declaration_list // - case 298: { action. consumeTranslationUnit(); break; + case 299: { action. consumeTranslationUnit(); break; } // - // Rule 299: translation_unit ::= $Empty + // Rule 300: translation_unit ::= $Empty // - case 299: { action. consumeTranslationUnit(); break; + case 300: { action. consumeTranslationUnit(); break; } // - // Rule 304: external_declaration ::= ; + // Rule 305: external_declaration ::= ; // - case 304: { action. consumeDeclarationEmpty(); break; + case 305: { action. consumeDeclarationEmpty(); break; } // - // Rule 305: external_declaration ::= ERROR_TOKEN + // Rule 306: external_declaration ::= ERROR_TOKEN // - case 305: { action. consumeDeclarationProblem(); break; + case 306: { action. consumeDeclarationProblem(); break; } // - // Rule 308: function_definition ::= declaration_specifiers <openscope-ast> function_declarator function_body + // Rule 310: function_definition ::= <openscope-ast> function_declarator function_body // - case 308: { action. consumeFunctionDefinition(true); break; + case 310: { action. consumeFunctionDefinition(false); break; } // - // Rule 309: function_definition ::= <openscope-ast> function_declarator function_body + // Rule 311: function_definition ::= declaration_specifiers <openscope-ast> knr_function_declarator <openscope-ast> declaration_list compound_statement // - case 309: { action. consumeFunctionDefinition(false); break; + case 311: { action. consumeFunctionDefinitionKnR(); break; } // - // Rule 310: function_definition ::= declaration_specifiers <openscope-ast> knr_function_declarator <openscope-ast> declaration_list compound_statement + // Rule 312: normal_function_definition ::= declaration_specifiers <openscope-ast> function_declarator function_body // - case 310: { action. consumeFunctionDefinitionKnR(); break; + case 312: { action. consumeFunctionDefinition(true); break; } // - // Rule 311: function_body ::= { } + // Rule 313: function_body ::= { } // - case 311: { action. consumeStatementCompoundStatement(false); break; + case 313: { action. consumeStatementCompoundStatement(false); break; } // - // Rule 312: function_body ::= { <openscope-ast> block_item_list } + // Rule 314: function_body ::= { <openscope-ast> block_item_list } // - case 312: { action. consumeStatementCompoundStatement(true); break; + case 314: { action. consumeStatementCompoundStatement(true); break; } // - // Rule 313: literal ::= MYTHREAD + // Rule 315: literal ::= MYTHREAD // - case 313: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_mythread); break; + case 315: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_mythread); break; } // - // Rule 314: literal ::= THREADS + // Rule 316: literal ::= THREADS // - case 314: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_threads); break; + case 316: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_threads); break; } // - // Rule 315: literal ::= UPC_MAX_BLOCKSIZE + // Rule 317: literal ::= UPC_MAX_BLOCKSIZE // - case 315: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_upc_max_block_size); break; + case 317: { action. consumeKeywordExpression(IUPCASTKeywordExpression.kw_upc_max_block_size); break; } // - // Rule 316: unary_expression ::= upc_localsizeof unary_expression + // Rule 318: unary_expression ::= upc_localsizeof unary_expression // - case 316: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_localsizeof); break; + case 318: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_localsizeof); break; } // - // Rule 317: unary_expression ::= upc_localsizeof ( type_id ) + // Rule 319: unary_expression ::= upc_localsizeof ( type_id ) // - case 317: { action. consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_localsizeof); break; + case 319: { action. consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_localsizeof); break; } // - // Rule 318: unary_expression ::= upc_blocksizeof unary_expression + // Rule 320: unary_expression ::= upc_blocksizeof unary_expression // - case 318: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_blocksizeof); break; + case 320: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_blocksizeof); break; } // - // Rule 319: unary_expression ::= upc_blocksizeof ( type_id ) + // Rule 321: unary_expression ::= upc_blocksizeof ( type_id ) // - case 319: { action. consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_blocksizeof); break; + case 321: { action. consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_blocksizeof); break; } // - // Rule 320: unary_expression ::= upc_elemsizeof unary_expression + // Rule 322: unary_expression ::= upc_elemsizeof unary_expression // - case 320: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_elemsizeof); break; + case 322: { action. consumeExpressionUnarySizeofOperator(IUPCASTUnarySizeofExpression.upc_elemsizeof); break; } // - // Rule 321: unary_expression ::= upc_elemsizeof ( type_id ) + // Rule 323: unary_expression ::= upc_elemsizeof ( type_id ) // - case 321: { action. consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_elemsizeof); break; + case 323: { action. consumeExpressionSizeofTypeId(IUPCASTUnarySizeofExpression.upc_elemsizeof); break; } // - // Rule 325: shared_type_qualifier ::= shared + // Rule 327: shared_type_qualifier ::= shared // - case 325: { action. consumeToken(); break; + case 327: { action. consumeToken(); break; } // - // Rule 326: reference_type_qualifier ::= relaxed + // Rule 328: reference_type_qualifier ::= relaxed // - case 326: { action. consumeToken(); break; + case 328: { action. consumeToken(); break; } // - // Rule 327: reference_type_qualifier ::= strict + // Rule 329: reference_type_qualifier ::= strict // - case 327: { action. consumeToken(); break; + case 329: { action. consumeToken(); break; } // - // Rule 328: layout_qualifier ::= [ constant_expression ] + // Rule 330: layout_qualifier ::= [ constant_expression ] // - case 328: { action. consumeLayoutQualifier(true, false); break; + case 330: { action. consumeLayoutQualifier(true, false); break; } // - // Rule 329: layout_qualifier ::= [ * ] + // Rule 331: layout_qualifier ::= [ * ] // - case 329: { action. consumeLayoutQualifier(false, true); break; + case 331: { action. consumeLayoutQualifier(false, true); break; } // - // Rule 330: layout_qualifier ::= [ ] + // Rule 332: layout_qualifier ::= [ ] // - case 330: { action. consumeLayoutQualifier(false, false); break; + case 332: { action. consumeLayoutQualifier(false, false); break; } // - // Rule 332: synchronization_statement ::= upc_notify expression ; + // Rule 334: synchronization_statement ::= upc_notify expression ; // - case 332: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_notify, true); break; + case 334: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_notify, true); break; } // - // Rule 333: synchronization_statement ::= upc_notify ; + // Rule 335: synchronization_statement ::= upc_notify ; // - case 333: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_notify, false); break; + case 335: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_notify, false); break; } // - // Rule 334: synchronization_statement ::= upc_wait expression ; + // Rule 336: synchronization_statement ::= upc_wait expression ; // - case 334: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_wait, true); break; + case 336: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_wait, true); break; } // - // Rule 335: synchronization_statement ::= upc_wait ; + // Rule 337: synchronization_statement ::= upc_wait ; // - case 335: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_wait, false); break; + case 337: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_wait, false); break; } // - // Rule 336: synchronization_statement ::= upc_barrier expression ; + // Rule 338: synchronization_statement ::= upc_barrier expression ; // - case 336: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_barrier, true); break; + case 338: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_barrier, true); break; } // - // Rule 337: synchronization_statement ::= upc_barrier ; + // Rule 339: synchronization_statement ::= upc_barrier ; // - case 337: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_barrier, false); break; + case 339: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_barrier, false); break; } // - // Rule 338: synchronization_statement ::= upc_fence ; + // Rule 340: synchronization_statement ::= upc_fence ; // - case 338: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_fence, false); break; + case 340: { action. consumeStatementSynchronizationStatement(IUPCASTSynchronizationStatement.st_upc_fence, false); break; } // - // Rule 339: iteration_statement ::= upc_forall ( expression ; expression ; expression ; affinity ) statement + // Rule 341: iteration_statement ::= upc_forall ( expression ; expression ; expression ; affinity ) statement // - case 339: { action. consumeStatementUPCForallLoop(true, true, true, true); break; + case 341: { action. consumeStatementUPCForallLoop(true, true, true, true); break; } // - // Rule 340: iteration_statement ::= upc_forall ( expression ; expression ; expression ; ) statement + // Rule 342: iteration_statement ::= upc_forall ( expression ; expression ; expression ; ) statement // - case 340: { action. consumeStatementUPCForallLoop(true, true, true, false); break; + case 342: { action. consumeStatementUPCForallLoop(true, true, true, false); break; } // - // Rule 341: iteration_statement ::= upc_forall ( expression ; expression ; ; affinity ) statement + // Rule 343: iteration_statement ::= upc_forall ( expression ; expression ; ; affinity ) statement // - case 341: { action. consumeStatementUPCForallLoop(true, true, false, true); break; + case 343: { action. consumeStatementUPCForallLoop(true, true, false, true); break; } // - // Rule 342: iteration_statement ::= upc_forall ( expression ; expression ; ; ) statement + // Rule 344: iteration_statement ::= upc_forall ( expression ; expression ; ; ) statement // - case 342: { action. consumeStatementUPCForallLoop(true, true, false, false); break; + case 344: { action. consumeStatementUPCForallLoop(true, true, false, false); break; } // - // Rule 343: iteration_statement ::= upc_forall ( expression ; ; expression ; affinity ) statement + // Rule 345: iteration_statement ::= upc_forall ( expression ; ; expression ; affinity ) statement // - case 343: { action. consumeStatementUPCForallLoop(true, false, true, true); break; + case 345: { action. consumeStatementUPCForallLoop(true, false, true, true); break; } // - // Rule 344: iteration_statement ::= upc_forall ( expression ; ; expression ; ) statement + // Rule 346: iteration_statement ::= upc_forall ( expression ; ; expression ; ) statement // - case 344: { action. consumeStatementUPCForallLoop(true, false, true, false); break; + case 346: { action. consumeStatementUPCForallLoop(true, false, true, false); break; } // - // Rule 345: iteration_statement ::= upc_forall ( expression ; ; ; affinity ) statement + // Rule 347: iteration_statement ::= upc_forall ( expression ; ; ; affinity ) statement // - case 345: { action. consumeStatementUPCForallLoop(true, false, false, true); break; + case 347: { action. consumeStatementUPCForallLoop(true, false, false, true); break; } // - // Rule 346: iteration_statement ::= upc_forall ( expression ; ; ; ) statement + // Rule 348: iteration_statement ::= upc_forall ( expression ; ; ; ) statement // - case 346: { action. consumeStatementUPCForallLoop(true, false, false, false); break; + case 348: { action. consumeStatementUPCForallLoop(true, false, false, false); break; } // - // Rule 347: iteration_statement ::= upc_forall ( ; expression ; expression ; affinity ) statement + // Rule 349: iteration_statement ::= upc_forall ( ; expression ; expression ; affinity ) statement // - case 347: { action. consumeStatementUPCForallLoop(false, true, true, true); break; + case 349: { action. consumeStatementUPCForallLoop(false, true, true, true); break; } // - // Rule 348: iteration_statement ::= upc_forall ( ; expression ; expression ; ) statement + // Rule 350: iteration_statement ::= upc_forall ( ; expression ; expression ; ) statement // - case 348: { action. consumeStatementUPCForallLoop(false, true, true, false); break; + case 350: { action. consumeStatementUPCForallLoop(false, true, true, false); break; } // - // Rule 349: iteration_statement ::= upc_forall ( ; expression ; ; affinity ) statement + // Rule 351: iteration_statement ::= upc_forall ( ; expression ; ; affinity ) statement // - case 349: { action. consumeStatementUPCForallLoop(false, true, false, true); break; + case 351: { action. consumeStatementUPCForallLoop(false, true, false, true); break; } // - // Rule 350: iteration_statement ::= upc_forall ( ; expression ; ; ) statement + // Rule 352: iteration_statement ::= upc_forall ( ; expression ; ; ) statement // - case 350: { action. consumeStatementUPCForallLoop(false, true, false, false); break; + case 352: { action. consumeStatementUPCForallLoop(false, true, false, false); break; } // - // Rule 351: iteration_statement ::= upc_forall ( ; ; expression ; affinity ) statement + // Rule 353: iteration_statement ::= upc_forall ( ; ; expression ; affinity ) statement // - case 351: { action. consumeStatementUPCForallLoop(false, false, true, true); break; + case 353: { action. consumeStatementUPCForallLoop(false, false, true, true); break; } // - // Rule 352: iteration_statement ::= upc_forall ( ; ; expression ; ) statement + // Rule 354: iteration_statement ::= upc_forall ( ; ; expression ; ) statement // - case 352: { action. consumeStatementUPCForallLoop(false, false, true, false); break; + case 354: { action. consumeStatementUPCForallLoop(false, false, true, false); break; } // - // Rule 353: iteration_statement ::= upc_forall ( ; ; ; affinity ) statement + // Rule 355: iteration_statement ::= upc_forall ( ; ; ; affinity ) statement // - case 353: { action. consumeStatementUPCForallLoop(false, false, false, true); break; + case 355: { action. consumeStatementUPCForallLoop(false, false, false, true); break; } // - // Rule 354: iteration_statement ::= upc_forall ( ; ; ; ) statement + // Rule 356: iteration_statement ::= upc_forall ( ; ; ; ) statement // - case 354: { action. consumeStatementUPCForallLoop(false, false, false, false); break; + case 356: { action. consumeStatementUPCForallLoop(false, false, false, false); break; } // - // Rule 355: iteration_statement ::= upc_forall ( declaration expression ; expression ; affinity ) statement + // Rule 357: iteration_statement ::= upc_forall ( declaration expression ; expression ; affinity ) statement // - case 355: { action. consumeStatementUPCForallLoop(true, true, true, true); break; + case 357: { action. consumeStatementUPCForallLoop(true, true, true, true); break; } // - // Rule 356: iteration_statement ::= upc_forall ( declaration expression ; expression ; ) statement + // Rule 358: iteration_statement ::= upc_forall ( declaration expression ; expression ; ) statement // - case 356: { action. consumeStatementUPCForallLoop(true, true, true, false); break; + case 358: { action. consumeStatementUPCForallLoop(true, true, true, false); break; } // - // Rule 357: iteration_statement ::= upc_forall ( declaration expression ; ; affinity ) statement + // Rule 359: iteration_statement ::= upc_forall ( declaration expression ; ; affinity ) statement // - case 357: { action. consumeStatementUPCForallLoop(true, true, false, true); break; + case 359: { action. consumeStatementUPCForallLoop(true, true, false, true); break; } // - // Rule 358: iteration_statement ::= upc_forall ( declaration expression ; ; ) statement + // Rule 360: iteration_statement ::= upc_forall ( declaration expression ; ; ) statement // - case 358: { action. consumeStatementUPCForallLoop(true, true, false, false); break; + case 360: { action. consumeStatementUPCForallLoop(true, true, false, false); break; } // - // Rule 359: iteration_statement ::= upc_forall ( declaration ; expression ; affinity ) statement + // Rule 361: iteration_statement ::= upc_forall ( declaration ; expression ; affinity ) statement // - case 359: { action. consumeStatementUPCForallLoop(true, false, true, true); break; + case 361: { action. consumeStatementUPCForallLoop(true, false, true, true); break; } // - // Rule 360: iteration_statement ::= upc_forall ( declaration ; expression ; ) statement + // Rule 362: iteration_statement ::= upc_forall ( declaration ; expression ; ) statement // - case 360: { action. consumeStatementUPCForallLoop(true, false, true, false); break; + case 362: { action. consumeStatementUPCForallLoop(true, false, true, false); break; } // - // Rule 361: iteration_statement ::= upc_forall ( declaration ; ; affinity ) statement + // Rule 363: iteration_statement ::= upc_forall ( declaration ; ; affinity ) statement // - case 361: { action. consumeStatementUPCForallLoop(true, false, false, true); break; + case 363: { action. consumeStatementUPCForallLoop(true, false, false, true); break; } // - // Rule 362: iteration_statement ::= upc_forall ( declaration ; ; ) statement + // Rule 364: iteration_statement ::= upc_forall ( declaration ; ; ) statement // - case 362: { action. consumeStatementUPCForallLoop(true, false, false, false); break; + case 364: { action. consumeStatementUPCForallLoop(true, false, false, false); break; } // - // Rule 364: affinity ::= continue + // Rule 366: affinity ::= continue // - case 364: { action. consumeToken(); break; + case 366: { action. consumeToken(); break; } |