Maya ; multiple-dispatch syntax extension in Java
Saved in:
| Title: | Maya ; multiple-dispatch syntax extension in Java |
|---|---|
| Authors: | Baker, Jason, Hsieh, Wilson C. |
| Source: | ACM SIGPLAN Notices ; volume 37, issue 5, page 270-281 ; ISSN 0362-1340 1558-1160 |
| Publisher Information: | Association for Computing Machinery (ACM) |
| Publication Year: | 2002 |
| Description: | We have designed and implemented Maya, a version of Java that allows programmers to extend and reinterpret its syntax. Maya generalizes macro systems by treating grammar productions as generic functions, and semantic actions on productions as multimethods on the corresponding generic functions. Programmers can write new generic functions (i.e., grammar productions) and new multimethods (i.e., semantic actions), through which they can extend the grammar of the language and change the semantics of its syntactic constructs, respectively. Maya's multimethods are compile-time metaprograms that transform abstract syntax: they execute at program compile-time, because they are semantic actions executed by the parser. Maya's multimethods can be dispatched on the syntactic structure of the input, as well as the static, source-level types of expressions in the input. In this paper we describe what Maya can do and how it works. We describe how its novel parsing techniques work and how Maya can statically detect certain kinds of errors, such as code that generates references to free variables. Finally, to demonstrate Maya's expressiveness, we describe how Maya can be used to implement the MultiJava language, which was described by Clifton et al. at OOPSLA 2000. |
| Document Type: | article in journal/newspaper |
| Language: | English |
| DOI: | 10.1145/543552.512562 |
| Availability: | https://doi.org/10.1145/543552.512562 https://dl.acm.org/doi/10.1145/543552.512562 https://dl.acm.org/doi/pdf/10.1145/543552.512562 |
| Rights: | https://www.acm.org/publications/policies/copyright_policy#Background |
| Accession Number: | edsbas.D09A34A0 |
| Database: | BASE |
Be the first to leave a comment!
Nájsť tento článok vo Web of Science