From 719d864ea70b2e1ca726c9bcc76fb6eb2b62e4c8 Mon Sep 17 00:00:00 2001 From: Daniil Yarancev <21169548+Yardanico@users.noreply.github.com> Date: Mon, 16 Oct 2017 15:33:29 +0300 Subject: [PATCH] Updated Compiler module reference (markdown) --- Compiler-module-reference.md | 172 +++++++++++++++++------------------ 1 file changed, 86 insertions(+), 86 deletions(-) diff --git a/Compiler-module-reference.md b/Compiler-module-reference.md index 53228c3..33059dc 100644 --- a/Compiler-module-reference.md +++ b/Compiler-module-reference.md @@ -1,253 +1,253 @@ **This wiki page was written quickly and may contain information which is out of date or needs to be worded better.** -###Module -###Aliases.nim - Alias Analysis +### Module +### aliases.nim - Alias Analysis Used for term-rewriting macros. Buggy for this purpose because it has been rewritten with something completely different in mind. Analysis is both value and type based. Looks for areas -###Ast.nim +### ast.nim Tree structure -###Astalgo +### astalgo contains helpers and debug procedures, which work on symbols, types, and node. -###babel.cmd +### babel.cmd helper for compilers babel support -###bitsets +### bitsets Helpers for code generator. Set representation as an array of bits -###nimsets.nim - +### nimsets.nim - The complement to bitsets. Set representation as an AST -###Canonicalizer +### Canonicalizer Will be the future. Used to make the C code generator generate code in a much more deterministic fashion. -###ccgcalls +### ccgcalls C code generator calls. Generates a call expression in C, objective c, and C++ syntax. What needs to be done is that we often need to translate the result type into a hidden parameter. -###cggexpr +### cggexpr C code generation for expressions. Divide between stmts and expr mostly historical -###ccgmerge +### ccgmerge A merger for C files which is used for the symbol files feature. -###ccgstmts +### ccgstmts Code generation for statements. See ccgexprs. NOt for for loops, b/c they are eliminated. -###ccthreadvars +### ccthreadvars Thread variable emulation. -###ccgtypes +### ccgtypes complex, b/c deals with types. The PNode's are not cyclic. You can recurse them without any recursion checks. Type generation for the c backend, as well as run time type generation. -###ccgutils +### ccgutils Misc. utilities for C generation code. Contains hash string. Has to be same as system hash string, generate hashes at compile time. Also contains getUniqueType, to be deprecated in place of the canonicalization module. -###cgen.nim +### cgen.nim Main file for the C code generation. Includes things like DLL generation, foreign function interface, dispatches to. Cgendata is the main structure. -###cgmeth.nim +### cgmeth.nim code generation for methods. Performs AST to AST transformations. Analysis away method look up. -###commands.nim +### commands.nim Command line argument processing. -###condsyms +### condsyms conditional symbols -###crc.nim +### crc.nim cyclic redundancy check algorithm. Used by symbol files, recom -###depends.nim +### depends.nim Pass which computes dependancies between modules. Able to generate a dot file which can be used. -###docgen.nim +### docgen.nim Old documentation generator, which doesn't use the semantic pass. Doesn't know about symbols and identifiers. -###docgen2.nim +### docgen2.nim New documenation generator -###effects.nim - -###evalffi.nim - +### effects.nim - +### evalffi.nim - -###evals.nim +### evals.nim old evaluation engine, not used anymore -###exccomp +### exccomp external compiler, describes how the c compiler is invoked. -###filter_template +### filter_template hashbang filter -###filters +### filters helper for common stuff which source code filter. -###syntaxes.nim - +### syntaxes.nim - -###guards - +### guards - Growing module. Flow sensitive analysis, mainly for values. Used for not nil checking -###hlo - +### hlo - High level optimizer. Part of the term-rewriting macro engine. -###idents.nim - +### idents.nim - PIdents. Hash identifiers into a single global hash table -###idgen - +### idgen - ID generator. Used to create persistant IDs for the symbol files mechanism -###imports.nim - +### imports.nim - The module which has the helpers which deal with the module import mechanism. -###jsgen - +### jsgen - Javascript code generator -###lambdalifting - +### lambdalifting - Pass which changes closures into pairs of function pointers and environments -###lexer - +### lexer - the lexer -###lists - +### lists - Linked list implementation -###llstream - +### llstream - low level stream which contains some features which the compiler needs. -###lookups.nim - +### lookups.nim - helpers for symbol lookup. Quite involved due to templates, overloading, etc. -###lowerings - +### lowerings - Quite new module which implements common AST to AST helpers. -###magicsyms - +### magicsyms - compilerproc symbol is used by code generator whic inse -###modules.nim - +### modules.nim - Module handling -###message.nim - +### message.nim - Messages, warnings, hints. -###nimconf - +### nimconf - configuration file handling -###nimeval - +### nimeval - the upcoming virtual machine to evaluate code. -###nimlexbase - +### nimlexbase - Old lexbase. Buffer handling fo rthe lexer. -###nimrod.nim - +### nimrod.nim - Main nimrod file which produces the nimrod executable. -###options - +### options - Contains commandline options and checks. -###parampatterns - +### parampatterns - Related to overloading based on AST -###parseaux - +### parseaux - auxileries for the parser. Contains verbosity handling. -###sempass2 - +### sempass2 - additional semantic checking. -###patterns - +### patterns - related to term rewriting macros -###pbraces - +### pbraces - start of braces parser -###platform.nim - +### platform.nim - contains information for cross compiling (data type information) -###pragmas.nim - +### pragmas.nim - Contains all the pragmas that the compiler support. Use a set approach. Contains one big procedure which parses all the possible pragmas. -###pretty.nim - +### pretty.nim - Prettifier. Used for case consistancy -###procfind - +### procfind - used to find the header of a procedure. Used to determine if -###renderer - +### renderer - able to give a string representation in the AST. -###rodread - +### rodread - Reader of rod files, the symbol file mechanism. It also does module dependency tracking to decide whether a rod file can be used or whether the module needs to be recompiled -###rodutils - +### rodutils - utilities for above -###ropes - +### ropes - Used throughout the code generator -###seterate.nim - +### seterate.nim - Implements saturated arithmatic for integers. -###sem.nim - +### sem.nim - Main file for the semantic checker -###semcall - +### semcall - semantic checking for calls -###semdata - +### semdata - contains the main data structures for semantic checking. -###semdestruct - +### semdestruct - semantic checking for destructors. -###semexprs - +### semexprs - semantic checking for expressions. -###semfold - +### semfold - semantic checking for constant folding. Needed in the semantic pass, since things like bounds checking etc rely on such data. -###semgnrc - +### semgnrc - pass which implements symbol lookups for generics. -###seminst - +### seminst - instantiation of generics -###macrosanity - +### macrosanity - generates semantic ast checking for macros -###semmagic - +### semmagic - magics that need special treatment after overloading resolution. -###semparallel - +### semparallel - semantic checking for the upcoming parallel statement -###sempass2 - +### sempass2 - Effect tracking -###service.nim - +### service.nim - IDE Tool stuff -###sigmatch - +### sigmatch - very important module. Overloading resolution procedures. -###suggest.nim - +### suggest.nim - helper for IDE tools -###syntaxes - +### syntaxes - dispatching for what parser or sourcecodefilter to invoke. -###transf - +### transf - old transformation pass. Prepass before the code generator. Mostly deals with for loops into while loops -###trees.nim - +### trees.nim - Helper for ast (should get rid of) -###treetab - +### treetab - hashtable which works with trees -###types - +### types - helper for types -###typesrenderer - +### typesrenderer - new. Used for the documentation generator so we get names -###vm.nim - +### vm.nim - new virtual machine for compile time evaluation