forked from JavaTX/JavaCompilerCore
Added some basic handling of package declarations.
This commit is contained in:
parent
b0a6585252
commit
e1d68291c9
@ -4,12 +4,21 @@ import de.dhbwstuttgart.syntaxtree.*;
|
||||
public class CompilationUnitEvaluator extends Java8BaseListener{
|
||||
@Override
|
||||
public void enterCompilationUnit(Java8Parser.CompilationUnitContext ctx) {
|
||||
System.out.println("Entering compilationUnit...");
|
||||
System.out.println("SourceFile(");
|
||||
}
|
||||
@Override
|
||||
public void exitCompilationUnit(Java8Parser.CompilationUnitContext ctx) {
|
||||
System.out.println("sourceFile(");
|
||||
System.out.println(ctx.packageDeclaration().Identifier());
|
||||
System.out.println(")");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enterPackageDeclaration(Java8Parser.PackageDeclarationContext ctx) {
|
||||
System.out.println("package(");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exitPackageDeclaration(Java8Parser.PackageDeclarationContext ctx) {
|
||||
System.out.println(ctx.Identifier());
|
||||
System.out.println(")");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user