Exemplo n.º 1
0
        protected override Result MakeResultImpl(bool restoreRecursion, RuleSet[] ruleSets)
        {
            var tree       = this.TreeNode.Recreate().Recreate(null);
            var resultTree = restoreRecursion ? RecursionRewritingCompensator.RestoreRecursion(tree, ruleSets) : tree;

            return(new Result(
                       this.Reader.Location == this.Reader.TextEndLocation,
                       this.ResultReconstructed,
                       _log,
                       resultTree
                       ));
        }
Exemplo n.º 2
0
        void IParsingTreeNodeVisitor.VisitGroup(IParsingTreeGroup group)
        {
            var compensator = new RecursionRewritingCompensator((ParsingTreeNode.Group)group, _alternativesInfo);

            RuleAlternativeInfo info;

            if (group.Rule != null && _alternativesInfo.TryGetInfo(group.Rule, out info))
            {
                _currChild = compensator.RestoreRecursion(_currChild, info);
            }
            else
            {
                _currChild = compensator.Recreate(_currChild);
            }
        }