diff options
| author | Yukihiro Matsumoto <[email protected]> | 2012-05-18 11:03:43 +0900 |
|---|---|---|
| committer | Yukihiro Matsumoto <[email protected]> | 2012-05-18 11:03:43 +0900 |
| commit | a18fb01b03a837a30d16e229d99d547b82505de2 (patch) | |
| tree | 82ce29bba7a92efb41e9a09c2161b12efcb8eaf1 /src/compile.h | |
| parent | 5d5d189dee7cd28e9811cef460b3c7ffc1da315d (diff) | |
| download | mruby-a18fb01b03a837a30d16e229d99d547b82505de2.tar.gz mruby-a18fb01b03a837a30d16e229d99d547b82505de2.zip | |
new API for parser
Diffstat (limited to 'src/compile.h')
| -rw-r--r-- | src/compile.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/compile.h b/src/compile.h index ba1dfd2ee..ca3e255c8 100644 --- a/src/compile.h +++ b/src/compile.h @@ -77,15 +77,20 @@ struct mrb_parser_state { jmp_buf jmp; }; -struct mrb_parser_state* mrb_parse_file(mrb_state*,FILE*,const char*,int); +/* parser structure */ +struct mrb_parser_state* mrb_parser_new(mrb_state*); +const char *mrb_parser_filename(struct mrb_parser_state*, const char*); +int mrb_parser_lineno(struct mrb_parser_state*, int); +void mrb_parser_parse(struct mrb_parser_state*); + +/* utility functions */ +struct mrb_parser_state* mrb_parse_file(mrb_state*,FILE*); struct mrb_parser_state* mrb_parse_string(mrb_state*,const char*); struct mrb_parser_state* mrb_parse_nstring(mrb_state*,const char*,size_t); struct mrb_parser_state* mrb_parse_nstring_ext(mrb_state*,const char*,size_t); int mrb_generate_code(mrb_state*, mrb_ast_node*); -int mrb_compile_file(mrb_state*,FILE*,const char*,int); +int mrb_compile_file(mrb_state*,FILE*); int mrb_compile_string(mrb_state*,char*); int mrb_compile_nstring(mrb_state*,char*,size_t); -const char *mrb_parser_filename(struct mrb_parser_state *p, const char *s); -int mrb_parser_lineno(struct mrb_parser_state *p, int n); |
