[REBOL] Parsing examples? Re:
Brad wrote: It seems that the 'parse' function in Rebol is quite advance, the documentation--at least in the dictionary, suggests great things. This example they give is awesome--also pretty much unexplained: ;page: read http://www.rebol.com ;parse page [thru title copy title to /title] ;print title I searched for 'thru' and 'to' which are not in the dictionary. The documentation is the biggest handicap to this language's success. The funny thing is that title is actually a variable after running this. Check the Core Users Guide 2.2.0 chapter on parse at: http://www.rebol.com/users/parintro.html The section 'skipping input' describes 'thru and 'to. Essentially, the second line in your example has the parser do this: Skip through :page until it's read past title, then start 'copying into variable 'title until it reaches /title. Best regards, Kev Kevin McKinnon, Network Engineer [EMAIL PROTECTED] Sunshine Communications http://www.sunshinecable.com PGP Public Key: http://www.dockmaster.net/pgp.html PGP 6.0 www.pgp.com If the box says Windows 95 or better, it should run under Linux, right??
[REBOL] Parsing examples? Re:
[EMAIL PROTECTED] wrote: I want to write an XML'ish parser. Which is to say that I need to match You may want to give a look to the function PARSE-XML (included in REBOL/Core). Try SOURCE PARSE-XML. Ciao, /Gabriele./ o) .-^-. (--o | Gabriele Santilli / /_/_\_\ \ Amiga Group Italia --- L'Aquila | | GIESSE on IRC \ \-\_/-/ / http://www.amyresource.it/AGI/ | o) `-v-' (--o
[REBOL] Parsing examples? Re:
Hi Brad, you wrote: [snip] I want to write an XML'ish parser. Which is to say that I need to match beginning and ends of tags, but I don't know the tag names. i.e. itembook/itemnameXML in a nutshell/name The tags are made up for a specific data set, but i don't know what they are in advance. I know they begin like this, ??? and end like this /??? Check out source xml-language You may find it helpful, especially the function xml-language/parse-xml, which is used by the global word parse-xml. source parse-xml ;- Elan [: - )]
[REBOL] Parsing examples? Re:(2)
You guys are awesome! Hi Brad, you wrote: [snip] I want to write an XML'ish parser. Which is to say that I need to match beginning and ends of tags, but I don't know the tag names. i.e. itembook/itemnameXML in a nutshell/name The tags are made up for a specific data set, but i don't know what they are in advance. I know they begin like this, ??? and end like this /??? Check out source xml-language You may find it helpful, especially the function xml-language/parse-xml, which is used by the global word parse-xml. source parse-xml ;- Elan [: - )]