summaryrefslogtreecommitdiff
path: root/boil
diff options
context:
space:
mode:
Diffstat (limited to 'boil')
-rw-r--r--boil/library/BoilSimp.java30
1 files changed, 25 insertions, 5 deletions
diff --git a/boil/library/BoilSimp.java b/boil/library/BoilSimp.java
index e5c622c..febaa20 100644
--- a/boil/library/BoilSimp.java
+++ b/boil/library/BoilSimp.java
@@ -716,10 +716,11 @@ public class BoilSimp extends GJDepthFirst<String,String> {
* f5 -> ")"
*/
public String visit(MessageSend n, String args) {
+ // if you have to read this, good luck
String mod = "";
- // gross code was required to create proper types + classes for anonymous classes...
String id;
+ String id2 = n.f2.f0.tokenImage;
TypeInstance cur;
ClassInstance cls;
switch (n.f0.f0.which) {
@@ -727,6 +728,20 @@ public class BoilSimp extends GJDepthFirst<String,String> {
id = ((Identifier) n.f0.f0.choice).f0.tokenImage;
cur = this.symt.getType(id);
break;
+ case 4:
+ id = n.f0.accept(this, args);
+ String call_tmp = this.tf.alias(Integer.toString(this.id++));
+ this.vapor += n.f4.accept(this, args);
+ vapor += String.format(" %s = call %s(this",
+ call_tmp,
+ id);
+
+ vapor += String.format(" %s)\n",
+ this.tf.retrieveRecentList(this.symt.getMethod(id2)
+ .getArguments()
+ .size()));
+
+ return call_tmp;
case 6:
id = n.f0.accept(this, args);
cur = new TypeInstance(Integer.toString(this.id++), TypeEnum.ERROR);
@@ -750,9 +765,8 @@ public class BoilSimp extends GJDepthFirst<String,String> {
}
n.f1.accept(this, args);
- String id2 = n.f2.f0.tokenImage;
String tp1 = Integer.toString(this.id++); // TypeFactory likes to know who it's renting to
- String tp2 = "tp2";
+ String tp2 = Integer.toString(this.id++);
// System.out.println("id " + id);
// System.out.println("cur " + cur);
@@ -875,7 +889,13 @@ public class BoilSimp extends GJDepthFirst<String,String> {
*/
public String visit(ThisExpression n, String args) {
String mod = "";
- n.f0.accept(this, args);
+ vapor += String.format(" %s = [this]\n",
+ this.tf.alias(Integer.toString(this.id++)));
+ vapor += String.format(" %s = [%s+%d]\n",
+ this.tf.alias(Integer.toString(this.id-1)),
+ this.tf.alias(Integer.toString(this.id-1)),
+ 0);
+ mod += this.tf.alias(Integer.toString(this.id-1));
return mod;
}
@@ -934,7 +954,7 @@ public class BoilSimp extends GJDepthFirst<String,String> {
public String visit(BracketExpression n, String args) {
String mod = "";
n.f0.accept(this, args);
- n.f1.accept(this, args);
+ mod += n.f1.accept(this, args);
n.f2.accept(this, args);
return mod;
}