lua-users home
lua-l archive

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

I am working on a master's thesis in which I working with a group that has been developing tools that extend the lex/yacc (flex/bison) capabilities. One of those extensions is to handle significant whitespace, which appears in modern languages such as python and javascript Lua falls into that category as it has optional semicolons, and thus newlines become significant. I will be writing flex/bison type files, adapted to our format. The name of the project is Harmonia.[]. We are also working on handling embedded languages, and lua provides us with a good language for testing our tools.

At the moment I am looking at lua from a theoretical point of view, rather than as a programmer. I have written almost no code. I hope to introduce a junior/senior level course in my department with some game programming, at which time, I will have to have actually learned to program in lua. But not until I finish this project!!

1. What is the difference between chunk and block grammatically? My understanding is that chunk is the start symbol and that you view a "program" as a chunk, not a block. Within all the productions, only block is used, but since it is defined as a chunk, I don't really understand the intention or the precise meaning of the grammar.

2. Somewhere it is stated that a #-line can be the first line in a chunk so that it can be run as a lua script. The definition of block would mean that you could have such statements sprinkled throughout the the code, i.e., wherever there is a block. Is that what is intended? And is it used that way?

3. How do you do line continuation?  Do you use '\'?

4. Is there a nice little starter set of examples that I could look at? Other than what is in the manual?

Thank you.