public Object render(Scope scope, Statement statement, int tokenIndex)
			throws PoslException {
		switch (state) {
		case NORMAL:
		case OPTIONAL:
			return scope.get(type, statement.get(tokenIndex));
		case CONTEXT_PROPERTY:
			return scope.get((String) parameter);
		case SCOPE:
			return scope;
			// Collection is a special case which takes a Collection
			// object and
			// adds all the remaining arguments into that collection
		case COLLECTION:
			try {
				Object list = type.getClass().newInstance();
				ParameterizedType parameterizedType = (ParameterizedType) type
						.getClass().getGenericSuperclass();
				Type generic = parameterizedType.getActualTypeArguments()[0];
				Method add = Collection.class.getDeclaredMethod("add",
						Object.class);
				for (int index = tokenIndex; index < statement.size(); ++index) {
					add.invoke(list, scope.get(generic, statement.get(index)));
				}
			} catch (Exception e) {
				throw new PoslException(statement.startPos(),
						"failed to get COLLECTION");
			}
		case REFERENCE:
			return new Reference(statement.get(tokenIndex), scope);
		}
		return null;
	}