ANTLR Test angepasst

This commit is contained in:
JanUlrich 2014-09-15 23:37:50 +02:00
parent 250b98d679
commit 199278ac8b

View File

@ -29,9 +29,9 @@ class EvalVisitor extends Java8BaseVisitor<SyntaxTreeNode> {
@Override @Override
public SyntaxTreeNode visitCompilationUnit(CompilationUnitContext ctx) { public SyntaxTreeNode visitCompilationUnit(CompilationUnitContext ctx) {
Vector<SyntaxTreeNode> classDefinitions = new Vector<>(); Vector<Class> classDefinitions = new Vector<>();
for(TypeDeclarationContext tDecl : ctx.typeDeclaration()){ for(TypeDeclarationContext tDecl : ctx.typeDeclaration()){
SyntaxTreeNode cl = visit(tDecl); Class cl = (Class) visit(tDecl);
classDefinitions.add(cl); classDefinitions.add(cl);
} }
@ -39,15 +39,14 @@ class EvalVisitor extends Java8BaseVisitor<SyntaxTreeNode> {
} }
@Override @Override
public SyntaxTreeNode visitTypeDeclaration(TypeDeclarationContext ctx) { public Class visitTypeDeclaration(TypeDeclarationContext ctx) {
// TODO Auto-generated method stub Class ret = (Class) visit(ctx.classDeclaration());
return super.visitTypeDeclaration(ctx); return ret;
} }
@Override @Override
public SyntaxTreeNode visitClassDeclaration(ClassDeclarationContext ctx) { public Class visitClassDeclaration(ClassDeclarationContext ctx) {
// TODO Auto-generated method stub return null;
return super.visitClassDeclaration(ctx);
} }
} }