Exemple #1
0
 /// <summary>
 ///     Adds another list of usage to this list, and sets the mode if not yet set
 /// </summary>
 /// <param name="other"></param>
 /// <param name="mode"></param>
 public void AddUsages(Usages other, Usage.ModeEnum?mode)
 {
     foreach (Usage usage in other.AllUsages)
     {
         if (usage.Mode == null)
         {
             usage.Mode = mode;
         }
         AllUsages.Add(usage);
     }
 }
        /// <summary>
        ///     Performs the semantic analysis of the expression
        /// </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>
        /// <returns>True if semantic analysis should be continued</returns>
        public virtual bool SemanticAnalysis(INamable instance, BaseFilter expectation)
        {
            bool retVal = !SemanticAnalysisDone;

            if (retVal)
            {
                StaticUsage          = new Usages();
                SemanticAnalysisDone = true;
            }

            return(retVal);
        }
Exemple #3
0
        /// <summary>
        ///     Performs the semantic analysis of the term
        /// </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="lastElement">Indicates that this element is the last one in a dereference chain</param>
        /// <returns>True if semantic analysis should be continued</returns>
        public void SemanticAnalysis(INamable instance, BaseFilter expectation, bool lastElement)
        {
            ReturnValue tmp = GetReferences(instance, expectation, lastElement);

            if (Image != ThisKeyword && Image != EnclosingKeyword)
            {
                tmp.Filter(expectation);
            }
            if (tmp.IsUnique)
            {
                Ref = tmp.Values[0].Value;
            }

            if (StaticUsage == null)
            {
                StaticUsage = new Usages();
                StaticUsage.AddUsage(Ref, Root, null);
            }
        }