How albazzaztariq/unilogic works
UniLogic is a multi-target language compiler and toolchain. A user supplies a UL source file; the driver coordinates lexing, parsing into an AST, normalization and semantic checks, then invokes a selected backend to produce C, Python, JavaScript, LLVM IR or WebAssembly. The repository also documents reverse-transpilation, configurable memory models, profiling, project/package commands and interactive tools. The graph centers on the compiler workflow and retains these documented capability branches. Some peripheral features are README-only; their internal wiring is not established by the sampled source.
Main entry points: Main.py Compiler driver · ast_nodes.py AST nodes · token2ast.py Parser · ul2c.py C backend
Components 22
Compiler Driver
- Compiler driver
Main.py
Language Front End
- Lexer
Compiler/Lexer/src2token.py - Parser
Compiler/AST Gen/token2ast.py - AST nodes
Compiler/SynTree Def/ast_nodes.py - AST normalizer
Compiler/simplifycode.py - Semantic checker
Compiler/Semantic/semcheck.py
Code Generation
- C backend
Transcoder/Decoder/ul2c.py - Python backend
Transcoder/Decoder/ul2py.py - JavaScript backend
Transcoder/Decoder/ul2js.py - LLVM backend
Transcoder/Decoder/ul2llvm.py - WebAssembly target
Transcoder/Decoder - Python encoder
Transcoder/Encoder/py2ul.py - C encoder
Transcoder/Encoder/c2ul.py - Bytecode encoder
Transcoder/Encoder/ul2ubi.py
Runtime And Tools
- Memory models
Compiler/Runtime - Profiler
- Package manager
- REPL
- VS Code extension
- Project manager
Other components
- UL author
- Generated target
Connections 25
- UL author → Compiler driver: submits source
- Compiler driver → Lexer: tokenizes source
Main.py - Compiler driver → Parser: parses tokens
Main.py - Parser → AST nodes: builds nodes
Compiler/AST Gen/token2ast.py - Compiler driver → AST normalizer: normalizes AST
Main.py - Compiler driver → Semantic checker: checks semantics
Main.py - Compiler driver → C backend: selects backend
Main.py - Compiler driver → Python backend: selects backend
Main.py - Compiler driver → JavaScript backend: selects backend
Main.py - Compiler driver → LLVM backend: selects backend
Main.py - Compiler driver → WebAssembly target: offers target
Main.py - C backend → AST nodes: walks AST
Transcoder/Decoder/ul2c.py - Python backend → AST nodes: walks AST
Transcoder/Decoder/ul2py.py - JavaScript backend → AST nodes: walks AST
Transcoder/Decoder/ul2js.py - LLVM backend → AST nodes: walks AST
Transcoder/Decoder/ul2llvm.py - Compiler driver → Generated target: emits target
Main.py - UL author → Python encoder: transpiles from
- UL author → C encoder: transpiles from
- UL author → Bytecode encoder: chooses bytecode
- UL author → Memory models: configures memory
- UL author → Profiler: profiles execution
- UL author → Package manager: manages project
- UL author → REPL: runs interactively
- UL author → VS Code extension: uses editor tools
- UL author → Project manager: manages projects