コード例 #1
0
ファイル: ScopeTable.cs プロジェクト: macias/Skila
        internal IEnumerable <EntityInstance> Find(ITemplateName name)
        {
            if (!this.dict.TryGetValue(name.Name, out List <List <EntityInstance> > list) || name.Arity >= list.Count)
            {
                return(Enumerable.Empty <EntityInstance>());
            }

            return(list[name.Arity]);
        }
コード例 #2
0
        /*internal void RemoveLast(ILocalBindable bindable)
         * {
         *  if (string.IsNullOrEmpty(bindable.Name.Name))
         *      return;
         *  this.bag.RemoveLast(bindable.Name, new LocalInfo(bindable));
         * }*/


        internal bool TryGet <T>(ITemplateName name, out T value)
            where T : class, IBindable
        {
            LocalInfo info;

            if (!this.bag.TryGetValue(name, out info))
            {
                value = null;
                return(false);
            }

            value = info.Bindable as T;
            bool result = value != null;

            if (result)
            {
                info.Used = true;
                if ((name.Owner as Assignment)?.Lhs != name)
                {
                    info.Read = true;
                }
            }
            return(result);
        }
コード例 #3
0
 public TemplateNamePresenter(ITemplateName _view)
 {
     view = _view;
 }