PageRenderTime 16ms CodeModel.GetById 8ms app.highlight 4ms RepoModel.GetById 2ms app.codeStats 0ms

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

http://github.com/nddrylliog/ooc
Java | 29 lines | 20 code | 9 blank | 0 comment | 2 complexity | 9b929f9509a9bd908ea3eb62af0c923a 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 While extends Conditional {
 9
10	public While(Expression condition, Token startToken) {
11		super(condition, startToken);
12	}
13	
14	public void accept(Visitor visitor) throws IOException {
15		visitor.visit(this);
16	}
17	
18	@Override
19	public boolean replace(Node oldie, Node kiddo) {
20		
21		if(oldie == condition) {
22			condition = (Expression) kiddo;
23			return true;
24		}
25		return false;
26		
27	}
28
29}