PageRenderTime 555ms CodeModel.GetById 443ms app.highlight 4ms RepoModel.GetById 107ms app.codeStats 0ms

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

http://github.com/nddrylliog/ooc
Java | 30 lines | 23 code | 7 blank | 0 comment | 4 complexity | b6020d528a5f67215ea9599efdc7fedd MD5 | raw file
 1package org.ooc.backend.cdirty;
 2
 3import java.io.IOException;
 4
 5import org.ooc.frontend.model.Access;
 6import org.ooc.frontend.model.ArrayAccess;
 7import org.ooc.frontend.model.MemberAccess;
 8import org.ooc.frontend.model.VariableAccess;
 9
10public class AccessWriter {
11
12	public static void write(Access access, CGenerator cgen) throws IOException {
13		write(access, true, cgen, 0);
14	}
15	
16	public static void write(Access access, boolean doTypeParams, CGenerator cgen) throws IOException {
17		write(access, doTypeParams, cgen, 0);
18	}
19	
20	public static void write(Access access, boolean doTypeParams, CGenerator cgen, int refOffset) throws IOException {
21		if(access instanceof ArrayAccess) {
22			ArrayAccessWriter.write((ArrayAccess) access, cgen);
23		} else if(access instanceof MemberAccess) {
24			MemberAccessWriter.write((MemberAccess) access, doTypeParams, cgen, refOffset);
25		} else {
26			LocalAccessWriter.write((VariableAccess) access, doTypeParams, cgen, refOffset);
27		}
28	}
29	
30}