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

[REBOL] parse parsing algorithm

From: shahn::cs::vu::nl at: 14-Aug-2001 0:11

Hello Everyone! I am new in the list and i hope this question wasn't asked before. Does anyone know what parsing algorithm the "parse" buildin uses? I really like the much more powerful context free parsing that Rebol uses instead of regular expressions used by Perl / PHP / Python / etc. I am trying to build something simular in another language (Python), just for fun. When researching parsing strategies i came across this document: Parsing Techniques - A Practical Guide http://www.cs.vu.nl/~dick/PTAPG.html (out of print book of +/- 300 pages in pdf) Does Rebol use the "Recursive Descent" Parsing Method? This method has the most direct mapping between the grammar and the parse method. Does one of you know more? --- I have found that this grammar makes Rebol go in an infinite loop (Chapter 4.2.3 from the book):
>> S: [L #'a' M]
== [L #'a' M]
>> L: [L M | none]
== [L M | none]
>> M: [M M | none]
== [M M | none]
>> parse "a" S
But the memory usage on my W2K machine doesn't seem to grow (2.936 K constant), no recursion?. Rebol does take 99% of the CPU time though. With kind regards, Sander Hahn [shahn--cs--vu--nl]