/* generated by Id 1.1 at ,$ */ /* with the command: -I../stage1/ -I../st80 -c IntegerNode.st -o ../stage2/IntegerNode.o.c */ #include static struct __libid *_libid= 0; #ifdef ID_DEBUG # define _enter(info) void *__id_debug= _libid->enter(info) # define _line(lno) _libid->line(lno) # define _leave() _libid->leave(__id_debug) # define _backtrace() _libid->backtrace() #else # define _enter(info) (void)info # define _line(lno) # define _leave() # define _backtrace() "(no debugging information)\n" #endif #define _return _leave(); return #define _sendv(MSG, N, RCV, ARG...) ({ \ struct __send _s= { (MSG), (N), (RCV) }; \ ((_imp_t)(_libid->bindv(&_s)))(&_s, _s.receiver, _s.receiver, ##ARG); \ }) #define _superv(TYP, MSG, N, RCV, ARG...) ({ \ struct __send _s= { (MSG), (N), (TYP) }; \ _imp_t _imp= _libid->bindv(&_s); \ _s.receiver= (RCV); \ _imp(&_s, _s.receiver, _s.receiver, ##ARG); \ }) static oop s_value_5f_= 0; static oop s_negative= 0; static oop s__5fimport_= 0; static oop s_print= 0; static oop s_skip_= 0; static oop s_println_= 0; static oop s_push= 0; static oop s__5fslots= 0; static oop s_withValue_position_= 0; static oop s_readFrom_base_= 0; static oop s_ifTrue_ifFalse_= 0; static oop s_readStream= 0; static oop s_fromString_position_= 0; static oop s__5fdebugName= 0; static oop s_beginsWith_= 0; static oop s_size_5f_value_5f_= 0; static oop s_requireType_at_= 0; static oop s_isSmallInteger= 0; static oop s_encodeLiteral_= 0; static oop s_loadLiteral_to_= 0; static oop s_genInitialisation_= 0; static oop s_initialiseInteger_constructor_with_= 0; static oop s_initialiseLargeInteger_constructor_with_= 0; static oop s_printIndent_= 0; static oop s_encode_= 0; static oop s_generate_= 0; static oop s__5fsizeof= 0; static oop s_println= 0; static struct _Selector { const char *name; oop *addr; } _Selectors[]= { { "value_:", &s_value_5f_ }, { "negative", &s_negative }, { "_import:", &s__5fimport_ }, { "print", &s_print }, { "skip:", &s_skip_ }, { "println:", &s_println_ }, { "push", &s_push }, { "_slots", &s__5fslots }, { "withValue:position:", &s_withValue_position_ }, { "readFrom:base:", &s_readFrom_base_ }, { "ifTrue:ifFalse:", &s_ifTrue_ifFalse_ }, { "readStream", &s_readStream }, { "fromString:position:", &s_fromString_position_ }, { "_debugName", &s__5fdebugName }, { "beginsWith:", &s_beginsWith_ }, { "size_:value_:", &s_size_5f_value_5f_ }, { "requireType:at:", &s_requireType_at_ }, { "isSmallInteger", &s_isSmallInteger }, { "encodeLiteral:", &s_encodeLiteral_ }, { "loadLiteral:to:", &s_loadLiteral_to_ }, { "genInitialisation:", &s_genInitialisation_ }, { "initialiseInteger:constructor:with:", &s_initialiseInteger_constructor_with_ }, { "initialiseLargeInteger:constructor:with:", &s_initialiseLargeInteger_constructor_with_ }, { "printIndent:", &s_printIndent_ }, { "encode:", &s_encode_ }, { "generate:", &s_generate_ }, { "_sizeof", &s__5fsizeof }, { "println", &s_println }, { 0, 0 } }; struct t__object { struct _vtable *_vtable[0]; }; struct t__selector { struct _vtable *_vtable[0]; oop v__size; oop v__elements; }; struct t__assoc { struct _vtable *_vtable[0]; oop v_key; oop v_value; }; struct t__closure { struct _vtable *_vtable[0]; oop v__method; oop v_data; }; struct t__vector { struct _vtable *_vtable[0]; oop v__size; }; struct t__vtable { struct _vtable *_vtable[0]; oop v__tally; oop v_bindings; oop v_delegate; }; struct t_Object { struct _vtable *_vtable[0]; }; struct t_UndefinedObject { struct _vtable *_vtable[0]; }; struct t_StaticBlockClosure { struct _vtable *_vtable[0]; oop v__function; oop v__arity; }; struct t_BlockClosure { struct _vtable *_vtable[0]; oop v__function; oop v__arity; oop v_outer; oop v_state; oop v__nlr; }; struct t_Magnitude { struct _vtable *_vtable[0]; }; struct t_Character { struct _vtable *_vtable[0]; oop v_value; }; struct t_Number { struct _vtable *_vtable[0]; }; struct t_Fraction { struct _vtable *_vtable[0]; oop v_numerator; oop v_denominator; }; struct t_Float { struct _vtable *_vtable[0]; }; struct t_Integer { struct _vtable *_vtable[0]; }; struct t_SmallInteger { struct _vtable *_vtable[0]; }; struct t_LargePositiveInteger { struct _vtable *_vtable[0]; oop v_bytes; }; struct t_LargeNegativeInteger { struct _vtable *_vtable[0]; oop v_bytes; }; struct t_Collection { struct _vtable *_vtable[0]; }; struct t_SequenceableCollection { struct _vtable *_vtable[0]; }; struct t_ArrayedCollection { struct _vtable *_vtable[0]; oop v_size; }; struct t_Array { struct _vtable *_vtable[0]; oop v_size; oop v__pointers; }; struct t_ImmutableArray { struct _vtable *_vtable[0]; oop v_size; oop v__pointers; }; struct t_WordArray { struct _vtable *_vtable[0]; oop v_size; oop v__words; }; struct t_ImmutableWordArray { struct _vtable *_vtable[0]; oop v_size; oop v__words; }; struct t_ByteArray { struct _vtable *_vtable[0]; oop v_size; oop v__bytes; }; struct t_ImmutableByteArray { struct _vtable *_vtable[0]; oop v_size; oop v__bytes; }; struct t_String { struct _vtable *_vtable[0]; oop v_size; oop v__bytes; }; struct t_ImmutableString { struct _vtable *_vtable[0]; oop v_size; oop v__bytes; }; struct t_Symbol { struct _vtable *_vtable[0]; oop v_size; oop v__bytes; }; struct t_nil { struct _vtable *_vtable[0]; }; struct t_true { struct _vtable *_vtable[0]; }; struct t_false { struct _vtable *_vtable[0]; }; struct t_CharacterTable { struct _vtable *_vtable[0]; oop v_size; oop v__pointers; }; struct t_ParseNode { struct _vtable *_vtable[0]; oop v_position; oop v_location; }; struct t_LiteralNode { struct _vtable *_vtable[0]; oop v_position; oop v_location; oop v_value; oop v_tag; oop v_constructor; }; struct t_IntegerNode { struct _vtable *_vtable[0]; oop v_position; oop v_location; oop v_value; oop v_tag; oop v_constructor; }; static oop l_2= 0; static oop l_3= 0; static oop l_4= 0; static oop l_5= 0; static oop l_7= 0; static oop l_8= 0; static oop l_9= 0; static oop l_13= 0; static oop l_14= 0; static oop v__object= 0; static oop v_Object= 0; static oop v_UndefinedObject= 0; static oop v_StaticBlockClosure= 0; static oop v_Magnitude= 0; static oop v_Number= 0; static oop v_Integer= 0; static oop v_SmallInteger= 0; static oop v_LargePositiveInteger= 0; static oop v_Collection= 0; static oop v_SequenceableCollection= 0; static oop v_ArrayedCollection= 0; static oop v_Array= 0; static oop v_WordArray= 0; static oop v_ByteArray= 0; static oop v_String= 0; static oop v_ImmutableString= 0; static oop v_ParseNode= 0; static oop v_LiteralNode= 0; static oop v_IntegerNode= 0; static size_t IntegerNode___5fsizeof(oop _closure, oop v_self) { return sizeof(struct t_IntegerNode); } static char *IntegerNode___5fdebugName(oop _closure, oop v_self) { return "IntegerNode"; } static struct __slotinfo *IntegerNode___5fslots(oop _closure, oop v_self) { static struct __slotinfo info[]= { { "position", 0, 4 }, { "location", 4, 4 }, { "value", 8, 4 }, { "tag", 12, 4 }, { "constructor", 16, 4 }, { 0, 0, 0 } }; return &info[0]; } static struct __methodinfo __info1= { "fromString:position:", "IntegerNode", "/Users/piumarta/src/idst/object/idc/IntegerNode.st", 0, 24, 36, 0 }; static oop IntegerNode__fromString_position_(oop v__closure, oop v_stateful_self, oop v_self, oop v_aString, oop v_aPosition) { _enter(&__info1); oop v_base= 0; oop v_aStream= 0; oop _1= 0; oop _2= 0; oop _3= 0; oop _4= 0; (void)v_base; (void)v_aStream; _line(24); _1= v_aString; _line(27); _1=_sendv(s_readStream, 1, _1); v_aStream= _1; /* ifTrue:ifFalse: */ _1= v_aString; _2= l_2; _line(29); _1=_sendv(s_beginsWith_, 2, _1, _2); if (!_1) goto _l1; { _1= l_3; v_base= _1; _1= v_aStream; _2= l_4; _line(31); _1=_sendv(s_skip_, 2, _1, _2); } goto _l2; _l1:; { _1= l_5; v_base= _1; } _l2:; _1= v_self; _2= v_Integer; _3= v_aStream; _4= v_base; _line(33); _2=_sendv(s_readFrom_base_, 3, _2, _3, _4); _3= v_aPosition; _line(33); _1=_sendv(s_withValue_position_, 3, _1, _2, _3); _leave(); return _1; _leave(); } static struct __methodinfo __info6= { "encode:", "IntegerNode", "/Users/piumarta/src/idst/object/idc/IntegerNode.st", 0, 36, 47, &__info1 }; static oop IntegerNode__encode_(oop v__closure, oop v_stateful_self, oop v_self, oop v_encoder) { _enter(&__info6); oop _1= 0; oop _2= 0; oop _3= 0; _line(36); _1= v_encoder; /* ifTrue:ifFalse: */ _2= ((struct t_IntegerNode *)v_stateful_self)->v_value; _line(39); _2=_sendv(s_isSmallInteger, 1, _2); if (!_2) goto _l3; { _2= l_7; } goto _l4; _l3:; { /* ifTrue:ifFalse: */ _2= ((struct t_IntegerNode *)v_stateful_self)->v_value; _line(41); _2=_sendv(s_negative, 1, _2); if (!_2) goto _l5; { _2= l_8; } goto _l6; _l5:; { _2= l_9; } _l6:; } _l4:; _3= ((struct t_IntegerNode *)v_stateful_self)->v_position; _line(39); _1=_sendv(s_requireType_at_, 3, _1, _2, _3); ((struct t_IntegerNode *)v_stateful_self)->v_constructor= _1; _1= v_encoder; _2= v_self; _line(43); _1=_sendv(s_encodeLiteral_, 2, _1, _2); ((struct t_IntegerNode *)v_stateful_self)->v_tag= _1; _1= v_encoder; _line(44); _1=_sendv(s_push, 1, _1); ((struct t_IntegerNode *)v_stateful_self)->v_location= _1; _1= v_self; _leave(); return _1; _leave(); } static struct __methodinfo __info10= { "generate:", "IntegerNode", "/Users/piumarta/src/idst/object/idc/IntegerNode.st", 0, 47, 49, &__info6 }; static oop IntegerNode__generate_(oop v__closure, oop v_stateful_self, oop v_self, oop v_gen) { _enter(&__info10); oop _1= 0; oop _2= 0; oop _3= 0; _line(47); _1= v_gen; _2= ((struct t_IntegerNode *)v_stateful_self)->v_tag; _3= ((struct t_IntegerNode *)v_stateful_self)->v_location; _line(47); _1=_sendv(s_loadLiteral_to_, 3, _1, _2, _3); _1= v_self; _leave(); return _1; _leave(); } static struct __methodinfo __info11= { "genInitialisation:", "IntegerNode", "/Users/piumarta/src/idst/object/idc/IntegerNode.st", 0, 49, 56, &__info10 }; static oop IntegerNode__genInitialisation_(oop v__closure, oop v_stateful_self, oop v_self, oop v_gen) { _enter(&__info11); oop _1= 0; oop _2= 0; oop _3= 0; oop _4= 0; _line(49); /* ifTrue:ifFalse: */ _1= ((struct t_IntegerNode *)v_stateful_self)->v_value; _line(51); _1=_sendv(s_isSmallInteger, 1, _1); if (!_1) goto _l7; { _1= v_gen; _2= ((struct t_IntegerNode *)v_stateful_self)->v_tag; _3= ((struct t_IntegerNode *)v_stateful_self)->v_constructor; _4= ((struct t_IntegerNode *)v_stateful_self)->v_value; _line(52); _1=_sendv(s_initialiseInteger_constructor_with_, 4, _1, _2, _3, _4); } goto _l8; _l7:; { _1= v_gen; _2= ((struct t_IntegerNode *)v_stateful_self)->v_tag; _3= ((struct t_IntegerNode *)v_stateful_self)->v_constructor; _4= ((struct t_IntegerNode *)v_stateful_self)->v_value; _line(53); _1=_sendv(s_initialiseLargeInteger_constructor_with_, 4, _1, _2, _3, _4); } _l8:; _1= v_self; _leave(); return _1; _leave(); } static struct __methodinfo __info12= { "println:", "IntegerNode", "/Users/piumarta/src/idst/object/idc/IntegerNode.st", 0, 56, 61, &__info11 }; static oop IntegerNode__println_(oop v__closure, oop v_stateful_self, oop v_self, oop v_indent) { _enter(&__info12); oop _1= 0; oop _2= 0; _line(56); _1= v_self; _2= v_indent; _line(58); _1=_sendv(s_printIndent_, 2, _1, _2); _1= l_13; _line(59); _1=_sendv(s_print, 1, _1); _1= ((struct t_IntegerNode *)v_stateful_self)->v_value; _line(59); _1=_sendv(s_print, 1, _1); _1= l_14; _line(59); _1=_sendv(s_println, 1, _1); _1= v_self; _leave(); return _1; _leave(); } static struct __methodinfo __info= { "__id__init__", "", "IntegerNode.st", 0, 0, 0, &__info12 }; void __id__init__IntegerNode(struct __libid *__libid) { if (_libid) return; if (!(_libid= __libid)) { fprintf(stderr, "init _libid %p\n", __libid); abort(); } # define GC_add_roots _libid->gc_addRoots GC_INIT(); { struct _Selector *s= 0; for (s= _Selectors; s->name; ++s) *s->addr= _libid->intern(s->name); } _enter(&__info); _libid->infos(&__info, &__info1); _sendv(s__5fimport_, 3, _libid->_object, "LiteralNode", "__id__init__LiteralNode"); v__object= _libid->import("_object"); v_Object= _libid->import("Object"); v_UndefinedObject= _libid->import("UndefinedObject"); v_StaticBlockClosure= _libid->import("StaticBlockClosure"); v_Magnitude= _libid->import("Magnitude"); v_Number= _libid->import("Number"); v_Integer= _libid->import("Integer"); v_SmallInteger= _libid->import("SmallInteger"); v_LargePositiveInteger= _libid->import("LargePositiveInteger"); v_Collection= _libid->import("Collection"); v_SequenceableCollection= _libid->import("SequenceableCollection"); v_ArrayedCollection= _libid->import("ArrayedCollection"); v_Array= _libid->import("Array"); v_WordArray= _libid->import("WordArray"); v_ByteArray= _libid->import("ByteArray"); v_String= _libid->import("String"); v_ImmutableString= _libid->import("ImmutableString"); v_ParseNode= _libid->import("ParseNode"); v_LiteralNode= _libid->import("LiteralNode"); v_IntegerNode= _libid->proto2(v_LiteralNode, IntegerNode___5fsizeof(0, 0)); _libid->method(v_IntegerNode, s__5fsizeof, (_imp_t)IntegerNode___5fsizeof); _libid->method(v_IntegerNode, s__5fdebugName, (_imp_t)IntegerNode___5fdebugName); _libid->method(v_IntegerNode, s__5fslots, (_imp_t)IntegerNode___5fslots); _libid->export("IntegerNode", v_IntegerNode); l_2= _sendv(s_size_5f_value_5f_, 3, v_ImmutableString, 2, "0x"); l_3= _sendv(s_value_5f_, 2, v_SmallInteger, 16); l_4= _sendv(s_value_5f_, 2, v_SmallInteger, 2); l_5= _sendv(s_value_5f_, 2, v_SmallInteger, 10); _libid->method(v_IntegerNode, s_fromString_position_, (_imp_t)IntegerNode__fromString_position_); l_7= _sendv(s_size_5f_value_5f_, 3, v_ImmutableString, 7, "integer"); l_8= _sendv(s_size_5f_value_5f_, 3, v_ImmutableString, 20, "largeNegativeInteger"); l_9= _sendv(s_size_5f_value_5f_, 3, v_ImmutableString, 20, "largePositiveInteger"); _libid->method(v_IntegerNode, s_encode_, (_imp_t)IntegerNode__encode_); _libid->method(v_IntegerNode, s_generate_, (_imp_t)IntegerNode__generate_); _libid->method(v_IntegerNode, s_genInitialisation_, (_imp_t)IntegerNode__genInitialisation_); l_13= _sendv(s_size_5f_value_5f_, 3, v_ImmutableString, 8, "Integer("); l_14= _sendv(s_size_5f_value_5f_, 3, v_ImmutableString, 1, ")"); _libid->method(v_IntegerNode, s_println_, (_imp_t)IntegerNode__println_); _leave(); }