A grammar for quoted strings with escaped chars

2014-09-22 Thread Ron Savage
I've developed a grammar (with help from various people of course) for quoted strings: http://scsys.co.uk:8002/424926 Requirements: o Strings must be quoted o Strings are either single or double quoted o The escape character is \ o If the string is single quoted, internal single quotes must

Re: A grammar for quoted strings with escaped chars

2014-09-22 Thread Christopher Layne
I've posted some things previously on this topic - but in short, you don't really need to use events to do this. It's possible to do it in a semi-straightforward fashion without a lot of jumping through hoops (just a bunch of rules). Here's some grammar fragments demonstrating what I'm talking

Re: A grammar for quoted strings with escaped chars

2014-09-22 Thread Ron Savage
Thanx for the link. I did not consider that case, since I'm really interested in the Graphviz DOT file format, where quotes if any must be double quotes, and internal quotes must be escaped. However, I will examine the code you link to, since ever such example is interesting. -- You

Re: A grammar for quoted strings with escaped chars

2014-09-22 Thread Ron Savage
I think I'll release such samples (I have encountered a few) as MarpaX::Demo::SampleGrammars. It'll be basically a dummy module with the good stuff in scripts/*.pl. I've been thinking about a script collection for many months now. Any other suggestions (module name, code to include)? -- You

Re: A grammar for quoted strings with escaped chars

2014-09-22 Thread Ruslan Shvedov
On Tue, Sep 23, 2014 at 2:14 AM, Ron Savage r...@savage.net.au wrote: Thanx for the link. 2 of those 3 samples (the 2nd 3rd) produce ambiguous parses. Is that what you find too? Yes, the code warns about it; actually I was planning to deal with it as part of my current work on ASF-based