SLE 2012: Software Language Engineering pp 4-23 | Cite as
Object Grammars
Abstract
Object Grammars define mappings between text and object graphs. Parsing recognizes syntactic features and creates the corresponding object structure. In the reverse direction, formatting recognizes object graph features and generates an appropriate textual presentation. The key to Object Grammars is the expressive power of the mapping, which decouples the syntactic structure from the graph structure. To handle graphs, Object Grammars support declarative annotations for resolving textual names that refer to arbitrary objects in the graph structure. Predicates on the semantic structure provide additional control over the mapping. Furthermore, Object Grammars are compositional so that languages may be defined in a modular fashion. We have implemented our approach to Object Grammars as one of the foundations of the Ensō system and illustrate the utility of our approach by showing how it enables definition and composition of domain-specific languages (DSLs).
Keywords
State Machine Current Object Object Graph Concrete Syntax Attribute GrammarPreview
Unable to display preview. Download preview PDF.
References
- 1.Alanen, M., Porres, I.: A relation between context-free grammars and meta object facility metamodels. Technical Report 606, Turku Centre for Computer Science (2004)Google Scholar
- 2.Apel, S., Hutchins, D.: A calculus for uniform feature composition. ACM Trans. Program. Lang. Syst. 32(5) 19:1–19:33 (2008)Google Scholar
- 3.Apel, S., Kastner, C., Lengauer, C.: FeatureHouse: Language-independent, automated software composition. In: Proceedings of the International Conference on Software Engineering (ICSE), pp. 221–231 (2009)Google Scholar
- 4.Avgustinov, P., Ekman, T., Tibble, J.: Modularity first: a case for mixing AOP and attribute grammars. In: Proceedings of the International Conference on Aspect-Oriented Software Development (AOSD), pp. 25–35. ACM (2008)Google Scholar
- 5.Bąk, K., Czarnecki, K., Wąsowski, A.: Feature and Meta-Models in Clafer: Mixed, Specialized, and Coupled. In: Malloy, B., Staab, S., van den Brand, M. (eds.) SLE 2010. LNCS, vol. 6563, pp. 102–122. Springer, Heidelberg (2011)CrossRefGoogle Scholar
- 6.Bravenboer, M., Visser, E.: Parse Table Composition. In: Gašević, D., Lämmel, R., Van Wyk, E. (eds.) SLE 2008. LNCS, vol. 5452, pp. 74–94. Springer, Heidelberg (2009)CrossRefGoogle Scholar
- 7.Casey, A., Hendren, L.: MetaLexer: a modular lexical specification language. In: Proceedings of the International Conference on Aspect-Oriented Software Development (AOSD), pp. 7–18. ACM (2011)Google Scholar
- 8.Chen, P.P.: The Entity-Relationship Model—Toward a Unified View of Data. ACM Transactions on Database Systems 1(1) (1976)Google Scholar
- 9.DevBoost: EMFText: concrete syntax mapper, http://www.emftext.org/
- 10.Ekman, T., Hedin, G.: Modular Name Analysis for Java Using JastAdd. In: Lämmel, R., Saraiva, J., Visser, J. (eds.) GTTSE 2005. LNCS, vol. 4143, pp. 422–436. Springer, Heidelberg (2006)CrossRefGoogle Scholar
- 11.Ekman, T., Hedin, G.: The JastAdd system—modular extensible compiler construction. Sci. Comput. Program. 69(1-3), 14–26 (2007)MathSciNetMATHCrossRefGoogle Scholar
- 12.Erdweg, S., Giarrusso, P.G., Rendel, T.: Language composition untangled. In: Proceedings of the International Workshop on Language Descriptions, Tools and Applications (LDTA) (2012)Google Scholar
- 13.Eysholdt, M., Behrens, H.: Xtext: implement your language faster than the quick and dirty way. In: OOPSLA Companion (SPLASH), pp. 307–309. ACM (2010)Google Scholar
- 14.Flanagan, D., Matsumoto, Y.: The Ruby Programming Language. O’Reilly (2008)Google Scholar
- 15.Fondement, F., Schnekenburger, R., Gérard, S., Muller, P.A.: Metamodel-aware textual concrete syntax specification. Technical Report LGL-2006-005, EPFL (December 2006)Google Scholar
- 16.Fondement, F.: Concrete syntax definition for modeling languages. PhD thesis, EPFL (2007)Google Scholar
- 17.Frakes, W., Terry, C.: Software reuse: metrics and models. ACM Comput. Surv. 28(2), 415–435 (1996)CrossRefGoogle Scholar
- 18.Goldschmidt, T., Becker, S., Uhl, A.: Classification of Concrete Textual Syntax Mapping Approaches. In: Schieferdecker, I., Hartman, A. (eds.) ECMDA-FA 2008. LNCS, vol. 5095, pp. 169–184. Springer, Heidelberg (2008)CrossRefGoogle Scholar
- 19.Heidenreich, F., Johannes, J., Karol, S., Seifert, M., Wende, C.: Derivation and Refinement of Textual Syntax for Models. In: Paige, R.F., Hartman, A., Rensink, A. (eds.) ECMDA-FA 2009. LNCS, vol. 5562, pp. 114–129. Springer, Heidelberg (2009)CrossRefGoogle Scholar
- 20.Jouault, F., Bézivin, J.: On the specification of textual syntaxes for models. In: Eclipse Modeling Symposium, Eclipse Summit Europe 2006 (2006)Google Scholar
- 21.Jouault, F., Bézivin, J., Kurtev, I.: TCS: a DSL for the specification of textual concrete syntaxes in model engineering. In: Proceedings of the International Conference on Generative Programming and Component Engineering (GPCE), pp. 249–254. ACM (2006)Google Scholar
- 22.Klint, P., van der Storm, T., Vinju, J.: Rascal: A Domain Specific Language for Source Code Analysis and Manipulation. In: Proceedings of the International Working Conference on Source Code Analysis and Manipulation (SCAM), pp. 168–177. IEEE (2009)Google Scholar
- 23.Krahn, H., Rumpe, B., Völkel, S.: Integrated Definition of Abstract and Concrete Syntax for Textual Languages. In: Engels, G., Opdyke, B., Schmidt, D.C., Weil, F. (eds.) MoDELS 2007. LNCS, vol. 4735, pp. 286–300. Springer, Heidelberg (2007)CrossRefGoogle Scholar
- 24.Kurtev, I., Bézivin, J., Jouault, F., Valduriez, P.: Model-based DSL frameworks. In: OOPSLA Companion (OOPSLA), pp. 602–616. ACM (2006)Google Scholar
- 25.Loh, A.: Piping and instrumentation in Ensō. Language Workbench Challenge Workshop at Code Generation 2012 (March 2012), http://www.languageworkbenches.net/index.php?title=LWC_2012 (accessed June 11, 2012)
- 26.Loh, A., van der Storm, T., Cook, W.R.: Managed data: Modular strategies for data abstraction (submitted), http://www.cs.utexas.edu/~wcook/Drafts/2012/ensodata.pdf
- 27.Merkle, B.: Textual modeling tools: overview and comparison of language workbenches. In: OOPSLA Companion (SPLASH), pp. 139–148. ACM (2010)Google Scholar
- 28.Muller, P.A., Fondement, F., Fleurey, F., Hassenforder, M., Schneckenburger, R., Gérard, S., Jézéquel, J.M.: Model-driven analysis and synthesis of textual concrete syntax. Software and System Modeling 7(4), 423–441 (2008)CrossRefGoogle Scholar
- 29.Object Management Group: Unified Modeling Language Specification, version 1.3. OMG (March 2000), http://www.omg.org
- 30.Paakki, J.: Attribute grammar paradigms—a high-level methodology in language implementation. ACM Comput. Surv. 27(2), 196–255 (1995)CrossRefGoogle Scholar
- 31.Renggli, L., Denker, M., Nierstrasz, O.: Language Boxes: Bending the Host Language with Modular Language Changes. In: van den Brand, M., Gašević, D., Gray, J. (eds.) SLE 2009. LNCS, vol. 5969, pp. 274–293. Springer, Heidelberg (2010)CrossRefGoogle Scholar
- 32.Schwerdfeger, A.C., Van Wyk, E.R.: Verifiable composition of deterministic grammars. In: Proceedings of the Conference on Programming Language Design and Implementation (PLDI), pp. 199–210. ACM (2009)Google Scholar
- 33.Scott, E., Johnstone, A.: GLL parsing. Electr. Notes Theor. Comput. Sci. 253(7), 177–189 (2010)CrossRefGoogle Scholar
- 34.Van Wyk, E.: Aspects as modular language extensions. In: Proc. of Language Descriptions, Tools and Applications (LDTA). Electronic Notes in Theoretical Computer Science, vol. 82.3. Elsevier Science (2003)Google Scholar
- 35.Van Wyk, E., Bodin, D., Gao, J., Krishnan, L.: Silver: an extensible attribute grammar system. Science of Computer Programming 75(1-2), 39–54 (2010)MathSciNetMATHCrossRefGoogle Scholar
- 36.Visser, E.: Syntax Definition for Language Prototyping. PhD thesis, University of Amsterdam (September 1997)Google Scholar
- 37.Völter, M., Solomatov, K.: Language modularization and composition with projectional language workbenches illustrated with MPS. In: Proceedings of the International Conference on Software Language Engineering (SLE). Revised selected papers. LNCS, vol. 6563. Springer (2010)Google Scholar
- 38.Völter, M., Visser, E.: Language extension and composition with language workbenches. In: OOPSLA Companion (SPLASH), pp. 301–304. ACM (2010)Google Scholar
- 39.Wadler, P.: A Prettier Printer. In: The Fun of Programming. Palgrave Macmillan (2003)Google Scholar
- 40.Wimmer, M., Kramler, G.: Bridging Grammarware and Modelware. In: Bruel, J.-M. (ed.) MoDELS 2005. LNCS, vol. 3844, pp. 159–168. Springer, Heidelberg (2006)CrossRefGoogle Scholar
- 41.Wirth, N.: What can we do about the unnecessary diversity of notation for syntactic definitions? Commun. ACM 20(11), 822–823 (1977)CrossRefGoogle Scholar