moved Eample to resources
This commit is contained in:
parent
c0b30f9620
commit
b2e86ca631
BIN
classFileOutput/Test.class
Normal file
BIN
classFileOutput/Test.class
Normal file
Binary file not shown.
@ -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());
|
||||
|
@ -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);
|
||||
|
||||
|
@ -1,6 +1,11 @@
|
||||
class Example {
|
||||
|
||||
int test;
|
||||
|
||||
}
|
||||
|
||||
class Test {
|
||||
|
||||
char test;
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user