lua-users home
lua-l archive

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


Hi all,

I would like define a simple grammar as follows:
seq{rf90, delay#, acq}

or
seq{rf90, delay*, acq}

or
seq{rf90, *delay, acq}

or
seq{rf90, delay[], acq}

in which delay may be a table array of objects, and # or * means do the seq{rf90, delay[i], acq} for #delay times.

Its explicit call is
for i =1, #delay do
seq{rf90, delay[i], acq}
end

I'd like to use # or * or [] to keep user in mind that it means loop.  It seems that we may need to define a special syntactic sugar? And is it possible to achieve the above goal? Thanks.

Regards,

Yan
--



Yan Chang
Suzhou Institute of Biomedical Engineering and Technology (SIBET)
Chinese Academy of Sciences (CAS)
88th Keling Road, SND, Suzhou, China 215163

Tel: +86 0512 6958 8133  (office)
Email:
changy@sibet.ac.cn