This makes perfect sense.  Since the grammar object takes a string, simply 
manipulate the string!  

Thanks for the pointer to handling the inaccessible warnings/errors.

On Tuesday, August 9, 2016 at 8:36:23 PM UTC-6, Jeffrey Kegler wrote:

> Re changing the starting rule -- you can write the SLIF DSL at runtime, 
> adding different ":start" statements.  
> http://search.cpan.org/~jkegl/Marpa-R2-3.000000/pod/Scanless/DSL.pod#Inaccessible_symbol_statement
>  
> <http://www.google.com/url?q=http%3A%2F%2Fsearch.cpan.org%2F~jkegl%2FMarpa-R2-3.000000%2Fpod%2FScanless%2FDSL.pod%23Inaccessible_symbol_statement&sa=D&sntz=1&usg=AFQjCNGX_CRgfOmiK5b5ylCOroOjUY7jlg>
>  
> will be useful to quiet various errors and warnings.
>
> Marpa::R2 has a test suite in the cpan/t/ directory.  In my regular 
> development I do lots and lots of regression testing on SLIF grammars.
>
> One pretty general approach to developing and testing the grammar is to 
> initially have to produce an AST, and test that's it's right for a test 
> suite of inputs.  Once you've got the right AST, add the semantics.
>
> While obviously I've had practice at this, you'll want to take into 
> account other's suggestions -- being the author gives me a perspective 
> which can be helpful to others, but which is very skewed so it can also be 
> quite unhelpful.
>
> Ron Savage: you wrote a couple of blog posts about exactly how to develop 
> a Marpa grammar, didn't you?  Jean-Damien: didn't some of yours describe 
> your process?  And there may be others in the archives.
>
> On Tue, Aug 9, 2016 at 7:21 PM, <ioba...@gmail.com <javascript:>> wrote:
>
>> I know in advance that my target grammar is complex.  So I would like to 
>> start at the lower, simpler levels and start testing my lexeme and grammar 
>> rules as I write them.
>>
>> * Can I change the starting rule of a (SLIF) grammar at runtime?  I would 
>> like to test very basic rules -- the kind that I'll only see in slices far 
>> into a file -- (bottom-up) before defining the grammar from the top down.  
>> If I can specify a rule and a string (to G->parse or R->read), I can write 
>> easy regression tests that each rule recognizes valid strings and rejects 
>> invalid strings.  I could modify the grammar file(s) for each test, but 
>> that seems like a bad idea.  I'm all ears if there's a better way to do 
>> this.
>>
>> * At a higher level, can you point me to any great examples of regression 
>> tests for a Marpa grammar?  
>>
>> * Even more generally, how do people develop and test a Marpa grammar?
>>
>> Thanks!
>>
>> - Ryan
>>
>> -- 
>> 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 marpa-parser...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 marpa-parser+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to