comments
This commit is contained in:
parent
dd424cda99
commit
5a28d88f6a
@ -29,7 +29,7 @@ public class Main {
|
||||
|
||||
|
||||
static void parsefile(CharStream codeCharStream) {
|
||||
/* ------------------------- Scanner -> tokens ------------------------- */
|
||||
/*------------------------- Scanner -> tokens -------------------------*/
|
||||
SimpleJavaLexer lexer = new SimpleJavaLexer(codeCharStream);
|
||||
CommonTokenStream tokenStream = new CommonTokenStream(lexer);
|
||||
|
||||
@ -46,7 +46,7 @@ public class Main {
|
||||
}
|
||||
System.out.println();
|
||||
|
||||
/* ------------------------- Parser -> Parsetree ------------------------- */
|
||||
/*------------------------- Parser -> Parsetree -------------------------*/
|
||||
SimpleJavaParser parser = new SimpleJavaParser(tokenStream);
|
||||
ParseTree parseTree = parser.program(); // parse the input
|
||||
|
||||
@ -56,7 +56,7 @@ public class Main {
|
||||
printTree(parseTree, parser, 0);
|
||||
System.out.println();
|
||||
|
||||
/* ------------------------- AST builder -> AST ------------------------- */
|
||||
/*------------------------- AST builder -> AST -------------------------*/
|
||||
ASTBuilder astBuilder = new ASTBuilder();
|
||||
ProgramNode abstractSyntaxTree = (ProgramNode) astBuilder.visit(parseTree);
|
||||
|
||||
@ -66,19 +66,14 @@ public class Main {
|
||||
printAST(abstractSyntaxTree, 0);
|
||||
System.out.println();
|
||||
|
||||
/*
|
||||
* ------------------------- Semantic Analyzer -> Tast -------------------------
|
||||
*/
|
||||
/*------------------------- Semantic Analyzer -> Tast -------------------------*/
|
||||
SemanticAnalyzer.generateTast(abstractSyntaxTree);
|
||||
ProgramNode typedAst = (ProgramNode) SemanticAnalyzer.generateTast(abstractSyntaxTree);
|
||||
|
||||
// Printing the Tast
|
||||
System.out.println("Tast generated");
|
||||
|
||||
/*
|
||||
* ------------------------- Bytecode Generator -> Bytecode
|
||||
* -------------------------
|
||||
*/
|
||||
/*------------------------- Bytecode Generator -> Bytecode -------------------------*/
|
||||
ByteCodeGenerator byteCodeGenerator = new ByteCodeGenerator();
|
||||
//byteCodeGenerator.generateByteCode(abstractSyntaxTree);
|
||||
byteCodeGenerator.visit(typedAst);
|
||||
|
Binary file not shown.
@ -5,7 +5,7 @@ public class Tester {
|
||||
}
|
||||
}
|
||||
// java -jar pfadtocompiler.jar EmptyClass.java
|
||||
//mit bash scipt ode rmakefile test automatisieren
|
||||
//mvn package
|
||||
// mit bash scipt ode rmakefile test automatisieren
|
||||
// mvn package
|
||||
// javac tester // tester compilen
|
||||
// java tester // tester ausführen
|
Loading…
Reference in New Issue
Block a user