summaryrefslogtreecommitdiff
path: root/internal/ruby_parser.h
diff options
context:
space:
mode:
Diffstat (limited to 'internal/ruby_parser.h')
-rw-r--r--internal/ruby_parser.h52
1 files changed, 43 insertions, 9 deletions
diff --git a/internal/ruby_parser.h b/internal/ruby_parser.h
index 97ac49dd3b..8e306d18de 100644
--- a/internal/ruby_parser.h
+++ b/internal/ruby_parser.h
@@ -1,31 +1,61 @@
#ifndef INTERNAL_RUBY_PARSE_H
#define INTERNAL_RUBY_PARSE_H
-#include "rubyparser.h"
#include "internal.h"
+#include "internal/bignum.h"
+#include "internal/compilers.h"
+#include "internal/complex.h"
+#include "internal/parse.h"
+#include "internal/rational.h"
+#include "rubyparser.h"
#include "vm.h"
+struct lex_pointer_string {
+ VALUE str;
+ long ptr;
+};
+
RUBY_SYMBOL_EXPORT_BEGIN
#ifdef UNIVERSAL_PARSER
-void rb_parser_config_initialize(rb_parser_config_t *config);
+const rb_parser_config_t *rb_ruby_parser_config(void);
+rb_parser_t *rb_parser_params_new(void);
#endif
VALUE rb_parser_set_context(VALUE, const struct rb_iseq_struct *, int);
+VALUE rb_parser_new(void);
+VALUE rb_parser_compile_string_path(VALUE vparser, VALUE fname, VALUE src, int line);
+VALUE rb_str_new_parser_string(rb_parser_string_t *str);
+VALUE rb_str_new_mutable_parser_string(rb_parser_string_t *str);
+rb_parser_string_t *rb_parser_lex_get_str(struct parser_params *p, struct lex_pointer_string *ptr_str);
+
+VALUE rb_node_str_string_val(const NODE *);
+VALUE rb_node_sym_string_val(const NODE *);
+VALUE rb_node_dstr_string_val(const NODE *);
+VALUE rb_node_regx_string_val(const NODE *);
+VALUE rb_node_dregx_string_val(const NODE *);
+VALUE rb_node_line_lineno_val(const NODE *);
+VALUE rb_node_file_path_val(const NODE *);
+VALUE rb_node_encoding_val(const NODE *);
+
+VALUE rb_node_integer_literal_val(const NODE *);
+VALUE rb_node_float_literal_val(const NODE *);
+VALUE rb_node_rational_literal_val(const NODE *);
+VALUE rb_node_imaginary_literal_val(const NODE *);
RUBY_SYMBOL_EXPORT_END
-VALUE rb_parser_new(void);
VALUE rb_parser_end_seen_p(VALUE);
VALUE rb_parser_encoding(VALUE);
VALUE rb_parser_set_yydebug(VALUE, VALUE);
+VALUE rb_parser_build_script_lines_from(rb_parser_ary_t *script_lines);
void rb_parser_set_options(VALUE, int, int, int, int);
-void *rb_parser_load_file(VALUE parser, VALUE name);
-void rb_parser_keep_script_lines(VALUE vparser);
+VALUE rb_parser_load_file(VALUE parser, VALUE name);
+void rb_parser_set_script_lines(VALUE vparser);
void rb_parser_error_tolerant(VALUE vparser);
void rb_parser_keep_tokens(VALUE vparser);
-rb_ast_t *rb_parser_compile_string(VALUE, const char*, VALUE, int);
-rb_ast_t *rb_parser_compile_string_path(VALUE vparser, VALUE fname, VALUE src, int line);
-rb_ast_t *rb_parser_compile_file_path(VALUE vparser, VALUE fname, VALUE input, int line);
-rb_ast_t *rb_parser_compile_generic(VALUE vparser, VALUE (*lex_gets)(VALUE, int), VALUE fname, VALUE input, int line);
+VALUE rb_parser_compile_string(VALUE, const char*, VALUE, int);
+VALUE rb_parser_compile_file_path(VALUE vparser, VALUE fname, VALUE input, int line);
+VALUE rb_parser_compile_generic(VALUE vparser, rb_parser_lex_gets_func *lex_gets, VALUE fname, VALUE input, int line);
+VALUE rb_parser_compile_array(VALUE vparser, VALUE fname, VALUE array, int start);
enum lex_state_bits {
EXPR_BEG_bit, /* ignore newline, +/- is a sign. */
@@ -65,4 +95,8 @@ enum lex_state_e {
EXPR_END_ANY = (EXPR_END | EXPR_ENDARG | EXPR_ENDFN),
EXPR_NONE = 0
};
+
+VALUE rb_ruby_ast_new(const NODE *const root);
+rb_ast_t *rb_ruby_ast_data_get(VALUE ast_value);
+
#endif /* INTERNAL_RUBY_PARSE_H */