How peixe2b/unilogic works
UniLogic is a source language compiler with multiple output targets and configurable runtime behavior. The main workflow is source text through lexing, parsing, AST normalization and semantic checking, then target-specific encoding or code generation; the CLI coordinates compilation and execution. The README also documents project-management commands and profiling, but the supplied tree and excerpts do not establish their internal implementation, so they are represented only at the driver level. Edges are limited to relationships shown by excerpts, the source index, or README statements.
Main entry points: Main.py CLI driver · ul2c.py C generator · ast_nodes.py AST model · ul_gc.c Garbage collector
Components 21
Language Front End
- Lexer
Compiler/Lexer/src2token.py - Parser
Compiler/AST Gen/token2ast.py - AST model
Compiler/SynTree Def/ast_nodes.py - AST normalizer
Compiler/simplifycode.py - Semantic checker
Compiler/Semantic/semcheck.py
Transcoding Targets
- C generator
Transcoder/Decoder/ul2c.py - Python generator
Transcoder/Decoder/ul2py.py - JavaScript generator
Transcoder/Decoder/ul2js.py - LLVM generator
Transcoder/Decoder/ul2llvm.py - WebAssembly target
Main.py - Python encoder
Transcoder/Encoder/py2ul.py - C encoder
Transcoder/Encoder/c2ul.py - Bytecode encoder
Transcoder/Encoder/ul2ubi.py
Runtime Memory
- Garbage collector
Compiler/Runtime/ul_gc.c - Manual memory
Compiler/Runtime/ul_manual.c - Reference counting
Compiler/Runtime/ul_refcount.c - Arena allocator
Compiler/Runtime/ul_arena.c
Product Entry
- CLI driver
Main.py - Project commands
Main.py - Profiler capability
Main.py
Other components
- UL developer
Connections 31
- UL developer → CLI driver: invokes
- CLI driver → Lexer: tokenizes
Main.py - CLI driver → Parser: parses
Main.py - Parser → AST model: builds
Compiler/AST Gen/token2ast.py - CLI driver → AST normalizer: normalizes
Main.py - CLI driver → Semantic checker: checks
Main.py - Semantic checker → AST model: walks
Compiler/Semantic/semcheck.py - AST normalizer → AST model: rewrites
Compiler/simplifycode.py - CLI driver → C generator: generates C
Main.py - CLI driver → Python generator: generates Python
Main.py - CLI driver → JavaScript generator: generates JavaScript
Main.py - CLI driver → LLVM generator: generates LLVM
Main.py - CLI driver → WebAssembly target: targets WASM
Main.py - CLI driver → Python encoder: transpiles Python
Main.py - CLI driver → C encoder: transpiles C
- CLI driver → Bytecode encoder: emits bytecode
Main.py - C generator → AST model: walks
Transcoder/Decoder/ul2c.py - C generator → Semantic checker: uses type map
Transcoder/Decoder/ul2c.py - Python generator → AST model: walks
Transcoder/Decoder/ul2py.py - JavaScript generator → AST model: walks
Transcoder/Decoder/ul2js.py - LLVM generator → AST model: walks
Transcoder/Decoder/ul2llvm.py - Bytecode encoder → AST model: uses nodes
Transcoder/Encoder/ul2ubi.py - CLI driver → Project commands: offers commands
Main.py - CLI driver → Profiler capability: offers profiling
Main.py - C generator → Garbage collector: selects by DR
- C generator → Manual memory: selects by DR
- C generator → Reference counting: selects by DR
- C generator → Arena allocator: selects by DR
- Garbage collector → Manual memory
- Garbage collector → Reference counting
- Garbage collector → Arena allocator