Conference article

Modelica Based Parser Generator with Good Error Handling

Arunkumar Palanisamy
Department of Computer and Information Science, Linköping University, Linköping, Sweden

Adrian Pop
Department of Computer and Information Science, Linköping University, Linköping, Sweden

Martin Sjölund
Department of Computer and Information Science, Linköping University, Linköping, Sweden

Peter Fritzson
Department of Computer and Information Science, Linköping University, Linköping, Sweden

Download articlehttp://dx.doi.org/10.3384/ecp14096567

Published in: Proceedings of the 10th International Modelica Conference; March 10-12; 2014; Lund; Sweden

Linköping Electronic Conference Proceedings 96:60, p. 567-575

Show more +

Published: 2014-03-10

ISBN: 978-91-7519-380-9

ISSN: 1650-3686 (print), 1650-3740 (online)

Abstract

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.

Keywords

Modelica; MetaModelica; Flex; Bison; ParModelica; Optimization; OMCCp

References

[1] Alfred Aho, Monica Lam, Ravi Sethi, Jeffrey Ullman. Compilers Principles, Techniques, and Tools, Second Edition. Addison-Wesley, 2006.

[2] Rober Bilos. Syntactic Error Diagnosis and Recovery. Master Thesis, Linköping University, Department of Computer and Information Science. 1983.

[3] Michael Burke and G.A. Fisher Jr. A Practical Method for Syntactic Diagnosis and Recovery. In Proceedings of the 1982 SIGPLAN symposium on Compiler constructions, 1982.

[4] Michael G. Burke and Gerald A. Fisher. A practical method for LR and LL Syntactic Error Diagnosis and Recovery. ACM Transactions on Programming Languages and Systems, March 1987.

[5] Peter Fritzson. Principles of Object-oriented modeling and Simulation with Modelica 2.1. Wiley-IEEE Press, 2004.

[6] Peter Fritzson, Adrian Pop and Martin Sjölund. Towards Modelica 4 Meta-Programming and Language Modeling with MetaModelica 2.0, Technical reports Computer and Information Science Linköping University Electronic Press, ISSN:1654-7233; 2011:10.

[7] Peter Fritzson and Adrian Pop. Meta-Programming and Language Modeling with MetaModelica 1.0. Technical reports Computer and Information Science Linköping University Electronic Press, ISSN: 1654-7233. 2011:9.

[8] Peter Fritzson et al. Compiler Construction laboratory assignments. Compendium, Bokakademin, Linköping University, Department of Computer and Information Science, 2011.

[9] Edgar Alonso Lopez-Rojas. OMCCp: A Meta-Modelica Based Parser Generator Applied to Modelica. Master Thesis, Linköping University, Department of Computer and Information Science, PELAB- Programming Environment Laboratory, ISRN: LIU-IDA/LITH-EX-A--11/019-- SE, May 2011.

[10] Open Source Modelica Consortium. OpenModelica System Documentation Version 1.6, November 2010. http://www.openmodelica.org.

[11] Arunkumar Palanisamy. Extended MetaModelica based Integrated Compiler generator. Master’s-Thesis, Linköping University, Department of Computer and Information Science, PELABProgramming Environment Laboratory, ISRN:LIU-IDA/LITH-EX-A--12/058--SE, October 2012.

[12] Terence Parr and R W Quong. ANTLR: A Predicated-LL(k) Parser Generator. Software Practice Experience, 25(7):789, 1995. ISSN 00380644. URL: http://portal.acm.org/citation.cfm?id=213593.213603.

[13] Vern Paxson. Flex Manual, 2002. URL: http://flex.sourceforge.net/manual/. [Accessed May 2011.

[14] Martin Sjölund, Peter Fritzson, and Adrian Pop. Bootstrapping a Modelica Compiler aiming at Modelica 4. In Proceedings of the 8th International Modelica Conference (Modelica’2011), Dresden, Germany, September 2011.

Citations in Crossref