diff options
author | Colin Cross <ccross@android.com> | 2010-04-20 14:29:05 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2010-04-21 19:43:40 -0700 |
commit | 6310a8261c922533a692fb3e74ece2da98d4bafa (patch) | |
tree | 32a27ed5e629bdc77f2a9d92644b010bf0bef5c8 /init/parser.h | |
parent | 3294bbbad9494eb4ca534624b96e39f8ed15aaf2 (diff) | |
download | core-6310a8261c922533a692fb3e74ece2da98d4bafa.tar.gz core-6310a8261c922533a692fb3e74ece2da98d4bafa.tar.bz2 core-6310a8261c922533a692fb3e74ece2da98d4bafa.zip |
init: Split parser into generic parser and init parser
Change-Id: I451ebc4ff12f2ac660eb533fa10ad561fa25c9dd
Diffstat (limited to 'init/parser.h')
-rw-r--r-- | init/parser.h | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/init/parser.h b/init/parser.h index e277faf4a..be9375805 100644 --- a/init/parser.h +++ b/init/parser.h @@ -17,15 +17,24 @@ #ifndef PARSER_H_ #define PARSER_H_ -struct action; +#define T_EOF 0 +#define T_TEXT 1 +#define T_NEWLINE 2 -struct action *action_remove_queue_head(void); -void action_add_queue_tail(struct action *act); -void action_for_each_trigger(const char *trigger, - void (*func)(struct action *act)); -int action_queue_empty(void); -void queue_property_triggers(const char *name, const char *value); -void queue_all_property_triggers(); -void queue_builtin_action(int (*func)(int nargs, char **args), char *name); +struct parse_state +{ + char *ptr; + char *text; + int line; + int nexttoken; + void *context; + void (*parse_line)(struct parse_state *state, int nargs, char **args); + const char *filename; +}; + +int lookup_keyword(const char *s); +void DUMP(void); +int next_token(struct parse_state *state); +void parse_error(struct parse_state *state, const char *fmt, ...); #endif /* PARSER_H_ */ |