Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Help for 'parse dialect words

 [1/2] from: al:bri:xtra at: 13-Dec-2000 7:12


It was written:
> Questions like this would be helped if we had a way of adding help to
keywords in a parse dialect. Anyone any ideas of a clean way of doing this? This sounds more like a problem for Rebol crew. Perhaps:
>> help parse
USAGE: PARSE input rules /all /case DESCRIPTION: Parses a series according to rules. SOME - blah blah ANY - blah blah etcetera... PARSE is a native value. ARGUMENTS: input -- Input series to parse (Type: series) rules -- Rules to parse by (Type: block string none) REFINEMENTS: /all -- Parses all chars including spaces. /case -- Uses case-sensitive comparison. This could be done in the description text for the 'parse function. Andrew Martin ICQ: 26227169 http://members.nbci.com/AndrewMartin/

 [2/2] from: pavone::saunalahti::fi at: 12-Dec-2000 21:05


At 07:12 13.12.2000 +1300, someone wrote:
>It was written: > > Questions like this would be helped if we had a way of adding help to >keywords in a parse dialect. Anyone any ideas of a clean way of doing this?
A related question inspired by the recursive parsing example from Core Users Guide 2.0: Has anybody implemented an attributive parse i.e. something a la Yacc or Precc? I would like to have: expr: make-parse-rule [term "+" expr (term/out + expr/out) | ;; binding e.g. from the first match term "-" expr (term/out - expr/out) | term (term/out) ] term: ... ... attributive-parse "1+41" expr Would that be too non-Rebolian? What is the 'right' way to work with recursive rules?