blob: 3bd17efbf805c2eb12e44b875b4d7cc75bc6ca7c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#ifndef BDL_PARSER_H
#define BDL_PARSER_H
typedef struct Visitor {
Tokens tokens;
size_t current;
} Visitor;
// Mimics the functionality in the Scanner functions, but for entire tokens.
Token next_token(Visitor *visitor);
Token peek_token(const Visitor *visitor);
bool has_next_token(const Visitor *visitor);
// Parse a token into a fixnum object.
Object * parse_fixnum(Token tok);
// Recursive descent parser. If an object is not a list the parsing is handled
// by the parse_tree function.
Object * parse_list(Visitor *vs);
Object * parse_tree(Visitor *vs);
#endif // BDL_PARSER_H
|