31 std::vector<AST::StmtPtr>
parse();
Header file for defining AST tree elements.
void consume_semicolon()
Method for skipping semicolon in the end of statement.
AST::ExprPtr parse_unary_expr()
Method for parsing expression as 'unary'.
AST::ExprPtr parse_expr()
Method for parsing expressions.
AST::StmtPtr parse_func_decl_proto_stmt()
Method for parsing of functions prototypes.
AST::StmtPtr parse_while_cycle_stmt()
Method for parsing of while cycle.
AST::ExprPtr parse_l_or_expr()
Method for parsing expression as 'logical or'.
AST::ExprPtr parse_additive_expr()
Method for parsing expression as 'additive'.
AST::StmtPtr parse_func_call_stmt()
Method for parsing of functions calling.
AST::StmtPtr parse_do_while_cycle_stmt()
Method for parsing of do-while cycle.
AST::StmtPtr parse_if_else_stmt()
Method for parsing of control flow operators (aka if-else).
std::vector< Token > tokens
AST::ExprPtr parse_primary_expr()
Method for parsing expression as 'primary'.
AST::StmtPtr parse_return_stmt()
Method for parsing of 'return'.
AST::StmtPtr parse_use_module_stmt()
Method for parsing of import the module.
AST::StmtPtr parse_var_asgn_stmt()
Method for parsing of variable assignment.
AST::Argument parse_argument()
Method for parsing of function argument.
AST::StmtPtr parse_stmt(bool from_for=false)
Method for parsing only one statement.
AST::Type consume_type()
Method for verifyng the Topaz type by current tokens.
std::vector< AST::StmtPtr > parse()
Method for parsing tokens into AST tree.
AST::StmtPtr parse_var_decl_stmt()
Method for parsing of variable declaration.
AST::ExprPtr create_inc_dec_operator(std::string var_name)
Method for creating increment/decrement operator and returns expression of assignment.
bool is_compound_asgn_operator(Token token)
Method for checking whether the passed token is a compound assignment operator.
AST::StmtPtr parse_func_decl_stmt()
Method for parsing of functions declaration.
AST::StmtPtr parse_break_stmt()
Method for parsing of break statement.
AST::ExprPtr parse_equality_expr()
Method for parsing expression as 'equality'.
AST::ExprPtr parse_comparation_expr()
Method for parsing expression as 'comparation'.
AST::StmtPtr parse_continue_stmt()
Method for parsing of continue statement.
AST::StmtPtr parse_extern_stmt()
Method for parsing of declaration functions prototypes as extern.
AST::ExprPtr parse_l_and_expr()
Method for parsing expression as 'logical and'.
Parser(std::vector< Token > t, bool id)
AST::StmtPtr parse_for_cycle_stmt()
Method for parsing of for cycle.
Token peek(int32_t rpos=0) const
Method for getting token from tokens by parser pos and passed offset.
AST::ExprPtr create_compound_asgn_operator(std::string var_name)
Method for creating compound assignment operator and returns expression of assignment.
AST::ExprPtr parse_multiplicative_expr()
Method for parsing expression as 'multiplicative'.
Token consume(TokenType type, std::string err_msg, uint32_t line)
Method for verifying the type of the current token.
AST::StmtPtr parse_module_stmt()
Method for parsing of module definition.
AST::TypeValue ttype_to_tvalue(TokenType type)
Method for convert type of token to type of Topaz value.
AST::ExprPtr parse_obj_chain_expr()
Method for parsing expresion as chain of objects.
bool match(TokenType type)
Method for skipping the current token if its type is equal to the passed one.
void reset()
Method for resetting all parameters in parser.
std::unique_ptr< Stmt > StmtPtr
TypeValue
Type values enum.
std::unique_ptr< Expr > ExprPtr
Structure for describing the argument (in function or method).
Structure for describing the type.
Header file for defining the token.
TokenType
All tokens types.