Re: A grammar for quoted strings with escaped chars

2014-09-25 Thread Ron Savage
An update on MarpaX::Demo::SampleGrammars. I've haven't started it yet, but after huge progress on the original problem over the last couple of days, I may well do it on Sunday. I have at least 5 demos ready. I'll create dirs (in the distro) such as data/nested.strings/, data/quoted.strings/,

Re: A grammar for quoted strings with escaped chars

2014-09-24 Thread Ron Savage
Not at first. Consider: V 1 or 2: :include file_name = /my/grammars/quoted.strings.bnf V 1 or 2: :include file_name = /my/grammars/quoted.strings.bnf namespace = xyz -- You received this message because you are subscribed to the Google Groups marpa parser group. To unsubscribe from this

Re: A grammar for quoted strings with escaped chars

2014-09-24 Thread Ruslan Shvedov
Well, perhaps. BTW, I was thinking about namespace more like an adverb for :default pseudo-rule and/or lexeme default statements. Or, crazy as it is, wrapping grammars up and exposing them as perl modules. On Wed, Sep 24, 2014 at 9:19 AM, Ron Savage r...@savage.net.au wrote: Not at first.

Re: A grammar for quoted strings with escaped chars

2014-09-24 Thread Ron Savage
Sounds good. Of course, the namespace declaration could be inside the include file. -- 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

Re: A grammar for quoted strings with escaped chars

2014-09-24 Thread Ron Savage
I've had a play with your (very fancy) code, but I'm now working purely on an extension of the grammar this thread started with. And the more I play with Marpa the more astonished I am by its power. -- You received this message because you are subscribed to the Google Groups marpa parser

Re: A grammar for quoted strings with escaped chars

2014-09-23 Thread Durand Jean-Damien
Not sure I got it right from the beginning, but my attempt, using a parameterized subset of the C grammar is at https://gist.github.com/jddurand/8d3238c22731a85eb890 . JD. Le lundi 22 septembre 2014 09:12:31 UTC+2, Ron Savage a écrit : I've developed a grammar (with help from various people

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