PageRenderTime 353ms CodeModel.GetById 179ms app.highlight 2ms RepoModel.GetById 159ms app.codeStats 0ms

/src/org/ooc/backend/cdirty/ArrayAccessWriter.java

http://github.com/nddrylliog/ooc
Java | 19 lines | 14 code | 5 blank | 0 comment | 1 complexity | 6f3a1deac20b3571891416e5eca9e044 MD5 | raw file
 1package org.ooc.backend.cdirty;
 2
 3import java.io.IOException;
 4
 5import org.ooc.frontend.model.ArrayAccess;
 6import org.ooc.frontend.model.Expression;
 7
 8public class ArrayAccessWriter {
 9
10	public static void write(ArrayAccess arrayAccess, CGenerator cgen) throws IOException {
11		arrayAccess.getVariable().accept(cgen);
12		for(Expression index: arrayAccess.getIndices()) {
13			cgen.current.app('[');
14			index.accept(cgen);
15			cgen.current.app(']');
16		}
17	}
18	
19}