[REBOL] Re: reusing parse rules
From: david::vydra::net at: 23-Jan-2001 23:41
I've been playing :)
r1: [r1: [any r2]]
r2: [r2: [word!]]
my-parser: make object! compose [
;-- you can even attach an action to an existing rule
([append r2 [( print "Found Word")]])
Hi, David (and feedback), you wrote (directly:
> Have you found a satisfactory solution to reusing grammar rules?
Not yet. My best so far is to put common rules in an object like:
Rules: make object! [
Label: [Alpha some Alphanumeric]
then refer to the rule in another object like:
Parser: make object! [
; Do stuff here
My next thoughts are to request object/path support in 'parse rules from
Rebol HQ. Something like:
; My action here.
would be good to add to Rebol's 'parse dialect.