public static IParsingTreeTerminal FindFirstTerminal(IParsingTreeNode node) { var visitor = new FirstTerminalSearcher(); node.Visit(visitor); return(visitor.Result); }
static Location?GetFromLocation(this IParsingTreeNode node) { var t = FirstTerminalSearcher.FindFirstTerminal(node); return(t == null ? null : (Location?)t.From); }