summaryrefslogtreecommitdiffstats
path: root/code/simpleSableCCCalulator/sableCCCalculator/Compiler.java
diff options
context:
space:
mode:
authorjwansek <eddie.atten.ea29@gmail.com>2021-10-18 16:40:56 +0100
committerjwansek <eddie.atten.ea29@gmail.com>2021-10-18 16:40:56 +0100
commite09b0bb865bbb0087c46b4acd90b759f14dfa824 (patch)
tree824f93a769d5ae3b38b4f6b3597347b78478e69c /code/simpleSableCCCalulator/sableCCCalculator/Compiler.java
parent3c3706a8957f27d7bcb553eff6ded1c6dc76fa24 (diff)
downloadesotericFORTRAN-e09b0bb865bbb0087c46b4acd90b759f14dfa824.tar.gz
esotericFORTRAN-e09b0bb865bbb0087c46b4acd90b759f14dfa824.zip
added sableCC calculator
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