How girishg17/gscript works
This repository implements a small language compiler and command-line runner. The main workflow reads a source file, tokenizes and parses it into an AST, generates assembly, then the runner invokes NASM and the linker before executing the binary. The language includes say, variable, and conditional statements. The graph separates the front end, AST model, code generation, and runner pipeline; source excerpts support the compiler calls, while the README is empty and unsampled internals are not inferred.
Main entry points: gscript-run.cpp Build And Run · main.cpp Compiler CLI · parser.cpp Parser · codegen.cpp Assembly Generator
Components 14
Runner
- Build And Run
gscript-run.cpp - NASM
- Object File
- Linker
- Executable
Compiler Front End
- Compiler CLI
src/main.cpp - Tokenizer
src/lexer/tokenizer.cpp - Parser
src/parser/parser.cpp - AST Display
src/main.cpp
Language Model
- Token Types
src/lexer/token.hpp - AST Nodes
src/parser/ast.hpp
Code Generation
- Assembly Generator
src/codegen/codegen.cpp - Assembly File
Other components
- CLI User
Connections 18
- CLI User → Build And Run: provides source
gscript-run.cpp - Build And Run → Compiler CLI: invokes compiler
gscript-run.cpp - Compiler CLI → Tokenizer: tokenizes source
src/main.cpp - Tokenizer → Token Types: produces tokens
src/lexer/tokenizer.cpp - Compiler CLI → Parser: parses tokens
src/main.cpp - Parser → Token Types: reads tokens
- Parser → AST Nodes: builds nodes
src/parser/parser.cpp - Compiler CLI → AST Display: prints AST
src/main.cpp - Compiler CLI → Assembly Generator: generates assembly
src/main.cpp - Assembly Generator → AST Nodes: reads nodes
- Assembly Generator → Assembly File: writes assembly
src/codegen/codegen.cpp - Build And Run → NASM: invokes NASM
gscript-run.cpp - Assembly File → NASM: assembles input
- NASM → Object File: writes object
- Build And Run → Linker: invokes linker
gscript-run.cpp - Object File → Linker: links input
- Linker → Executable: writes executable
- Build And Run → Executable: executes binary
gscript-run.cpp