FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
lpython/src/lpython/parser/parser.h at main · archiv-nptel/lpython · GitHub
archiv-nptel
/
lpython
Public
forked from
lcompilers/lpython
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
lpython
/
src
/
lpython
/
parser
/
parser.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
47 lines (36 loc) · 1.17 KB
Breadcrumbs
lpython
/
src
/
lpython
/
parser
/
parser.h
Copy path
File metadata and controls
47 lines (36 loc) · 1.17 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#
ifndef
LPYTHON_PARSER_PARSER_H
#
define
LPYTHON_PARSER_PARSER_H
#
include
"
lpython/python_ast.h
"
#
include
<
libasr/containers.h
>
#
include
<
libasr/diagnostics.h
>
#
include
<
lpython/parser/tokenizer.h
>
namespace
LCompilers
::LPython {
class
Parser
{
public:
std::string inp;
public:
diag::Diagnostics &diag;
Allocator &m_a;
Tokenizer m_tokenizer;
Vec<LPython::
AST
::
stmt_t
*> result;
Vec<LPython::
AST
::
type_ignore_t
*> type_ignore;
Parser
(Allocator &al, diag::Diagnostics &diagnostics)
: diag{diagnostics}, m_a{al} {
result.
reserve
(al,
32
);
type_ignore.
reserve
(al,
4
);
}
void
parse
(
const
std::string &input,
uint32_t
prev_loc);
void
handle_yyerror
(
const
Location &loc,
const
std::string &msg);
};
//
Parses Python code to AST
Result<LPython::
AST
::Module_t*>
parse
(Allocator &al,
const
std::string &s,
uint32_t
prev_loc,
diag::Diagnostics &diagnostics);
Result<LPython::
AST
::
ast_t
*>
parse_python_file
(Allocator &al,
const
std::string &runtime_library_dir,
const
std::string &infile,
diag::Diagnostics &diagnostics,
uint32_t
prev_loc,
bool
new_parser);
}
//
namespace LCompilers::LPython
#
endif
Back
|
FazBrowse Home
|
New Git URL