A temperorary name for 1141 YZU CS321B Final Proj.
-
(Optional) Python Virtual Environment
- Create
venv
python -m venv .venv-
Enter Virtual Env
- Windows
.\.venv\Scripts\activate
- Linux
source .\.venv\bin\activate
- Create
- From
*.itzto*.cpp
-
Using for demostrating specific file
python .\demo.py <specific features name>
-
Using for demostrating all features
python .\demo.py --all
-
From
*.cppto EXEC1-1. Windows
Get-ChildItem .\results\*.cpp | ForEach-Object { g++ -std=c++20 $_.FullName -o ("results\" + $_.BaseName + ".exe") }
1-2. Linux / Mac
for f in results/*.cpp; do g++ -std=c++20 "$f" -o "${f%.cpp}"; done
-
Define variables
-
Basic arithmetic
-
Condition statements
- if
- else
- then
-
Loop statements
- for
- while
-
Print
-
Comments
-
Simple Algorithms
- max/min
- max_elements/min_elements
- sort
-
Input
-
Functions
- functions
- struct
- class
-
STL Containers
- vectors
- stack
- queue
- link-list
-
File I/O
- Read File
- Write File
- Append File
The following tree illustrates the organization of the project and the purpose of each file.
.
├── demo.py # Main Entry Point (Driver Script)
├── build.bat # (Optional) Windows One-Click Build Script
├── examples/ # Source Code Examples (*.itz)
│ ├── algorithm.itz # Algorithm implementation (Bubble Sort, Min/Max)
│ ├── comments.itz # Comment handling tests
│ ├── expressions.itz # Math operations & type inference tests
│ ├── file.itz # File I/O tests (Read/Write/Append)
│ ├── function.itz # Function & Recursion tests
│ ├── hello-world.itz # Basic String Interpolation
│ ├── input.itz # User Input (cin) tests
│ ├── logic.itz # Logic gates & comparison tests
│ ├── loop.itz # Loops (For/While) tests
│ └── random.itz # Random number generation tests
├── src/ # Compiler Core Modules
│ ├── token.py # Definition of Language Tokens (Enums)
│ ├── lexer.py # Lexical Analyzer (Raw Text -> Tokens)
│ ├── parser.py # Syntax Parser (Tokens -> C++ Logic)
│ └── emitter.py # Code Generator (Manages C++ output buffers)
└── results/ # Build Artifacts (Generated .cpp & .exe)
0. -bash: /mnt/c/Users/<user>/.pyenv/pyenv-win/shims/python: cannot execute: required file not found
- Solution:
python3 <rest of the cli commands>