Renames project.
This commit is contained in:
33
src/Parser/Parser.hpp
Normal file
33
src/Parser/Parser.hpp
Normal file
@@ -0,0 +1,33 @@
|
||||
#ifndef MALACHSCRIPT_PARSER_HPP
|
||||
#define MALACHSCRIPT_PARSER_HPP
|
||||
|
||||
#include "Lexer/LexToken.hpp"
|
||||
#include "Statements/ParsedStatement.hpp"
|
||||
namespace MalachScript::Parser {
|
||||
class Parser {
|
||||
public:
|
||||
Parser(const LexToken* firstToken) : _currentToken(firstToken) {}
|
||||
ParsedScriptStatement* Parse();
|
||||
|
||||
private:
|
||||
const LexToken* _currentToken;
|
||||
inline const LexToken* Peek() {
|
||||
if (_currentToken->GetKind() == LexTokenKind::EndOfFile) {
|
||||
return _currentToken;
|
||||
}
|
||||
return _currentToken->GetNext().get();
|
||||
}
|
||||
|
||||
inline const LexToken* Consume() {
|
||||
if (_currentToken->GetKind() == LexTokenKind::EndOfFile) {
|
||||
return _currentToken;
|
||||
}
|
||||
_currentToken = _currentToken->GetNext().get();
|
||||
return _currentToken;
|
||||
}
|
||||
|
||||
const ParsedStatement* ParseStatement(const LexToken* token);
|
||||
};
|
||||
}
|
||||
|
||||
#endif // MALACHSCRIPT_PARSER_HPP
|
||||
Reference in New Issue
Block a user