-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutil.h
31 lines (28 loc) · 1009 Bytes
/
util.h
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
#ifndef util
#define util
#include <string>
#include "lexer.h"
#include <optional>
#include <stack>
#include "parser.h"
#include "statement.h"
#include <vector>
void eat_whitespace(Tokens& tokens);
std::string enum_to_string(TokenType t);
std::string enum_to_string(ReturnType t);
std::string enum_to_string(ValueType t);
void lex_error(int pos, std::string lexing_string);
void lex_error(std::string error_message);
void parse_error(std::string, std::string, Tokens);
void parse_error(std::string, Tokens);
void eval_error(std::string, std::string, int id);
void eval_error(std::string, int id);
void pushOperatorToStack(std::stack<StatementHelper>& operatorStack, StatementHelper& op, std::vector<StatementHelper>& queue);
int getOperatorPrecedence(StatementHelper& op);
void debug(Tokens);
std::string boolToString(bool);
bool stringToBool(std::string);
int ipow(int, int);
Statement* convertReturnToExpression(ReturnValue);
std::optional<Token> lex_keyword(std::string lexing_string, int& pos);
#endif