lua-users home
lua-l archive

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


chris@kandji.com wrote:
Hello, I wonder if LUA is capable to mimic the syntax of another language (more or less)...
So, I could use LUA to prototype another script language.

For example : could LUA partially mimics PASCAL syntax ??

No.  :)

You could write a (i.e.) pascal parser in lua, of course.  You could
even use that to write a pascal interpreter, or with a lot of effort
to convert pascal source to lua source.  But lua's flexibility
is more in the semantics department than in syntax, so a heavy
preprocessing/parsing stage would almost always be necessary to
have lua even begin to understand another language's syntax 'as
its own' rather than simply hosting an interpreter (at which
lua has no special advantage besides being a neat language in
its own right).

--Adam
--
Adam D. Moss   . ,,^^   adam@gimp.org   http://www.foxbox.org/   co:3
Consume Less, Live More