v1.1.1
A tiny JS/TS compiler written in vanilla TS.
Repository
Current version released
3 years ago
🤖 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.1.1/ts/TinyComp.ts";
❤️ Npm
Coming soon?
🧪 Just test
- Install the JS/TS runtime Deno
- Clone this repo & navigate into the root directory
deno run ./example.ts