private static ActivityLocationReferenceEnvironment processVariables(
			Activity owner,
			List<Variable> variables,
			boolean isPublic,
			ActivityLocationReferenceEnvironment environment,
			AtomicInteger environmentId,
			Stack<Activity> stack) {
		if (variables.size() == 0)
			return environment;
		if (environment == null)
			environment = new ActivityLocationReferenceEnvironment(owner.getParentEnvironment());
		for (Variable variable : variables) {
			variable.initializeRelationship(owner, isPublic);
			variable.setId(environmentId.getAndIncrement());
			environment.declare(variable, owner);

			if (variable.getDefault() != null)
				stack.add(variable.getDefault());
		}
		return environment;
	}