PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/src/org/ooc/frontend/parser/TypeParamParser.java

http://github.com/nddrylliog/ooc
Java | 24 lines | 19 code | 5 blank | 0 comment | 3 complexity | dbb3f6e23d4d70f77beabafc47e20d89 MD5 | raw file
 1package org.ooc.frontend.parser;
 2
 3import java.util.List;
 4
 5import org.ooc.frontend.model.TypeParam;
 6import org.ooc.frontend.model.tokens.Token;
 7import org.ooc.frontend.model.tokens.TokenReader;
 8import org.ooc.frontend.model.tokens.Token.TokenType;
 9import org.ubi.SourceReader;
10
11public class TypeParamParser {
12
13	public static void parse(SourceReader sReader, TokenReader reader,
14			List<TypeParam> typeParams) {
15		while(reader.peek().type != TokenType.GREATERTHAN) {
16			Token nameTok = reader.read();
17			typeParams.add(new TypeParam(nameTok.get(sReader), nameTok));
18			if(reader.peek().type != TokenType.COMMA) break;
19			reader.skip();
20		}
21		reader.skip();
22	}
23	
24}