moved Eample to resources

This commit is contained in:
Bruder John 2024-05-08 15:04:57 +02:00
parent c0b30f9620
commit b2e86ca631
4 changed files with 8 additions and 2 deletions

BIN
classFileOutput/Test.class Normal file

Binary file not shown.

View File

@ -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());

View File

@ -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);

View File

@ -1,6 +1,11 @@
class Example {
int test;
}
class Test {
char test;
}