Commit 120ff0a6 authored by Lubomir Bulej's avatar Lubomir Bulej

processor.generator: unified whitespace to simplify merging.

parent 77e263e1
......@@ -8,77 +8,77 @@ import ch.usi.dag.disl.snippet.Shadow;
public class PIResolver {
private Map<ResolverKey, ProcInstance> piStore =
new HashMap<ResolverKey, ProcInstance>();
private static class ResolverKey {
private Shadow shadow;
private int instrPos;
public ResolverKey(Shadow shadow, int instrPos) {
super();
this.shadow = shadow;
this.instrPos = instrPos;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + instrPos;
result = prime * result
+ ((shadow == null) ? 0 : shadow.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ResolverKey other = (ResolverKey) obj;
if (instrPos != other.instrPos)
return false;
if (shadow == null) {
if (other.shadow != null)
return false;
} else if (!shadow.equals(other.shadow))
return false;
return true;
}
}
public ProcInstance get(Shadow shadow, int instrPos) {
ResolverKey key = new ResolverKey(shadow, instrPos);
return piStore.get(key);
}
public void set(Shadow shadow, int instrPos,
ProcInstance processorInstance) {
ResolverKey key = new ResolverKey(shadow, instrPos);
piStore.put(key, processorInstance);
}
public Collection<ProcInstance> getAllProcInstances() {
return piStore.values();
}
private Map<ResolverKey, ProcInstance> piStore =
new HashMap<ResolverKey, ProcInstance>();
private static class ResolverKey {
private Shadow shadow;
private int instrPos;
public ResolverKey(Shadow shadow, int instrPos) {
super();
this.shadow = shadow;
this.instrPos = instrPos;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + instrPos;
result = prime * result
+ ((shadow == null) ? 0 : shadow.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ResolverKey other = (ResolverKey) obj;
if (instrPos != other.instrPos)
return false;
if (shadow == null) {
if (other.shadow != null)
return false;
} else if (!shadow.equals(other.shadow))
return false;
return true;
}
}
public ProcInstance get(Shadow shadow, int instrPos) {
ResolverKey key = new ResolverKey(shadow, instrPos);
return piStore.get(key);
}
public void set(Shadow shadow, int instrPos,
ProcInstance processorInstance) {
ResolverKey key = new ResolverKey(shadow, instrPos);
piStore.put(key, processorInstance);
}
public Collection<ProcInstance> getAllProcInstances() {
return piStore.values();
}
}
......@@ -6,21 +6,21 @@ import ch.usi.dag.disl.processorcontext.ArgumentProcessorMode;
public class ProcInstance {
private ArgumentProcessorMode procApplyType;
private List<ProcMethodInstance> methods;
private ArgumentProcessorMode procApplyType;
private List<ProcMethodInstance> methods;
public ProcInstance(ArgumentProcessorMode procApplyType,
List<ProcMethodInstance> methods) {
super();
this.procApplyType = procApplyType;
this.methods = methods;
}
public ProcInstance(ArgumentProcessorMode procApplyType,
List<ProcMethodInstance> methods) {
super();
this.procApplyType = procApplyType;
this.methods = methods;
}
public ArgumentProcessorMode getProcApplyType() {
return procApplyType;
}
public List<ProcMethodInstance> getMethods() {
return methods;
}
public ArgumentProcessorMode getProcApplyType() {
return procApplyType;
}
public List<ProcMethodInstance> getMethods() {
return methods;
}
}
......@@ -6,42 +6,42 @@ import ch.usi.dag.disl.processor.ProcCode;
public class ProcMethodInstance {
private int argPos;
private int argsCount;
private ProcArgType argType;
private String argTypeDesc;
private ProcCode code;
public ProcMethodInstance(int argPos, int argsCount, ProcArgType argType,
String argTypeDesc, ProcCode code) {
super();
this.argPos = argPos;
this.argsCount = argsCount;
this.argType = argType;
this.code = code;
this.argTypeDesc = argTypeDesc;
}
public int getArgPos() {
return argPos;
}
public int getArgsCount() {
return argsCount;
}
public ProcArgType getArgType() {
return argType;
}
public String getArgTypeDesc() {
return argTypeDesc;
}
// Note: Code is NOT cloned for each instance of ProcMethodInstance.
// If the weaver does not rely on this, we can reuse processor instances
// which can save us some computation
public ProcCode getCode() {
return code;
}
private int argPos;
private int argsCount;
private ProcArgType argType;
private String argTypeDesc;
private ProcCode code;
public ProcMethodInstance(int argPos, int argsCount, ProcArgType argType,
String argTypeDesc, ProcCode code) {
super();
this.argPos = argPos;
this.argsCount = argsCount;
this.argType = argType;
this.code = code;
this.argTypeDesc = argTypeDesc;
}
public int getArgPos() {
return argPos;
}
public int getArgsCount() {
return argsCount;
}
public ProcArgType getArgType() {
return argType;
}
public String getArgTypeDesc() {
return argTypeDesc;
}
// Note: Code is NOT cloned for each instance of ProcMethodInstance.
// If the weaver does not rely on this, we can reuse processor instances
// which can save us some computation
public ProcCode getCode() {
return code;
}
}
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