Exemple #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>
        /// <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 override ReturnValue getReferenceTypes(Utils.INamable instance, Filter.AcceptableChoice expectation, bool last)
        {
            ReturnValue retVal = ReturnValue.Empty;

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

            return(retVal);
        }
Exemple #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>
        /// <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);
        }