slige/compiler/main.ts

14 lines
331 B
TypeScript
Raw Normal View History

2024-11-04 13:54:55 +00:00
import { Lexer } from "./Lexer.ts";
2024-11-15 14:20:49 +00:00
import { readFileSync } from 'node:fs';
2024-11-18 09:21:30 +00:00
import { Parser } from "./Parser.ts";
2024-11-04 13:54:55 +00:00
2024-11-15 14:20:49 +00:00
2024-11-18 09:21:30 +00:00
const text = readFileSync("example-no-types.slg").toString()
2024-11-04 13:54:55 +00:00
const lexer = new Lexer(text);
2024-11-18 09:21:30 +00:00
const parser = new Parser(lexer)
while (!parser.done()) {
const result = parser.parseExpr()
console.log(result)
2024-11-04 13:54:55 +00:00
}