Slide 34
Slide 34 text
kanayago_parse
Pass the code to the Universal
Parser and accept the AST
static VALUE
kanayago_parse(VALUE self, VALUE source)
{
struct ruby_parser *parser;
rb_parser_t *parser_params;
// Set Ruby Parser struct...
VALUE vast = rb_parser_compile_string(vparser, "main", source, 0);
rb_ast_t *ast = rb_ruby_ast_data_get(vast);
return ast_to_hash(ast->body.root);
}