develooper Front page | perl.recdescent | Postings from November 2004

dealing with line-oriented data (revisited)

Terrence Brannon
November 30, 2004 01:39
dealing with line-oriented data (revisited)
Message ID:
I wanted to add an entry in the FAQ for recdescent based on this question:

but I am not so sure about Randal's answer... it appears irrelevant to 
the question at hand.

<skip> appears to be used to discriminate terminals in a production. I 
don't think skip is going to affect or make a statement about the fact 
that each sentence of the grammar terminates with a carriage return.

Any input into the way to structure a prd grammar so that it is clear 
that each production is terminated by a newline is appreciated.... 
though I'm beginning to see the light myself:

program : statement(s)

statement : command arg(s) /[\n]/

command: /\w+/

args  :  /\d+/ | alphanum

alphanum :  /[A-Za-z0-9/

Terrence Brannon, Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About