1 #include "syntax._sep.h"
2 val_t
syntax___SrcModuleLoader___file_type(val_t self
) {
3 struct trace_t trace
= {NULL
, "syntax::SrcModuleLoader::file_type (src/syntax//syntax.nit:31,2--37)"};
5 trace
.prev
= tracehead
; tracehead
= &trace
;
6 variable0
= NEW_string___String___with_native(BOX_NativeString("nit"), TAG_Int(3)); /*new String*/
8 return_label0
: while(false);
9 tracehead
= trace
.prev
;
12 val_t
syntax___SrcModuleLoader___parse_file(val_t self
, val_t param0
, val_t param1
, val_t param2
, val_t param3
, val_t param4
) {
13 struct trace_t trace
= {NULL
, "syntax::SrcModuleLoader::parse_file (src/syntax//syntax.nit:33,2--49:15)"};
34 trace
.prev
= tracehead
; tracehead
= &trace
;
40 variable6
= NEW_lexer___Lexer___init( variable1
/*file*/, variable2
/*filename*/); /*new Lexer*/
41 variable5
= variable6
;
42 variable7
= NEW_parser___Parser___init( variable5
/*lexer*/); /*new Parser*/
43 variable6
= variable7
;
44 variable8
= ((parser___Parser___parse_t
)CALL( variable6
/*parser*/,COLOR_parser___Parser___parse
))( variable6
/*parser*/) /*Parser::parse*/;
45 variable7
= variable8
;
46 variable8
= ((parser_nodes___Start___n_base_t
)CALL( variable7
/*node_tree*/,COLOR_parser_nodes___Start___n_base
))( variable7
/*node_tree*/) /*Start::n_base*/;
47 variable8
= TAG_Bool((variable8
== NIT_NULL
/*null*/) || ((variable8
!= NIT_NULL
) && ((((kernel___Object_____eqeq_t
)CALL(variable8
,COLOR_kernel___Object_____eqeq
))==kernel___Object_____eqeq
)?
(IS_EQUAL_NN(variable8
, NIT_NULL
/*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t
)CALL(variable8
,COLOR_kernel___Object_____eqeq
))(variable8
, NIT_NULL
/*null*/) /*PModule::==*/)))));
48 if (UNTAG_Bool(variable8
)) { /*if*/
49 variable9
= ((parser_nodes___Start___n_eof_t
)CALL( variable7
/*node_tree*/,COLOR_parser_nodes___Start___n_eof
))( variable7
/*node_tree*/) /*Start::n_eof*/;
50 variable8
= variable9
;
51 variable9
= TAG_Bool(( variable8
/*err*/==NIT_NULL
) || VAL_ISA( variable8
/*err*/, COLOR_PError
, ID_PError
)) /*cast PError*/;
52 if (!UNTAG_Bool(variable9
)) { fprintf(stderr
, "Assert failed: src/syntax//syntax.nit:40,4--24\n"); nit_exit(1);}
53 variable9
= NEW_string___String___init(); /*new String*/
54 variable10
= NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
55 variable11
= variable10
;
56 ((string___String___append_t
)CALL(variable9
,COLOR_abstract_collection___IndexedCollection___append
))(variable9
, variable11
) /*String::append*/;
57 variable12
= ((parser_prod___Token___locate_t
)CALL( variable8
/*err*/,COLOR_parser_prod___PNode___locate
))( variable8
/*err*/) /*PError::locate*/;
58 variable13
= variable12
;
59 ((string___String___append_t
)CALL(variable9
,COLOR_abstract_collection___IndexedCollection___append
))(variable9
, variable13
) /*String::append*/;
60 variable14
= NEW_string___String___with_native(BOX_NativeString(": "), TAG_Int(2)); /*new String*/
61 variable15
= variable14
;
62 ((string___String___append_t
)CALL(variable9
,COLOR_abstract_collection___IndexedCollection___append
))(variable9
, variable15
) /*String::append*/;
63 variable16
= ((lexer___PError___message_t
)CALL( variable8
/*err*/,COLOR_lexer___PError___message
))( variable8
/*err*/) /*PError::message*/;
64 variable17
= variable16
;
65 ((string___String___append_t
)CALL(variable9
,COLOR_abstract_collection___IndexedCollection___append
))(variable9
, variable17
) /*String::append*/;
66 variable18
= NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
67 variable19
= variable18
;
68 ((string___String___append_t
)CALL(variable9
,COLOR_abstract_collection___IndexedCollection___append
))(variable9
, variable19
) /*String::append*/;
69 ((mmloader___ToolContext___error_t
)CALL( variable0
/*context*/,COLOR_mmloader___ToolContext___error
))( variable0
/*context*/, variable9
) /*ToolContext::error*/;
70 exit(UNTAG_Int( TAG_Int(1)));
72 variable9
= ((parser_nodes___Start___n_base_t
)CALL( variable7
/*node_tree*/,COLOR_parser_nodes___Start___n_base
))( variable7
/*node_tree*/) /*Start::n_base*/;
73 variable8
= variable9
;
74 variable9
= TAG_Bool(( variable8
/*node_module*/==NIT_NULL
) || VAL_ISA( variable8
/*node_module*/, COLOR_AModule
, ID_AModule
)) /*cast AModule*/;
75 if (!UNTAG_Bool(variable9
)) { fprintf(stderr
, "Assert failed: src/syntax//syntax.nit:45,3--32\n"); nit_exit(1);}
76 variable10
= NEW_syntax_base___MMSrcModule___init( variable0
/*context*/, variable8
/*node_module*/, variable4
/*dir*/, variable3
/*name*/); /*new MMSrcModule*/
77 variable9
= variable10
;
78 variable5
= variable9
/*module*/;
80 return_label1
: while(false);
81 tracehead
= trace
.prev
;
84 void syntax___SrcModuleLoader___process_metamodel(val_t self
, val_t param0
, val_t param1
) {
85 struct trace_t trace
= {NULL
, "syntax::SrcModuleLoader::process_metamodel (src/syntax//syntax.nit:52,2--55:31)"};
88 trace
.prev
= tracehead
; tracehead
= &trace
;
91 ((syntax___MMSrcModule___process_supermodules_t
)CALL( variable1
/*module*/,COLOR_syntax___MMSrcModule___process_supermodules
))( variable1
/*module*/, variable0
/*context*/) /*MMSrcModule::process_supermodules*/;
92 ((syntax___MMSrcModule___process_syntax_t
)CALL( variable1
/*module*/,COLOR_syntax___MMSrcModule___process_syntax
))( variable1
/*module*/, variable0
/*context*/) /*MMSrcModule::process_syntax*/;
93 tracehead
= trace
.prev
;
96 void syntax___SrcModuleLoader___init(val_t self
, int* init_table
) {
97 struct trace_t trace
= {NULL
, "syntax::SrcModuleLoader::init (src/syntax//syntax.nit:58,2--5)"};
98 trace
.prev
= tracehead
; tracehead
= &trace
;
99 if (init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_SrcModuleLoader
].i
]) return;
100 init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_SrcModuleLoader
].i
] = 1;
101 tracehead
= trace
.prev
;
104 val_t
syntax___MMContext___tc(val_t self
) {
105 struct trace_t trace
= {NULL
, "syntax::MMContext::tc (src/syntax//syntax.nit:62,2--63:47)"};
106 trace
.prev
= tracehead
; tracehead
= &trace
;
107 tracehead
= trace
.prev
;
108 return ATTR_syntax___MMContext____tc( self
) /*MMContext::_tc*/;
110 void syntax___MMContext___tc__eq(val_t self
, val_t param0
) {
111 struct trace_t trace
= {NULL
, "syntax::MMContext::tc= (src/syntax//syntax.nit:62,2--63:47)"};
112 trace
.prev
= tracehead
; tracehead
= &trace
;
113 ATTR_syntax___MMContext____tc( self
) /*MMContext::_tc*/ = param0
;
114 tracehead
= trace
.prev
;
117 void syntax___MMSrcModule___process_supermodules(val_t self
, val_t param0
) {
118 struct trace_t trace
= {NULL
, "syntax::MMSrcModule::process_supermodules (src/syntax//syntax.nit:67,2--70:36)"};
121 trace
.prev
= tracehead
; tracehead
= &trace
;
123 variable1
= ((syntax_base___MMSrcModule___node_t
)CALL( self
,COLOR_syntax_base___MMSrcModule___node
))( self
) /*MMSrcModule::node*/;
124 ((mmbuilder___AModule___import_super_modules_t
)CALL(variable1
,COLOR_mmbuilder___AModule___import_super_modules
))(variable1
, variable0
/*tc*/, self
) /*AModule::import_super_modules*/;
125 tracehead
= trace
.prev
;
128 void syntax___MMSrcModule___process_syntax(val_t self
, val_t param0
) {
129 struct trace_t trace
= {NULL
, "syntax::MMSrcModule::process_syntax (src/syntax//syntax.nit:74,2--85:35)"};
132 trace
.prev
= tracehead
; tracehead
= &trace
;
134 ((mmbuilder___MMSrcModule___do_mmbuilder_t
)CALL( self
,COLOR_mmbuilder___MMSrcModule___do_mmbuilder
))( self
, variable0
/*tc*/) /*MMSrcModule::do_mmbuilder*/;
135 variable1
= ((mmloader___ToolContext___error_count_t
)CALL( variable0
/*tc*/,COLOR_mmloader___ToolContext___error_count
))( variable0
/*tc*/) /*ToolContext::error_count*/;
136 variable1
= TAG_Bool(UNTAG_Int(variable1
)>UNTAG_Int( TAG_Int(0)));
137 if (UNTAG_Bool(variable1
)) { /*if*/
138 exit(UNTAG_Int( TAG_Int(1)));
140 ((control_flow___MMSrcModule___do_control_flow_t
)CALL( self
,COLOR_control_flow___MMSrcModule___do_control_flow
))( self
, variable0
/*tc*/) /*MMSrcModule::do_control_flow*/;
141 variable1
= ((mmloader___ToolContext___error_count_t
)CALL( variable0
/*tc*/,COLOR_mmloader___ToolContext___error_count
))( variable0
/*tc*/) /*ToolContext::error_count*/;
142 variable1
= TAG_Bool(UNTAG_Int(variable1
)>UNTAG_Int( TAG_Int(0)));
143 if (UNTAG_Bool(variable1
)) { /*if*/
144 exit(UNTAG_Int( TAG_Int(1)));
146 ((typing___MMSrcModule___do_typing_t
)CALL( self
,COLOR_typing___MMSrcModule___do_typing
))( self
, variable0
/*tc*/) /*MMSrcModule::do_typing*/;
147 variable1
= ((mmloader___ToolContext___error_count_t
)CALL( variable0
/*tc*/,COLOR_mmloader___ToolContext___error_count
))( variable0
/*tc*/) /*ToolContext::error_count*/;
148 variable1
= TAG_Bool(UNTAG_Int(variable1
)>UNTAG_Int( TAG_Int(0)));
149 if (UNTAG_Bool(variable1
)) { /*if*/
150 exit(UNTAG_Int( TAG_Int(1)));
152 tracehead
= trace
.prev
;