A .NET C# WinForms application that takes lexical tokens from a specially-tailored domain-specific language and visually translates them into geometric designs drawn on a canvas
The Lexical Interpreter Engine is a powerful C# WinForms-based interpreter designed to transform a custom domain-specific language into graphical geometric designs. The interpreter parses and visualizes the commands in real-time, drawing shapes on a canvas based on the lexical tokens provided.
Built to demonstrate concepts of lexical analysis and geometric rendering, it serves as both a functional interpreter and a learning tool for understanding how visualizations can be driven by code.
- Lexical Token Parsing: Translates tokens from a DSL (Domain-Specific Language) into corresponding visual elements.
- Geometric Rendering: Draws shapes like triangles, rectangles, squares, and circles on a canvas based on token values.
- Control Structures: Supports basic programming constructs such as if, while, and pen for creating dynamic designs.
- Dynamic Canvas: Real-time rendering of geometric designs.
- C# and WinForms: Built using the powerful .NET framework and WinForms for the UI.
- GitHub Actions CI Workflows: Automated CI workflows using GitHub Actions for building and testing.
- Language: C# (.NET Framework)
- Framework: WinForms
- IDE: Visual Studio
- Version Control: Git & GitHub
- CI/CD: GitHub Actions
This project features robust CI/CD processes implemented using GitHub Actions:
- Automatically builds and tests code for quality assurance.
- Checks PR names for consistency and style.
- Assigns labels to PRs based on file changes.
- Automatically adds issues to the active project.
- Tags issues and PRs with the authorβs name.
Follow these steps to get up and running with the Lexical Interpreter Engine:
- Visual Studio 2019 or later
- .NET Framework 5.0+
- Git
- Clone the repository:
git clone https://github.com/aryanprince/Lexical-Interpreter-Engine.git
cd Lexical-Interpreter-Engine
- Open in Visual Studio:
Open the LexicalEngine.sln
solution file in Visual Studio.
- Build the solution:
Build the project using Visual Studio.
- Run the program:
Execute the project and try out the below test code in the program.
var x = 50
triangle x
var y = 125
var x = x + 20
rectangle x y
pen 3
if x > 25
var x = x + 25
square x
endif
pen 2
while 3
var y = y + x
circle y
endwhile
fill 1
pen 1
move x y
triangle y
var x = 250
move x x
rectangle x x
- Extended Geometric Shapes: Add support for additional shapes (polygons, ellipses, etc.).
- Advanced Error Handling: Improve lexical error reporting and debugging features.
- Save/Export Designs: Allow users to save the rendered designs as image files.