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
107 lines (79 loc) · 2.05 KB
/
Copy pathparser_stype.h
File metadata and controls
107 lines (79 loc) · 2.05 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#ifndef LFORTRAN_PARSER_STYPE_H
#define LFORTRAN_PARSER_STYPE_H
#include <cstring>
#include <lpython/ast.h>
#include <libasr/location.h>
#include <libasr/containers.h>
#include <lpython/bigint.h>
namespace LFortran
{
struct VarType {
Location loc;
Str string;
Vec<AST::kind_item_t> kind;
char *identifier;
};
struct FnArg {
bool keyword;
union {
AST::fnarg_t arg;
AST::keyword_t kw;
};
};
struct CoarrayArg {
bool keyword;
union {
AST::coarrayarg_t arg;
AST::keyword_t kw;
};
};
struct ArgStarKw {
bool keyword;
union {
AST::argstar_t arg;
AST::kw_argstar_t kw;
};
};
struct IntSuffix {
BigInt::BigInt int_n;
Str int_kind;
};
union YYSTYPE {
int64_t n;
Str string;
IntSuffix int_suffix;
AST::ast_t* ast;
Vec<AST::ast_t*> vec_ast;
AST::var_sym_t *var_sym;
Vec<AST::var_sym_t> vec_var_sym;
AST::dimension_t *dim;
Vec<AST::dimension_t> vec_dim;
AST::codimension_t *codim;
Vec<AST::codimension_t> vec_codim;
AST::reduce_opType reduce_op_type;
VarType *var_type;
AST::kind_item_t *kind_arg;
Vec<AST::kind_item_t> vec_kind_arg;
FnArg *fnarg;
Vec<FnArg> vec_fnarg;
CoarrayArg *coarrayarg;
Vec<CoarrayArg> vec_coarrayarg;
ArgStarKw *argstarkw;
Vec<ArgStarKw> vec_argstarkw;
AST::struct_member_t *struct_member;
Vec<AST::struct_member_t> vec_struct_member;
AST::intrinsicopType interface_op_type;
AST::equi_t *equi;
Vec<AST::equi_t> vec_equi;
};
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<AST::ast_t*>));
} // namespace LFortran
typedef struct LFortran::Location YYLTYPE;
#define YYLTYPE_IS_DECLARED 1
#define YYLTYPE_IS_TRIVIAL 0
#endif // LFORTRAN_PARSER_STYPE_H