12 static Context globalContext { };
13 static Module privateModule;
14 static ModuleImport mainModule;
15 static OldList _excludedSymbols { offset = (uint)(uintptr)&((Symbol)0).left };
16 static OldList defines, imports;
17 static NameSpace globalData
19 classes.CompareKey = (void *)BinaryTree::CompareString;
20 defines.CompareKey = (void *)BinaryTree::CompareString;
21 functions.CompareKey = (void *)BinaryTree::CompareString;
22 nameSpaces.CompareKey = (void *)BinaryTree::CompareString;
25 static void OutputImports(char * fileName)
27 File f = FileOpen(fileName, write);
33 f.Printf("[Imported Modules]\n");
34 for(module = imports.first; module; module = module.next)
37 FunctionImport function;
40 f.Printf(" %s\n", module.name);
42 f.Printf(" [This]\n");
43 if(module.importType == staticImport)
44 f.Printf(" [Static]\n");
45 else if(module.importType == remoteImport)
46 f.Printf(" [Remote]\n");
48 if(module.importAccess == privateAccess)
49 f.Printf(" [Private]\n");
51 f.Printf(" [Public]\n");
53 if(module.classes.first)
55 f.Printf(" [Imported Classes]\n");
56 for(_class = module.classes.first; _class; _class = _class.next)
58 f.Printf(" %s\n", _class.name);
61 f.Printf(" [Instantiated]\n");
65 f.Printf(" [Remote]\n");
68 if(_class.methods.first)
71 f.Printf(" [Imported Methods]\n");
72 for(method = _class.methods.first; method; method = method.next)
74 f.Printf(" %s\n", method.name);
76 f.Printf(" [Virtual]\n");
82 if(_class.properties.first)
85 f.Printf(" [Imported Properties]\n");
86 for(prop = _class.properties.first; prop; prop = prop.next)
88 f.Printf(" %s\n", prop.name);
90 f.Printf(" [Virtual]\n");
101 if(module.functions.first)
103 f.Printf(" [Imported Functions]\n");
104 for(function = module.functions.first; function; function = function.next)
106 f.Printf(" %s\n", function.name);
118 /*static bool TestType(String string, String expected)
121 char typeString[1024] = { 0 };
122 Type type = ProcessTypeString(string, false);
123 PrintType(type, typeString, true, false);//true);
124 if(strcmp(typeString, expected ? expected : string))
126 PrintLn("FAILED: ", string, " -> ", typeString);
132 static void TestTypes()
134 int succeeded = 0, count = 0;
136 count++, succeeded += TestType("dllexport void (dllexport * Module::signal(int, void (*)(int)))(int)", null);
137 count++, succeeded += TestType("int (* f[8])[10]", null);
138 count++, succeeded += TestType("void (* signal(int, void (*)(int)))(int)", null);
139 count++, succeeded += TestType("void (* signal(double))()", null);
140 count++, succeeded += TestType("void (* bla)(int)", null);
141 count++, succeeded += TestType("int f(void (*[10])())", null);
142 count++, succeeded += TestType("void (*[10])()", null);
143 count++, succeeded += TestType("void (* converters_table[10])()", null);
144 count++, succeeded += TestType("int (* f[8])[10]", null);
146 count++, succeeded += TestType("int f[8][10]", null);
147 count++, succeeded += TestType("int f[10]", null);
148 count++, succeeded += TestType("void *", null);
149 count++, succeeded += TestType("char * x", "char * x");
150 count++, succeeded += TestType("char * x", null);
151 count++, succeeded += TestType("char (* x[3])()", null);
152 count++, succeeded += TestType("char (*(* x[3])())", "char * (* x[3])()");
153 count++, succeeded += TestType("char (* x())", "char * x()");
154 count++, succeeded += TestType("char (* (* x[3])())[5]", null);
155 count++, succeeded += TestType("char (* f())[5]", null);
156 count++, succeeded += TestType("char * (* f())[5]", null);
157 count++, succeeded += TestType("char * (* * f())[5][2][3]", null);
158 count++, succeeded += TestType("char * (* * (* f)())[5][2][3]", null);
159 count++, succeeded += TestType("char * (* (* * (* f)())[5][2])[3]", null);
160 count++, succeeded += TestType("void (* (* bar)[5])()", null);
161 count++, succeeded += TestType("const int * (* const f)(char[10])", null);
162 count++, succeeded += TestType("const int", null);
163 count++, succeeded += TestType("int * const *", null);
164 count++, succeeded += TestType("int * const", null);
165 count++, succeeded += TestType("const int *", null);
167 count++, succeeded += TestType("char * const (* (* const bar)[5])(int)", null);
168 count++, succeeded += TestType("char * const (* (* (* const bar)[5][6])(int))[2]", null);
169 count++, succeeded += TestType("int * * a", null);
171 count++, succeeded += TestType("char * const (* bar)()", null);
173 count++, succeeded += TestType("char * const (* const (* const bar)[5])(int)", null);
175 count++, succeeded += TestType("char * (* const (* bar)[5])(int)", null);
176 count++, succeeded += TestType("void (* * const bar[5])()", null);
177 count++, succeeded += TestType("void (* * const bar)()", null);
178 count++, succeeded += TestType("void (* const * bar)()", null);
179 count++, succeeded += TestType("const int * * foo", null); // this prevents you from doing: **foo = 0;
180 count++, succeeded += TestType("int * const * bar", null); // this prevents you from doing: *bar = 0;
181 count++, succeeded += TestType("int * * const two", null); // this prevents you from doing: two = 0;
182 count++, succeeded += TestType("dllexport int TestFunction()", null);
183 count++, succeeded += TestType("dllexport int (* TestFunction())[3]", null);
186 count++, succeeded += TestType("int dllexport TestFunction()", "dllexport int TestFunction()");
187 count++, succeeded += TestType("bool (stdcall * Load)(Module module)", null);
189 count++, succeeded += TestType("bool (__attribute__((stdcall)) * Load)(Module module)", "bool (stdcall * Load)(Module module)");
190 count++, succeeded += TestType("int (dllexport * Load)()", null);
191 count++, succeeded += TestType("int (* Load)(Module module)", null);
192 count++, succeeded += TestType("bool (__declspec(dllexport) * Load)(Module module)", "bool (dllexport * Load)(Module module)");
193 count++, succeeded += TestType("__declspec(dllexport) int TestFunction()", "dllexport int TestFunction()");
194 count++, succeeded += TestType("int __declspec(dllexport) TestFunction()", "dllexport int TestFunction()");
195 count++, succeeded += TestType("int __attribute__((dllexport)) TestFunction()", "dllexport int TestFunction()");
196 count++, succeeded += TestType("bool (__attribute__((dllexport)) * Load)(Module module)", "bool (dllexport * Load)(Module module)");
197 count++, succeeded += TestType("any_object TestFunction(any_object, typed_object param)", null);
198 count++, succeeded += TestType("void typed_object::OnDisplay(Surface surface, int x, int y, int width, void * fieldData, Alignment alignment, DataDisplayFlags displayFlags)", null);
199 count++, succeeded += TestType("int typed_object::OnCompare(any_object object)", null);
200 count++, succeeded += TestType("char * typed_object::OnGetString(char * tempString, void * fieldData, bool * needClass)", null);
201 count++, succeeded += TestType("void typed_object&::OnCopy(any_object newData)", null);
202 count++, succeeded += TestType("void typed_object::OnFree(void)", null);
203 count++, succeeded += TestType("bool typed_object&::OnGetDataFromString(char * string)", null);
204 count++, succeeded += TestType("Window typed_object::OnEdit(DataBox dataBox, DataBox obsolete, int x, int y, int w, int h, void * userData)", null);
205 count++, succeeded += TestType("void typed_object::OnSerialize(IOChannel channel)", null);
206 count++, succeeded += TestType("void typed_object&::OnUnserialize(IOChannel channel)", null);
207 count++, succeeded += TestType("bool typed_object&::OnSaveEdit(Window window, void * object)", null);
208 count++, succeeded += TestType("void ::StaticMethod(IOChannel channel)", null);
210 count++, succeeded += TestType("void PrintLn(typed_object object, ...)", null);
211 count++, succeeded += TestType("void PrintLn(typed_object object, ...)", null);
213 count++, succeeded += TestType("thisclass RemoveSwapRight()", null);
214 count++, succeeded += TestType("struct { thisclass prev; thisclass next; }", null);
216 count++, succeeded += TestType("LinkElement<thisclass>", null);
218 count++, succeeded += TestType("void (dllexport * converters_table[10])()", null);
220 count++, succeeded += TestType("bool (stdcall * * Load)(Module module)", null);
222 count++, succeeded += TestType("int stdcall TestFunction()", "stdcall int TestFunction()");
223 count++, succeeded += TestType("dllexport stdcall void test()", null);
225 count++, succeeded += TestType("bool (* Module::notifySelect)(MenuItem selection, Modifiers mods)", null);
227 count++, succeeded += TestType("typed_object &", null);
229 PrintLn("\n", succeeded, " / ", count, " tests succeeded.");
234 class CompilerApp : Application
238 char * cppCommand = null;
239 char * cppOptions = null;
240 int cppOptionsLen = 0;
241 /*char ** argv = null;
245 char defaultOutputFile[MAX_LOCATION];
246 bool buildingBootStrap = false;
248 Platform targetPlatform = __runtimePlatform;
249 int targetBits = GetHostBits();
252 // buildingBootStrap = true;
257 /*for(c = 0; c<this.argc; c++)
259 char * arg = this.argv[c];
260 int argLen = strlen(arg);
262 argv = renew argv char *[argc + 1];
263 argv[argc] = new char[argLen+1];
264 strcpy(argv[argc], arg);
266 while(argv[argc][argLen-1] == '\\' && c < this.argc-1)
273 argv[argc] = renew argv[argc] char[argLen + len + 1];
275 argv[argc][argLen-1] = ' ';
276 strcpy(argv[argc] + argLen, arg);
283 printf("\nArguments given:\n");
284 for(c=1; c<argc; c++)
285 printf(" %s", argv[c]);
287 for(c=1; c<argc; c++)
288 PrintLn("Arg", c, ": ", argv[c]);
293 for(c = 1; c<argc; c++)
295 const char * arg = argv[c];
298 if(!strcmp(arg + 1, "m32") || !strcmp(arg + 1, "m64"))
300 int newLen = cppOptionsLen + 1 + strlen(arg);
301 cppOptions = renew cppOptions char[newLen + 1];
302 cppOptions[cppOptionsLen] = ' ';
303 strcpy(cppOptions + cppOptionsLen + 1, arg);
304 cppOptionsLen = newLen;
305 targetBits = !strcmp(arg + 1, "m32") ? 32 : 64;
307 else if(!strcmp(arg + 1, "t32") || !strcmp(arg + 1, "t64"))
309 targetBits = !strcmp(arg + 1, "t32") ? 32 : 64;
311 else if(arg[1] == 'D' || arg[1] == 'I')
314 int size = cppOptionsLen + 1 + strlen(arg) * 2 + 1;
315 cppOptions = renew cppOptions char[size];
316 buf = cppOptions + cppOptionsLen;
319 cppOptionsLen = cppOptionsLen + 1 + strlen(buf);
322 if(!strcmp(arg, "-DBUILDING_ECERE_COM"))
323 SetBuildingEcereCom(true);
324 else if(!strcmp(arg, "-DECERE_COM_MODULE"))
325 SetBuildingEcereComModule(true);
326 else if(!strcmp(arg, "-DECERE_BOOTSTRAP"))
327 buildingBootStrap = true;
330 else if(!strcmp(arg+1, "t"))
333 targetPlatform = argv[c];
337 else if(!strcmp(arg+1, "cpp"))
340 cppCommand = CopyString(argv[c]);
344 else if(!strcmp(arg+1, "o"))
346 if(!GetOutputFile() && c + 1 < argc)
348 SetOutputFile(argv[c+1]);
354 else if(!strcmp(arg+1, "c"))
356 if(!GetSourceFile() && c + 1 < argc)
358 SetSourceFile(argv[c+1]);
364 else if(!strcmp(arg+1, "isystem") || !strcmp(arg+1, "isysroot"))
369 const char * arg1 = argv[++c];
370 int size = cppOptionsLen + 1 + strlen(arg) * 2 + strlen(arg1) * 2 + 1;
371 cppOptions = renew cppOptions char[size];
372 buf = cppOptions + cppOptionsLen;
374 buf = PassArg(buf, arg);
376 buf = PassArg(buf, arg1);
377 cppOptionsLen = buf - cppOptions;
382 else if(!strcmp(arg+1, "fno-diagnostics-show-caret"))
385 int size = cppOptionsLen + 1 + strlen(arg) * 2 + 1;
386 cppOptions = renew cppOptions char[size];
387 buf = cppOptions + cppOptionsLen;
390 cppOptionsLen = cppOptionsLen + 1 + strlen(buf);
392 else if(!strcmp(arg+1, "symbols"))
396 SetSymbolsDir(argv[c+1]);
402 else if(!strcmp(arg+1, "module"))
406 SetI18nModuleName(argv[c+1]);
412 else if(!strcmp(arg+1, "memguard"))
414 SetMemoryGuard(true);
416 else if(!strcmp(arg+1, "defaultns"))
420 SetDefaultNameSpace(argv[c+1]);
421 //defaultNameSpaceLen = strlen(defaultNameSpace);
427 else if(!strcmp(arg+1, "strictns"))
429 SetStrictNameSpaces(true);
431 else if(!strcmp(arg+1, "nolinenumbers"))
433 SetOutputLineNumbers(false);
442 cppCommand = CopyString("gcc");
445 else if(!GetOutputFile())
447 strcpy(defaultOutputFile, "");
448 PathCat(defaultOutputFile, GetSourceFile());
449 ChangeExtension(defaultOutputFile, "c", defaultOutputFile);
450 SetOutputFile(defaultOutputFile);
456 printf("%s", $"Syntax:\n ecc [-t <target platform>] [-cpp <c preprocessor>] [-o <output>] [-module <module>] [-symbols <outputdir>] [-I<includedir>]* [-isystem <sysincludedir>]* [-D<definition>]* -c <input>\n");
461 // TODO: Improve this
462 char command[MAX_F_STRING*3];
463 SetGlobalData(&globalData);
464 SetExcludedSymbols(&_excludedSymbols);
465 SetGlobalContext(globalContext);
466 SetCurrentContext(globalContext);
467 SetTopContext(globalContext);
468 SetDefines(&::defines);
469 SetImports(&imports);
471 SetTargetPlatform(targetPlatform);
472 SetTargetBits(targetBits);
474 // TOFIX: Use a bit class instead of a bool to store target bits information
475 privateModule = (Module)__ecere_COM_Initialize((bool)(true | (targetBits == sizeof(uintptr)*8 ? 0 : targetBits == 64 ? 2 : targetBits==32 ? 4 : 0) | 8), 1, null);
476 SetPrivateModule(privateModule);
478 globalContext.types.Add((BTNode)Symbol { string = CopyString("uint"), type = ProcessTypeString("unsigned int", false) });
479 globalContext.types.Add((BTNode)Symbol { string = CopyString("uint64"), type = ProcessTypeString("unsigned int64", false) });
480 globalContext.types.Add((BTNode)Symbol { string = CopyString("uint32"), type = ProcessTypeString("unsigned int", false) });
481 globalContext.types.Add((BTNode)Symbol { string = CopyString("uint16"), type = ProcessTypeString("unsigned short", false) });
482 globalContext.types.Add((BTNode)Symbol { string = CopyString("byte"), type = ProcessTypeString("unsigned char", false) });
483 if(buildingBootStrap)
485 // Do not define this when we pre-include stdint.h or the eC compiler will be confused when parsing these types (External prioritization in pass15.ec will fail)
486 globalContext.types.Add((BTNode)Symbol { string = CopyString("intptr_t"), type = ProcessTypeString("intptr", false) });
487 globalContext.types.Add((BTNode)Symbol { string = CopyString("uintptr_t"), type = ProcessTypeString("uintptr", false) });
488 globalContext.types.Add((BTNode)Symbol { string = CopyString("ssize_t"), type = ProcessTypeString("intsize", false) });
489 globalContext.types.Add((BTNode)Symbol { string = CopyString("size_t"), type = ProcessTypeString("uintsize", false) });
497 GlobalData data { fullName = CopyString("__thisModule"), dataTypeString = CopyString("Module"), module = privateModule };
498 data.key = (uintptr)data.fullName;
499 globalData.functions.Add((BTNode)data);
502 snprintf(command, sizeof(command), "%s%s -x c -E %s\"%s\"", cppCommand, cppOptions ? cppOptions : "", buildingBootStrap ? "" : "-include stdint.h -include sys/types.h ", GetSourceFile());
503 command[sizeof(command)-1] = 0;
505 PrintLn("ECC Executing:");
508 if((cppOutput = DualPipeOpen({ output = true }, command)))
510 char impFile[MAX_LOCATION];
511 ImportedModule module;
512 char sourceFileName[MAX_FILENAME];
513 char mainModuleName[MAX_FILENAME];
517 TempFile fileInput { };
518 SetFileInput(fileInput);
520 imports.Add((mainModule = ModuleImport { }));
521 SetMainModule(mainModule);
523 GetLastDirectory(GetSourceFile(), sourceFileName);
524 strcpy(mainModuleName, sourceFileName);
527 // TEMP: UNTIL WE CAN HAVE PER SOURCE FILE PREPROCESSOR DEFINITIONS...
528 if(GetBuildingEcereCom() &&
529 !(strcmpi(mainModuleName, "instance.ec") && strcmpi(mainModuleName, "BinaryTree.ec") &&
530 strcmpi(mainModuleName, "dataTypes.ec") && strcmpi(mainModuleName, "OldList.ec") &&
531 strcmpi(mainModuleName, "String.ec") && strcmpi(mainModuleName, "BTNode.ec") &&
532 strcmpi(mainModuleName, "Array.ec") && strcmpi(mainModuleName, "AVLTree.ec") &&
533 strcmpi(mainModuleName, "BuiltInContainer.ec") && strcmpi(mainModuleName, "Container.ec") &&
534 strcmpi(mainModuleName, "CustomAVLTree.ec") && strcmpi(mainModuleName, "LinkList.ec") &&
535 strcmpi(mainModuleName, "List.ec") && strcmpi(mainModuleName, "Map.ec") &&
536 strcmpi(mainModuleName, "Mutex.ec")))
537 SetBuildingEcereComModule(true);
538 if(GetBuildingEcereCom() &&
539 !(strcmpi(mainModuleName, "instance.ec") && strcmpi(mainModuleName, "BinaryTree.ec") &&
540 /*strcmpi(mainModuleName, "dataTypes.ec") && strcmpi(mainModuleName, "OldList.ec") &&*/
541 /*strcmpi(mainModuleName, "String.ec") && */strcmpi(mainModuleName, "BTNode.ec") &&
542 strcmpi(mainModuleName, "Mutex.ec") && strcmpi(mainModuleName, "Thread.ec")))
543 //if(GetBuildingEcereCom() && !strcmpi(mainModuleName, "instance.ec"))
544 SetMemoryGuard(false);
547 StripExtension(mainModuleName);
548 module = ImportedModule { name = CopyString(mainModuleName), type = moduleDefinition };
549 ::defines.AddName(module);
552 while(!cppOutput.Eof())
555 int count = cppOutput.Read(junk, 1, 4096);
556 fileInput.Write(junk, 1, count);
558 exitCode = cppOutput.GetExitCode();
561 fileInput.Seek(0, start);
567 // Predeclare all classes
569 char symFile[MAX_FILENAME];
570 char symLocation[MAX_LOCATION];
571 ImportedModule module, next;
573 strcpy(symFile, sourceFileName);
574 ChangeExtension(symFile, "sym", symFile);
576 strcpy(symLocation, GetSymbolsDir());
577 PathCat(symLocation, symFile);
579 // LoadSymbols(symLocation, normalImport, true);
580 LoadSymbols(symLocation, preDeclImport, false);
582 for(module = ::defines.first; module; module = next)
585 if(module.type == moduleDefinition && strcmpi(module.name, mainModuleName))
588 ::defines.Delete(module);
592 if(!GetEcereImported() && !GetBuildingEcereCom())
593 eModule_LoadStrict(privateModule, "ecereCOM", publicAccess /*privateAccess*/);
598 CheckDataRedefinitions();
601 SetCurrentNameSpace(null);
602 SetDefaultNameSpace(null);
603 SetDeclMode(privateAccess);
610 if(/*ast && !parseError*/ /*&& */!exitCode)
612 ProcessDBTableDefinitions();
614 // *** PASS 0 - Register all classes, methods, properties and members ***
615 // *** Build the constructors, destructors, properties as ***
616 // *** class functions ***
617 PrePreProcessClassDefinitions();
618 ComputeModuleClasses(privateModule);
619 PreProcessClassDefinitions();
621 // For classes defined in this module...
622 ComputeModuleClasses(privateModule);
625 // *** PASS 1 - Turn the class functions into functions ***
626 // *** Write the RegisterModule (Register classes) ***
627 ProcessClassDefinitions();
629 // *** PASS 1.5 - Replace members by this.member, figure out types, do type checking / conversions
632 // *** PASS 1.6 - Replace instantiations
633 ProcessInstantiations();
635 // *** PASS 2 - Replace Member Access ***
636 ProcessMemberAccess();
638 // *** PASS 3 - Replace pointers to objects by "Instance *" ***
639 ProcessInstanceDeclarations();
641 strcpy(impFile, GetSymbolsDir());
642 PathCat(impFile, sourceFileName);
643 ChangeExtension(impFile, "imp", impFile);
645 OutputImports(impFile);
646 // For now use precomp to generate sym file only...
648 if(/*!strcmp(targetExt, "c") && */!this.exitCode)
650 File output = FileOpen(GetOutputFile(), write);
653 output.Printf("/* Code generated from eC source file: %s */\n", sourceFileName);
654 output.Printf("#if defined(_WIN32)\n");
655 output.Printf("#define __runtimePlatform 1\n");
656 output.Printf("#elif defined(__APPLE__)\n");
657 output.Printf("#define __runtimePlatform 3\n");
658 output.Printf("#else\n");
659 output.Printf("#define __runtimePlatform 2\n");
660 output.Printf("#endif\n");
662 output.Printf("#if defined(__GNUC__)\n");
663 output.Printf("typedef long long int64;\n");
664 output.Printf("typedef unsigned long long uint64;\n");
665 output.Printf("#ifndef _WIN32\n");
666 output.Printf("#define __declspec(x)\n");
667 output.Printf("#endif\n");
668 output.Printf("#elif defined(__TINYC__)\n");
669 output.Printf("#include <stdarg.h>\n");
670 output.Printf("#define __builtin_va_list va_list\n");
671 output.Printf("#define __builtin_va_start va_start\n");
672 output.Printf("#define __builtin_va_end va_end\n");
673 output.Printf("#ifdef _WIN32\n");
674 output.Printf("#define strcasecmp stricmp\n");
675 output.Printf("#define strncasecmp strnicmp\n");
676 output.Printf("#define __declspec(x) __attribute__((x))\n");
677 output.Printf("#else\n");
678 output.Printf("#define __declspec(x)\n");
679 output.Printf("#endif\n");
680 output.Printf("typedef long long int64;\n");
681 output.Printf("typedef unsigned long long uint64;\n");
682 output.Printf("#else\n");
683 output.Printf("typedef __int64 int64;\n");
684 output.Printf("typedef unsigned __int64 uint64;\n");
685 output.Printf("#endif\n");
686 output.Printf("#ifdef __BIG_ENDIAN__\n");
687 output.Printf("#define __ENDIAN_PAD(x) (8 - (x))\n");
688 output.Printf("#else\n");
689 output.Printf("#define __ENDIAN_PAD(x) 0\n");
690 output.Printf("#endif\n");
692 output.Printf("#if defined(_WIN32)\n");
693 output.Printf("# if defined(__GNUC__) || defined(__TINYC__)\n");
694 output.Printf("# define ecere_stdcall __attribute__((__stdcall__))\n");
695 output.Printf("# else\n");
696 output.Printf("# define ecere_stdcall __stdcall\n");
697 output.Printf("# endif\n");
698 output.Printf("#else\n");
699 output.Printf("# define ecere_stdcall\n");
700 output.Printf("#endif\n");
702 if(buildingBootStrap)
704 //output.Printf("#ifdef __MINGW32__\n");
705 //output.Printf("#ifdef _WIN64\n");
707 output.Printf("#if defined(_WIN64) || WORDSIZE == 64\n");
708 output.Printf("typedef unsigned long long int uintptr_t;\n");
709 output.Printf("typedef long long int intptr_t;\n");
710 output.Printf("#else\n");
711 output.Printf("typedef unsigned int uintptr_t;\n");
712 output.Printf("typedef int intptr_t;\n");
713 output.Printf("#endif\n");
715 //output.Printf("#else\n");
716 output.Printf("#include <stdint.h>\n");
717 output.Printf("#include <sys/types.h>\n");
718 //output.Printf("#endif\n");
721 // NOTE: If anything is changed up there, the start outputLine must be updated in libec's output.c or Debugging lines will be wrong
724 OutputTree(ast, output);
729 else if(!strcmp(targetExt, "o"))
731 // Compile right away
732 File output = FileOpen(GetOutputFile(), Write);
733 output.Printf("#include <ecereCOM.h>\n\n");
734 OutputTree(ast, output);
739 this.exitCode = exitCode;
747 FreeContext(globalContext);
748 FreeExcludedSymbols(_excludedSymbols);
750 ::defines.Free(FreeModuleDefine);
751 imports.Free(FreeModuleImport);
753 FreeTypeData(privateModule);
755 FreeGlobalData(globalData);
757 delete privateModule;
763 /*for(c = 0; c<argc; c++)
767 SetSymbolsDir(null); // Free symbols dir
771 #if 0 //defined(_DEBUG) && defined(__WIN32__)
773 if(exitCode || GetNumWarnings())