Class: Katana::SupportsExpression
- Inherits:
-
Object
- Object
- Katana::SupportsExpression
- Defined in:
- ext/katana/rb_katana_rule.c
Instance Method Summary collapse
Instance Method Details
#declaration ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 |
# File 'ext/katana/rb_katana_rule.c', line 53 VALUE rb_supports_exp_declaration(VALUE self) { KatanaSupportsExp *c_exp; Data_Get_Struct(self, KatanaSupportsExp, c_exp); if (c_exp->decl) { VALUE array = Data_Wrap_Struct(rb_Declaration, NULL, NULL, c_exp->decl); } else return Qnil; } |
#expressions ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'ext/katana/rb_katana_rule.c', line 35 VALUE rb_supports_exp_exps(VALUE self) { KatanaSupportsExp *c_exp; Data_Get_Struct(self, KatanaSupportsExp, c_exp); if (c_exp->exps) { VALUE array = Data_Wrap_Struct(rb_KArray, NULL, NULL, c_exp->exps); VALUE sing = rb_singleton_class(array); rb_define_method(sing, "each", rb_supports_expression_each, 0); return array; } else return Qnil; } |
#operation ⇒ Symbol
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'ext/katana/rb_katana_rule.c', line 8 VALUE rb_supports_exp_op(VALUE self) { ID id; KatanaSupportsExp *c_exp; Data_Get_Struct(self, KatanaSupportsExp, c_exp); switch (c_exp->op) { case KatanaSupportsOperatorNone: id = rb_intern("none"); break; case KatanaSupportsOperatorNot: id = rb_intern("not"); break; case KatanaSupportsOperatorAnd: id = rb_intern("and"); break; case KatanaSupportsOperatorOr: id = rb_intern("or"); break; default: id = rb_intern("unknown"); break; } return ID2SYM(id); } |