import { Checker } from "./checker.ts"; import { Lexer } from "./lexer.ts"; import { Lowerer } from "./lowerer.ts"; import { Parser } from "./parser.ts"; import { Resolver } from "./resolver.ts"; const text = await Deno.readTextFile("example.slg"); const lexer = new Lexer(text); const parser = new Parser(lexer); const ast = parser.parseStmts(); new Resolver().resolve(ast); new Checker().check(ast); // console.log(JSON.stringify(ast, null, 4)) const lowerer = new Lowerer(); lowerer.lower(ast); lowerer.printProgram(); const program = lowerer.finish(); console.log(JSON.stringify(program, null, 4));