[DGD] parse_string() & removal of ()'s
Jason Cone
jcone at cs.tamu.edu
Fri Feb 13 06:39:23 CET 1998
Greetings.
This question is in regard to the parse_string() kfun and the omission of
the ()'s from production rules. Basically, it's mentioned that functions
can be used to shape the returned parse tree, but I'm having an extremely
hard time visualizing it. :) I guess the best way to ask this question or
address the issue is to present an example.
When it was assumed that the () were going to be a part of the production
rules a grammar of the following grammar was legitimate:
whitespace = / /
word = /[a-z]+/
Thing: Noun
Thing: ( Adjs ) Noun
Noun: word
Adjs: word Adjs
Adjs: word
This enabled an input string like "big blue bottle" to be returned as
({ "big, "blue", }), "bottle" })
This was taken directly from one of Dworkin's examples, btw.
I'm having a really hard time seeing how functions could be used in lieu of
the (). Any thoughts? Specifically, how could the above grammar be
represented without the () and with a function?
Hasta,
Jason Cone
||==================================================================||
|| || "Hard work spotlights the character ||
|| Jason H. Cone || of people: some turn up their ||
|| Dept. Computer Science || sleeves, some turn up their noses, ||
|| Texas A&M University || and some don't turn up at all." ||
|| jcone at cs.tamu.edu || - Sam Ewing ||
|| || ||
||==================================================================||
List config page: http://list.imaginary.com/mailman/listinfo/dgd
More information about the DGD
mailing list