15 #ifndef NINJA_PARSER_H_
16 #define NINJA_PARSER_H_
32 bool Load(
const std::string& filename, std::string* err,
Lexer* parent = NULL);
45 virtual bool Parse(
const std::string& filename,
const std::string& input,
46 std::string* err) = 0;
Interface for reading files from disk.
FileReader * file_reader_
virtual bool Parse(const std::string &filename, const std::string &input, std::string *err)=0
Parse a file, given its contents as a string.
bool Load(const std::string &filename, std::string *err, Lexer *parent=NULL)
Load and parse a file.
bool ExpectToken(Lexer::Token expected, std::string *err)
If the next token is not expected, produce an error string saying "expected foo, got bar".
Parser(State *state, FileReader *file_reader)
Global state (file status) for a single run.