lua-users home
lua-l archive

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


Am 07.12.2012 13:24, schrieb Vasiliy Tolstov:
But if count of this rules is about 50 how can i specify error for each
block?

I'm not sure I understand correctly. You do have file-, directory-, and 48 more different block types that you want to parse? In that case I probably would use 'ERR' instead of 'E"directory or ... expected"' which produces a generic parse error without specific reason. Or you could use E"top level directive (e.g. file/directory/...) expected" or E"bad block type". I can't tell you what you want your error messages to be ...

Philipp



07.12.2012 15:55 пользователь "Philipp Janda" <siffiejoe@gmx.net> написал:

Am 07.12.2012 12:11, schrieb Vasiliy Tolstov:

Thanks. How can i add to this grammar file {} parsing (that have all
things like directory).. ?


- duplicate the directory rule and replace both "directory" strings in it
with "file"
- add  +V"file" after V"directory inside the parentheses in the startrule
- change the error message for eof from "directory expected" to something
like "directory or file expected"

Philipp