Добавлено: Вт Dec 23, 2014 3:02
Заголовок сообщения: Parser for game files
I have written a parser to try and catch syntax errors in var files.
Most of the "issues" found were only stylistic inconsistencies (which I've "corrected" to shut the parser up) but there were also actual bugs (two in unit.var and a stray semicolon in defender.var).
The project is hosted on github:
see the ru/var folder for the updated files
I will also import Satshanti's translation, and fix whatever the parser reports, as time permits.
The parser source code is check_syntax.c and the tool is run as
$ check_syntax input template language
input = the var file to scan
template = a template specified using @N "expressions"
@0 for an unsigned integer,
@1 for a signed integer,
@2 for a comma-separated list of unsigned integers,
@3 for a semicolon-separated list of unsigned integer pairs (only used in unit.var),
@4 for a label,
@5 for a name/description in russian or english,
@6 to ignore a Text: free-form dialog (in the two dialog files).
See the template files for examples.
language = ru (for Russian) or en (for English)
I'd love to hear your comments