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

[REBOL] Re: Parse limitation ?

From: petr:krenzelok:trz:cz at: 8-Oct-2003 18:57

Gabriele Santilli wrote:
>Hi Petr, > >On Wednesday, October 8, 2003, 4:39:01 PM, you wrote: > >PK> ah, but that is char-by-char execution ... > >Do you know any other way to do that? (Your example is using FIND >multiple times, and in a big string that would be many times >slower.) >
Well - I am not sure my example will be any slower, except the penalty of extra function call. First, I pass it string at certain position and it then returns strings at positions, where further parse rule a) or b) can be applied directly, second - it is 2 direct search in string and decision upon which index came first vs probably recursive char-by-char rules (which penalty I am not able to think about :-)
>PK> yes, exactly - but I think such grammar to simply achieve what was >PK> requested will not be easy for novices. The tool (REBOL) should support >PK> our thinking pattern - and the most easy on is to "skip" "to | thru" >PK> certain string - no matter what is in between. > >I think that it is better to think of the problem in a different >way, because it allows you to understand things much better. If >you switch to think about grammars instead of patterns you'll find >out that your problems get simpler, not more complicated. IMHO. >
Yes, I can imagine it, really. The problem is (at least for me), that I am able to understand such grammar once someone creates it, but am not able to come up with it to solve problem at hand. Will you blame us little bit underskilled rebol programmers now? :-)
>PK> If someone is up-to writing complete html parser, building DOM object, >PK> then maybe we are near seeing rebol based web-browser? :-) > >Well, the 74-lines [X]HTML parser built into Temple is far from >being complete, but has been able to parse all the HTML files I've >fed into it until now. I don't think this is so much complicated, >you just need to avoid that brain-dead way of doing things that >seems to pervade the world. ;-) >
Sounds interesting. I am just curious, if e.g. html only (not trying to complicate things with java-script for now :-) browser would be possible with Rebol? IIRC Python has web browser. Just curious. -pekr-