diff --git a/src/Parser.cpp b/src/Parser.cpp index 0f1a4eb..28736d6 100644 --- a/src/Parser.cpp +++ b/src/Parser.cpp @@ -31,3 +31,18 @@ Parser::ErrorOr Parser::walk_expr() { return ErrorOr(new ExprNode()); // constructor does not want to accept a shared_ptr in the argument list, thats why im not using make_shared here } + +Parser::ErrorOr Parser::walk_number() +{ + return ErrorOr(new NumberNode()); +} + +void Parser::save_current_position() +{ + saved_m_index = m_index; +} + +void Parser::restore_current_position() +{ + m_index = saved_m_index; +} diff --git a/src/Parser.h b/src/Parser.h index 25be0e3..c85a9cd 100644 --- a/src/Parser.h +++ b/src/Parser.h @@ -38,6 +38,12 @@ private: ErrorOr walk_expr(); ErrorOr walk_number(); + + int m_index; + int saved_m_index; + + void save_current_position(); + void restore_current_position(); public: ~Parser();