<div dir="ltr"><img src="http://t.signauxsix.com/e1t/o/5/f18dQhb0S7ks8dDMPbW2n0x6l2B9gXrN7sKj6v4LCN8VdVgrx4X9JVCW3MhxYF3LvrVvVWd7Zg1k1H6H0?si=6480119168761856&pi=2c3c4249-1176-47d8-d6a2-bea1bd0589d0" style="display:none!important" height="1" width="1"><div class="gmail_extra"><div class="gmail_quote">On Tue, Jun 9, 2015 at 12:30 PM, Skybuck Flying <span dir="ltr"><<a href="mailto:skybuck2000@hotmail.com" target="_blank">skybuck2000@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Anyway... I am trying a more robust parser... because my own parser right now didn't work out for new inputs.<br></blockquote><div><br></div><div>You should take a look at lrparsing: <a href="https://pypi.python.org/pypi/lrparsing/1.0.11">https://pypi.python.org/pypi/lrparsing/1.0.11</a></div><div><br></div><div>Cheers</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
It almost worked except for first item... don't know what problem was.... maybe just this...<br>
<br>
But I'll try and do it the usually way.<br>
<br>
"Tokenize", "Parse" etc.<br>
<br>
It's significantly slower though.<br>
<br>
Maybe an idea for a new kind of parser could be:<br>
<br>
Find all recgonized token keywords in one go... and stuff all find indexes into a list... and then perhaps sort the list...<br>
<br>
and then use the sorted list... to return token found at that position...<br>
<br>
and then start processing like that...<br>
<br>
Benefit of this idea is less characters to compare... and could be done with just integer compare... or even lookup table processing.<br>
<br>
Added benefit is still in-order which is nice.<br>
<br>
For now I won't do it... cause I am not sure it would be an improvemt.<br>
<br>
Another idea which might be an improvement is.<br>
<br>
Parallel searching... ofcourse that might not be possible... though... multi core does it exist and threading too.<br>
<br>
But to mimic parallel searching and to prevent problems.<br>
<br>
A sliding window approach could be taken.<br>
<br>
And perhaps items found that way in a certain buffer or so and then still added to processing list or so...<br>
<br>
which kinda mimics parallel search... but just uses data cache nicely.<br>
<br>
Though it's somewhat of a complex method... I will avoid it for now.<br>
<br>
The split() routine is real nice... to get rid of fudd/white space... and just tokens which is nice.<br>
<br>
So for now I will use that as my tokenizer ;) =D<br>
<br>
and bracket level counting and sections and stuff like that yeah...<div class=""><div class="h5"><br>
<br>
Bye,<br>
 Skybuck. <br>
-- <br>
<a href="https://mail.python.org/mailman/listinfo/python-list" target="_blank">https://mail.python.org/mailman/listinfo/python-list</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Ryan Stuart, B.Eng<br>Software Engineer<br><br><div><div>ABN: 81-206-082-133<br>W: <a href="http://www.textisbeautiful.net/" target="_blank">http://www.textisbeautiful.net/</a><br>M: +61-431-299-036</div></div></div></div>
</div></div>