Re: Suggested dual human/binary interface for proc/devfs

From: Mike Porter (mike@UDel.Edu)
Date: Tue Apr 11 2000 - 09:24:03 EST


On Tue, 11 Apr 2000, Vardhan Varma wrote:

>
> On subject of parsing, and genrating the text file:-
> 1. parsing and generating is easy, if syntax is regular-expression rather
> than CFG.

What is CFG?

> 2. significance of white space - [ \t]
> just visually appeal

Mostly. Some people do feel, myself included, that newline can
serve as a statement seperator. So ';' and '\n' are equivalent,
with an ending '\' serving to concatentate two lines.

> 3. significance of new lines - [\n]
> putting all related info on a single line frees parser of a
> 'state machine' . This may ease error recovery slightly

Why? At best, it makes it easier to say 'error on line n', but
you really should point to the exact character in error.

> 4. significance of noise chars [{}() ....]
> just visual appeal. Mostly they are noise. ( except in
> C when defining scopes ), since before first '{' you are
> putting a keyword which essentially defines what follows
> till '}'

No, they do much more. At a minimum, they make it easier to
do error recovery and they simplify the parsing.

> As long as it's RE, can be parsed with shell script too,
> just 'tr' off all noise chars, sed all spaces/tabs outside
> "" to newline, remove ^$'s, and get a little state machine
> in your script.

Hmm...

Mike

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Apr 15 2000 - 21:00:16 EST