33 inline std::pair<std::unordered_map<std::string, int>,
Prog>
gcompile(
35 std::unordered_map<std::string, int> var_counter;
36 std::vector<gymbo::Node *> code;
43 return std::make_pair(var_counter, prg);
Implementation of compiler.
Definition: compiler.h:11
void compile_ast(std::vector< Node * > code, Prog &prg)
Compile the Abstract Syntax Tree (AST) into a sequence of instructions.
Definition: compiler.h:133
void generate_ast(Token *&token, char *user_input, std::vector< Node * > &code)
Parses a C-like language program into an AST.
Definition: parser.h:439
std::pair< std::unordered_map< std::string, int >, Prog > gcompile(char *user_input)
Compiles user input into a program, returning variable counts and the compiled program.
Definition: pipeline.h:33
Token * tokenize(char *user_input, std::unordered_map< std::string, int > &var_counter)
Tokenizes a given string and returns a linked list of tokens.
Definition: tokenizer.h:222
std::vector< Instr > Prog
Alias for a program, represented as a vector of instructions.
Definition: type.h:143
Structure representing a token.
Definition: tokenizer.h:89