-
Notifications
You must be signed in to change notification settings - Fork 5
/
common.h
838 lines (686 loc) · 30.1 KB
/
common.h
1
2
3
4
5
6
7
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
#ifndef __COMMON_H__
#define __COMMON_H__
#include <comelang.h>
#define FUN_VERSION_MAX 128
#define GENERICS_TYPE_MAX 12
#define METHOD_GENERICS_TYPE_MAX 7
#define RIGHT_VALUE_OBJECT_NUM_MAX 1024
#define METHOD_BLOCK_RESULT_KIND_BREAK 1
#define METHOD_BLOCK_RESULT_KIND_CONTINUE 2
#define METHOD_BLOCK_RESULT_KIND_RETURN 3
#define METHOD_BLOCK_RESULT_KIND_RETURN_VOID 4
extern bool gComeDebug;
extern bool gComeGC;
extern bool gComeC;
extern bool gComeStr;
extern bool gComeNet;
extern bool gComeMalloc;
extern bool gCommonHeader;
extern int gComeDebugStackFrameID;
struct sType;
struct sClass;
struct sClass
{
bool mStruct;
bool mFloat;
bool mUnion;
bool mGenerics;
bool mMethodGenerics;
bool mEnum;
bool mProtocol;
bool mNumber;
string mName;
int mGenericsNum;
int mMethodGenericsNum;
list<tuple2<string, sType*%>*%>*% mFields;
bool mOutputed;
bool mOutputed2;
string mDeclareSName;
bool mNobodyStruct;
string mParentClassName;
};
struct sInfo;
interface sNode
{
bool compile(sInfo* info);
int sline();
string sname();
bool terminated();
string kind();
};
struct sNodeBase
{
int sline;
string sname;
};
int sNodeBase*::sline(sNodeBase* self, sInfo* info);
string sNodeBase*::sname(sNodeBase* self, sInfo* info);
struct sType
{
sClass* mClass;
tuple1<sType*%>*% mNoSolvedGenericsType;
tuple1<sType*%>*% mOriginalLoadVarType;
tuple1<sType*%>*% mNoExceptionType;
string mGenericsName;
list<sType*%>*% mGenericsTypes;
list<sNode*%>*% mArrayNum;
bool mOmitArrayNum;
list<sType*%>*% mParamTypes;
list<string>*% mParamNames;
tuple1<sType*%>*% mResultType;
bool mVarArgs;
sNode*% mAlignas;
bool mUnsigned;
bool mShort;
bool mLong;
bool mLongLong;
bool mConstant;
bool mRegister;
bool mVolatile;
bool mStatic;
bool mUniq;
bool mRecord;
bool mExtern;
bool mRestrict;
bool mImmutable;
bool mHeap;
bool mDummyHeap;
bool mDelegate;
bool mShare;
bool mClone;
bool mNoHeap;
bool mNoCallingDestructor;
bool mRefference;
bool mException;
int mPointerNum;
int mOriginalTypeNamePointerNum;
int mOriginalTypeNameHeap;
int mNoArrayPointerNum;
int mTypedefOriginalPointerNum;
sNode*% mSizeNum;
int mFunctionPointerNum;
unsigned int mDynamicArrayNum;
unsigned int mTypeOfExpression;
string mOriginalTypeName;
int mOriginalPointerNum;
bool mFunctionParam;
bool mAllocaValue;
bool mGenericsStruct;
bool mSolvedGenericsName;
bool mComeMemCore;
bool mInline;
bool mNullValue;
bool mGuardValue;
string mAsmName;
bool mArrayPointerType;
bool mLambdaArray;
bool mNoNumberArray;
bool mTypedef;
bool mMultipleTypes;
bool mOriginIsArray;
};
struct sVar;
struct sRightValueObject;
struct CVALUE
{
string c_value;
sType*% type;
sVar* var;
sRightValueObject* right_value_objects;
string c_value_without_right_value_objects;
};
CVALUE*% CVALUE*::initialize(CVALUE*% self);
struct sVar
{
string mName;
string mCValueName;
sType*% mType;
int mBlockLevel;
bool mGlobal;
bool mAllocaValue;
bool mFunctionParam;
bool mNoFree;
string mFunName;
};
struct sVarTable;
struct sBlock;
struct sFun
{
string mName;
sType*% mResultType;
list<sType*%>*% mParamTypes;
list<string>*% mParamNames;
list<string>*% mParamDefaultParametors;
sType*% mLambdaType;
sBlock*% mBlock;
bool mExternal;
bool mVarArgs;
buffer*% mSource;
buffer*% mSourceHead;
buffer*% mSourceHead2;
buffer*% mSourceDefer;
bool mStatic;
string mComeHeader;
bool mCloner;
string mDeclareSName;
bool mNoResultType;
bool mDeclaredResultObject;
};
struct sGenericsFun
{
sType*% mImplType;
list<string>*% mGenericsTypeNames;
list<string>*% mMethodGenericsTypeNames;
string mName;
sType*% mResultType;
list<sType*%>*% mParamTypes;
list<string>*% mParamNames;
list<string>*% mParamDefaultParametors;
string mBlock;
int mSLine;
bool mVarArgs;
string mGenericsSName;
int mGenericsSLine;
};
struct sModule
{
buffer*% mSourceHead;
buffer*% mSourceHead2;
buffer*% mSourceHead3;
buffer*% mSource;
string mLastCode;
string mLastCode2;
string mLastCode3;
buffer*% mHeader;
};
struct sVarTable;
struct sVarTable
{
map<string, sVar*%>*% mVars;
bool mGlobal;
struct sVarTable* mParent;
int mID;
};
struct sBlock
{
list<sNode*%>*% mNodes;
sVarTable*% mVarTable;
bool mOmitSemicolon;
};
struct sRightValueObject
{
sType*% mType;
string mVarName;
string mFunName;
bool mFreed;
int mID;
int mBlockLevel;
bool mStored;
bool mDecrementRefCount;
};
struct sClassModule
{
string mName;
string mText;
list<string>*% mParams;
string mSName;
int mSLine;
};
struct sInfo
{
char* p;
char* head;
buffer*% original_source;
buffer*% source;
string sname;
string base_sname;
int sline;
int err_num;
string err_line;
string clang_option;
string cpp_option;
bool no_output_err;
bool no_output_come_code;
sFun* come_fun;
string come_fun_name;
sFun* caller_fun;
int caller_line;
char* caller_sname;
int block_level;
map<string, sFun*%>*% funcs;
map<string, sGenericsFun*%>*% generics_funcs;
map<string, sClass*%>*% classes;
map<string, sClassModule*%>*% modules;
map<string, sType*%>*% types;
map<string, sClass*%>*% generics_classes;
sModule*% module;
sType*% type;
list<sRightValueObject*%>*% right_value_objects;
sType*% generics_type;
list<sType*%>*% method_generics_types;
list<CVALUE*%>*% stack;
sType*% come_function_result_type;
sType*% come_method_block_function_result_type;
sVarTable* lv_table;
sVarTable*% gv_table;
bool comma_instead_of_semicolon;
bool no_comma;
bool no_assign;
bool no_label;
bool last_statment_is_return;
list<string>*% generics_type_names;
list<string>*% method_generics_type_names;
sType*% impl_type;
int current_stack_num;
int num_method_block;
sClass* current_stack_frame_struct;
list<sType*%>* param_types;
list<string>* param_names;
bool define_struct;
bool in_typedef;
bool in_loop;
string output_file_name;
sVarTable* current_loop_vtable;
bool verbose;
bool output_header_file;
int num_current_stack;
int num_source_files;
int max_source_files;
bool without_semicolon;
bool writing_source_file_position;
sType*% function_result_type;
bool in_class;
map<string,string>*% module_params;
bool constructor_;
sClass* defining_class;
bool array_initializer;
bool struct_initializer;
bool va_arg;
bool in_fun_param;
bool inhibits_output_code;
bool inhibits_output_code2;
bool in_generics_fun;
bool in_clone_object;
bool in_conditional_operator;
string if_result_var_name;
list<sVar*%>*% match_it_var;
list<int>*% sline_stack;
int sline_top;
};
module sCurrentNodeModule
{
new(sInfo* info)
{
self.super();
}
int sline(sInfo* info)
{
return self.sline;
}
string sname(sInfo* info)
{
return string(self.sname);
}
string kind()
{
return string("sCurrentNode");
}
bool compile(sInfo* info)
{
info->current_stack_num++;
string class_name = xsprintf("__current_stack%d__", info->current_stack_num);
sClass*% current_stack = new sClass(name: class_name, struct_:true);
sVarTable* vtable = info->lv_table;
while(vtable) {
foreach(it, vtable.mVars) {
char* key = it;
sVar* value = vtable.mVars[key];
sType*% type2 = clone value.mType;
type2.mPointerNum++;
tuple2<string, sType*%>*% item = (string(value.mCValueName), type2);
if(value.mCValueName != null) {
if(strcmp(value.mCValueName, "__list_values") == 0)
{
}
else if(strcmp(value.mCValueName, "__map_keys") == 0)
{
}
else if(strcmp(value.mCValueName, "__map_element") == 0)
{
}
else if(value.mType.mClass.mName === "va_list" || value.mType.mClass.mName === "__builtin_va_list")
{
}
else if(type2->mArrayNum.length() == 1) {
sType*% type3 = clone type2;
type3->mArrayNum.reset();
type3->mPointerNum++;
type3->mOriginIsArray = true;
tuple2<string, sType*%>*% item2 = (string(value.mCValueName), type3);
current_stack.mFields.push_back(clone item2);
value->mType->mOriginIsArray = true;
}
else {
current_stack.mFields.push_back(clone item);
}
}
}
vtable = vtable->mParent;
}
output_struct(current_stack, info);
info.classes.insert(class_name, current_stack);
add_come_code_at_function_head(info, "struct %s __current_stack%d__;\n", class_name, info->current_stack_num);
add_come_code_at_function_head2(info, "memset(&__current_stack%d__, 0, sizeof(struct %s));\n", info->current_stack_num, class_name);
vtable = info->lv_table;
while(vtable) {
foreach(it, vtable.mVars) {
char* key = it;
sVar* value = vtable.mVars[key];
sType*% type2 = clone value.mType;
tuple2<string, sType*%>*% item = (value.mCValueName, type2);
if(value.mCValueName != null) {
if(strcmp(value.mCValueName, "__list_values") == 0)
{
}
else if(strcmp(value.mCValueName, "__map_keys") == 0)
{
}
else if(strcmp(value.mCValueName, "__map_element") == 0)
{
}
else if(value.mType.mClass.mName === "va_list" || value.mType.mClass.mName === "__builtin_va_list")
{
}
else {
if(type2->mClass->mName === "lambda") {
add_come_code(info, "__current_stack%d__.%s = %s;\n", info->current_stack_num, value.mCValueName, value.mCValueName);
}
else {
add_come_code(info, "__current_stack%d__.%s = &%s;\n", info->current_stack_num, value.mCValueName, value.mCValueName);
}
}
}
}
vtable = vtable->mParent;
}
CVALUE*% come_value = new CVALUE();
come_value.c_value = xsprintf("&__current_stack%d__", info->current_stack_num);
come_value.type = new sType(class_name);
come_value.var = null;
add_come_last_code(info, "%s;\n", come_value.c_value);
info.stack.push_back(come_value);
return true;
}
};
/////////////////////////////////////////////////////////////////////
/// 01main.c ///
/////////////////////////////////////////////////////////////////////
int come_main(int argc, char** argv) version 1;
/////////////////////////////////////////////////////////////////////
/// 02transpile.c ///
/////////////////////////////////////////////////////////////////////
sNodeBase*% sNodeBase*::initialize(sNodeBase*% self, sInfo* info=info);
bool node_compile(sNode* node, sInfo* info=info);
bool node_condional_compile(sNode* node, sInfo* info=info);
int come_main(int argc, char** argv) version 2;
void err_msg(sInfo* info, char* msg, ...);
bool sNodeBase*::terminated(sNodeBase* self);
int transpile(sInfo* info) version 2;
bool output_source_file(sInfo* info) version 2;
sModule*% sModule*::initialize(sModule*% self);
sType*% sType*::initialize(sType*% self, char* name, bool heap=false, sInfo* info=info);
sVarTable*% sVarTable*::initialize(sVarTable*% self, bool global, sVarTable* parent);
void sVarTable*::finalize(sVarTable* self);
sClass*% sClass*::initialize(sClass*% self, char* name, bool number=false, bool union_=false, bool generics=false, bool method_generics=false, bool protocol_=false, bool struct_=false, bool float_=false, int generics_num=-1, int method_generics_num=-1, bool enum_=false, sInfo* info=info);
sClassModule*% sClassModule*::initialize(sClassModule*% self, char* name, string text, string sname, int sline, sInfo* info);
sFun*% sFun*::initialize(sFun*% self, string name, sType*% result_type, list<sType*%>*% param_types, list<string>*% param_names, list<string>*% param_default_parametors, bool external, bool var_args, sBlock*% block, bool static_, string come_header, string declare_sname, sInfo* info);
string make_type_name_string(sType* type, bool in_header=false, bool array_cast_pointer=false, bool no_pointer=false, sInfo* info=info, bool no_static=false);
string make_come_type_name_string(sType* type, sInfo* info=info);
string make_come_type_name_string_no_solved(sType* type, bool original_type_name=false, sInfo* info=info);
/////////////////////////////////////////////////////////////////////
/// 03transpile2.c ///
/////////////////////////////////////////////////////////////////////
string make_define_var_no_solved(sType* type, char* name, bool in_header=false, bool original_type_name=false, sInfo* info=info);
string header_function(sFun* fun, sInfo* info);
int transpile(sInfo* info) version 3;
bool output_source_file(sInfo* info) version 3;
void show_type(sType* type, sInfo* info);
string create_generics_name(sType* generics_type, sInfo* info);
void add_last_code_to_source(sInfo* info);
void add_come_code_at_function_head(sInfo* info, char* code, ...);
void add_come_code_at_come_header(sInfo* info, const char* msg, ...);
void add_come_code_at_function_head2(sInfo* info, char* code, ...);
void add_come_code_at_source_head(sInfo* info, const char* msg, ...);
void add_come_code_at_source_head3(sInfo* info, const char* msg, ...);
void add_come_code_at_source_head2(sInfo* info, const char* msg, ...);
void add_come_code(sInfo* info, const char* msg, ...);
void add_come_last_code(sInfo* info, const char* msg, ...);
void add_come_last_code2(sInfo* info, const char* msg, ...);
void add_come_last_code3(sInfo* info, const char* msg, ...);
void add_last_code_to_source_with_comma(sInfo* info);
void dec_stack_ptr(int value, sInfo* info);
CVALUE*% get_value_from_stack(int offset, sInfo* info);
string make_define_var(sType* type, char* name, bool in_header=false, sInfo* info=info);
void transpiler_clear_last_code(sInfo* info);
bool output_header_file(sInfo* info);
/////////////////////////////////////////////////////////////////////
/// 04heap.c ///
/////////////////////////////////////////////////////////////////////
sType*% solve_method_generics(sType* type, sInfo* info);
void free_exception_right_value_objects(sInfo* info, bool comma=false);
bool existance_free_right_value_objects(sInfo* info);
bool existance_free_objects_on_return(sBlock* current_block, sInfo* info, sVar* ret_value, bool top_block);
void std_move(sType* left_type, sType* right_type, CVALUE* right_value, sInfo* info=info, bool no_delete_from_right_value_objects=false);
string append_stackframe(char* c_value, sType* type, sInfo* info);
bool create_equals_method(sType* type, sInfo* info);
bool create_operator_equals_method(sType* type, sInfo* info);
bool create_operator_not_equals_method(sType* type, sInfo* info);
sType*% solve_generics(sType* type, sType* generics_type, sInfo* info);
sVar* get_variable_from_table(sVarTable* table, char* name);
void free_objects_on_return(sBlock* current_block, sInfo* info, sVar* ret_value, bool top_block);
void free_objects_of_match_lv_tables(sInfo* info);
void free_objects_on_break(sInfo* info);
void free_object(sType* type, char* obj, bool no_decrement, bool no_free, sInfo* info, bool comma=false, bool ret_value=false, bool force_delete_=false);
sType*%, string clone_object(sType* type, char* obj, sInfo* info);
void free_right_value_objects(sInfo* info, bool comma=false);
void free_objects(sVarTable* table, sVar* ret_value, sInfo* info);
string append_object_to_right_values(char* obj, sType*% type, sInfo* info);
void append_object_to_right_values2(CVALUE* come_value, sType*% type, sInfo* info, bool decrement_ref_count=false);
void remove_object_from_right_values(int right_value_num, sInfo* info);
string increment_ref_count_object(sType* type, char* obj, sInfo* info);
void decrement_ref_count_object(sType* type, char* obj, sInfo* info, bool force_delete_=false, bool no_free=false);
/////////////////////////////////////////////////////////////////////
/// 05function.c ///
/////////////////////////////////////////////////////////////////////
sNode*% cast_node(sType*% type, sNode*% node, sInfo* info=info);
sNode*% craete_fun_call(char* fun_name, list<tuple2<string,sNode*%>*%>* params, bool guard_break, list<sType*%>*% method_generics_types, buffer*% method_block, int method_block_sline, bool throw_or_rescue, sInfo* info);
string make_method_generics_function(string fun_name, list<sType*%>*% method_generics_types, sInfo* info);
sNode*% create_return_node(sNode*% value, string value_source, sInfo* info=info);
sNode*% post_position_operator(sNode*% node, sInfo* info);
bool create_method_generics_fun(string fun_name, sGenericsFun* generics_fun, sInfo* info);
bool operator_overload_fun_self(sType* type, char* fun_name, CVALUE* left_value, sInfo* info);
bool strmemcmp(char* p, char* p2);
void caller_begin(sInfo* info=info);
void caller_end(sInfo* info=info);
sNode*% craete_logical_denial(sNode*% node, sInfo* info);
tuple3<sType*%,string,bool>*% backtrace_parse_type(bool parse_variable_name=false,sInfo* info=info);
void transpile_toplevel(bool block=false, sInfo* info=info);
void skip_pointer_attribute(sInfo* info=info);
sNode*% parse_normal_block(bool clang=false, bool comma=false, sInfo* info=info);
sNode*% parse_comma_block(sInfo* info=info);
bool check_assign_type(char* msg, sType* left_type, sType* right_type, CVALUE* come_value, bool check_no_pointer=false, bool print_err_msg=true, bool pointer_massive=false, sInfo* info=info);
void cast_type(sType* left_type, sType* right_type, CVALUE* come_value, sInfo* info=info);
string parse_attribute(sInfo* info=info);
sNode*% get_number(bool minus, sInfo* info);
sNode*% get_oct_number(sInfo* info);
sNode*% get_hex_number(bool minus, sInfo* info);
sNode*% create_int_node(int value, sInfo* info);
list<sType*%>*%, list<string>*%, list<string>*%, bool parse_params(sInfo* info, bool in_constructor_=false);
sFun*,string create_finalizer_automatically(sType* type, char* fun_name, sInfo* info);
sFun*,string create_to_string_automatically(sType* type, char* fun_name, sInfo* info);
sFun*,string create_force_finalizer_automatically(sType* type, char* fun_name, sInfo* info);
sFun*,string create_cloner_automatically(sType* type, char* fun_name, sInfo* info);
sFun*,string create_equals_automatically(sType* type, char* fun_name, sInfo* info);
sFun*,string create_operator_equals_automatically(sType* type, char* fun_name, sInfo* info);
sFun*,string create_operator_not_equals_automatically(sType* type, char* fun_name, sInfo* info);
string skip_block(sInfo* info=info);
bool is_contained_generics_class(sType* type, sInfo* info);
bool is_type_name(char* buf, sInfo* info=info);
bool parsecmp(char* str, sInfo* info=info);
string parse_word(sInfo* info=info);
string backtrace_parse_word(sInfo* info=info);
void skip_spaces_and_lf(sInfo* info=info);
int expected_next_character(char c, sInfo* info=info);
sBlock*% sBlock*::initialize(sBlock*% self, sInfo* info);
bool create_generics_fun(string fun_name, sGenericsFun* generics_fun, sType* generics_type, sInfo* info);
tuple3<sType*%,string,bool>*% parse_type(sInfo* info=info, bool parse_variable_name=false, bool parse_multiple_type=true, bool in_function_parametor=false);
tuple2<sType*%, string>*% parse_variable_name(sType*% base_type_name, bool first, sInfo* info);
sBlock*% parse_block(sInfo* info=info, bool no_block_level=false, bool return_self_at_last=false, bool in_function=false);
int transpile_block(sBlock* block, list<sType*%>* param_types, list<string>* param_names, sInfo* info, bool no_var_table=false, bool loop_block=false, bool comma=false, bool if_result=false);
void arrange_stack(sInfo* info, int top);
sNode*% parse_function(sInfo* info);
sNode*% expression(sInfo* info=info) version 5;
sNode*% statment(sInfo* info=info);
sNode*% top_level(char* buf, char* head, int head_sline, sInfo* info) version 1;
sNode*% top_level(char* buf, char* head, int head_sline, sInfo* info) version 99;
sNode*% expression_node(sInfo* info=info) version 1;
sNode*% expression_node(sInfo* info=info) version 99;
sNode*% expression_node(sInfo* info=info) version 98;
sNode*% expression_node(sInfo* info=info) version 97;
int transpile(sInfo* info) version 5;
void parse_sharp(sInfo* info=info) version 5;
string create_method_name(sType* obj_type, bool no_pointer_name, char* fun_name, sInfo* info, bool array_equal_pointer=true);
string create_non_method_name(sType* obj_type, bool no_pointer_name, char* fun_name, sInfo* info, bool array_equal_pointer=true);
string create_method_name_using_class(sClass* obj_class, bool no_pointer_name, char* fun_name, sInfo* info, bool array_equal_pointer=true);
/////////////////////////////////////////////////////////////////////
/// 06str.c ///
/////////////////////////////////////////////////////////////////////
sNode*% create_null_value(sType*% type, sInfo* info=info);
sNode*% create_null_return_value(sInfo* info=info);
sNode*% create_some(sNode*% exp, sInfo* info);
sNode*% expression_node(sInfo* info=info) version 96;
sNode*% parse_tuple(sInfo* info);
sNode*% parse_some(sInfo* info);
sNode*% parse_none(sInfo* info);
/////////////////////////////////////////////////////////////////////
/// 07var.c
/////////////////////////////////////////////////////////////////////
sNode*% store_var(string name, list<string>*% multiple_assign, list<tuple3<sType*%, string, sNode*%>*%>*% multiple_declare, sType*% type, bool alloc, sNode*% right_value, sInfo* info);
sNode*% create_load_var(char* var_name, sInfo* info=info);
sNode*% parse_array_initializer(sInfo* info=info);
sNode*% parse_struct_initializer(sInfo* info=info);
sNode*% parse_global_variable(sInfo* info);
sNode*% load_var(string name, sInfo* info);
sNode*% string_node(char* buf, char* head, int head_sline, sInfo* info) version 7;
void add_variable_to_table(char* name, sType*% type, sInfo* info);
void add_variable_to_global_table(char* name, sType*% type, sInfo* info);
void add_variable_to_global_table_with_int_value(char* name, sType*% type, char* c_value, sInfo* info);
/////////////////////////////////////////////////////////////////////
/// 08if.c
/////////////////////////////////////////////////////////////////////
extern list<sRightValueObject*%>*% gExceptionRightValueObjects;
sNode*% parse_match(sNode*% expression_node, sInfo* info);
sNode*% create_exception_throw(sNode*% expression_node, sInfo* info);
sNode*% create_exception_value(sNode*% expression_node, sInfo* info);
sNode*% string_node(char* buf, char* head, int head_sline, sInfo* info) version 8;
sNode*% parse_if_method_call(sNode*% expression_node, sInfo* info);
sNode*% parse_less_method_call(sNode*% expression_node, sInfo* info);
sNode*% parse_elif_method_call(sNode*% expression_node, sInfo* info);
sNode*% parse_or_statment(sNode*% expression_node, sInfo* info);
sNode*% parse_and_statment(sNode*% expression_node, sInfo* info);
sNode*% parse_rescue_method_call(sNode*% expression_node, sInfo* info);
/////////////////////////////////////////////////////////////////////
/// 09while.c
/////////////////////////////////////////////////////////////////////
sNode*% string_node(char* buf, char* head, int head_sline, sInfo* info) version 9;
/////////////////////////////////////////////////////////////////////
/// 10do_while.c
/////////////////////////////////////////////////////////////////////
sNode*% string_node(char* buf, char* head, int head_sline, sInfo* info) version 10;
/////////////////////////////////////////////////////////////////////
/// 11for.c
/////////////////////////////////////////////////////////////////////
sNode*% string_node(char* buf, char* head, int head_sline, sInfo* info) version 11;
/////////////////////////////////////////////////////////////////////
/// 12switch.c
/////////////////////////////////////////////////////////////////////
sNode*% string_node(char* buf, char* head, int head_sline, sInfo* info) version 12;
/////////////////////////////////////////////////////////////////////
/// 13op.c
/////////////////////////////////////////////////////////////////////
sNode*% create_less(sNode*% node, sNode*% right, sInfo* info);
sNode*% create_null_node(sInfo* info=info);
sNode*% conditional_node(sNode*% value1, sNode*% value2, sNode*% value3, sInfo* info);
bool operator_overload_fun(sType* type, char* fun_name, CVALUE* left_value, CVALUE* right_value, bool break_guard, sInfo* info);
sNode*% expression(sInfo* info=info) version 13;
sNode*% post_op(sNode*% node, sInfo* info) version 13;
sNode*% string_node(char* buf, char* head, int head_sline, sInfo* info) version 13;
/////////////////////////////////////////////////////////////////////
/// 14struct.c
/////////////////////////////////////////////////////////////////////
bool is_contained_method_generics_types(sType* type, sInfo* info);
bool is_contained_generics_types(sType* type, sInfo* info);
sNode*% string_node(char* buf, char* head, int head_sline, sInfo* info) version 14;
sNode*% parse_struct(string type_name, sInfo* info);
string get_none_generics_name(char* class_name);
sNode*% top_level(char* buf, char* head, int head_sline, sInfo* info) version 98;
bool output_generics_struct(sType* type, sType* generics_type, sInfo* info);
void output_struct(sClass* klass, sInfo* info);
/////////////////////////////////////////////////////////////////////
/// 15union.c
/////////////////////////////////////////////////////////////////////
sNode*% string_node(char* buf, char* head, int head_sline, sInfo* info) version 15;
sNode*% parse_union(string type_name, sInfo* info);
sNode*% top_level(char* buf, char* head, int head_sline, sInfo* info) version 97;
/////////////////////////////////////////////////////////////////////
/// 16enum.c
/////////////////////////////////////////////////////////////////////
sNode*% parse_enum(string type_name, sInfo* info);
sNode*% top_level(char* buf, char* head, int head_sline, sInfo* info) version 96;
/////////////////////////////////////////////////////////////////////
/// 17typedef.c
/////////////////////////////////////////////////////////////////////
sNode*% top_level(char* buf, char* head, int head_sline, sInfo* info) version 95;
sNode*% string_node(char* buf, char* head, int head_sline, sInfo* info) version 17;
/////////////////////////////////////////////////////////////////////
/// 18field.c
/////////////////////////////////////////////////////////////////////
bool compiletime_get_exception_value(sInfo* info);
sNode*% store_field(sNode* left, sNode*% right, string name, sInfo* info);
sNode*% exception_get_value(sNode*% node, sInfo* info);
sNode*% post_position_operator(sNode*% node, sInfo* info) version 99;
sNode*% parse_method_call(sNode*% obj, string fun_name, sInfo* info) version 18;
/////////////////////////////////////////////////////////////////////
/// 19eq.c
/////////////////////////////////////////////////////////////////////
sNode*% post_position_operator(sNode*% node, sInfo* info) version 19;
/////////////////////////////////////////////////////////////////////
/// 20method.c
/////////////////////////////////////////////////////////////////////
sNode*% create_method_call(char* fun_name,sNode*% obj, list<tuple2<string,sNode*%>*%>*% params, buffer* method_block, int method_block_sline, list<sType*%>* method_generics_types, bool throw_or_rescue, sInfo* info);
bool compile_method_block(buffer* method_block, list<CVALUE*%>*% come_params, sFun* fun, char* fun_name, int method_block_sline, sInfo* info, bool no_create_current_stack=false) ;
string make_generics_function(sType* type, string fun_name, sInfo* info, bool array_equal_pointer=true);
sNode*% parse_method_call(sNode*% obj, string fun_name, sInfo* info) version 20;
sNode*% string_node(char* buf, char* head, int head_sline, sInfo* info) version 20;
/////////////////////////////////////////////////////////////////////
/// 21obj.c
/////////////////////////////////////////////////////////////////////
sNode*% create_object(sType*% type, sInfo* info);
sNode*% create_true_object(sInfo* info);
sNode*% create_false_object(sInfo* info);
sNode*% string_node(char* buf, char* head, int head_sline, sInfo* info) version 21;
sNode*% top_level(char* buf, char* head, int head_sline, sInfo* info) version 94;
sNode*% post_position_operator(sNode*% node, sInfo* info) version 21;
/////////////////////////////////////////////////////////////////////
/// 22impl.c
/////////////////////////////////////////////////////////////////////
sNode*% top_level(char* buf, char* head, int head_sline, sInfo* info) version 93;
/////////////////////////////////////////////////////////////////////
/// 23interface.c
/////////////////////////////////////////////////////////////////////
sNode*% top_level(char* buf, char* head, int head_sline, sInfo* info) version 92;
/////////////////////////////////////////////////////////////////////
/// 24module.c
/////////////////////////////////////////////////////////////////////
sNode*% top_level(char* buf, char* head, int head_sline, sInfo* info) version 91;
#endif