14 lines
331 B
TypeScript
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)
|
|
}
|