IMPLEMENTING GENERALIZED OPERATOR OVERLOADING

Citation
Ws. Miles et Lf. Johnson, IMPLEMENTING GENERALIZED OPERATOR OVERLOADING, Software, practice & experience, 28(6), 1998, pp. 593-610
Citations number
12
Categorie Soggetti
Computer Science Software Graphycs Programming","Computer Science Software Graphycs Programming
ISSN journal
00380644
Volume
28
Issue
6
Year of publication
1998
Pages
593 - 610
Database
ISI
SICI code
0038-0644(1998)28:6<593:IGOO>2.0.ZU;2-Y
Abstract
This paper presents a practical method of adding problem-specific nota tion to an established computer language, Our idea is to use unrestric ted operator overloading as a tool to map the problem domain notation directly into an existing programming language. Our method introduces new operator symbols and function names into a host language by overlo ading existing usage, We extend the host programming language syntax t o an augmented language which is mapped to the host language by a prog rammable preprocessor. The preprocessor uses a programmer-modifiable s ymbolic language grammar to translate an augmented program into a stan dard program, This process gives a natural extension to any computer l anguage without modifying the host language. Direct use of problem not ation can improve program legibility and code comprehension within the problem domain. The preprocessor provides a useful research tool for exploring language issues without the need to write a compiler for a n ew language, It can also be used to provide a domain specific language for a programming group at lower cost than new language development, This paper presents several working examples which illustrate our work . We redefine many of the standard C operators to alleviate some of th e more common programming errors, thus creating a 'cleaner' C. As a mo re esoteric example, we encode a subset of APL vector operators as an algebraic extension to the C language, A curious application of our me thod shows its success in an arbitrary problem domain by compiling and executing poetry. Our final example introduces standard symbolic logi c notation into C for tautology verification. (C) 1998 John Wiley & So ns, Ltd.