Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
e23d84cd09
@ -34,7 +34,7 @@ public class ASTGenerator extends DecafBaseVisitor<Node> {
|
|||||||
boolean hasMain;
|
boolean hasMain;
|
||||||
if(ctx.MainMethodDecl() != null) {
|
if(ctx.MainMethodDecl() != null) {
|
||||||
hasMain = true;
|
hasMain = true;
|
||||||
MethodDecl mainMethod = new MethodDecl(name, "void", "main", new ParameterList(new ArrayList<>()), new BlockStatement(new ArrayList<>(), "void"));
|
MethodDecl mainMethod = new MethodDecl(name, "void", "main", new ParameterList(new ArrayList<>()), new BlockStatement(new ArrayList<>(), null));
|
||||||
} else {
|
} else {
|
||||||
hasMain = false;
|
hasMain = false;
|
||||||
}
|
}
|
||||||
@ -378,12 +378,7 @@ public class ASTGenerator extends DecafBaseVisitor<Node> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getReturnType(List<IStatement> statements) {
|
public String getReturnType(List<IStatement> statements) {
|
||||||
for(IStatement stmt: statements) {
|
return null;
|
||||||
if(stmt instanceof ReturnStatement) {
|
|
||||||
return "not";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return "void";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user