class Racc::Parser

Constants

Racc_Runtime_Core_Id_C
Racc_Runtime_Core_Version_C

Private Instance Methods

_racc_do_parse_c(p1, p2) click to toggle source
static VALUE
racc_cparse(VALUE parser, VALUE arg, VALUE sysdebug)
{
    VALUE vparams;
    struct cparse_params *v;

    vparams = TypedData_Make_Struct(CparseParams, struct cparse_params,
                                    &cparse_params_type, v);
    D_puts("starting cparse");
    v->sys_debug = RTEST(sysdebug);
    vparams = initialize_params(vparams, parser, arg, Qnil, Qnil);
    v->lex_is_iterator = FALSE;
    parse_main(v, Qnil, Qnil, 0);

    RB_GC_GUARD(vparams);
    return v->retval;
}
_racc_yyparse_c(p1, p2, p3, p4) click to toggle source
static VALUE
racc_yyparse(VALUE parser, VALUE lexer, VALUE lexmid, VALUE arg, VALUE sysdebug)
{
    VALUE vparams;
    struct cparse_params *v;

    vparams = TypedData_Make_Struct(CparseParams, struct cparse_params,
                                    &cparse_params_type, v);
    v->sys_debug = RTEST(sysdebug);
    D_puts("start C yyparse");
    vparams = initialize_params(vparams, parser, arg, lexer, lexmid);
    v->lex_is_iterator = TRUE;
    D_puts("params initialized");
    parse_main(v, Qnil, Qnil, 0);
    call_lexer(v);
    if (!v->fin) {
        rb_raise(rb_eArgError, "%s() is finished before EndOfToken",
                 rb_id2name(v->lexmid));
    }

    RB_GC_GUARD(vparams);
    return v->retval;
}