/// <summary> /// Provides the states used in an expression /// </summary> /// <param name="expression"></param> /// <returns></returns> public static List<Constants.State> GetStates(Interpreter.Expression expression) { List<Constants.State> retval = new List<Constants.State>(); if (expression != null) { foreach (Values.IValue value in expression.GetLiterals()) { Constants.State state = value as Constants.State; if (state != null) { retval.Add(state); } } Interpreter.Call call = expression as Interpreter.Call; if (call != null) { Functions.Function function = call.Called.getStaticCallable() as Functions.Function; if (function != null) { foreach (Values.IValue value in function.GetLiterals()) { Constants.State state = value as Constants.State; if (state != null) { retval.Add(state); } } } } } return retval; }