Re: How to "trap" unacceptable lines.

2022-02-21 Thread Jeffrey Kegler
I have attached a reworked version, which I have tested. A few comments: 1.) In your version you had a long JUNK lexeme which slurped up the entire line. Marpa uses LATM lexing (Longest Acceptable Token Matching). JUNK would usually be longest, meaning the parser would usually see nothing else a

Re: How to "trap" unacceptable lines.

2022-02-21 Thread 'Jeffrey Kegler' via marpa parser
I will download this and look it over. Sent with [ProtonMail](https://protonmail.com/) Secure Email. --- Original Message --- On Monday, February 21st, 2022 at 2:01 PM, F. Li wrote: > Thank you for your response. > > I tried stripping the example in your third link > [here](https://me

Re: How to "trap" unacceptable lines.

2022-02-21 Thread F. Li
Thank you for your response. I tried stripping the example in your third link here to a bare minimum ending up with the attached but the test strings get caught as "JUNK". (The first 'a = 1', is acceptable.) Obviously I'm missing so

Re: How to "trap" unacceptable lines.

2022-02-21 Thread Jeffrey Kegler
One matter which requires getting used to with Marpa is that you are working with BNF, so the core logic is non-procedural. This is why most programmers seem to want to suffer endlessly with recursive descent rather than consider stronger parsers. You can understand recursive descent with purely

Re: How to "trap" unacceptable lines.

2022-02-21 Thread F. Li
I could of course feed the parser one line at a time but what I would like to achieve is "I, Marpa, am parsing a line that doesn't conform to any previous alternatives so I'm called the sub you designated for this piece of junk." -- You received this message because you are subscribed to the Goog

How to "trap" unacceptable lines.

2022-02-21 Thread clueless newbie
Marpa brings back the feeling of being as a child listening to my father giving a lecture to a graduate class in partial differential equations - I could see the x's the y's but how things work were far beyond my comprehension. I'm sure my head would be a lot less sore and Jeffrey richer if ins