Sign in to follow this  

integrating Syntax parser in LUA

This topic is 4769 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all! I'm starting to write a scripting system for a game I work on. I've been reading alot about LUA, and decided it would make my game and user interaction much flexiable. It's really great to keep scenarios in independent files. But, I have a few wonders and questions: 1) LUA is all about interperting the software, right? it's dynamic and all. but, if I want to make a full new language with grammer embedded in LUA. what would be the best approach? would it be making/ using a syntax parser functions interpreted in LUA ?. For example: Lua File: test.lua ------------------ Parser(" Look at [ Joe ] "); Do u guys think it is OK? the parser function will sit in the software, will parse it correctly and activate the right logic for it, and therefore will be interpreted. Plus, I could use plain LUA for other interpretions such as: loading levels, and other. 2) if u read Question number 1: is there anything I'm missing? I plan on using a parser library named GOLD. any recommandations are welcomed. please do. cheers, tomer!

Share this post


Link to post
Share on other sites
I'm not sure exactly what you're asking. Usually, you embed Lua because you want to do your scripting in the Lua language itself - not use Lua to implement a separate language. In other words, Lua is there to provide a parsing, syntax, and grammar structure for you, not to make it easier for you to provide your own. If all you'd use Lua for is to pass data to another language of your own creation, you may as well just cut out Lua completely.

Share this post


Link to post
Share on other sites
Lua isn't Lisp - it isn't designed to allow creation of sublanguages. It is however possible to do something like that by transforming small programs in your custom language to strings of lua code and executing those strings.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
If you want to do a simple 'language' it can be done with LUA's string library. In fact LUA is quite good at text maniputation

Share this post


Link to post
Share on other sites

This topic is 4769 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this