15 #ifndef NINJA_LEXER_H_
16 #define NINJA_LEXER_H_
30 explicit Lexer(
const char* input);
90 bool Error(
const string& message,
string* err);
105 #endif // NINJA_LEXER_H_
void UnreadToken()
Rewind to the last read Token.
StringPiece represents a slice of a string whose memory is managed externally.
static const char * TokenErrorHint(Token expected)
Return a human-readable token hint, used in error messages.
void EatWhitespace()
Skip past whitespace (called after each read token/ident/etc.).
bool PeekToken(Token token)
If the next token is token, read it and return true.
bool Error(const string &message, string *err)
Construct an error message with context.
Token ReadToken()
Read a Token from the Token enum.
bool ReadPath(EvalString *path, string *err)
Read a path (complete with $escapes).
string DescribeLastError()
If the last token read was an ERROR token, provide more info or the empty string. ...
bool ReadIdent(string *out)
Read a simple identifier (a rule or variable name).
bool ReadVarValue(EvalString *value, string *err)
Read the value side of a var = value line (complete with $escapes).
bool ReadEvalString(EvalString *eval, bool path, string *err)
Read a $-escaped string.
static const char * TokenName(Token t)
Return a human-readable form of a token, used in error messages.
A tokenized string that contains variable references.
void Start(StringPiece filename, StringPiece input)
Start parsing some input.