Commit 78ce89f7 authored by Alexander Weigl's avatar Alexander Weigl

functions in prettyprinter

parent 5a85236f
Pipeline #15296 failed with stages
in 1 minute and 27 seconds
...@@ -2,7 +2,7 @@ package edu.kit.iti.formal.psdbg.parser; ...@@ -2,7 +2,7 @@ package edu.kit.iti.formal.psdbg.parser;
import edu.kit.iti.formal.psdbg.parser.ast.*; import edu.kit.iti.formal.psdbg.parser.ast.*;
public class ASTDiff implements Visitor<ASTNode> { public class ASTDiff extends DefaultASTVisitor<ASTNode> {
private ASTNode other; private ASTNode other;
private ProofScript newScript; private ProofScript newScript;
......
...@@ -166,7 +166,7 @@ public class PrettyPrinter extends DefaultASTVisitor<Void> { ...@@ -166,7 +166,7 @@ public class PrettyPrinter extends DefaultASTVisitor<Void> {
} }
/* if (casesStatement.getDefaultCase() != null) { /* if (casesStatement.getDefaultCase() != null) {
s.append("default {"); s.append("default {");
casesStatement.getDefaultCase().accept(this); casesStatement.getDefaultCase().visit(this);
cl(); cl();
s.append("}"); s.append("}");
}*/ }*/
...@@ -271,6 +271,19 @@ public class PrettyPrinter extends DefaultASTVisitor<Void> { ...@@ -271,6 +271,19 @@ public class PrettyPrinter extends DefaultASTVisitor<Void> {
} }
@Override
public Void visit(FunctionCall func) {
s.append(func.getFunction().getName())
.append('(');
func.getArguments().forEach(a -> {
a.accept(this);
s.append(", ");
});
s.delete(s.length() - 3, s.length() - 1); //delete last ', '
s.append(')');
return null;
}
@Override @Override
public Void visit(Parameters parameters) { public Void visit(Parameters parameters) {
int nl = getLastNewline(); int nl = getLastNewline();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment