5#include <unordered_map>
28 std::vector<std::shared_ptr<ASTNode>>
children;
44 if (!
lhs)
return nullptr;
78 std::cout <<
pad <<
"Node: " <<
node->value <<
" [Type=" <<
static_cast<int>(
node->type) <<
"]\n";
TokenType
Definition Latex.hpp:8
bool eof() const
Definition AST.hpp:57
Parser(const std::vector< Token > &tokens)
Definition AST.hpp:39
std::vector< Token > tokens
Definition AST.hpp:49
std::shared_ptr< ASTNode > parse_expression(int precedence=0)
Definition AST.hpp:42
std::shared_ptr< ASTNode > parse_binary_rhs(int prec, std::shared_ptr< ASTNode > lhs)
Token peek() const
Definition AST.hpp:55
int get_precedence(TokenType t) const
Definition AST.hpp:59
size_t pos
Definition AST.hpp:50
std::shared_ptr< ASTNode > parse_expression()
std::shared_ptr< ASTNode > parse_primary()
Token get()
Definition AST.hpp:56
Multi-dimensional tensor class with fixed rank and SIMD support.
Definition Tensor.hpp:25
Definition Derivate.hpp:24
void print_ast(const std::shared_ptr< ASTNode > &node, int indent=0)
Definition AST.hpp:75
ASTNodeType
Definition AST.hpp:12
std::string value
Definition AST.hpp:27
ASTNode(ASTNodeType type, const std::string &val="")
Definition AST.hpp:30
std::vector< std::shared_ptr< ASTNode > > children
Definition AST.hpp:28
ASTNode(ASTNodeType type, const std::string &val, const std::vector< std::shared_ptr< ASTNode > > &childs)
Definition AST.hpp:33
ASTNodeType type
Definition AST.hpp:26