Abstract
The term “extensible language” is especially used when a language allows the extension of its own concrete syntax and the definition of the semantics of new constructs. Most popular tools designed for automatic generation of syntactic analyzers do not offer any desirable resources for the specification of extensible languages. When used in the implementation of features like syntax macro definitions, these tools usually impose severe restrictions. We claim that one of the main reasons for these limitations is the lack of formal models that are appropriate for the definition of the syntax of extensible languages.
This paper presents the design and formal definition for Adaptable Parsing Expression Grammars (APEG), an extension to the PEG model that allows the manipulation of its own production rules during the analysis of an input string. It is shown that the proposed model may compare favorably with similar approaches for the definition of the syntax of extensible languages.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Allen, E., Culpepper, R., Nielsen, J.D., Rafkind, J., Ryu, S.: Growing a syntax. In: Proceedings of FOOL 2009 (2009)
Boullier, P.: Dynamic grammars and semantic analysis. Rapport de recherche RR-2322, INRIA. Projet CHLOE (1994)
Bravenboer, M., Kalleberg, K.T., Vermaas, R., Visser, E.: Stratego/XT 0.17. A language and toolset for program transformation. Sci. Comput. Program. 72(1-2), 52–70 (2008)
Burshteyn, B.: Generation and recognition of formal languages by modifiable grammars. SIGPLAN Not. 25, 45–53 (1990)
Burshteyn, B.: Ussa – universal syntax and semantics analyzer. SIGPLAN Not. 27, 42–60 (1992)
Cabasino, S., Paolucci, P.S., Todesco, G.M.: Dynamic parsers and evolving grammars. SIGPLAN Not. 27, 39–48 (1992)
Christiansen, H.: The Syntax and Semantics of Extensible Languages. Roskilde datalogiske skrifter. Computer Science, Roskilde University Centre (1987)
Christiansen, H.: A survey of adaptable grammars. SIGPLAN Not. 25, 35–44 (1990)
Christiansen, H.: Adaptable Grammars for Non-Context-Free Languages. In: Cabestany, J., Sandoval, F., Prieto, A., Corchado, J.M. (eds.) IWANN 2009, Part I. LNCS, vol. 5517, pp. 488–495. Springer, Heidelberg (2009)
Dinkelaker, T., Eichberg, M., Mezini, M.: Incremental concrete syntax for embedded languages. In: Proceedings of the 2011 ACM Symposium on Applied Computing, SAC 2011, pp. 1309–1316. ACM, New York (2011)
Erdweg, S., Rendel, T., Kästner, C., Ostermann, K.: Sugarj: library-based syntactic language extensibility. In: Proceedings of OOPSLA 2011, pp. 391–406. ACM, New York (2011)
Ford, B.: Packrat parsing: simple, powerful, lazy, linear time, functional pearl. SIGPLAN Not. 37(9), 36–47 (2002)
Ford, B.: Parsing expression grammars: a recognition-based syntactic foundation. SIGPLAN Not. 39(1), 111–122 (2004)
Grimm, R.: Better extensibility through modular syntax. SIGPLAN Not. 41(6), 38–51 (2006)
Jambon, M.: How to customize the syntax of ocaml, using camlp5 (2011), http://mjambon.com/extend-ocaml-syntax.html
Jim, T., Mandelbaum, Y., Walker, D.: Semantics and algorithms for data-dependent grammars. SIGPLAN Not. 45, 417–430 (2010)
Knuth, D.E.: Semantics of Context-Free Languages. Mathematical Systems Theory 2(2), 127–145 (1968)
Koster, C.H.A.: Affix grammars. In: Algol 68 Implementation, pp. 95–109. North-Holland (1971)
Minsky, Y.: Ocaml for the masses. Commun. ACM 54(11), 53–58 (2011)
Parr, T., Fisher, K.: LL(*): the foundation of the ANTLR parser generator. SIGPLAN Not. 46(6), 425–436 (2011)
Ryu, S.: Parsing fortress syntax. In: Proceedings of PPPJ 2009, pp. 76–84. ACM, New York (2009)
Shutt, J.N.: Recursive adaptable grammars. Master’s thesis, Worchester Polytechnic Institute (1998)
Shutt, J.N.: What is an adaptive grammar? (2001), http://www.cs.wpi.edu/~jshutt/adapt/adapt.html
Stansifer, P., Wand, M.: Parsing reflective grammars. In: Proceedings of LDTA 2011, pp. 10:1–10:7. ACM, New York (2011)
Steele Jr., G.L.: Growing a language. In: Addendum to OOPSLA 1998, pp. 0.01–A1. ACM, New York (1998)
Watt, D.A., Madsen, O.L.: Extended attribute grammars. Comput. J. 26(2), 142–153 (1983)
Wegbreit, B.: Studies in Extensible Programming Languages. Outstanding Dissertations in the Computer Sciences. Garland Publishing, New York (1970)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2012 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
dos Santos Reis, L.V., da Silva Bigonha, R., Di Iorio, V.O., de Souza Amorim, L.E. (2012). Adaptable Parsing Expression Grammars. In: de Carvalho Junior, F.H., Barbosa, L.S. (eds) Programming Languages. Lecture Notes in Computer Science, vol 7554. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-33182-4_7
Download citation
DOI: https://doi.org/10.1007/978-3-642-33182-4_7
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-33181-7
Online ISBN: 978-3-642-33182-4
eBook Packages: Computer ScienceComputer Science (R0)