summary refs log tree commit diff
path: root/pc-thing/the_e_programming_language/lang.ts
diff options
context:
space:
mode:
authorWlodekM <[email protected]>2025-04-02 12:23:56 +0300
committerWlodekM <[email protected]>2025-04-02 12:23:56 +0300
commit1027b91f357eaaa4793b9d16673b0ab662b37c7e (patch)
tree8625f0aebc48ab32d6d4c3bd5ae92cfbf82c8c08 /pc-thing/the_e_programming_language/lang.ts
parent0f6d349f9b8d22b3f8d972c5ff19ffb276629bdb (diff)
remove pc thing
Diffstat (limited to 'pc-thing/the_e_programming_language/lang.ts')
-rwxr-xr-xpc-thing/the_e_programming_language/lang.ts31
1 files changed, 0 insertions, 31 deletions
diff --git a/pc-thing/the_e_programming_language/lang.ts b/pc-thing/the_e_programming_language/lang.ts
deleted file mode 100755
index 5c00b98..0000000
--- a/pc-thing/the_e_programming_language/lang.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-import Tokenizer from "./tokenizer.ts";
-import ASTGen from "./ast.ts";
-import Compiler from "./compiler.ts";
-const input = Deno.readTextFileSync('test.e')
-
-const tokenizer = new Tokenizer(input);
-const tokens = tokenizer.tokenize();
-
-console.log(tokens)
-
-const astGenerator = new ASTGen(tokens);
-
-let ast;
-try {
-    ast = astGenerator.parse()
-} catch (error) {
-    console.error(error);
-    console.log('at', astGenerator.position, tokens.map((a, i) => i == astGenerator.position ? `${a.type}(${a.value}) <--` : `${a.type}(${a.value})`).join('\n'))
-    Deno.exit(1)
-}
-
-console.log(ast)
-
-const compiler = new Compiler(ast);
-
-for (const node of compiler.AST) {
-    compiler.compile(node)
-}
-
-Deno.writeTextFileSync('ast.json', JSON.stringify(ast, null, 4))
-Deno.writeTextFileSync('code.txt', compiler.instructions.map(i => `${i.opcode}${i.args.length > 0 ? ' ' : ''}${i.args.join(',')}`).join('\n'))
\ No newline at end of file