Structure
This commit is contained in:
parent
7e4c0d97f6
commit
c48a3671fb
3
src/main/java/Example.java
Normal file
3
src/main/java/Example.java
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
public class Example {
|
||||||
|
}
|
||||||
|
|
@ -1,10 +1,11 @@
|
|||||||
package parser;
|
|
||||||
|
|
||||||
import bytecode.ByteCodeGenerator;
|
import bytecode.ByteCodeGenerator;
|
||||||
import org.antlr.v4.runtime.CharStream;
|
import org.antlr.v4.runtime.CharStream;
|
||||||
import org.antlr.v4.runtime.CharStreams;
|
import org.antlr.v4.runtime.CharStreams;
|
||||||
import org.antlr.v4.runtime.CommonTokenStream;
|
import org.antlr.v4.runtime.CommonTokenStream;
|
||||||
import org.antlr.v4.runtime.tree.ParseTree;
|
import org.antlr.v4.runtime.tree.ParseTree;
|
||||||
|
import parser.ASTBuilder;
|
||||||
|
import parser.ClassDeclarationNode;
|
||||||
|
import parser.ProgramNode;
|
||||||
import parser.generated.SimpleJavaLexer;
|
import parser.generated.SimpleJavaLexer;
|
||||||
import parser.generated.SimpleJavaParser;
|
import parser.generated.SimpleJavaParser;
|
||||||
|
|
||||||
@ -15,7 +16,7 @@ public class Main {
|
|||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
CharStream codeCharStream = null;
|
CharStream codeCharStream = null;
|
||||||
try {
|
try {
|
||||||
codeCharStream = CharStreams.fromPath(Paths.get("path/to/your/file.txt"));
|
codeCharStream = CharStreams.fromPath(Paths.get("src/main/java/Example.java"));
|
||||||
parsefile(codeCharStream);
|
parsefile(codeCharStream);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
System.err.println("Error reading the file: " + e.getMessage());
|
System.err.println("Error reading the file: " + e.getMessage());
|
@ -1 +0,0 @@
|
|||||||
class Test { }
|
|
@ -9,6 +9,11 @@ public class SimpleJavaFeatureTest {
|
|||||||
this.b = b;
|
this.b = b;
|
||||||
this.c = c;
|
this.c = c;
|
||||||
}
|
}
|
||||||
|
private class InnerClass {
|
||||||
|
void innerMethod() {
|
||||||
|
System.out.println("Inner class method");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Methode zur Demonstration von Kontrollstrukturen
|
// Methode zur Demonstration von Kontrollstrukturen
|
||||||
void controlStructures() {
|
void controlStructures() {
|
||||||
|
Loading…
Reference in New Issue
Block a user