Line data Source code
1 : /* lexer header section */
2 :
3 :
4 : // Generated from acclexer.g4 by ANTLR 4.7.2
5 :
6 : #pragma once
7 :
8 : /* lexer precinclude section */
9 :
10 :
11 : #include "antlr4-runtime.h"
12 :
13 :
14 : /* lexer postinclude section */
15 : #ifndef _WIN32
16 : #pragma GCC diagnostic ignored "-Wunused-parameter"
17 : #endif
18 :
19 :
20 :
21 : /* lexer context section */
22 :
23 :
24 : class acclexer : public antlr4::Lexer {
25 : public:
26 : enum {
27 : EXPR = 1, C_PREFIX = 2, FORTRAN_PREFIX = 3, ACC = 4, ATOMIC = 5, CACHE = 6,
28 : DATA = 7, END = 8, DECLARE = 9, ENTER = 10, EXIT = 11, HOST_DATA = 12,
29 : INIT = 13, KERNELS = 14, LOOP = 15, PARALLEL = 16, ROUTINE = 17, SERIAL = 18,
30 : SET = 19, SHUTDOWN = 20, UPDATE = 21, LEFT_PAREN = 22, RIGHT_PAREN = 23,
31 : D_BLANK = 24, COLON = 25, LINE_END = 26, ASYNC = 27, ATTACH = 28, AUTO = 29,
32 : BIND = 30, CAPTURE = 31, COLLAPSE = 32, COPY = 33, COPYIN = 34, COPYOUT = 35,
33 : CREATE = 36, DEFAULT = 37, DEFAULT_ASYNC = 38, DELETE = 39, DETACH = 40,
34 : DEVICE = 41, DEVICE_NUM = 42, DEVICE_RESIDENT = 43, DEVICE_TYPE = 44,
35 : DEVICEPTR = 45, FINALIZE = 46, FIRSTPRIVATE = 47, GANG = 48, HOST = 49,
36 : IF = 50, IF_PRESENT = 51, INDEPENDENT = 52, LINK = 53, NOHOST = 54,
37 : NO_CREATE = 55, NUM = 56, NUM_GANGS = 57, NUM_WORKERS = 58, PRESENT = 59,
38 : PRIVATE = 60, READ = 61, REDUCTION = 62, SELF = 63, SEQ = 64, TILE = 65,
39 : USE_DEVICE = 66, VECTOR = 67, VECTOR_LENGTH = 68, WAIT = 69, WORKER = 70,
40 : WRITE = 71, COMMENT = 72, CACHE_LEFT_PAREN = 73, CACHE_READONLY = 74,
41 : CACHE_COLON = 75, CACHE_COMMA = 76, CACHE_BLANK = 77, CACHE_LINE_END = 78,
42 : ROUTINE_LEFT_PAREN = 79, ROUTINE_BLANK = 80, ROUTINE_LINE_END = 81,
43 : COPYIN_LEFT_PAREN = 82, READONLY = 83, COPYIN_COLON = 84, COPYIN_COMMA = 85,
44 : COPYIN_BLANK = 86, COPYIN_LINE_END = 87, COPYOUT_LEFT_PAREN = 88, ZERO = 89,
45 : COPYOUT_COLON = 90, COPYOUT_COMMA = 91, COPYOUT_BLANK = 92, COPYOUT_LINE_END = 93,
46 : CREATE_LEFT_PAREN = 94, CREATE_ZERO = 95, CREATE_COLON = 96, CREATE_COMMA = 97,
47 : CREATE_BLANK = 98, CREATE_LINE_END = 99, NONE = 100, BLANK = 101, EXPR_LINE_END = 102,
48 : VECTOR_LEFT_PAREN = 103, LENGTH = 104, VECTOR_COLON = 105, VECTOR_BLANK = 106,
49 : VECTOR_LINE_END = 107, REDUCTION_LEFT_PAREN = 108, ADD = 109, MUL = 110,
50 : MAX = 111, MIN = 112, BITAND = 113, BITOR = 114, BITXOR = 115, LOGAND = 116,
51 : LOGOR = 117, REDUCTION_COLON = 118, REDUCTION_COMMA = 119, REDUCTION_BLANK = 120,
52 : REDUCTION_LINE_END = 121, WAIT_LEFT_PAREN = 122, DEVNUM = 123, QUEUES = 124,
53 : WAIT_COLON = 125, WAIT_COMMA = 126, WAIT_BLANK = 127, WAIT_LINE_END = 128,
54 : WORKER_LEFT_PAREN = 129, WORKER_NUM = 130, WORKER_COLON = 131, WORKER_BLANK = 132,
55 : WORKER_LINE_END = 133, EXPR_LEFT_PAREN = 134, COMMA = 135, EXPRESSION_LEFT_PAREN = 136,
56 : EXPRESSION_RIGHT_PAREN = 137, EXPRESSION_CHAR = 138
57 : };
58 :
59 : enum {
60 : CommentsChannel = 2, DirectiveChannel = 3
61 : };
62 :
63 : enum {
64 : cache_directive = 1, routine_directive = 2, copyin_clause = 3, copyout_clause = 4,
65 : create_clause = 5, default_clause = 6, vector_clause = 7, reduction_clause = 8,
66 : wait_clause = 9, worker_clause = 10, expr_clause = 11, expression_mode = 12
67 : };
68 :
69 : acclexer(antlr4::CharStream *input);
70 : ~acclexer();
71 :
72 : /* public lexer declarations section */
73 : bool lookAhead(std::string word) {
74 : size_t i;
75 0 : for (i = 0; i < word.size(); i++) {
76 0 : if (_input->LA(i + 1) != (size_t)word[i]) {
77 : return false;
78 : }
79 : }
80 : return true;
81 : }
82 :
83 : virtual std::string getGrammarFileName() const override;
84 : virtual const std::vector<std::string>& getRuleNames() const override;
85 :
86 : virtual const std::vector<std::string>& getChannelNames() const override;
87 : virtual const std::vector<std::string>& getModeNames() const override;
88 : virtual const std::vector<std::string>& getTokenNames() const override; // deprecated, use vocabulary instead
89 : virtual antlr4::dfa::Vocabulary& getVocabulary() const override;
90 :
91 : virtual const std::vector<uint16_t> getSerializedATN() const override;
92 : virtual const antlr4::atn::ATN& getATN() const override;
93 :
94 : virtual void action(antlr4::RuleContext *context, size_t ruleIndex, size_t actionIndex) override;
95 : private:
96 : static std::vector<antlr4::dfa::DFA> _decisionToDFA;
97 : static antlr4::atn::PredictionContextCache _sharedContextCache;
98 : static std::vector<std::string> _ruleNames;
99 : static std::vector<std::string> _tokenNames;
100 : static std::vector<std::string> _channelNames;
101 : static std::vector<std::string> _modeNames;
102 :
103 : static std::vector<std::string> _literalNames;
104 : static std::vector<std::string> _symbolicNames;
105 : static antlr4::dfa::Vocabulary _vocabulary;
106 : static antlr4::atn::ATN _atn;
107 : static std::vector<uint16_t> _serializedATN;
108 :
109 : /* private lexer declarations/members section */
110 : int parenthesis_local_count, parenthesis_global_count, bracket_count;
111 : int colon_count;
112 : bool paren_processed = false;
113 :
114 :
115 : // Individual action functions triggered by action() above.
116 : void ROUTINEAction(antlr4::RuleContext *context, size_t actionIndex);
117 : void ASYNCAction(antlr4::RuleContext *context, size_t actionIndex);
118 : void BINDAction(antlr4::RuleContext *context, size_t actionIndex);
119 : void GANGAction(antlr4::RuleContext *context, size_t actionIndex);
120 : void SELFAction(antlr4::RuleContext *context, size_t actionIndex);
121 : void VECTORAction(antlr4::RuleContext *context, size_t actionIndex);
122 : void WAITAction(antlr4::RuleContext *context, size_t actionIndex);
123 : void WORKERAction(antlr4::RuleContext *context, size_t actionIndex);
124 : void CACHE_LEFT_PARENAction(antlr4::RuleContext *context, size_t actionIndex);
125 : void CACHE_READONLYAction(antlr4::RuleContext *context, size_t actionIndex);
126 : void CACHE_COLONAction(antlr4::RuleContext *context, size_t actionIndex);
127 : void CACHE_COMMAAction(antlr4::RuleContext *context, size_t actionIndex);
128 : void ROUTINE_LEFT_PARENAction(antlr4::RuleContext *context, size_t actionIndex);
129 : void COPYIN_LEFT_PARENAction(antlr4::RuleContext *context, size_t actionIndex);
130 : void READONLYAction(antlr4::RuleContext *context, size_t actionIndex);
131 : void COPYIN_COLONAction(antlr4::RuleContext *context, size_t actionIndex);
132 : void COPYIN_COMMAAction(antlr4::RuleContext *context, size_t actionIndex);
133 : void COPYOUT_LEFT_PARENAction(antlr4::RuleContext *context, size_t actionIndex);
134 : void ZEROAction(antlr4::RuleContext *context, size_t actionIndex);
135 : void COPYOUT_COLONAction(antlr4::RuleContext *context, size_t actionIndex);
136 : void COPYOUT_COMMAAction(antlr4::RuleContext *context, size_t actionIndex);
137 : void CREATE_LEFT_PARENAction(antlr4::RuleContext *context, size_t actionIndex);
138 : void CREATE_ZEROAction(antlr4::RuleContext *context, size_t actionIndex);
139 : void CREATE_COLONAction(antlr4::RuleContext *context, size_t actionIndex);
140 : void CREATE_COMMAAction(antlr4::RuleContext *context, size_t actionIndex);
141 : void VECTOR_LEFT_PARENAction(antlr4::RuleContext *context, size_t actionIndex);
142 : void LENGTHAction(antlr4::RuleContext *context, size_t actionIndex);
143 : void VECTOR_COLONAction(antlr4::RuleContext *context, size_t actionIndex);
144 : void REDUCTION_LEFT_PARENAction(antlr4::RuleContext *context, size_t actionIndex);
145 : void ADDAction(antlr4::RuleContext *context, size_t actionIndex);
146 : void MULAction(antlr4::RuleContext *context, size_t actionIndex);
147 : void MAXAction(antlr4::RuleContext *context, size_t actionIndex);
148 : void MINAction(antlr4::RuleContext *context, size_t actionIndex);
149 : void BITANDAction(antlr4::RuleContext *context, size_t actionIndex);
150 : void BITORAction(antlr4::RuleContext *context, size_t actionIndex);
151 : void BITXORAction(antlr4::RuleContext *context, size_t actionIndex);
152 : void LOGANDAction(antlr4::RuleContext *context, size_t actionIndex);
153 : void LOGORAction(antlr4::RuleContext *context, size_t actionIndex);
154 : void REDUCTION_COLONAction(antlr4::RuleContext *context, size_t actionIndex);
155 : void REDUCTION_COMMAAction(antlr4::RuleContext *context, size_t actionIndex);
156 : void WAIT_LEFT_PARENAction(antlr4::RuleContext *context, size_t actionIndex);
157 : void DEVNUMAction(antlr4::RuleContext *context, size_t actionIndex);
158 : void QUEUESAction(antlr4::RuleContext *context, size_t actionIndex);
159 : void WAIT_COLONAction(antlr4::RuleContext *context, size_t actionIndex);
160 : void WAIT_COMMAAction(antlr4::RuleContext *context, size_t actionIndex);
161 : void WORKER_LEFT_PARENAction(antlr4::RuleContext *context, size_t actionIndex);
162 : void WORKER_NUMAction(antlr4::RuleContext *context, size_t actionIndex);
163 : void WORKER_COLONAction(antlr4::RuleContext *context, size_t actionIndex);
164 : void EXPR_LEFT_PARENAction(antlr4::RuleContext *context, size_t actionIndex);
165 : void COMMAAction(antlr4::RuleContext *context, size_t actionIndex);
166 : void EXPRESSION_LEFT_PARENAction(antlr4::RuleContext *context, size_t actionIndex);
167 : void EXPRESSION_RIGHT_PARENAction(antlr4::RuleContext *context, size_t actionIndex);
168 : void EXPRESSION_CHARAction(antlr4::RuleContext *context, size_t actionIndex);
169 :
170 : // Individual semantic predicate functions triggered by sempred() above.
171 :
172 : struct Initializer {
173 : Initializer();
174 : };
175 : static Initializer _init;
176 : };
177 :
|