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