PageRenderTime 453ms CodeModel.GetById 172ms app.highlight 3ms RepoModel.GetById 156ms app.codeStats 0ms

/src/org/ooc/frontend/model/Block.java

http://github.com/nddrylliog/ooc
Java | 53 lines | 38 code | 15 blank | 0 comment | 0 complexity | 3aa24972ba7c6bc2a191835dfb487ef9 MD5 | raw file
 1package org.ooc.frontend.model;
 2
 3import java.io.IOException;
 4
 5import org.ooc.frontend.Visitor;
 6import org.ooc.frontend.model.tokens.Token;
 7
 8public class Block extends Statement implements Scope {
 9
10	protected final NodeList<Line> body;
11	
12	public Block(Token startToken) {
13		super(startToken);
14		body = new NodeList<Line>(startToken);
15	}
16	
17	public void accept(Visitor visitor) throws IOException {
18		visitor.visit(this);
19	}
20
21	public void acceptChildren(Visitor visitor) throws IOException {
22		body.accept(visitor);
23	}
24
25	public boolean hasChildren() {
26		return body.hasChildren();
27	}
28	
29	@Override
30	public boolean replace(Node oldie, Node kiddo) {
31		return false;
32	}
33	
34	public NodeList<Line> getBody() {
35		return body;
36	}
37
38	public FunctionDecl getFunction(String name, String suffix,
39			FunctionCall call) {
40		return null;
41	}
42
43	public void getFunctions(NodeList<FunctionDecl> functions) {}
44
45	public VariableDecl getVariable(String name) {
46		return getVariable(body, name);
47	}
48
49	public void getVariables(NodeList<VariableDecl> variables) {
50		getVariables(body, variables);
51	}
52
53}