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

Method translate

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

Source from the content-addressed store, hash-verified

150 @Reviser public static class BlockEx2 extends TypeChecker.BlockEx {
151 public BlockEx2(List<ASTree> c) { super(c); }
152 public String translate(TypeInfo result) {
153 ArrayList<ASTree> body = new ArrayList<ASTree>();
154 for (ASTree t: this)
155 if (!(t instanceof NullStmnt))
156 body.add(t);
157 StringBuilder code = new StringBuilder();
158 if (result != null && body.size() < 1)
159 code.append(returnZero(result));
160 else
161 for (int i = 0; i < body.size(); i++)
162 translateStmnt(code, body.get(i), result,
163 i == body.size() - 1);
164 return code.toString();
165 }
166 protected void translateStmnt(StringBuilder code, ASTree tree,
167 TypeInfo result, boolean last)
168 {

Callers

nothing calls this directly

Calls 7

translateStmntMethod · 0.95
returnZeroMethod · 0.80
getMethod · 0.65
addMethod · 0.45
sizeMethod · 0.45
appendMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected