ProcInfo.java 2.24 KB
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
package jcircus.util;

import java.util.ArrayList;
import java.util.List;
import net.sourceforge.czt.circus.ast.ProcessPara;
import net.sourceforge.czt.z.ast.VarDecl;
import net.sourceforge.czt.z.ast.Expr;

/**
* ProcInfo.java
*
* Contains the information of a process definition.
*
* @author Angela Freitas
*/
public class ProcInfo {

/** Process name */
private String _processName;
/** Process definition */
private ProcessPara _processPara;
/** Code resulting from the translation of the process definition */
private String _code;
/** Normalized variable declarations. That is, each VarDecl declares at most
one variable */
private List<VarDecl> _parameters;
/** Code for the parameters */
private List<String> _codeForActuals;
/** Flag indicating if a main is to be created for the process or not. */
private boolean _createMain;
/**
* Constructor.
*/
public ProcInfo(String processName, ProcessPara processPara, String code,
List<VarDecl> parameters, boolean createMain) {
this._processName = processName;
this._processPara = processPara;
this._code = code;
this._parameters = parameters;
this._codeForActuals = new ArrayList();
this._createMain = createMain;
}
/**
* Getters
*/
public String getProcessName() {
return this._processName;
}
public ProcessPara getProcessPara() {
return this._processPara;
}

public List<VarDecl> getParameters() {
return this._parameters;
}
public List<String> getCodeForActuals() {
return this._codeForActuals;
}
public boolean getCreateMain() {
return this._createMain;
}
public String getCode() {
return this._code;
}

/**
* Setters
*/
public void setCreateMain(boolean createMain) {
this._createMain = createMain;
}

/**
* Other methods.
*/
public void addCodeForActuals(int position, String code) {
this._codeForActuals.add(position, code);
}
public Expr getTypeOfParameter(int position) {
return ((VarDecl) _parameters.get(position)).getExpr();
}
}