GetReferenceTypes() public method

Provides the possible references types for this expression (used in semantic analysis)
public GetReferenceTypes ( INamable instance, BaseFilter expectation, bool last ) : DataDictionary.Interpreter.ReturnValue
instance INamable the reference instance on which this element should analysed
expectation BaseFilter Indicates the kind of element we are looking for
last bool indicates that this is the last element in a dereference chain
return DataDictionary.Interpreter.ReturnValue
Exemplo n.º 1
0
        /// <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>
        /// <param name="expectation">Indicates the kind of element we are looking for</param>
        /// <param name="last">indicates that this is the last element in a dereference chain</param>
        /// <returns></returns>
        public override ReturnValue GetReferenceTypes(INamable instance, BaseFilter expectation, bool last)
        {
            ReturnValue retVal = ReturnValue.Empty;

            if (Term != null)
            {
                retVal = Term.GetReferenceTypes(instance, expectation, last);
            }
            else
            {
                if (Expression != null)
                {
                    retVal = Expression.GetReferenceTypes(instance, expectation, true);
                }
            }

            return(retVal);
        }
Exemplo n.º 2
0
        /// <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>
        /// <param name="expectation">Indicates the kind of element we are looking for</param>
        /// <param name="last">indicates that this is the last element in a dereference chain</param>
        /// <returns></returns>
        public ReturnValue GetReferenceTypes(INamable instance, BaseFilter 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 Type)
                    {
                        const bool asType = true;
                        retVal.Add(element.Value, null, asType);
                    }
                }
            }
            else if (LiteralValue != null)
            {
                retVal = LiteralValue.GetReferenceTypes(instance, expectation, true);
            }

            return(retVal);
        }