Gel: A Generic Extensible Language

  • Jose Falcon
  • William R. Cook
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5658)

Abstract

Both XML and Lisp have demonstrated the utility of generic syntax for expressing tree-structured data. But generic languages do not provide the syntactic richness of custom languages. Generic Extensible Language (Gel) is a rich generic syntax that embodies many of the common syntactic conventions for operators, grouping and lists in widely-used languages. Prefix/infix operators are disambiguated by white-space, so that documents which violate common white-space conventions will not necessarily parse correctly with Gel. With some character replacements and adjusting for mismatch in operator precedence, Gel can extract meaningful structure from typical files in many languages, including Java, Cascading Style Sheets, Smalltalk, and ANTLR grammars. This evaluation shows the expressive power of Gel, not that Gel can be used as a parser for existing languages. Gel is intended to serve as a generic language for creating composable domain-specific languages.

References

  1. 1.
    Backus, J.W., Beeber, R.J., Best, S., Goldberg, R., Herrick, H.L., Hughes, R.A., Mitchell, L.B., Nelson, R.A., Nutt, R., Sayre, D., Sheridan, B.P., Stern, H., Ziller, I.: Fortran Automated Coding System For the IBM 704. International Business Machines Corporation, New York (1956)Google Scholar
  2. 2.
    Berners-Lee, T., Masinter, L., McCahill, M.: Uniform Resource Locators (URL). RFC 1738, Internet Engineering Task Force (December 1994), http://ds.internic.net/rfc/rfc1738.txt (accessed August 23, 1997)
  3. 3.
    Biron, P.V., Malhotra, A.: XML Schema part 2: Datatypes. The World Wide Web Consortium (May 2001), http://www.w3.org/TR/xmlschema-2/
  4. 4.
    Brabrand, C., Møller, A., Schwartzbach, M.I.: The <bigwig> project. ACM Trans. Interet Technol. 2(2), 79–114 (2002)CrossRefGoogle Scholar
  5. 5.
    Brabrand, C., Schwartzbach, M.I.: Growing languages with metamorphic syntax macros. In: Proceedings of Workshop on Partial Evaluation and Semantics-Based Program Manipulation, PEPM 2002, pp. 31–40. ACM Press, New York (2002)Google Scholar
  6. 6.
    Brabrand, C., Schwartzbach, M.I.: The metafront system: Safe and extensible parsing and transformation. Sci. Comput. Program 68(1), 2–20 (2007)MathSciNetCrossRefMATHGoogle Scholar
  7. 7.
    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)MathSciNetCrossRefGoogle Scholar
  8. 8.
    Bravenboer, M., Visser, E.: Designing syntax embeddings and assimilations for language libraries. In: Engels, G., Opdyke, B., Schmidt, D.C., Weil, F. (eds.) MODELS 2007. LNCS, vol. 4735, pp. 34–46. Springer, Heidelberg (2007)Google Scholar
  9. 9.
    Bray, T., Paoli, J., Sperberg-McQueen, C.M., Maler, E., Yergeau, F. (eds.): Extensible Markup Language (XML) 1.0. W3C Recommendation. W3C, 4th edn. (August 2003)Google Scholar
  10. 10.
    Cardelli, L., Matthes, F., Abadi, M.: Extensible syntax with lexical scoping. Technical report, Research Report 121, Digital SRC (1994)Google Scholar
  11. 11.
    Crocker, D.H.: Standard for the Format of ARPA Internet Text Messages. University of Delaware, Department of Electrical Engineering, Newark, DE 19711 (August 1982), http://www.faqs.org/rtcs/rfc822.html
  12. 12.
    Crockford, D.: Rfc 4627. the application/json media type for javascript object notation (json) (2006), http://www.json.org/
  13. 13.
    Ford, B.: Parsing expression grammars: A recognition-based syntactic foundation. In: Symposium on Principles of Programming Languages, pp. 111–122 (2004)Google Scholar
  14. 14.
    Gladky, A.V., Melčuk, I.A.: Tree grammars (= Δ-grammars). In: Proceedings of the 1969 Conference on Computational linguistics, Morristown, NJ, USA, pp. 1–7. Association for Computational Linguistics (1969)Google Scholar
  15. 15.
    Goldberg, A., Robson, D.: Smalltalk-80: the Language and Its Implementation. Addison-Wesley, Reading (1983)MATHGoogle Scholar
  16. 16.
    Grimm, R.: Practical packrat parsing. New York University Technical Report, Dept. of Computer Science, TR2004-854 (2004)Google Scholar
  17. 17.
    Grimm, R.: Better extensibility through modular syntax. In: PLDI 2006: Proceedings of the 2006 ACM SIGPLAN conference on Programming language design and implementation, New York, NY, USA, pp. 38–51. ACM, New York (2006)CrossRefGoogle Scholar
  18. 18.
    Hudak, P., Jones, S.P., Wadler, P., Boutel, B., Fairbairn, J., Fasel, J., Guzmán, M.M., Hammond, K., Hughes, J., Johnsson, T., Kieburtz, D., Nikhil, R., Partain, W., Peterson, J.: Report on the programming language Haskell: a non-strict, purely functional language version 1.2. SIGPLAN Not. 27(5), 1–164 (1992)Google Scholar
  19. 19.
    Johnson, S.C.: Yacc: Yet another compiler compiler. In: UNIX Programmer’s Manual, vol. 2, pp. 353–387. Holt, Rinehart, and Winston, New York (1979)Google Scholar
  20. 20.
    Knuth, D.E.: The TEX book. Addison-Wesley, Reading (1984)MATHGoogle Scholar
  21. 21.
    Krishnamurthi, S.: Programming Languages: Application and Interpretation (2006), http://www.cs.brown.edu/~sk/Publications/Books/ProgLangs/
  22. 22.
    Lie, H.W., Bos, B.: Cascading Style Sheets, level 1. W3c recommendation, W3C (January 1999)Google Scholar
  23. 23.
    McCarthy, J.: Recursive functions of symbolic expressions and their computation by machine, part i. Commun. ACM 3(4), 184–195 (1960)CrossRefMATHGoogle Scholar
  24. 24.
    Odersky, M., Spoon, L., Venners, B.: Programming in Scala: A comprehensive step-by-step guide. Artima Inc. (August 2008)Google Scholar
  25. 25.
    Parr, T., Quong, R.: ANTLR: A Predicated-LL(k) parser generator. Journal of Software Practice and Experience 25(7), 789–810 (1995)CrossRefGoogle Scholar
  26. 26.
    Thompson, H.S., Beech, D., Maloney, M., Mendelsohn, N.: XML Schema part 1: Structures. The World Wide Web Consortium (May 2001), http://www.w3.org/TR/xmlschema-2/
  27. 27.
    Visser, E.: Meta-programming with concrete object syntax. In: Batory, D., Consel, C., Taha, W. (eds.) GPCE 2002. LNCS, vol. 2487, pp. 299–315. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  28. 28.
    Visser, E.: Program transformation with stratego/xt: Rules, strategies, tools, and systems in stratego/xt 0.9. In: Lengauer, C., Batory, D., Consel, C., Odersky, M. (eds.) Domain-Specific Program Generation. LNCS, vol. 3016, pp. 216–238. Springer, Heidelberg (2004)CrossRefGoogle Scholar

Copyright information

© IFIP International Federation for Information Processing 2009

Authors and Affiliations

  • Jose Falcon
    • 1
  • William R. Cook
    • 1
  1. 1.Department of Computer ScienceUniversity of Texas at AustinUSA

Personalised recommendations