BNFT part 1 done
Ah, small steps
The "biggest" advantage of being a lazy programmer is that programming tasks gets designed to a minimum of programming. I have spent some time trying to port it from C++ to Java, which proved to be a b*st*rd (inglorious or not). At some stage I thought about how I usually implement parsers very quickly and decided to try from scratch.
Turned out that 3 hrs was enough for mocking the parsing part up (while trying to use only simple java, so it would port easily to other langauges).
So what remains is the execution part, for which I have designed an even simpler and speedier design that the original. By "accident" I came up with a lazy evaluation scheme, which should be pretty efficient, considering what the original tool did, with an abundance of stacks of strings (which was the ports biggest problem).
Now I will build a tree to do the second level parsing, which while traversion will build a second tree, where I call the an eval function to get the result in the end.
This means that the parsing itself will not be optimized, but putting together the answer will only take the "correct" path into consideration. Should be simple and nifty.
Hopefully I will soon have time to implement the last part so I can release it.
The "biggest" advantage of being a lazy programmer is that programming tasks gets designed to a minimum of programming. I have spent some time trying to port it from C++ to Java, which proved to be a b*st*rd (inglorious or not). At some stage I thought about how I usually implement parsers very quickly and decided to try from scratch.
Turned out that 3 hrs was enough for mocking the parsing part up (while trying to use only simple java, so it would port easily to other langauges).
So what remains is the execution part, for which I have designed an even simpler and speedier design that the original. By "accident" I came up with a lazy evaluation scheme, which should be pretty efficient, considering what the original tool did, with an abundance of stacks of strings (which was the ports biggest problem).
Now I will build a tree to do the second level parsing, which while traversion will build a second tree, where I call the an eval function to get the result in the end.
This means that the parsing itself will not be optimized, but putting together the answer will only take the "correct" path into consideration. Should be simple and nifty.
Hopefully I will soon have time to implement the last part so I can release it.

0 Comments:
Post a Comment
<< Home