A Lex-based MAD parser and its applications
Oleg Krivosheev, E. McCrory, L. Michelotti, Dmitri Mokhov, Nikolai V. Mokhov, J.-F. Ostiguy · PACS2001. Proceedings of the 2001 Particle Accelerator Conference (Cat. No.01CH37268) · 2002
An embeddable and portable Lex-based MAD language parser has been developed. The parser consists of a frontend which reads a MAD file and keeps beam elements, beam line data and algebraic expressions in tree-like structures, and a back-end, which processes the front-end data to generate an input file or data structures compatible with user applications. Three working programs are described, namely, a MAD to C++ converter, a dynamic C++ object factory and a MAD-MARS beam line builder. Design and implementation issues are discussed.