slige/compiler/main.ts
2024-11-18 10:23:48 +01:00

14 lines
331 B
TypeScript

import { Lexer } from "./Lexer.ts";
import { readFileSync } from 'node:fs';
import { Parser } from "./Parser.ts";
const text = readFileSync("example-no-types.slg").toString()
const lexer = new Lexer(text);
const parser = new Parser(lexer)
while (!parser.done()) {
const result = parser.parseExpr()
console.log(result)
}