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


C# Symbols.SymbolTable類代碼示例

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


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

示例1: ReplWindow

 public ReplWindow()
 {
     this.Width = 450;
     this.Height = 350;
     this.Title = "YACQ Console";
     this.Content = this.textBox;
     this.textBox.AcceptsReturn = true;
     this.textBox.BorderThickness = new Thickness(0);
     this.textBox.FontFamily = new FontFamily("Consolas");
     this.textBox.HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled;
     this.textBox.VerticalScrollBarVisibility = ScrollBarVisibility.Visible;
     this.textBox.TextWrapping = TextWrapping.Wrap;
     this.textBox.Text = string.Format("YACQ {0} on Krile {1}\r\n", YacqServices.Version, typeof(App).Assembly.GetName().Version);
     this.textBox.Select(this.textBox.Text.Length, 0);
     this.textBox.PreviewKeyDown += this.textBox_PreviewKeyDown;
     this.symbolTable = new SymbolTable(YacqFilter.FilterSymbols, typeof(Symbols))
     {
         {"*textbox*", YacqExpression.Constant(textBox)},
     };
     var rcPath = Path.Combine(
         Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
         "yacq_lib\\rc.yacq"
     );
     if(File.Exists(rcPath))
     {
         YacqServices.ParseAll(this.symbolTable, File.ReadAllText(rcPath))
             .ForEach(e => YacqExpression.Lambda(e).Compile().DynamicInvoke());
         this.textBox.AppendText("rc.yacq was loaded.\r\n");
     }
     this.textBox.AppendText(">>> ");
 }
開發者ID:takeshik,項目名稱:YacqPlugin,代碼行數:31,代碼來源:ReplWindow.cs

示例2: VectorExpression

 internal VectorExpression(
     SymbolTable symbols,
     YacqList elements
 )
     : base(symbols, elements)
 {
 }
開發者ID:takeshik,項目名稱:yacq,代碼行數:7,代碼來源:VectorExpression.cs

示例3: LambdaListExpression

 internal LambdaListExpression(
     SymbolTable symbols,
     YacqList elements
 )
     : base(symbols, elements)
 {
 }
開發者ID:takeshik,項目名稱:yacq,代碼行數:7,代碼來源:LambdaListExpression.cs

示例4: IdentifierExpression

 internal IdentifierExpression(
     SymbolTable symbols,
     String name
 )
     : base(symbols)
 {
     this.Name = name;
 }
開發者ID:takeshik,項目名稱:yacq,代碼行數:8,代碼來源:IdentifierExpression.cs

示例5: TypeCandidateExpression

 internal TypeCandidateExpression(
     SymbolTable symbols,
     IList<Type> candidates
 )
     : base(symbols)
 {
     this.Candidates = new ReadOnlyCollection<Type>(candidates ?? Type.EmptyTypes);
 }
開發者ID:takeshik,項目名稱:yacq,代碼行數:8,代碼來源:TypeCandidateExpression.cs

示例6: SerializedExpression

 internal SerializedExpression(
     SymbolTable symbols,
     Node node
 )
     : base(symbols)
 {
     this.Node = node;
 }
開發者ID:takeshik,項目名稱:yacq,代碼行數:8,代碼來源:SerializedExpression.cs

示例7: Clear

 public static Expression Clear(DispatchExpression e, SymbolTable s, Type t)
 {
     return YacqExpression.Dispatch(
         s,
         DispatchTypes.Method,
         s.Resolve("*textbox*"),
         "Clear"
     );
 }
開發者ID:takeshik,項目名稱:YacqPlugin,代碼行數:9,代碼來源:Symbols.cs

示例8: NumberExpression

 internal NumberExpression(
     SymbolTable symbols,
     String text
 )
     : base(symbols)
 {
     this.SourceText = text;
     this.Value = this.Parse();
 }
開發者ID:takeshik,項目名稱:yacq,代碼行數:9,代碼來源:NumberExpression.cs

示例9: AmbiguousParameterExpression

 internal AmbiguousParameterExpression(
     SymbolTable symbols,
     Type type,
     String name
 )
     : base(symbols)
 {
     this._type = type;
     this.Name = name;
 }
開發者ID:takeshik,項目名稱:yacq,代碼行數:10,代碼來源:AmbiguousParameterExpression.cs

示例10: QuotedExpression

 internal QuotedExpression(
     SymbolTable symbols,
     QuoteType quoteType,
     Expression expression
 )
     : base(symbols)
 {
     this.QuoteType = quoteType;
     this.Expression = expression ?? Empty();
     this.SetPosition(this.Expression);
 }
開發者ID:takeshik,項目名稱:yacq,代碼行數:11,代碼來源:QuotedExpression.cs

示例11: ContextfulExpression

 internal ContextfulExpression(
     SymbolTable symbols,
     Expression expression,
     ContextType contextType
 )
     : base(symbols)
 {
     this.Expression = expression;
     this.ContextType = contextType;
     this.SetPosition(expression);
 }
開發者ID:takeshik,項目名稱:yacq,代碼行數:11,代碼來源:ContextfulExpression.cs

示例12: MacroExpression

 internal MacroExpression(SymbolTable symbols, Expression body, IList<AmbiguousParameterExpression> parameters)
     : base(symbols)
 {
     if (parameters.Any(p => p.Type(symbols) != null && !typeof(Expression).IsAppropriate(p.Type)))
     {
         throw new ArgumentException("All parameters of macro must be Expression", "parameters");
     }
     this.Parameters = new ReadOnlyCollection<AmbiguousParameterExpression>(parameters ?? Arrays.Empty<AmbiguousParameterExpression>());
     this.Body = body ?? Empty();
     this.SetPosition(this.Parameters.EndWith(this.Body));
 }
開發者ID:takeshik,項目名稱:yacq,代碼行數:11,代碼來源:MacroExpression.cs

示例13: TextExpression

 internal TextExpression(
     SymbolTable symbols,
     Char quoteChar,
     String sourceText
 )
     : base(symbols)
 {
     this._codes = new List<String>();
     this.QuoteChar = quoteChar;
     this.SourceText = sourceText ?? "";
     this.Value = this.Parse();
 }
開發者ID:takeshik,項目名稱:yacq,代碼行數:12,代碼來源:TextExpression.cs

示例14: 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

示例15: Write

 public static Expression Write(DispatchExpression e, SymbolTable s, Type t)
 {
     return YacqExpression.Dispatch(
         s,
         DispatchTypes.Method,
         s.Resolve("*textbox*"),
         "AppendText",
         YacqExpression.Dispatch(
             s,
             DispatchTypes.Method,
             e.Left,
             "ToString"
         )
     );
 }
開發者ID:takeshik,項目名稱:YacqPlugin,代碼行數:15,代碼來源:Symbols.cs


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