public override IEnumerable <alt> iter(IEnumerable <Token> toks, bool suppress_epsilon = false) { foreach (alt it in subPI.iter(toks, suppress_epsilon)) { var N = new TaggedPINode <NamedNodeT> { childrenA = new AnonPINode [] { it.n } }; // for each alt, yield one wrapper node ( type-tagged ) with the subPI's node as the only chlid yield return(new alt { n = N, toks = it.toks }); } }
public override IEnumerable <alt> iter(IEnumerable <Token> toks, bool suppress_epsilon = false) { if (deferred_subPI == null) { throw new Exception("trying to run a deferred Prod without assigning it"); } foreach (alt it in deferred_subPI.iter(toks, suppress_epsilon)) { var N = new TaggedPINode <NamedNodeT> { childrenA = new AnonPINode [] { it.n } }; // for each alt, yield one wrapper node ( type-tagged ) with the subPI's node as the only chlid yield return(new alt { n = N, toks = it.toks }); } }