summaryrefslogtreecommitdiffstats
path: root/src/parsers.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/parsers.h')
-rw-r--r--src/parsers.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/parsers.h b/src/parsers.h
index 055ba79..31fe8a7 100644
--- a/src/parsers.h
+++ b/src/parsers.h
@@ -23,6 +23,7 @@ using namespace std;
struct BindingEnv;
+/// A single parsed token in an input stream.
struct Token {
enum Type {
NONE,
@@ -51,6 +52,7 @@ struct Token {
const char* end_;
};
+/// Processes an input stream into Tokens.
struct Tokenizer {
Tokenizer(bool whitespace_significant)
: whitespace_significant_(whitespace_significant),
@@ -85,6 +87,7 @@ struct Tokenizer {
int last_indent_, cur_indent_;
};
+/// Parses simple Makefiles as generated by gcc.
struct MakefileParser {
MakefileParser();
bool Parse(const string& input, string* err);
@@ -96,6 +99,7 @@ struct MakefileParser {
struct State;
+/// Parses .ninja files.
struct ManifestParser {
struct FileReader {
virtual bool ReadFile(const string& path, string* content, string* err) = 0;
@@ -107,12 +111,12 @@ struct ManifestParser {
bool Parse(const string& input, string* err);
bool ParseRule(string* err);
- // Parse a key=val statement. If expand is true, evaluate variables
- // within the value immediately.
+ /// Parse a key=val statement. If expand is true, evaluate variables
+ /// within the value immediately.
bool ParseLet(string* key, string* val, bool expand, string* err);
bool ParseEdge(string* err);
- // Parse either a 'subninja' or 'include' line.
+ /// Parse either a 'subninja' or 'include' line.
bool ParseFileInclude(Token::Type type, string* err);
State* state_;