aboutsummaryrefslogtreecommitdiffstats
path: root/src/bootstrap/parser.h
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2021-10-18 12:31:20 +0200
committerBad Diode <bd@badd10de.dev>2021-10-18 12:31:20 +0200
commit043a96a6b7cf55f7ef58fb5ebf8ad87b7d50b571 (patch)
tree14861de314cfa5587103bd3cf21a761dd0e8248e /src/bootstrap/parser.h
parent6f34133b0661849bccf891ea0aa4d04f45ca9a9a (diff)
downloadbdl-043a96a6b7cf55f7ef58fb5ebf8ad87b7d50b571.tar.gz
bdl-043a96a6b7cf55f7ef58fb5ebf8ad87b7d50b571.zip
Add header files for all modules
Diffstat (limited to 'src/bootstrap/parser.h')
-rw-r--r--src/bootstrap/parser.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/bootstrap/parser.h b/src/bootstrap/parser.h
new file mode 100644
index 0000000..3bd17ef
--- /dev/null
+++ b/src/bootstrap/parser.h
@@ -0,0 +1,22 @@
1#ifndef BDL_PARSER_H
2#define BDL_PARSER_H
3
4typedef struct Visitor {
5 Tokens tokens;
6 size_t current;
7} Visitor;
8
9// Mimics the functionality in the Scanner functions, but for entire tokens.
10Token next_token(Visitor *visitor);
11Token peek_token(const Visitor *visitor);
12bool has_next_token(const Visitor *visitor);
13
14// Parse a token into a fixnum object.
15Object * parse_fixnum(Token tok);
16
17// Recursive descent parser. If an object is not a list the parsing is handled
18// by the parse_tree function.
19Object * parse_list(Visitor *vs);
20Object * parse_tree(Visitor *vs);
21
22#endif // BDL_PARSER_H