forked from lcompilers/lpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparser_stype.h
More file actions
75 lines (54 loc) · 1.63 KB
/
Copy pathparser_stype.h
File metadata and controls
75 lines (54 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#ifndef LPYTHON_PARSER_STYPE_H
#define LPYTHON_PARSER_STYPE_H
#include <cstring>
#include <lpython/python_ast.h>
#include <libasr/location.h>
#include <libasr/containers.h>
#include <libasr/bigint.h>
namespace LFortran
{
struct Key_Val {
LPython::AST::expr_t* key;
LPython::AST::expr_t* value;
};
struct Args {
LPython::AST::arguments_t arguments;
};
struct Arg {
bool default_value;
LPython::AST::arg_t _arg;
LPython::AST::expr_t *defaults;
};
union YYSTYPE {
int64_t n;
double f;
Str string;
LPython::AST::ast_t* ast;
Vec<LPython::AST::ast_t*> vec_ast;
LPython::AST::alias_t* alias;
Vec<LPython::AST::alias_t> vec_alias;
Arg *arg;
Vec<Arg*> vec_arg;
Args *args;
Vec<Args> vec_args;
Key_Val *key_val;
Vec<Key_Val*> vec_key_val;
LPython::AST::withitem_t* withitem;
Vec<LPython::AST::withitem_t> vec_withitem;
LPython::AST::keyword_t* keyword;
Vec<LPython::AST::keyword_t> vec_keyword;
LPython::AST::comprehension_t* comp;
Vec<LPython::AST::comprehension_t> vec_comp;
LPython::AST::operatorType operator_type;
};
static_assert(std::is_standard_layout<YYSTYPE>::value);
static_assert(std::is_trivial<YYSTYPE>::value);
// Ensure the YYSTYPE size is equal to Vec<AST::ast_t*>, which is a required member, so
// YYSTYPE has to be at least as big, but it should not be bigger, otherwise it
// would reduce performance.
static_assert(sizeof(YYSTYPE) == sizeof(Vec<LPython::AST::ast_t*>));
} // namespace LFortran
typedef struct LFortran::Location YYLTYPE;
#define YYLTYPE_IS_DECLARED 1
#define YYLTYPE_IS_TRIVIAL 0
#endif // LPYTHON_PARSER_STYPE_H