PageRenderTime 344ms CodeModel.GetById 160ms app.highlight 3ms RepoModel.GetById 171ms app.codeStats 0ms

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

http://github.com/nddrylliog/ooc
Java | 30 lines | 22 code | 8 blank | 0 comment | 4 complexity | fed861b60f64b34af771922b0c7fdfa4 MD5 | raw file
 1package org.ooc.frontend.model;
 2
 3import org.ooc.frontend.model.interfaces.MustBeResolved;
 4import org.ooc.frontend.model.tokens.Token;
 5import org.ooc.middle.hobgoblins.Resolver;
 6
 7public abstract class Literal extends Expression implements MustBeResolved {
 8
 9	public Literal(Token startToken) {
10		super(startToken);
11	}
12	
13	public boolean isResolved() {
14		return getType() != null && getType().isResolved();
15	}
16	
17	public Response resolve(NodeList<Node> stack, Resolver res, boolean fatal) {
18		if(getType() != null) {
19			getType().resolve(stack, res, fatal);
20		}
21		
22		return isResolved() ? Response.OK : Response.LOOP; 
23	}
24	
25	@Override
26	public boolean isConstant() {
27		return true;
28	}
29
30}