1 package edu.uci.eecs.specCompiler.specExtraction;
3 import java.util.ArrayList;
5 public class FunctionHeader {
6 public final String returnType;
7 public final QualifiedName qualifiedName;
8 public final ArrayList<VariableDeclaration> args;
10 public FunctionHeader(String returnType, QualifiedName qualifiedName,
11 ArrayList<VariableDeclaration> args) {
12 this.returnType = returnType;
13 this.qualifiedName = qualifiedName;
17 public String toString() {
18 String res = returnType + " " + qualifiedName.fullName + "(";
19 if (args.size() >= 1) {
20 res = res + args.get(0);
22 for (int i = 1; i < args.size(); i++) {
23 res = res + ", " + args.get(i);
29 public FunctionHeader getRenamedHeader(String prefix) {
30 String newFullName = qualifiedName.qualifiedName + prefix + "_"
31 + qualifiedName.bareName;
32 FunctionHeader newHeader = new FunctionHeader(returnType,
33 new QualifiedName(newFullName), args);
37 public String getRenamedCall(String prefix) {
38 String res = prefix + "_" + qualifiedName.fullName + "(";
39 if (args.size() >= 1) {
40 res = res + args.get(0).name;
42 for (int i = 1; i < args.size(); i++) {
43 res = res + ", " + args.get(i).name;