source: CIVL/mods/dev.civl.abc/grammar/c/OmpParserNotes.txt

main
Last change on this file was aad342c, checked in by Stephen Siegel <siegel@…>, 3 years ago

Performing huge refactor to incorporate ABC, GMC, and SARL into CIVL repo and use Java modules.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5664 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 1.1 KB
Line 
1
2grammar/OmpLexer.g: defines OpenMP keywords
3grammar/OmpParser.g: defines OpenMP grammar rules, uses OmpLexer,
4 imports CivlCParser to reuse the rule for expressions
5antlr2ast.common.OMPPragmaHandler: translating an OpenMP pragma
6 into OpenMP AST nodes. Note: the source is first parsed by the
7 general parser (CivlCParser), and then at the AST builder phase,
8 the OMPPragmaHandler is triggered to translate the OpenMP pragma.
9 The input is a general pragma node produced by applying the general parser
10 (CivlCParser) to the pragma source.
11
12- add a new keyword, for example, "barrier"
13 (1) add a token for the keyword in OmpLexer.g: BARRIER: 'barrier';
14 (2) add a case for the keyword in OMPPragmaHandler.markTokens():
15 case "barrier":
16 token.setType(BARRIER);
17 break;
18 Since the OpenMP parser uses extra tokens provided by OmpLexer,
19 it needs to mark those tokens explicitly, which are all
20 considered as "IDENTIFIER" by CivlCParser.
21
22- add a new BNF rule
23 (1) add the rule in OmpParser.g
24 (2) add a method for translating the rule in OMPPragmaHandler
25
Note: See TracBrowser for help on using the repository browser.