本文整理汇总了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(">>> ");
}
示例2: VectorExpression
internal VectorExpression(
SymbolTable symbols,
YacqList elements
)
: base(symbols, elements)
{
}
示例3: LambdaListExpression
internal LambdaListExpression(
SymbolTable symbols,
YacqList elements
)
: base(symbols, elements)
{
}
示例4: IdentifierExpression
internal IdentifierExpression(
SymbolTable symbols,
String name
)
: base(symbols)
{
this.Name = name;
}
示例5: TypeCandidateExpression
internal TypeCandidateExpression(
SymbolTable symbols,
IList<Type> candidates
)
: base(symbols)
{
this.Candidates = new ReadOnlyCollection<Type>(candidates ?? Type.EmptyTypes);
}
示例6: SerializedExpression
internal SerializedExpression(
SymbolTable symbols,
Node node
)
: base(symbols)
{
this.Node = node;
}
示例7: Clear
public static Expression Clear(DispatchExpression e, SymbolTable s, Type t)
{
return YacqExpression.Dispatch(
s,
DispatchTypes.Method,
s.Resolve("*textbox*"),
"Clear"
);
}
示例8: NumberExpression
internal NumberExpression(
SymbolTable symbols,
String text
)
: base(symbols)
{
this.SourceText = text;
this.Value = this.Parse();
}
示例9: AmbiguousParameterExpression
internal AmbiguousParameterExpression(
SymbolTable symbols,
Type type,
String name
)
: base(symbols)
{
this._type = type;
this.Name = name;
}
示例10: QuotedExpression
internal QuotedExpression(
SymbolTable symbols,
QuoteType quoteType,
Expression expression
)
: base(symbols)
{
this.QuoteType = quoteType;
this.Expression = expression ?? Empty();
this.SetPosition(this.Expression);
}
示例11: ContextfulExpression
internal ContextfulExpression(
SymbolTable symbols,
Expression expression,
ContextType contextType
)
: base(symbols)
{
this.Expression = expression;
this.ContextType = contextType;
this.SetPosition(expression);
}
示例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));
}
示例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();
}
示例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);
}
}
示例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"
)
);
}