|
Ninja
|
Parses dyndep files. More...
#include <dyndep_parser.h>

Public Member Functions | |
| DyndepParser (State *state, FileReader *file_reader, DyndepFile *dyndep_file) | |
| bool | Load (const std::string &filename, std::string *err, Lexer *parent=NULL) |
| Load and parse a file. | |
| bool | ParseTest (const std::string &input, std::string *err) |
| Parse a text string of input. Used by tests. | |
Protected Member Functions | |
| bool | ExpectToken (Lexer::Token expected, std::string *err) |
| If the next token is not expected, produce an error string saying "expected foo, got bar". | |
Protected Attributes | |
| FileReader * | file_reader_ |
| Lexer | lexer_ |
| State * | state_ |
Private Member Functions | |
| bool | Parse (const std::string &filename, const std::string &input, std::string *err) |
| Parse a file, given its contents as a string. | |
| bool | ParseDyndepVersion (std::string *err) |
| bool | ParseEdge (std::string *err) |
| bool | ParseLet (std::string *key, EvalString *val, std::string *err) |
Private Attributes | |
| DyndepFile * | dyndep_file_ |
| BindingEnv | env_ |
Parses dyndep files.
Definition at line 25 of file dyndep_parser.h.
| DyndepParser::DyndepParser | ( | State * | state, |
| FileReader * | file_reader, | ||
| DyndepFile * | dyndep_file ) |
Definition at line 27 of file dyndep_parser.cc.
References dyndep_file_, and Parser::Parser().
|
protectedinherited |
If the next token is not expected, produce an error string saying "expected foo, got bar".
Definition at line 40 of file parser.cc.
References lexer_, Lexer::TokenErrorHint(), and Lexer::TokenName().
Referenced by ManifestParser::ParseDefault(), DyndepParser::ParseEdge(), ManifestParser::ParseEdge(), ManifestParser::ParseFileInclude(), DyndepParser::ParseLet(), ManifestParser::ParseLet(), ManifestParser::ParsePool(), and ManifestParser::ParseRule().
|
inherited |
Load and parse a file.
Definition at line 22 of file parser.cc.
References Lexer::Error(), file_reader_, METRIC_RECORD_IF, FileReader::Okay, and Parse().
Referenced by DyndepLoader::LoadDyndepFile(), LoadManifests(), and TEST_F().
|
privatevirtual |
Parse a file, given its contents as a string.
Implements Parser.
Definition at line 33 of file dyndep_parser.cc.
References Lexer::BUILD, Lexer::ERROR, Lexer::IDENT, Parser::lexer_, Lexer::NEWLINE, ParseDyndepVersion(), ParseEdge(), Lexer::TEOF, and Lexer::TokenName().
Referenced by ParseTest().
|
private |
Definition at line 77 of file dyndep_parser.cc.
References env_, EvalString::Evaluate(), Parser::lexer_, ParseLet(), and ParseVersion().
Referenced by Parse().
|
private |
Definition at line 101 of file dyndep_parser.cc.
References CanonicalizePath(), Lexer::COLON, dyndep_file_, EvalString::empty(), env_, EvalString::Evaluate(), Parser::ExpectToken(), Dyndeps::implicit_inputs_, Dyndeps::implicit_outputs_, Node::in_edge(), Lexer::INDENT, Parser::lexer_, Lexer::NEWLINE, ParseLet(), Lexer::PIPE, Lexer::PIPE2, Dyndeps::restat_, and Parser::state_.
Referenced by Parse().
|
private |
Definition at line 95 of file dyndep_parser.cc.
References Lexer::EQUALS, Parser::ExpectToken(), and Parser::lexer_.
Referenced by ParseDyndepVersion(), and ParseEdge().
|
inline |
Parse a text string of input. Used by tests.
Definition at line 30 of file dyndep_parser.h.
References Parse().
Referenced by DyndepParserTest::AssertParse(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
private |
Definition at line 43 of file dyndep_parser.h.
Referenced by DyndepParser(), and ParseEdge().
|
private |
Definition at line 44 of file dyndep_parser.h.
Referenced by ParseDyndepVersion(), and ParseEdge().
|
protectedinherited |
Definition at line 40 of file parser.h.
Referenced by Load(), ManifestParser::ParseFileInclude(), and Parser().
|
protectedinherited |
Definition at line 41 of file parser.h.
Referenced by ExpectToken(), DyndepParser::Parse(), ManifestParser::Parse(), ManifestParser::ParseDefault(), DyndepParser::ParseDyndepVersion(), DyndepParser::ParseEdge(), ManifestParser::ParseEdge(), ManifestParser::ParseFileInclude(), DyndepParser::ParseLet(), ManifestParser::ParseLet(), ManifestParser::ParsePool(), and ManifestParser::ParseRule().
|
protectedinherited |
Definition at line 39 of file parser.h.
Referenced by ManifestParser::ParseDefault(), DyndepParser::ParseEdge(), ManifestParser::ParseEdge(), ManifestParser::ParseFileInclude(), ManifestParser::ParsePool(), and Parser().