=ADD= =reftype= 14 =number= 98-15 =url= ftp://ftp.risc.uni-linz.ac.at/pub/techreports/1998/98-15.ps.gz =year= 1998 =month= 10 =author= Danielczyk-Landerl; Werner =title= Syntax Processing and Code Generation for a Generic Programming Language =abstract= We describe the techniques developed and used for implementing the parser and code generator for a programming language that exploits functors, i.e., parameterized modules, for developing generic libraries. An imperative core language is used for describing the implementation of the entities provided by functors. The parser generates a syntax tree representing the parsed source text. Several sub-parsers are called (and call each other) for parsing certain syntax domains of the language. In particular, the parsers for the syntax domains of the C-like core language are separated from the actual functor language parts of the parser. This allows to easily switch to another core language if desired. The parser hides the operators and literals allowed in the expressions of the language as purely syntactic features from the other parts of the compiler, and makes them, on the other hand, user-definable. The code generator produces C++ (essentially C) code for fully instantiated functors. This is compiled by the GNU C++ compiler to object code that can be linked to C or C++ programs. The functor language allows the definition of constructors and destructors for user-defined types. The code generated for expressions serves for the correct life-time and appropriate destruction of all temporary values. Default implementations for functions are generated from function specifications. Appropriate parameter passing mechanisms are chosen depending on parameter modes and types. This is possible since the semantics of the parameter modes provided by the functor language are not specified in terms of certain passing mechanisms. Finally, debugging information is included in the generated C++ code that allows tracing the execution of functor language source texts with usual source level debugging tools. =note= Diploma Thesis =sponsor= FWF project P11414-{\"O}TE ``HPGP---High-Performance Generic Programming''