rahulnoronha / svg-compiler

A simple JavaScript compiler that compiles DBN like language (by MIT) and generates the corresponding shapes in the form of SVGs

Home Page:https://master.ddyzdttmkunq0.amplifyapp.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SVG Compiler

The compiler takes in simple code describing different shapes, and generates corresponding SVG code and image. The SVG Code can then be downloaded for further use.


How does the compiler work?

The SVG compiler has 4 phases

1. Lexer - This function is used to generate tokens from the input file

2. Parser - Parser parses the generated tokens and creates an Abstract Syntax Tree (AST)

3. Transformer - This function transforms the AST to get it into SVG format

4. Generator - This function is used to generate the SVG code from the SVG tree created by Transformer function


Different SVG Shapes Supported

Line, Rectangle, Circle and Ellipse


Getting Started

Clone this repository: git clone https://github.com/riyasavant/svg-compiler.git

Install all dependencies: yarn

Run the application: yarn start


Project Created by

About

A simple JavaScript compiler that compiles DBN like language (by MIT) and generates the corresponding shapes in the form of SVGs

https://master.ddyzdttmkunq0.amplifyapp.com/


Languages

Language:JavaScript 89.2%Language:HTML 7.2%Language:CSS 3.6%