Ron, please see below....
I guess in the end it comes back to what Jeff said earlier. He implied that one cannot simply change the content of the input string. I guess that maybe somehow the recognizing is happening in the C code and that the input is copied into C space and the position information is maintained between the string I gave Marpa and the actual physical string that sits in C space? Th. On Monday, February 9, 2015 at 8:19:13 PM UTC-6, Ron Savage wrote: > > > > There are 2 courses of action in these situations: > > 1: Since you know $pos, use your own - called external - scanner to > process the tokens starting at the one which $start points to (presumably > #), and when finished, set $pos to the end of this substring, and call > resume($pos). > Right, but I need to inject some other text into the input string to be parsed afterwards. > > 2: Off-the-top-of-my-head: Consider changing the rule 'word ::= W' to 'word > ::= W | fakecpp', so Marpa finds the # without error, and extend the > grammar to handle all things which follow a #. In this case you > deliberately sidetrack Marpa to process #ifdef and then let it (with > resume($pos) ) naturally return to process the next token, here operator. > I think this strategy would be completely infeasible for a real grammar. -- You received this message because you are subscribed to the Google Groups "marpa parser" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
