summaryrefslogtreecommitdiffstats
path: root/code/simpleSableCCCalulator/sableCCCalculator/Compiler.java
diff options
context:
space:
mode:
authorAidenRushbrooke <72034940+AidenRushbrooke@users.noreply.github.com>2021-10-25 16:57:36 +0100
committerAidenRushbrooke <72034940+AidenRushbrooke@users.noreply.github.com>2021-10-25 16:57:36 +0100
commit69b0ad07bac30beca1397ff187468e7597203c44 (patch)
treef125c988f73e2f16bef2a1f145994bc827b0d418 /code/simpleSableCCCalulator/sableCCCalculator/Compiler.java
parent74c5732bded6695eed3aabf125a888fbdf206a40 (diff)
parentaa3a6929584eaa63cafb73353a62effd75d4dd8c (diff)
downloadesotericFORTRAN-69b0ad07bac30beca1397ff187468e7597203c44.tar.gz
esotericFORTRAN-69b0ad07bac30beca1397ff187468e7597203c44.zip
Merge branch 'main' of https://github.com/AlfieEagleton/EsotericProject
Diffstat (limited to 'code/simpleSableCCCalulator/sableCCCalculator/Compiler.java')
-rw-r--r--code/simpleSableCCCalulator/sableCCCalculator/Compiler.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/code/simpleSableCCCalulator/sableCCCalculator/Compiler.java b/code/simpleSableCCCalulator/sableCCCalculator/Compiler.java
new file mode 100644
index 0000000..7430cfe
--- /dev/null
+++ b/code/simpleSableCCCalulator/sableCCCalculator/Compiler.java
@@ -0,0 +1,27 @@
+package sableCCCalculator;
+import sableCCCalculator.parser.*;
+import sableCCCalculator.lexer.*;
+import sableCCCalculator.node.*;
+import java.io.*;
+
+public class Compiler
+{
+ public static void main(String[] args)
+ {
+ try
+ {
+ System.out.println("Using source file: " + args[0]);
+ // Create a Parser instance.
+ Parser p = new Parser(new Lexer(new PushbackReader(new InputStreamReader(new FileInputStream(args[0])), 1024)));
+ // Parse the input.
+ Start tree = p.parse();
+ // Apply the translation.
+ tree.apply(new Translation());
+ System.out.println("");
+ }
+ catch(Exception e)
+ {
+ System.out.println(e.getMessage());
+ }
+ }
+} \ No newline at end of file