lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Hi all,

I finished rewriting UMENU in Lua. Menu structures for UMENU are authored in 
EMDL (Easy Menu Definition Language) and then converted to UMENU .mnu files 
with a converter. I've attempted to write that converter three times:

1) In Perl using brute force OOP
2) In Perl using a (home grown) node tree tool
3) In AWK

I failed in #3, and #1 was the worst code I've ever written. #2 came out well 
and I still use it today. The challenge of EMDL conversion is that the outline 
is in depth first order, but the menu files must be right first. #2 solved 
this with a node tree and a generic walker for the tree, and took the run time 
down from 15 seconds to 2 seconds for a 4000 line EMDL file.

I could easily rewrite the Node tool in Lua, but instead I'm going to try a 
different data structure -- a stack plus a table of tables, with each of the 
lower level tables representing one level. Wish me luck :-)


Steve Litt
Recession Relief Package