当前位置: 首页>>代码示例>>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;未经允许,请勿转载。