Home Tools Construction EBNF Class Generator
EBNF Class Generator Print
Written by Samuel E. Henley   
Tuesday, 22 July 2008 00:00

The EBNF Class generator tool is located in the src/tools/ebnfclassgenerator directory. The tool is designed to read only the newshape.bnf distributed with Microsoft Train Simulator (MSTS) in the FFEDIT directory. EbnfClassGenerator converts newshape.bnf to C++ structures and generate stream members for those structures to read the train simulators shape files. The generated header file (src/include/shape.h.in) is used by the MSTS2Blender utility to read and write MSTS shape files (*.s). A default shape.h.in is supplied in the src/include directory and maintained and updated in the svn repository. The program is made up of three parts, lex utilities (lexutilities.h), symbols(symbol.cpp), MSTS tokens(mststokens.cpp) and the main program. The main program interprets the command line options and supplies them to a context object. The lexutilities are a minimal lexer (lexical analysis), supplied as a header, to read the newshape.bnf files. The MSTS tokes files are used to lookup either the integer values of a MSTS token or the string definition of a MSTS integer. The Symbol program generates the structures or classes that represent a MSTS shape file.

Last Updated on Wednesday, 03 June 2009 08:09