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
42 lines (31 loc) · 972 Bytes
/
Copy pathparser_stype.h
File metadata and controls
42 lines (31 loc) · 972 Bytes
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
#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 IntSuffix {
BigInt::BigInt int_n;
Str int_kind;
};
union YYSTYPE {
int64_t n;
Str string;
IntSuffix int_suffix;
LPython::AST::ast_t* ast;
Vec<LPython::AST::ast_t*> vec_ast;
};
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