mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 23:04:08 +10:00
Basically, all Toy varaibles, functions, etc. are prepended with "Toy_", and macros are prepended with "TOY_". This is to reduce namespace pollution, which was an issue pointed out to be - blame @GyroVorbis. I've also bumped the minor version number - theoretically I should bump the major number, but I'm not quite ready for 1.0 yet.
21 lines
555 B
C
21 lines
555 B
C
#pragma once
|
|
|
|
#include "toy_common.h"
|
|
#include "toy_lexer.h"
|
|
#include "toy_ast_node.h"
|
|
|
|
//DOCS: parsers are bound to a lexer, and turn the outputted tokens into AST nodes
|
|
typedef struct {
|
|
Toy_Lexer* lexer;
|
|
bool error; //I've had an error
|
|
bool panic; //I am processing an error
|
|
|
|
//track the last two outputs from the lexer
|
|
Toy_Token current;
|
|
Toy_Token previous;
|
|
} Toy_Parser;
|
|
|
|
TOY_API void Toy_initParser(Toy_Parser* parser, Toy_Lexer* lexer);
|
|
TOY_API void Toy_freeParser(Toy_Parser* parser);
|
|
TOY_API Toy_ASTNode* Toy_scanParser(Toy_Parser* parser);
|