MCPcopy Create free account
hub / github.com/chibash/stone / translate

Method translate

src/chap14/ToJava.java:91–100  ·  view source on GitHub ↗
(TypeInfo result)

Source from the content-addressed store, hash-verified

89 @Reviser public static class NameEx3 extends TypeChecker.NameEx2 {
90 public NameEx3(Token t) { super(t); }
91 public String translate(TypeInfo result) {
92 if (type.isFunctionType())
93 return JavaFunction.className(name()) + "." + METHOD;
94 else if (nest == 0)
95 return LOCAL + index;
96 else {
97 String expr = ENV + ".get(0," + index + ")";
98 return translateExpr(expr, TypeInfo.ANY, type);
99 }
100 }
101 public String translateAssign(TypeInfo valueType, ASTree right) {
102 if (nest == 0)
103 return "(" + LOCAL + index + "="

Callers

nothing calls this directly

Calls 4

classNameMethod · 0.95
translateExprMethod · 0.80
isFunctionTypeMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected