Beispiel #1
0
void open_placeholder(lua_State * L) {
    SET_GLOBAL_FUN(mk_level_placeholder, "mk_level_placeholder");
    SET_GLOBAL_FUN(mk_expr_placeholder,  "mk_expr_placeholder");
    SET_GLOBAL_FUN(is_placeholder,       "is_placeholder");
    SET_GLOBAL_FUN(placeholder_type,     "placeholder_type");
    SET_GLOBAL_FUN(has_placeholder,      "has_placeholder");
}
Beispiel #2
0
void open_rb_map(lua_State * L) {
    luaL_newmetatable(L, lua_rb_map_mt);
    lua_pushvalue(L, -1);
    lua_setfield(L, -2, "__index");
    setfuncs(L, lua_rb_map_m, 0);

    SET_GLOBAL_FUN(mk_lua_rb_map,          "rb_map");
    SET_GLOBAL_FUN(lua_rb_map_pred,        "is_rb_map");
}
Beispiel #3
0
void open_name_set(lua_State * L) {
    luaL_newmetatable(L, name_set_mt);
    lua_pushvalue(L, -1);
    lua_setfield(L, -2, "__index");
    setfuncs(L, name_set_m, 0);

    SET_GLOBAL_FUN(mk_name_set,   "name_set");
    SET_GLOBAL_FUN(name_set_pred, "is_name_set");
}
Beispiel #4
0
void open_app_builder(lua_State * L) {
    luaL_newmetatable(L, app_builder_ref_mt);
    lua_pushvalue(L, -1);
    lua_setfield(L, -2, "__index");
    setfuncs(L, app_builder_ref_m, 0);

    SET_GLOBAL_FUN(mk_app_builder,       "app_builder");
    SET_GLOBAL_FUN(app_builder_ref_pred, "is_app_builder");
}
Beispiel #5
0
static void open_parse_table(lua_State * L) {
    luaL_newmetatable(L, parse_table_mt);
    lua_pushvalue(L, -1);
    lua_setfield(L, -2, "__index");
    setfuncs(L, parse_table_m, 0);

    SET_GLOBAL_FUN(parse_table_pred,   "is_parse_table");
    SET_GLOBAL_FUN(mk_parse_table,     "parse_table");
}
Beispiel #6
0
void open_mpz(lua_State * L) {
    luaL_newmetatable(L, mpz_mt);
    lua_pushvalue(L, -1);
    lua_setfield(L, -2, "__index");
    setfuncs(L, mpz_m, 0);

    SET_GLOBAL_FUN(mk_mpz,   "mpz");
    SET_GLOBAL_FUN(mpz_pred, "is_mpz");
}
Beispiel #7
0
void open_mpq(lua_State * L) {
    luaL_newmetatable(L, mpq_mt);
    set_migrate_fn_field(L, -1, mpq_migrate);
    lua_pushvalue(L, -1);
    lua_setfield(L, -2, "__index");
    setfuncs(L, mpq_m, 0);

    SET_GLOBAL_FUN(mk_mpq,   "mpq");
    SET_GLOBAL_FUN(mpq_pred, "is_mpq");
}
Beispiel #8
0
void open_token_table(lua_State * L) {
    luaL_newmetatable(L, token_table_mt);
    lua_pushvalue(L, -1);
    lua_setfield(L, -2, "__index");
    setfuncs(L, token_table_m, 0);

    SET_GLOBAL_FUN(token_table_pred,       "is_token_table");
    SET_GLOBAL_FUN(mk_default_token_table, "default_token_table");
    SET_GLOBAL_FUN(mk_token_table,         "token_table");
}
Beispiel #9
0
void open_options(lua_State * L) {
    luaL_newmetatable(L, options_mt);
    lua_pushvalue(L, -1);
    lua_setfield(L, -2, "__index");
    setfuncs(L, options_m, 0);

    SET_GLOBAL_FUN(mk_options,          "options");
    SET_GLOBAL_FUN(options_pred,        "is_options");
    SET_GLOBAL_FUN(_get_global_options, "get_options");
    SET_GLOBAL_FUN(_set_global_options, "set_options");
    SET_GLOBAL_FUN(_set_global_option,  "set_option");
}
Beispiel #10
0
static void open_notation_action(lua_State * L) {
    luaL_newmetatable(L, notation_action_mt);
    lua_pushvalue(L, -1);
    lua_setfield(L, -2, "__index");
    setfuncs(L, notation_action_m, 0);

    SET_GLOBAL_FUN(notation_action_pred,   "is_notation_action");
    SET_GLOBAL_FUN(mk_skip_action,         "skip_notation_action");
    SET_GLOBAL_FUN(mk_binder_action,       "binder_notation_action");
    SET_GLOBAL_FUN(mk_binders_action,      "binders_notation_action");
    SET_GLOBAL_FUN(mk_expr_action,         "expr_notation_action");
    SET_GLOBAL_FUN(mk_exprs_action,        "exprs_notation_action");
    SET_GLOBAL_FUN(mk_scoped_expr_action,  "scoped_expr_notation_action");
    SET_GLOBAL_FUN(mk_ext_lua_action,      "ext_action");

    push_notation_action(L, mk_skip_action());
    lua_setglobal(L, "Skip");
    push_notation_action(L, mk_binder_action());
    lua_setglobal(L, "Binder");
    push_notation_action(L, mk_binders_action());
    lua_setglobal(L, "Binders");

    lua_newtable(L);
    SET_ENUM("Skip",        action_kind::Skip);
    SET_ENUM("Expr",        action_kind::Expr);
    SET_ENUM("Exprs",       action_kind::Exprs);
    SET_ENUM("Binder",      action_kind::Binder);
    SET_ENUM("Binders",     action_kind::Binders);
    SET_ENUM("ScopedExpr",  action_kind::ScopedExpr);
    SET_ENUM("Ext",         action_kind::Ext);
    SET_ENUM("LuaExt",      action_kind::LuaExt);
    lua_setglobal(L, "notation_action_kind");
}
Beispiel #11
0
static void open_local_scope(lua_State * L) {
    luaL_newmetatable(L, local_scope_mt);
    lua_pushvalue(L, -1);
    lua_setfield(L, -2, "__index");
    setfuncs(L, local_scope_m, 0);

    SET_GLOBAL_FUN(local_scope_pred, "is_local_scope");
}
Beispiel #12
0
void open_exception(lua_State * L) {
    luaL_newmetatable(L, exception_mt);
    set_migrate_fn_field(L, -1, exception_migrate);
    lua_pushvalue(L, -1);
    lua_setfield(L, -2, "__index");
    setfuncs(L, exception_m, 0);

    SET_GLOBAL_FUN(exception_pred, "is_exception");
}
Beispiel #13
0
void open_private(lua_State * L) {
    SET_GLOBAL_FUN(add_private_name,    "add_private_name");
    SET_GLOBAL_FUN(hidden_to_user_name, "hidden_to_user_name");
}
Beispiel #14
0
void open_fo_unify(lua_State * L) {
    SET_GLOBAL_FUN(fo_unify, "fo_unify");
}
Beispiel #15
0
void open_choice(lua_State * L) {
    SET_GLOBAL_FUN(mk_choice,       "mk_choice");
    SET_GLOBAL_FUN(is_choice,       "is_choice");
    SET_GLOBAL_FUN(get_num_choices, "get_num_choices");
    SET_GLOBAL_FUN(get_choice,      "get_choice");
}