Parse rules for Rebol values
[1/5] from: al:bri:xtra at: 23-Sep-2002 12:34
Rebol has these:
time? -- for testing a value to see if it's a time! value.
time! -- to indicate a value of time! type.
time -- a generic value that contains a time! value.
What would be a suitable name for a parse rule that picks out a time value
from text? How about:
time^
Andrew Martin
ICQ: 26227169 http://valley.150m.com/
[2/5] from: greggirwin:mindspring at: 23-Sep-2002 11:24
Hi Andrew,
<<
Rebol has these:
time? -- for testing a value to see if it's a time! value.
time! -- to indicate a value of time! type.
time -- a generic value that contains a time! value.
What would be a suitable name for a parse rule that picks out a time value
from text? How about:
time^
>>
If you already have other parse rules that map to REBOL datatypes, go for
consistency. If not, maybe that's something we should all think about. #"!"
is actually a valid character for use in words, correct? Would it be too
confusing to use that as a basis (e.g. time!!)? While 'time! would also be
valid, that might be *really* confusing.
The EBNF standard for a production rule ( ::= ) contains colons so that's
out as an option, unless we write parser to translate EBNF grammars for use
with REBOL. :)
--Gregg
[3/5] from: jason:cunliffe:verizon at: 23-Sep-2002 21:08
hmm...
time
time!
time?
time^
time*
I prefer time* for your parse rule suggestion, because it evokes wild cards.
While I associate ^ with common control characters strings like
print "Content-type: text/html^/^/"
./Jason.0.02
[4/5] from: brett::codeconscious::com at: 24-Sep-2002 17:21
> The EBNF standard for a production rule ( ::= ) contains colons so that's
> out as an option, unless we write parser to translate EBNF grammars for
use
> with REBOL. :)
Tangential to the thread, I fiddled BNF rules a whle ago - brain bending
stuff.
For interest here is the script - expect bugs and it being incomplete. I did
it as an excercise.
http://www.codeconscious.com/rebol/scripts/bnf-tools.r
Regards,
Brett.
[5/5] from: greggirwin:mindspring at: 24-Sep-2002 9:39
Hi Brett,
<< Tangential to the thread, I fiddled BNF rules a whle ago - brain bending
stuff. >>
Wow. No kidding. I'll have to find some time to look at that. I think most
of the old BNF stuff I have around was in VisualParse++ which may have used
a slightly non-standard syntax.
Thanks!
--Gregg