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