public override Result Process(OclParser.PropertyCallContext context) { CollectionResult newElements = (CollectionResult)GlobalResult; foreach (Result val in newElements.ToList()) { GlobalResult = val; newElements.Remove(val); newElements.Add(Calculator.VisitExpression(context.propertyCallParameters().actualParameterList().expression()[0])); } return(newElements); }
public override Result Process(OclParser.PropertyCallContext context) { CollectionResult filteredElements = (CollectionResult)GlobalResult; Dictionary <string, Result> varsStack = new Dictionary <string, Result>(); Vars.Add(varsStack); foreach (Result val in filteredElements.ToList()) { varsStack["self"] = val; if (!Interpreter.VisitExpression(context.propertyCallParameters().actualParameterList().expression()[0])) { filteredElements.Remove(val); } } Vars.RemoveAt(Vars.Count - 1); return(filteredElements); }