slige/compiler/main.ts

14 lines
331 B
TypeScript
Raw Normal View History

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