Example #1
0
            public static IParsingTreeTerminal FindFirstTerminal(IParsingTreeNode node)
            {
                var visitor = new FirstTerminalSearcher();

                node.Visit(visitor);
                return(visitor.Result);
            }
Example #2
0
        static Location?GetFromLocation(this IParsingTreeNode node)
        {
            var t = FirstTerminalSearcher.FindFirstTerminal(node);

            return(t == null ? null : (Location?)t.From);
        }