Implementing S-Expression Based Extended Languages in Lisp
نویسندگان
چکیده
Many extended, C-like languages can be implemented by translating them into C. This paper proposes an extension scheme for SC languages (extended/plain C languages with an S-expression based syntax). The extensions are implemented by transformation rules over S-expressions, that is, Lisp functions with pattern-matching on S-expressions. Thus, many flexible extensions to C can be implemented at low cost because (1) of the ease with which new constructs can be added to an SC language, and (2) of the preexisting Common Lisp capabilities for reading/printing, analyzing, and transforming S-expressions themselves. We also present a practical example of just such an extended language.
منابع مشابه
Computation with the Extended Rational Numbers and an Application to Interval Arithmetic
Programming languages such as Common Lisp and virtu ally every computer algebra system CAS support exact arbitrary precision integer arithmetic as well as exact ra tional number computation Several CAS include interval arithmetic directly but not in the extended form indicated here We explain why changes to the usual rational number system to include in nity and not a number may be use ful espe...
متن کاملRule-Based Expression Mechanisms for Procedural Languages
We report on experiences on adding a rule based expression mechanism to an existing procedural programming language (C++) and on designing and implementing a self-contained language { and its integrated programming environment { supporting similar but more general capabilities. Both languages, XC and XE, are based on abstract data types and XE is a close relative of CLU. Its programming environ...
متن کاملMixing Lisps in Kawa
Kawa started as a Scheme implementation written in Java, based on compiling Scheme forms to Java byte-codes. It has developed into a powerful Scheme dialect whose strengths include speed and easy access to Java classes. It is Free Software that some companies depend on. The Kawa compiler and run-time environment have been generalized to implement other languages besides Scheme, both in the Lisp...
متن کاملA Transformation-Based Implementation of Lightweight Nested Functions
The SC language system has been developed to provide a transformation-based language extension scheme for SC languages (extended/plain C languages with an S-expression based syntax). Using this system, many flexible extensions to the C language can be implemented by transformation rules over S-expressions at low cost mainly because of the pre-existing Common Lisp capabilities for manipulating S...
متن کاملFrom Lisp S-expressions to Java source code
The syntax of Lisp languages is based on S-expressions, an extremely simple form of structured data representation that is nevertheless fundamental to the development of Lisp syntactic extensions. By adopting a more conventional syntax, the Java language placed itself in a difficult position in regard to user-defined syntax extensions. In spite of the many efforts to provide mechanisms for such...
متن کامل