๐ค TinyCompTS
A tiny Javascript/Typescript compiler written in vanilla Typescript as a hobby project.
๐ Guide
Define an attribute grammar
Create an object that implements AttributeGrammar:
- Define a lexical ruleset by creating an object that implements LexicalRuleset
- Define a syntax ruleset by creating an object that implements SyntaxRuleset
- Define a semantic ruleset by creating an object that implements SemanticRuleset
Configure TinyComp
- Create an object that implements TinyCompOptions
- Create an instance of TinyComp using the AttributeGrammar and TinyCompOptions object
- Use
compiler.compile(input: string)
to compile input
๐ Example
โ see example.ts
Import
๐ฆ Denoland
import TinyComp, {AttributeGrammar, LexicalRuleset, SemanticRuleset, SyntaxRuleset, TinyCompOptions}
from "https://deno.land/x/tiny_comp_ts@v1.0.0";
โค๏ธ Npm
Coming soon?
๐งช Just test
- Install the JS/TS runtime Deno
- Clone this repo & navigate into the root directory
deno run ./example.ts