本文整理汇总了C#中ExpressionVisitor.Visit方法的典型用法代码示例。如果您正苦于以下问题:C# ExpressionVisitor.Visit方法的具体用法?C# ExpressionVisitor.Visit怎么用?C# ExpressionVisitor.Visit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExpressionVisitor
的用法示例。
在下文中一共展示了ExpressionVisitor.Visit方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParseTokens
private static Expression ParseTokens(CommonTokenStream input)
{
ExpressionParser.ExpressionContext startContext = new ExpressionParser(input).expression();
ExpressionVisitor visit = new ExpressionVisitor();
Expression expr = visit.Visit(startContext);
return expr;
}
示例2: Visit
public override void Visit(ExpressionVisitor visitor)
{
visitor.Visit(this);
}
示例3: SearchCriteria
public static Companies SearchCriteria(this ICompaniesContract contract, Expression<Func<Company, bool>> predicate)
{
var visitor = new ExpressionVisitor();
var criteria = visitor.Visit(predicate.Body);
return contract.SearchCriteria(string.Format("search.xml?{0}", criteria));
}
示例4: Accept
public override SRUObject Accept(ExpressionVisitor v)
{
return v.Visit(this);
}
示例5: Report
public static TimeEntries Report(this ITimeTrackingContract contract, Expression<Func<ReportCriteria, bool>> predicate)
{
var visitor = new ExpressionVisitor();
var criteria = visitor.Visit(predicate.Body);
return contract.Report(string.Format("report.xml?{0}", criteria.TrimStart("&".ToCharArray())));
}
示例6: SearchCriteria
public static People SearchCriteria(this IPeopleContract contract, Expression<Func<Person, bool>> predicate)
{
var visitor = new ExpressionVisitor();
var criteria = visitor.Visit(predicate.Body);
return contract.SearchCriteria(string.Format("search.xml?{0}", criteria));
}
示例7: ParseFNode
public static FNode ParseFNode(string Text, MemoryStruct LocalHeap, Workspace Home, string Alias, Schema Columns, Register Memory)
{
// Build text stream //
AntlrInputStream ais = new AntlrInputStream(Text);
HScriptLexer lex = new HScriptLexer(ais);
// Build token tree //
CommonTokenStream cts = new CommonTokenStream(lex);
HScriptParser par = new HScriptParser(cts);
// Build AST //
IParseTree tree = par.expression();
// Visit each node getting the final node //
ExpressionVisitor v = new ExpressionVisitor(LocalHeap, Home);
v.AddSchema(Alias, Columns, Memory);
return v.Visit(tree);
}