當前位置: 首頁>>代碼示例>>C#>>正文


C# SymbolTable.ResolveMatch方法代碼示例

本文整理匯總了C#中XSpect.Yacq.Symbols.SymbolTable.ResolveMatch方法的典型用法代碼示例。如果您正苦於以下問題:C# SymbolTable.ResolveMatch方法的具體用法?C# SymbolTable.ResolveMatch怎麽用?C# SymbolTable.ResolveMatch使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在XSpect.Yacq.Symbols.SymbolTable的用法示例。


在下文中一共展示了SymbolTable.ResolveMatch方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ReduceImpl

 /// <summary>
 /// Reduces this node to a simpler expression with additional symbol tables.
 /// </summary>
 /// <param name="symbols">The additional symbol table for reducing.</param>
 /// <param name="expectedType">The type which is expected as the type of reduced expression.</param>
 /// <returns>The reduced expression.</returns>
 protected override Expression ReduceImpl(SymbolTable symbols, Type expectedType)
 {
     if (symbols.ResolveMatch(DispatchTypes.Member, this.Name) != null
         || symbols.Missing != DispatchExpression.DefaultMissing
     )
     {
         return Variable(symbols, this.Name)
             .ReduceOnce(symbols, expectedType)
             .Let(e => (e as MacroExpression).Null(m => m.Evaluate(symbols)) ?? e);
     }
     else
     {
         throw new ParseException("Identifier evaluation failed: " + this, this);
     }
 }
開發者ID:takeshik,項目名稱:yacq,代碼行數:21,代碼來源:IdentifierExpression.cs

示例2: ReduceImpl

 /// <summary>
 /// Reduces this node to a simpler expression with additional symbol tables.
 /// </summary>
 /// <param name="symbols">The additional symbol table for reducing.</param>
 /// <param name="expectedType">The type which is expected as the type of reduced expression.</param>
 /// <returns>The reduced expression.</returns>
 protected override Expression ReduceImpl(SymbolTable symbols, Type expectedType)
 {
     Expression value = null;
     if (this.Elements.IsEmpty())
     {
         return Empty();
     }
     if (!(this[0] is IdentifierExpression)
         || symbols.ResolveMatch(DispatchTypes.Member, this[0].Id()) != null
     )
     {
         value = this[0].TryReduce(symbols);
         if (value is MacroExpression)
         {
             return ((MacroExpression) value).Evaluate(symbols, this.Elements.Skip(1));
         }
         if (value != null && value.Type(symbols).GetDelegateSignature() != null)
         {
             return Invoke(value, this.Elements.Skip(1).ReduceAll(symbols));
         }
         if (value is TypeCandidateExpression)
         {
             return Dispatch(
                 symbols,
                 DispatchTypes.Constructor,
                 value,
                 null,
                 this.Elements.Skip(1)
             );
         }
     }
     if (this[0] is IdentifierExpression
         && symbols.ResolveMatch(DispatchTypes.Method, this[0].Id()) != null
         || symbols.Missing != DispatchExpression.DefaultMissing
     )
     {
         return Function(
             symbols,
             this[0].Id(),
             this.Elements.Skip(1)
         );
     }
     if (value != null && this.Length == 1)
     {
         return value;
     }
     throw new ParseException("List evaluation failed: " + this, this);
 }
開發者ID:takeshik,項目名稱:yacq,代碼行數:54,代碼來源:ListExpression.cs

示例3: ReduceImpl

        // this._left and Candidate.Arguments is already reduced with symbols.

        /// <summary>
        /// Reduces this node to a simpler expression with additional symbol tables.
        /// </summary>
        /// <param name="symbols">The additional symbol table for reducing.</param>
        /// <param name="expectedType">The type which is expected as the type of reduced expression.</param>
        /// <returns>The reduced expression.</returns>
        protected override Expression ReduceImpl(SymbolTable symbols, Type expectedType)
        {
            this._left = this.Left.Reduce(symbols);
            return symbols.ResolveMatch(this)
                .If(d => d == null, d => symbols.Missing)
                (this, symbols, expectedType);
        }
開發者ID:takeshik,項目名稱:yacq,代碼行數:15,代碼來源:DispatchExpression.cs


注:本文中的XSpect.Yacq.Symbols.SymbolTable.ResolveMatch方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。