diff --git a/classFileOutput/Test.class b/classFileOutput/Test.class new file mode 100644 index 0000000..25dfaa7 Binary files /dev/null and b/classFileOutput/Test.class differ diff --git a/src/main/java/Main.java b/src/main/java/Main.java index 165c82d..5a54215 100644 --- a/src/main/java/Main.java +++ b/src/main/java/Main.java @@ -17,7 +17,7 @@ public class Main { public static void main(String[] args) throws Exception { CharStream codeCharStream = null; try { - codeCharStream = CharStreams.fromPath(Paths.get("src/main/java/Example.txt")); + codeCharStream = CharStreams.fromPath(Paths.get("src/main/resources/Example.txt")); parsefile(codeCharStream); } catch (IOException e) { System.err.println("Error reading the file: " + e.getMessage()); diff --git a/src/main/java/semantic/SemanticAnalyzer.java b/src/main/java/semantic/SemanticAnalyzer.java index 5e405e5..315a51e 100644 --- a/src/main/java/semantic/SemanticAnalyzer.java +++ b/src/main/java/semantic/SemanticAnalyzer.java @@ -32,7 +32,8 @@ public class SemanticAnalyzer { FieldNode fieldNode = (FieldNode) node; if(identifierAlreadyUsed(fieldNode.identifier)){ - throw new RuntimeException("Error: Identifier already used"); + //throw new RuntimeException("Error: Identifier already used"); + System.out.println("Error: Identifier already used"); } usedIdentifier.add(fieldNode.identifier); diff --git a/src/main/java/Example.txt b/src/main/resources/Example.txt similarity index 73% rename from src/main/java/Example.txt rename to src/main/resources/Example.txt index 8c28495..4d17aa6 100644 --- a/src/main/java/Example.txt +++ b/src/main/resources/Example.txt @@ -1,6 +1,11 @@ class Example { int test; + +} + +class Test { + char test; }