Skip to content
Snippets Groups Projects

Dominicsbranch

4 files
+ 116
112
Compare changes
  • Side-by-side
  • Inline

Files

+ 4
4
@@ -12,10 +12,10 @@ public class Application {
@@ -12,10 +12,10 @@ public class Application {
List<String> expressions = new LinkedList<>();
List<String> expressions = new LinkedList<>();
//Reads the file "expressions.txt" and adds its values to a list
//Reads the file "expressions.txt" and adds its values to a list
BufferedReader reader;
BufferedReader reader;
String datapath = "expressions.txt";
String dataPath = "expressions.txt";
try {
try {
System.out.println("Reading the file...\n");
System.out.println("Reading the file...\n");
reader = new BufferedReader(new FileReader(datapath));
reader = new BufferedReader(new FileReader(dataPath));
String line = reader.readLine();
String line = reader.readLine();
while(line != null) {
while(line != null) {
expressions.add(line);
expressions.add(line);
@@ -39,8 +39,8 @@ public class Application {
@@ -39,8 +39,8 @@ public class Application {
}
}
Parser parser = new Parser();
Parser parser = new Parser();
try {
try {
parser.parse(tokens);
Parser.Expression exp = parser.parse(tokens);
System.out.println();
System.out.println(exp.toString());
}
}
catch (ParserException e) {
catch (ParserException e) {
System.out.println(e.getMessage());
System.out.println(e.getMessage());
Loading