Modelica Based Parser Generator with Good Error Handling

This paper describes the new OpenModelica Compiler-Compiler (OMCC) including a parser generator, OMCCp which is based on an LALR parser generator extended with advanced error handling facilities. It is implemented in the MetaModelica language with parsing tables generated by the tools Flex and Bison. It is integrated with the MetaModelica semantics specification language, based on operational semantics for generating executable compiler and interpreter modules. The OMCCp parser generating part of OMCC is being used for the full Modelica language grammar as well as for the language extensions of MetaModelica, ParModelica, and Optimization specifications. The generated parsers have reasonable performance compared to other parser generators.