Publication Type |
technical report |
School or College |
College of Engineering |
Department |
Computing, School of |
Program |
Advanced Research Projects Agency |
Creator |
Baker, Jason; Hsieh, Wilson C. |
Title |
Maya: multiple-dispatch syntax extension in Java |
Date |
2001-12-11 |
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 hygiene violations. 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. |
Type |
Text |
Publisher |
University of Utah |
Subject |
Maya; Syntax extension |
Subject LCSH |
Java (Computer program language); Programming languages (Electronic computers) -- Syntax |
Language |
eng |
Bibliographic Citation |
Baker, Jason; Hsieh, Wilson C. (2001). Maya: multiple-dispatch syntax extension in Java. UUCS-01-015. |
Series |
University of Utah Computer Science Technical Report |
Relation is Part of |
ARPANET |
Rights Management |
©University of Utah |
Format Medium |
application/pdf |
Format Extent |
111,335 bytes |
Source |
University of Utah School of Computing |
ARK |
ark:/87278/s6k36bww |
Setname |
ir_uspace |
ID |
703530 |
Reference URL |
https://collections.lib.utah.edu/ark:/87278/s6k36bww |