PandA-2024.02
token_interface.cpp
Go to the documentation of this file.
1 /*
2  *
3  * _/_/_/ _/_/ _/ _/ _/_/_/ _/_/
4  * _/ _/ _/ _/ _/_/ _/ _/ _/ _/ _/
5  * _/_/_/ _/_/_/_/ _/ _/_/ _/ _/ _/_/_/_/
6  * _/ _/ _/ _/ _/ _/ _/ _/ _/
7  * _/ _/ _/ _/ _/ _/_/_/ _/ _/
8  *
9  * ***********************************************
10  * PandA Project
11  * URL: http://panda.dei.polimi.it
12  * Politecnico di Milano - DEIB
13  * System Architectures Group
14  * ***********************************************
15  * Copyright (C) 2004-2024 Politecnico di Milano
16  *
17  * This file is part of the PandA framework.
18  *
19  * The PandA framework is free software; you can redistribute it and/or modify
20  * it under the terms of the GNU General Public License as published by
21  * the Free Software Foundation; either version 3 of the License, or
22  * (at your option) any later version.
23  *
24  * This program is distributed in the hope that it will be useful,
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27  * GNU General Public License for more details.
28  *
29  * You should have received a copy of the GNU General Public License
30  * along with this program. If not, see <http://www.gnu.org/licenses/>.
31  *
32  */
43 #include "token_interface.hpp"
45 
47 #include "config_HAVE_BISON_2_7_OR_GREATER.hpp"
48 #include <cstring>
49 #include <fstream>
50 #include <iosfwd>
51 
53 #include "refcount.hpp"
54 
57 REF_FORWARD_DECL(BisonParserData);
59 
61 #if HAVE_BISON_2_7_OR_GREATER
62 #include "treeParser.hpp"
63 #else
64 #include "treeParser.h"
65 #endif
66 
68 #include "exceptions.hpp"
69 
70 #define NO_TOKEN (-1)
71 
73  TOK_BISON_COMPILER_VERSION, TOK_BISON_PLUGIN_VERSION, TOK_BISON_IDENTIFIER_NODE, TOK_BISON_TREE_LIST,
74  TOK_BISON_TREE_VEC, TOK_BISON_BLOCK, TOK_BISON_VOID_TYPE, TOK_BISON_INTEGER_TYPE, TOK_BISON_REAL_TYPE,
75  TOK_BISON_COMPLEX_TYPE, TOK_BISON_TYPE_ARGUMENT_PACK, TOK_BISON_NONTYPE_ARGUMENT_PACK,
76  TOK_BISON_EXPR_PACK_EXPANSION, TOK_BISON_VECTOR_TYPE, TOK_BISON_ENUMERAL_TYPE, TOK_BISON_BOOLEAN_TYPE,
77  TOK_BISON_CHAR_TYPE, TOK_BISON_NULLPTR_TYPE, TOK_BISON_ERROR_MARK, TOK_BISON_TYPE_PACK_EXPANSION,
78  TOK_BISON_POINTER_TYPE, TOK_BISON_OFFSET_TYPE, TOK_BISON_REFERENCE_TYPE, TOK_BISON_METHOD_TYPE,
79  TOK_BISON_ARRAY_TYPE, TOK_BISON_SET_TYPE, TOK_BISON_RECORD_TYPE, TOK_BISON_UNION_TYPE, TOK_BISON_QUAL_UNION_TYPE,
80  TOK_BISON_FUNCTION_TYPE, TOK_BISON_LANG_TYPE, TOK_BISON_INTEGER_CST, TOK_BISON_REAL_CST, TOK_BISON_COMPLEX_CST,
81  TOK_BISON_VECTOR_CST, TOK_BISON_VOID_CST, TOK_BISON_STRING_CST, TOK_BISON_FUNCTION_DECL, TOK_BISON_LABEL_DECL,
82  TOK_BISON_CONST_DECL, TOK_BISON_TYPE_DECL, TOK_BISON_USING_DECL, TOK_BISON_VAR_DECL, TOK_BISON_PARM_DECL,
83  TOK_BISON_PARAM_PACKS, TOK_BISON_RESULT_DECL, TOK_BISON_FIELD_DECL, TOK_BISON_NAMESPACE_DECL,
84  TOK_BISON_TRANSLATION_UNIT_DECL, TOK_BISON_COMPONENT_REF, TOK_BISON_BIT_FIELD_REF, TOK_BISON_INDIRECT_REF,
85  TOK_BISON_MISALIGNED_INDIRECT_REF, TOK_BISON_BUFFER_REF, TOK_BISON_ARRAY_REF, TOK_BISON_ARRAY_RANGE_REF,
86  TOK_BISON_VTABLE_REF, TOK_BISON_CONSTRUCTOR, TOK_BISON_DESTRUCTOR, TOK_BISON_COMPOUND_EXPR, TOK_BISON_MODIFY_EXPR,
87  TOK_BISON_GIMPLE_ASSIGN, TOK_BISON_INIT_EXPR, TOK_BISON_TARGET_EXPR, TOK_BISON_COND_EXPR, TOK_BISON_GIMPLE_COND,
88  NO_TOKEN, NO_TOKEN, TOK_BISON_GIMPLE_BIND, TOK_BISON_GIMPLE_CALL, TOK_BISON_CALL_EXPR, TOK_BISON_AGGR_INIT_EXPR,
89  TOK_BISON_GIMPLE_NOP, TOK_BISON_WITH_CLEANUP_EXPR, TOK_BISON_CLEANUP_POINT_EXPR, TOK_BISON_PLACEHOLDER_EXPR,
90  TOK_BISON_REDUC_MAX_EXPR, TOK_BISON_REDUC_MIN_EXPR, TOK_BISON_REDUC_PLUS_EXPR, TOK_BISON_PLUS_EXPR,
91  TOK_BISON_TERNARY_PLUS_EXPR, TOK_BISON_TERNARY_PM_EXPR, TOK_BISON_TERNARY_MP_EXPR, TOK_BISON_TERNARY_MM_EXPR,
92  TOK_BISON_BIT_IOR_CONCAT_EXPR, TOK_BISON_MINUS_EXPR, TOK_BISON_MULT_EXPR, TOK_BISON_TRUNC_DIV_EXPR,
93  TOK_BISON_CEIL_DIV_EXPR, TOK_BISON_FLOOR_DIV_EXPR, TOK_BISON_ROUND_DIV_EXPR, TOK_BISON_TRUNC_MOD_EXPR,
94  TOK_BISON_CEIL_MOD_EXPR, TOK_BISON_FLOOR_MOD_EXPR, TOK_BISON_ROUND_MOD_EXPR, TOK_BISON_RDIV_EXPR,
95  TOK_BISON_EXACT_DIV_EXPR, TOK_BISON_FIX_TRUNC_EXPR, TOK_BISON_FIX_CEIL_EXPR, TOK_BISON_FIX_FLOOR_EXPR,
96  TOK_BISON_FIX_ROUND_EXPR, TOK_BISON_FLOAT_EXPR, TOK_BISON_LUT_EXPR, TOK_BISON_NEGATE_EXPR, TOK_BISON_MIN_EXPR,
97  TOK_BISON_MAX_EXPR, TOK_BISON_ABS_EXPR, TOK_BISON_LSHIFT_EXPR, TOK_BISON_RSHIFT_EXPR, TOK_BISON_LROTATE_EXPR,
98  TOK_BISON_RROTATE_EXPR, TOK_BISON_BIT_IOR_EXPR, TOK_BISON_BIT_XOR_EXPR, TOK_BISON_BIT_AND_EXPR,
99  TOK_BISON_BIT_NOT_EXPR, TOK_BISON_TRUTH_ANDIF_EXPR, TOK_BISON_TRUTH_ORIF_EXPR, TOK_BISON_TRUTH_AND_EXPR,
100  TOK_BISON_TRUTH_OR_EXPR, TOK_BISON_TRUTH_XOR_EXPR, TOK_BISON_TRUTH_NOT_EXPR, TOK_BISON_LT_EXPR, TOK_BISON_LE_EXPR,
101  TOK_BISON_GT_EXPR, TOK_BISON_GE_EXPR, TOK_BISON_EQ_EXPR, TOK_BISON_NE_EXPR, TOK_BISON_UNORDERED_EXPR,
102  TOK_BISON_ORDERED_EXPR, TOK_BISON_UNLT_EXPR, TOK_BISON_UNLE_EXPR, TOK_BISON_UNGT_EXPR, TOK_BISON_UNGE_EXPR,
103  TOK_BISON_UNEQ_EXPR, TOK_BISON_LTGT_EXPR, TOK_BISON_IN_EXPR, TOK_BISON_SET_LE_EXPR, TOK_BISON_CARD_EXPR,
104  TOK_BISON_RANGE_EXPR, TOK_BISON_PAREN_EXPR, TOK_BISON_CONVERT_EXPR, TOK_BISON_NOP_EXPR, TOK_BISON_NON_LVALUE_EXPR,
105  TOK_BISON_VIEW_CONVERT_EXPR, TOK_BISON_SAVE_EXPR, TOK_BISON_UNSAVE_EXPR, TOK_BISON_ADDR_EXPR,
106  TOK_BISON_REFERENCE_EXPR, TOK_BISON_FDESC_EXPR, TOK_BISON_COMPLEX_EXPR, TOK_BISON_CONJ_EXPR,
107  TOK_BISON_REALPART_EXPR, TOK_BISON_IMAGPART_EXPR, TOK_BISON_PREDECREMENT_EXPR, TOK_BISON_PREINCREMENT_EXPR,
108  TOK_BISON_POSTDECREMENT_EXPR, TOK_BISON_POSTINCREMENT_EXPR, TOK_BISON_VA_ARG_EXPR, TOK_BISON_TRY_CATCH_EXPR,
109  TOK_BISON_TRY_FINALLY, TOK_BISON_, TOK_BISON_GIMPLE_GOTO, TOK_BISON_GOTO_SUBROUTINE, TOK_BISON_GIMPLE_RETURN,
110  TOK_BISON_EXIT_EXPR, TOK_BISON_LOOP_EXPR, TOK_BISON_GIMPLE_SWITCH, TOK_BISON_GIMPLE_MULTI_WAY_IF,
111  TOK_BISON_CASE_LABEL_EXPR, TOK_BISON_GIMPLE_RESX, TOK_BISON_GIMPLE_ASM, TOK_BISON_SSA_NAME, TOK_BISON_ADDR_STMT,
112  TOK_BISON_DEF_STMT, TOK_BISON_USE_STMT, TOK_BISON_GIMPLE_PHI, TOK_BISON_CATCH_EXPR, TOK_BISON_EH_FILTER_EXPR,
113  TOK_BISON_STATEMENT_LIST, TOK_BISON_TEMPLATE_DECL, TOK_BISON_TEMPLATE_TYPE_PARM, TOK_BISON_CAST_EXPR,
114  TOK_BISON_STATIC_CAST_EXPR, TOK_BISON_TYPENAME_TYPE, TOK_BISON_SIZEOF_EXPR, TOK_BISON_SCOPE_REF,
115  TOK_BISON_CTOR_INITIALIZER, TOK_BISON_DO_STMT, TOK_BISON_EXPR_STMT, TOK_BISON_FOR_STMT, TOK_BISON_IF_STMT,
116  TOK_BISON_RETURN_STMT, TOK_BISON_WHILE_STMT, TOK_BISON_MODOP_EXPR, TOK_BISON_NEW_EXPR, TOK_BISON_VEC_COND_EXPR,
117  TOK_BISON_VEC_PERM_EXPR, TOK_BISON_DOT_PROD_EXPR, TOK_BISON_VEC_LSHIFT_EXPR, TOK_BISON_VEC_RSHIFT_EXPR,
118  TOK_BISON_WIDEN_MULT_HI_EXPR, TOK_BISON_WIDEN_MULT_LO_EXPR, TOK_BISON_VEC_UNPACK_HI_EXPR,
119  TOK_BISON_VEC_UNPACK_LO_EXPR, TOK_BISON_VEC_UNPACK_FLOAT_HI_EXPR, TOK_BISON_VEC_UNPACK_FLOAT_LO_EXPR,
120  TOK_BISON_VEC_PACK_TRUNC_EXPR, TOK_BISON_VEC_PACK_SAT_EXPR, TOK_BISON_VEC_PACK_FIX_TRUNC_EXPR,
121  TOK_BISON_VEC_EXTRACTEVEN_EXPR, TOK_BISON_VEC_EXTRACTODD_EXPR, TOC_BISON_VEC_INTERLEAVEHIGH_EXPR,
122  TOC_BISON_VEC_INTERLEAVELOW_EXPR, TOK_BISON_VEC_NEW_EXPR, TOK_BISON_OVERLOAD, TOK_BISON_REINTERPRET_CAST_EXPR,
123  TOK_BISON_TEMPLATE_ID_EXPR, TOK_BISON_THROW_EXPR, TOK_BISON_TRY_BLOCK, TOK_BISON_ALIGNOF_EXPR, TOK_BISON_ARROW_EXPR,
124  TOK_BISON_HANDLER, TOK_BISON_BASELINK,
125 
126  TOK_BISON_NAME, TOK_BISON_TYPE, TOK_BISON_SRCP, TOK_BISON_ARG, TOK_BISON_BODY, TOK_BISON_STRG, TOK_BISON_LNGT,
127  TOK_BISON_SIZE, TOK_BISON_ALGN, TOK_BISON_RETN, TOK_BISON_PRMS, TOK_BISON_SCPE, TOK_BISON_BB_INDEX, TOK_BISON_USED,
128  TOK_BISON_VALUE, TOK_BISON_ARGT, TOK_BISON_PREC, TOK_BISON_MIN, TOK_BISON_MAX, TOK_BISON_BIT_VALUES, TOK_BISON_VALU,
129  TOK_BISON_CHAN, TOK_BISON_STMT, TOK_BISON_OP, NO_TOKEN, NO_TOKEN, NO_TOKEN, NO_TOKEN, NO_TOKEN, NO_TOKEN, NO_TOKEN,
130  NO_TOKEN, NO_TOKEN, TOK_BISON_VARS, TOK_BISON_UNQL, TOK_BISON_ELTS, TOK_BISON_DOMN, TOK_BISON_BLOC, TOK_BISON_DCLS,
131  TOK_BISON_MNGL, TOK_BISON_PTD, TOK_BISON_REFD, TOK_BISON_QUAL, TOK_BISON_VALR, TOK_BISON_VALX, TOK_BISON_FLDS,
132  TOK_BISON_VFLD, TOK_BISON_BPOS, TOK_BISON_FN, TOK_BISON_GOTO, TOK_BISON_REAL, TOK_BISON_IMAG, TOK_BISON_BASES,
133  TOK_BISON_BINFO, TOK_BISON_PUB, TOK_BISON_PROT, TOK_BISON_PRIV, TOK_BISON_BINF, TOK_BISON_UID, TOK_BISON_OLD_UID,
134  TOK_BISON_INIT, TOK_BISON_FINI, TOK_BISON_PURP, TOK_BISON_PRED, TOK_BISON_SUCC, TOK_BISON_PHI, TOK_BISON_RES,
135  TOK_BISON_DEF, TOK_BISON_EDGE, TOK_BISON_VAR, TOK_BISON_VERS, TOK_BISON_ORIG_VERS, TOK_BISON_CNST, TOK_BISON_CLAS,
136  TOK_BISON_DECL, TOK_BISON_CLNP, TOK_BISON_LAB, TOK_BISON_TRY, TOK_BISON_EX, TOK_BISON_OUT, TOK_BISON_IN,
137  TOK_BISON_STR, TOK_BISON_CLOB, TOK_BISON_CLOBBER, TOK_BISON_REF, TOK_BISON_FNCS, TOK_BISON_CSTS, TOK_BISON_RSLT,
138  TOK_BISON_INST, TOK_BISON_SPCS, TOK_BISON_CLS, TOK_BISON_BFLD, TOK_BISON_CTOR, TOK_BISON_NEXT, TOK_BISON_COND,
139  TOK_BISON_EXPR, TOK_BISON_THEN, TOK_BISON_ELSE, TOK_BISON_CRNT, TOK_BISON_HDLR, TOK_BISON_ARTIFICIAL,
140  TOK_BISON_SYSTEM, TOK_BISON_OPERATING_SYSTEM, TOK_BISON_LIBRARY_SYSTEM, TOK_BISON_LIBBAMBU, TOK_BISON_EXTERN,
141  TOK_BISON_ADDR_TAKEN, TOK_BISON_ADDR_NOT_TAKEN, TOK_BISON_C, TOK_BISON_LSHIFT, TOK_BISON_GLOBAL_INIT,
142  TOK_BISON_GLOBAL_FINI, TOK_BISON_UNDEFINED, TOK_BISON_BUILTIN, TOK_BISON_HWCALL, TOK_BISON_OPERATOR,
143  TOK_BISON_OVERFLOW, TOK_BISON_VIRT, TOK_BISON_UNSIGNED, TOK_BISON_STRUCT, TOK_BISON_UNION, TOK_BISON_CONSTANT,
144  TOK_BISON_READONLY, TOK_BISON_REGISTER, TOK_BISON_STATIC, NO_TOKEN, TOK_BISON_REVERSE_RESTRICT,
145  TOK_BISON_WRITING_MEMORY, TOK_BISON_READING_MEMORY, TOK_BISON_PIPELINE_ENABLED, TOK_BISON_SIMPLE_PIPELINE,
146  TOK_BISON_INITIATION_TIME, TOK_BISON_OMP_ATOMIC, TOK_BISON_OMP_BODY_LOOP, TOK_BISON_OMP_CRITICAL_SESSION,
147  TOK_BISON_OMP_FOR_WRAPPER, TOK_BISON_DEFAULT, TOK_BISON_VOLATILE, TOK_BISON_VARARGS, TOK_BISON_INF, TOK_BISON_NAN,
148  TOK_BISON_ENTRY, TOK_BISON_EXIT, TOK_BISON_NEW, TOK_BISON_DELETE, TOK_BISON_ASSIGN, TOK_BISON_MEMBER,
149  TOK_BISON_PUBLIC, TOK_BISON_PRIVATE, TOK_BISON_PROTECTED, TOK_BISON_NORETURN, TOK_BISON_NOINLINE,
150  TOK_BISON_ALWAYS_INLINE, TOK_BISON_UNUSED, TOK_BISON_CONST, TOK_BISON_TRANSPARENT_UNION, TOK_BISON_MODE,
151  TOK_BISON_SECTION, TOK_BISON_ALIGNED, TOK_BISON_PACKED, TOK_BISON_WEAK, TOK_BISON_ALIAS,
152  TOK_BISON_NO_INSTRUMENT_FUNCTION, TOK_BISON_MALLOC, TOK_BISON_NO_STACK_LIMIT, TOK_BISON_NO_STACK, TOK_BISON_PURE,
153  TOK_BISON_DEPRECATED, TOK_BISON_VECTOR_SIZE, TOK_BISON_VISIBILITY, TOK_BISON_TLS_MODEL, TOK_BISON_NONNULL,
154  TOK_BISON_NOTHROW, TOK_BISON_MAY_ALIAS, TOK_BISON_WARN_UNUSED_RESULT, TOK_BISON_FORMAT, TOK_BISON_FORMAT_ARG,
155  TOK_BISON_NULL, TOK_BISON_CONVERSION, TOK_BISON_VIRTUAL, TOK_BISON_MUTABLE, TOK_BISON_PSEUDO_TMPL, TOK_BISON_SPEC,
156  TOK_BISON_LINE, TOK_BISON_FIXD,
157 
158  TOK_BISON_VECNEW, TOK_BISON_VECDELETE, TOK_BISON_POS, TOK_BISON_NEG, TOK_BISON_ADDR, TOK_BISON_DEREF, TOK_BISON_NOT,
159  TOK_BISON_LNOT, TOK_BISON_PREINC, TOK_BISON_PREDEC, TOK_BISON_PLUSASSIGN, TOK_BISON_PLUS, TOK_BISON_MINUSASSIGN,
160  TOK_BISON_MINUS, TOK_BISON_MULTASSIGN, TOK_BISON_MULT, TOK_BISON_DIVASSIGN, TOK_BISON_DIV, TOK_BISON_MODASSIGN,
161  TOK_BISON_MOD, TOK_BISON_ANDASSIGN, TOK_BISON_AND, TOK_BISON_ORASSIGN, TOK_BISON_OR, TOK_BISON_XORASSIGN,
162  TOK_BISON_XOR, TOK_BISON_LSHIFTASSIGN, TOK_BISON_RSHIFTASSIGN, TOK_BISON_RSHIFT, TOK_BISON_EQ, TOK_BISON_NE,
163  TOK_BISON_LT, TOK_BISON_GT, TOK_BISON_LE, TOK_BISON_GE, TOK_BISON_LAND, TOK_BISON_LOR, TOK_BISON_COMPOUND,
164  TOK_BISON_MEMREF, TOK_BISON_SUBS, TOK_BISON_POSTINC, TOK_BISON_POSTDEC, TOK_BISON_CALL, TOK_BISON_THUNK,
165  TOK_BISON_THIS_ADJUSTING, TOK_BISON_RESULT_ADJUSTING, TOK_BISON_PTRMEM, TOK_BISON_QUAL_R, TOK_BISON_QUAL_V,
166  TOK_BISON_QUAL_VR, TOK_BISON_QUAL_C, TOK_BISON_QUAL_CR, TOK_BISON_QUAL_CV, TOK_BISON_QUAL_CVR,
167 
168  TOK_BISON_USE_TMPL, TOK_BISON_TMPL_PARMS, TOK_BISON_TMPL_ARGS, TOK_BISON_TEMPLATE_PARM_INDEX, TOK_BISON_INDEX,
169  TOK_BISON_LEVEL, TOK_BISON_ORIG_LEVEL, TOK_BISON_INLINE_BODY, TOK_BISON_BITFIELD, TOK_BISON_WITH_SIZE_EXPR,
170  TOK_BISON_OBJ_TYPE_REF, TOK_BISON_MEMUSE, TOK_BISON_MEMDEF, TOK_BISON_VUSE, TOK_BISON_VDEF, TOK_BISON_VOVER,
171  TOK_BISON_PTR_INFO, TOK_BISON_TRUE_EDGE, TOK_BISON_FALSE_EDGE, TOK_BISON_POINTER_PLUS_EXPR,
172  TOK_BISON_TARGET_MEM_REF, TOK_BISON_TARGET_MEM_REF461, TOK_BISON_MEM_REF, TOK_BISON_WIDEN_SUM_EXPR,
173  TOK_BISON_WIDEN_MULT_EXPR, TOK_BISON_MULT_HIGHPART_EXPR, TOK_BISON_EXTRACT_BIT_EXPR, TOK_BISON_ASSERT_EXPR,
174  TOK_BISON_SYMBOL, TOK_BISON_BASE, TOK_BISON_IDX, TOK_BISON_IDX2, TOK_BISON_STEP, TOK_BISON_OFFSET, TOK_BISON_ORIG,
175  TOK_BISON_TAG, TOK_BISON_SMT_ANN, TOK_BISON_TRAIT_EXPR, TOK_BISON_TIME_WEIGHT, TOK_BISON_SIZE_WEIGHT,
176  TOK_BISON_RTL_SIZE_WEIGHT, TOK_BISON_HPL, TOK_BISON_LOOP_ID, TOK_BISON_ATTRIBUTES, NO_TOKEN, NO_TOKEN, NO_TOKEN,
179  NO_TOKEN, NO_TOKEN, NO_TOKEN, NO_TOKEN, TOK_BISON_GIMPLE_PREDICT, TOK_BISON_CLB, TOK_BISON_CLB_VARS, TOK_BISON_USE,
180  TOK_BISON_USE_VARS, TOK_BISON_PREDICATE, TOK_BISON_SLOT, TOK_BISON_SAT_PLUS_EXPR, TOK_BISON_SAT_MINUS_EXPR,
181  TOK_BISON_FSHL_EXPR, TOK_BISON_FSHR_EXPR, TOK_BISON_EXTRACTVALUE_EXPR, TOK_BISON_INSERTVALUE_EXPR,
182  TOK_BISON_EXTRACTELEMENT_EXPR, TOK_BISON_INSERTELEMENT_EXPR, TOK_BISON_FREM_EXPR,
183 
196 
197 const char* treeVocabularyTokenTypes::tokenNames[] = {
198  "COMPILER_VERSION",
199  "PLUGIN_VERSION",
200  "identifier_node",
201  "tree_list",
202  "tree_vec",
203  "block",
204  "void_type",
205  "integer_type",
206  "real_type",
207  "complex_type",
208  "type_argument_pack",
209  "nontype_argument_pack",
210  "expr_pack_expansion",
211  "vector_type",
212  "enumeral_type",
213  "boolean_type",
214  "CharType",
215  "nullptr_type",
216  "error_mark",
217  "type_pack_expansion",
218  "pointer_type",
219  "offset_type",
220  "reference_type",
221  "method_type",
222  "array_type",
223  "set_type",
224  "record_type",
225  "union_type",
226  "qual_union_type",
227  "function_type",
228  "lang_type",
229  "integer_cst",
230  "real_cst",
231  "complex_cst",
232  "vector_cst",
233  "void_cst",
234  "string_cst",
235  "function_decl",
236  "label_decl",
237  "const_decl",
238  "type_decl",
239  "using_decl",
240  "var_decl",
241  "parm_decl",
242  "param_packs",
243  "result_decl",
244  "field_decl",
245  "namespace_decl",
246  "translation_unit_decl",
247  "component_ref",
248  "bit_field_ref",
249  "indirect_ref",
250  "misaligned_indirect_ref",
251  "buffer_ref",
252  "array_ref",
253  "array_range_ref",
254  "vtable_ref",
255  "constructor",
256  "destructor",
257  "compound_expr",
258  "modify_expr",
259  "gimple_assign",
260  "init_expr",
261  "target_expr",
262  "cond_expr",
263  "gimple_cond",
264  "while_expr",
265  "for_expr",
266  "gimple_bind",
267  "gimple_call",
268  "call_expr",
269  "aggr_init_expr",
270  "gimple_nop",
271  "with_cleanup_expr",
272  "cleanup_point_expr",
273  "placeholder_expr",
274  "reduc_max_expr",
275  "reduc_min_expr",
276  "reduc_plus_expr",
277  "plus_expr",
278  "ternary_plus_expr",
279  "ternary_pm_expr",
280  "ternary_mp_expr",
281  "ternary_mm_expr",
282  "bit_ior_concat_expr",
283  "minus_expr",
284  "mult_expr",
285  "trunc_div_expr",
286  "ceil_div_expr",
287  "floor_div_expr",
288  "round_div_expr",
289  "trunc_mod_expr",
290  "ceil_mod_expr",
291  "floor_mod_expr",
292  "round_mod_expr",
293  "rdiv_expr",
294  "exact_div_expr",
295  "fix_trunc_expr",
296  "fix_ceil_expr",
297  "fix_floor_expr",
298  "fix_round_expr",
299  "float_expr",
300  "lut_expr",
301  "negate_expr",
302  "min_expr",
303  "max_expr",
304  "abs_expr",
305  "lshift_expr",
306  "rshift_expr",
307  "lrotate_expr",
308  "rrotate_expr",
309  "bit_ior_expr",
310  "bit_xor_expr",
311  "bit_and_expr",
312  "bit_not_expr",
313  "truth_andif_expr",
314  "truth_orif_expr",
315  "truth_and_expr",
316  "truth_or_expr",
317  "truth_xor_expr",
318  "truth_not_expr",
319  "lt_expr",
320  "le_expr",
321  "gt_expr",
322  "ge_expr",
323  "eq_expr",
324  "ne_expr",
325  "unordered_expr",
326  "ordered_expr",
327  "unlt_expr",
328  "unle_expr",
329  "ungt_expr",
330  "unge_expr",
331  "uneq_expr",
332  "ltgt_expr",
333  "in_expr",
334  "set_le_expr",
335  "card_expr",
336  "range_expr",
337  "paren_expr",
338  "convert_expr",
339  "nop_expr",
340  "non_lvalue_expr",
341  "view_convert_expr",
342  "save_expr",
343  "unsave_expr",
344  "addr_expr",
345  "reference_expr",
346  "fdesc_expr",
347  "complex_expr",
348  "conj_expr",
349  "realpart_expr",
350  "imagpart_expr",
351  "predecrement_expr",
352  "preincrement_expr",
353  "postdecrement_expr",
354  "postincrement_expr",
355  "va_arg_expr",
356  "try_catch_expr",
357  "try_finally",
358  "gimple_label",
359  "gimple_goto",
360  "goto_subroutine",
361  "gimple_return",
362  "exit_expr",
363  "loop_expr",
364  "gimple_switch",
365  "gimple_multi_way_if",
366  "case_label_expr",
367  "gimple_resx",
368  "gimple_asm",
369  "ssa_name",
370  "addr_stmt",
371  "def_stmt",
372  "use_stmt",
373  "gimple_phi",
374  "gimple_catch",
375  "eh_filter_expr",
376  "statement_list",
377  "template_decl",
378  "template_type_parm",
379  "cast_expr",
380  "static_cast_expr",
381  "typename_type",
382  "sizeof_expr",
383  "scope_ref",
384  "ctor_initializer",
385  "do_stmt",
386  "expr_stmt",
387  "for_stmt",
388  "if_stmt",
389  "return_stmt",
390  "while_stmt",
391  "modop_expr",
392  "new_expr",
393  "vec_cond_expr",
394  "vec_perm_expr",
395  "dot_prod_expr",
396  "vec_lshift_expr",
397  "vec_rshift_expr",
398  "widen_mult_hi_expr",
399  "widen_mult_lo_expr",
400  "vec_unpack_hi_expr",
401  "vec_unpack_lo_expr",
402  "vec_unpack_float_hi_expr",
403  "vec_unpack_float_lo_expr",
404  "vec_pack_trunc_expr",
405  "vec_pack_sat_expr",
406  "vec_pack_fix_trunc_expr",
407  "vec_extracteven_expr",
408  "vec_extractodd_expr",
409  "vec_interleavehigh_expr",
410  "vec_interleavelow_expr",
411  "vec_new_expr",
412  "overload",
413  "reinterpret_cast_expr",
414  "template_id_expr",
415  "throw_expr",
416  "try_block",
417  "alignof_expr",
418  "arrow_expr",
419  "handler",
420  "baselink",
421 
422  "name",
423  "type",
424  "srcp",
425  "arg",
426  "body",
427  "strg",
428  "lngt",
429  "size",
430  "algn",
431  "retn",
432  "prms",
433  "scpe",
434  "bb_index",
435  "used",
436  "value",
437  "argt",
438  "prec",
439  "min",
440  "max",
441  "bit_values",
442  "valu",
443  "chan",
444  "stmt",
445  "op",
446  "op0",
447  "op1",
448  "op2",
449  "op3",
450  "op4",
451  "op5",
452  "op6",
453  "op7",
454  "op8",
455  "vars",
456  "unql",
457  "elts",
458  "domn",
459  "bloc",
460  "dcls",
461  "mngl",
462  "ptd",
463  "refd",
464  "qual",
465  "valr",
466  "valx",
467  "flds",
468  "vfld",
469  "bpos",
470  "fn",
471  "goto",
472  "real",
473  "imag",
474  "bases",
475  "binfo",
476  "pub",
477  "prot",
478  "priv",
479  "binf",
480  "uid",
481  "UID",
482  "init",
483  "fini",
484  "purp",
485  "pred",
486  "succ",
487  "phi",
488  "res",
489  "def",
490  "edge",
491  "var",
492  "vers",
493  "orig_vers",
494  "cnst",
495  "clas",
496  "decl",
497  "clnp",
498  "lab",
499  "try",
500  "exit",
501  "out",
502  "in",
503  "str",
504  "clob",
505  "clobber",
506  "ref",
507  "fncs",
508  "csts",
509  "rslt",
510  "inst",
511  "spcs",
512  "cls",
513  "bfld",
514  "ctor",
515  "next",
516  "cond",
517  "expr",
518  "then",
519  "else",
520  "crnt",
521  "hdlr",
522 
523  "artificial",
524  "system",
525  "operating_system",
526  "library_system",
527  "libbambu",
528  "extern",
529  "addr_taken",
530  "addr_not_taken",
531  "C",
532  "lshift",
533  "global_init",
534  "global_fini",
535  "undefined",
536  "builtin",
537  "hwcall",
538  "operator",
539  "overflow",
540  "virt",
541  "unsigned",
542  "struct",
543  "union",
544  "constant",
545  "readonly",
546  "register",
547  "static",
548  "static_static",
549  "reverse_restrict",
550  "writing_memory",
551  "reading_memory",
552  "pipeline_enabled",
553  "simple_pipeline",
554  "initiation_time",
555  "omp_atomic",
556  "omp_body_loop",
557  "omp_critical_session",
558  "omp_for_wrapper",
559  "default",
560  "volatile",
561  "varargs",
562  "Inf",
563  "Nan",
564  "ENTRY",
565  "EXIT",
566  "new",
567  "delete",
568  "assign",
569  "member",
570  "public",
571  "private",
572  "protected",
573  "noreturn",
574  "noinline",
575  "always_inline",
576  "unused",
577  "const",
578  "transparent_union",
579  "mode",
580  "section",
581  "aligned",
582  "packed",
583  "weak",
584  "alias",
585  "no_instrument_function",
586  "malloc",
587  "no_stack_limit",
588  "no_stack",
589  "pure",
590  "deprecated",
591  "vector_size",
592  "visibility",
593  "tls_model",
594  "nonnull",
595  "nothrow",
596  "may_alias",
597  "warn_unused_result",
598  "format",
599  "format_arg",
600  "NULL",
601  "conversion",
602  "virtual",
603  "mutable",
604  "pseudo_tmpl",
605  "spec",
606  "line",
607  "fixd",
608 
609  "vecnew",
610  "vecdelete",
611  "pos",
612  "neg",
613  "addr",
614  "deref",
615  "not",
616  "lnot",
617  "preinc",
618  "predec",
619  "plusassign",
620  "plus",
621  "minusassign",
622  "minus",
623  "multassign",
624  "mult",
625  "divassign",
626  "div",
627  "modassign",
628  "mod",
629  "andassign",
630  "and",
631  "orassign",
632  "or",
633  "xorassign",
634  "xor",
635  "lshiftassign",
636  "rshiftassign",
637  "rshift",
638  "eq",
639  "ne",
640  "lt",
641  "gt",
642  "le",
643  "ge",
644  "land",
645  "lor",
646  "compound",
647  "memref",
648  "subs",
649  "postinc",
650  "postdec",
651  "call",
652  "thunk",
653  "this_adjusting",
654  "result_adjusting",
655  "ptrmem",
656  "r",
657  "v",
658  "vr",
659  "c",
660  "cr",
661  "cv",
662  "cvr",
663  "use_tmpl",
664  "tmpl_parms",
665  "tmpl_args",
666  "template_parm_index",
667  "index",
668  "level",
669  "orig_level",
670  "inline_body",
671  "bitfield",
672  "with_size_expr",
673  "obj_type_ref",
674  "memuse",
675  "memdef",
676  "vuse",
677  "vdef",
678  "vover",
679  "ptr_info",
680  "true_edge",
681  "false_edge",
682  "pointer_plus_expr",
683  "target_mem_ref",
684  "target_mem_ref461",
685  "mem_ref",
686  "widen_sum_expr",
687  "widen_mult_expr",
688  "mult_highpart_expr",
689  "extract_bit_expr",
690  "assert_expr",
691  "symbol",
692  "base",
693  "idx",
694  "idx2",
695  "step",
696  "offset",
697  "orig",
698  "tag",
699  "smt_ann",
700  "trait_expr",
701  "time_weight",
702  "size_weight",
703  "rtl_size_weight",
704  "hpl",
705  "loop_id",
706  "attributes",
707  "pragma_node",
708  "pragma_scope",
709  "pragma_directive",
710  "omp_pragma",
711  "omp_critical",
712  "omp_declare_simd_pragma",
713  "omp_for_pragma",
714  "omp_parallel_pragma",
715  "omp_parallel_sections_pragma",
716  "omp_section_pragma",
717  "omp_sections_pragma",
718  "omp_shortcut",
719  "omp_simd_pragma",
720  "omp_target",
721  "omp_task",
722  "map",
723  "call_hw",
724  "call_point_hw",
725  "hw_component",
726  "id_implementation",
727  "recursive",
728  "issue_pragma",
729  "blackbox_pragma",
730  "profiling_pragma",
731  "statistical_profiling",
732  "is_open_pragma",
733  "is_block_pragma",
734  "pragma_line",
735  "empty",
736  "gimple_predict",
737  "clb",
738  "clb_vars",
739  "use",
740  "use_vars",
741  "predicate",
742  "slot",
743  "sat_plus_expr",
744  "sat_minus_expr",
745  "fshl_expr",
746  "fshr_expr",
747  "extractvalue_expr",
748  "insertvalue_expr",
749  "extractelement_expr",
750  "insertelement_expr",
751  "frem_expr",
752 
754  "rtl",
755 
756  "abs_R",
757  "and_R",
758  "ashift_R",
759  "ashiftrt_R",
760  "bswap_R",
761  "call_R",
762  "call_insn_R",
763  "clz_R",
764  "code_label_R",
765  "compare_R",
766  "concat_R",
767  "const_double_R",
768  "const_int_R",
769  "ctz_R",
770  "div_R",
771  "eq_R",
772  "ffs_R",
773  "fix_R",
774  "float_R",
775  "float_extend_R",
776  "float_truncate_R",
777  "fract_convert_R",
778  "ge_R",
779  "geu_R",
780  "gt_R",
781  "gtu_R",
782  "high_R",
783  "if_then_else_R",
784  "insn_R",
785  "ior_R",
786  "jump_insn_R",
787  "label_ref_R",
788  "le_R",
789  "leu_R",
790  "lshiftrt_R",
791  "lt_R",
792  "ltgt_R",
793  "ltu_R",
794  "lo_sum_R",
795  "write_mem_R",
796  "read_mem_R",
797  "minus_R",
798  "mod_R",
799  "mult_R",
800  "ne_R",
801  "neg_R",
802  "not_R",
803  "ordered_R",
804  "parallel_R",
805  "parity_R",
806  "pc_R",
807  "plus_R",
808  "popcount_R",
809  "reg_R",
810  "rotate_R",
811  "rotatert_R",
812  "sat_fract_R",
813  "set_R",
814  "sign_extend_R",
815  "smax_R",
816  "smin_R",
817  "sqrt_R",
818  "symbol_ref_R",
819  "truncate_R",
820  "udiv_R",
821  "umax_R",
822  "umin_R",
823  "umod_R",
824  "uneq_R",
825  "unge_R",
826  "ungt_R",
827  "unle_R",
828  "unlt_R",
829  "unordered_R",
830  "unsigned_fix_R",
831  "unsigned_float_R",
832  "unsigned_fract_convert_R",
833  "unsigned_sat_fract_R",
834  "xor_R",
835  "zero_extend_R",
836 
837  "none_R",
838  "qc_R",
839  "hc_R",
840  "sc_R",
841  "dc_R",
842  "tc_R",
843  "cqi_R",
844  "chi_R",
845  "csi_R",
846  "cdi_R",
847  "cti_R",
848  "qf_R",
849  "hf_R",
850  "sf_R",
851  "df_R",
852  "tf_R",
853  "qi_R",
854  "hi_R",
855  "si_R",
856  "di_R",
857  "ti_R",
858  "v2si_R",
859  "v4hi_R",
860  "v8qi_R",
861  "cc_R",
862  "ccfp_R",
863  "ccfpe_R",
864  "ccz_R",
865 };
866 
868 {
869  const char* tmp = treeVocabularyTokenTypes::tokenNames[static_cast<unsigned int>(i)];
870  return std::string(tmp);
871 }
872 
873 int treeVocabularyTokenTypes::check_tokens(const char* tok) const
874 {
875  auto el = token_map.find(tok);
876  if(el == token_map.end())
877  {
878  return -1;
879  }
880  else
881  {
882  return bisontokens[el->second];
883  }
884 }
886 {
887  auto el = from_bisontoken_map.find(bison);
888  THROW_ASSERT(el != from_bisontoken_map.end(), "Token " + std::to_string(bison) + " does not exist");
889  return el->second;
890 }
892 {
893  for(int i = static_cast<int>(TreeVocabularyTokenTypes_TokenEnum::FIRST_TOKEN) + 1;
894  i < static_cast<int>(TreeVocabularyTokenTypes_TokenEnum::LAST_TOKEN); i++)
895  {
896  token_map[tokenNames[i]] = i;
898  }
899 }
TreeVocabularyTokenTypes_TokenEnum bison2token(int bison) const
static const char * tokenNames[]
REF_FORWARD_DECL(BisonParserData)
Header include.
std::map< int, TreeVocabularyTokenTypes_TokenEnum > from_bisontoken_map
Map between bison token and token_interface token.
exceptions managed by PandA
A simple interface to token object of the raw files.
std::map< const char *, int, ltstr > token_map
const std::string TI_getTokenName(const TreeVocabularyTokenTypes_TokenEnum i)
Return the name associated with the token.
#define NO_TOKEN
Tree include.
static const int bisontokens[]
int check_tokens(const char *tok) const
TreeVocabularyTokenTypes_TokenEnum
Template definition of refcount.
int el
Definition: adpcm.c:105
#define THROW_ASSERT(cond, str_expr)
helper function used to check an assert and if needed to throw an error in a standard way ...
Definition: exceptions.hpp:289

Generated on Mon Feb 12 2024 13:02:55 for PandA-2024.02 by doxygen 1.8.13