/// <summary> /// Provides the possible references for this term (only available during semantic analysis) /// </summary> /// <param name="instance">the instance on which this element should be found.</param> /// <param name="expectation">the expectation on the element found</param> /// <param name="last">indicates that this is the last element in a dereference chain</param> /// <returns></returns> public ReturnValue getReferences(Utils.INamable instance, Filter.AcceptableChoice expectation, bool last) { ReturnValue retVal = null; if (Designator != null) { retVal = Designator.getReferences(instance, expectation, last); } else if (LiteralValue != null) { retVal = LiteralValue.getReferences(instance, expectation, last); } return(retVal); }
/// <summary> /// Provides the possible references types for this expression (used in semantic analysis) /// </summary> /// <param name="instance">the reference instance on which this element should analysed</param> /// <paraparam name="expectation">Indicates the kind of element we are looking for</paraparam> /// <param name="last">indicates that this is the last element in a dereference chain</param> /// <returns></returns> public ReturnValue getReferenceTypes(Utils.INamable instance, Filter.AcceptableChoice expectation, bool last) { ReturnValue retVal = null; if (Designator != null) { retVal = new ReturnValue(); foreach (ReturnValueElement element in Designator.getReferences(instance, expectation, last).Values) { if (element.Value is Types.Type) { retVal.Add(element.Value); } } } else if (LiteralValue != null) { retVal = LiteralValue.getReferenceTypes(instance, expectation, true); } return(retVal); }