From: Petra M. <pe...@cs...> - 2004-02-29 21:58:37
|
Hi, I think we need an agreement on handling template and example files. Template files are files from which source code is generated. The template files of Gnast (the source code genetator) are currently located in src/vm and the java source code lives in src/java (which is inconsistent with most other czt subprojects where the java source code lives in src). However, if the java source code lives in src, where should the template files live? I am planning to add some template files to the parser. One is needed for the scanner, which is used by different parsers. To avoid duplicating code I want to write an xml file containing the java source code and an xsl script which transforms the xml into java source code so that several versions of the scanner can be generated from just one file. This approach can probably also be used to handle the different parser versions (Z, OZ, TCOZ etc.). I've got the same problem in corejava where I want to generate ZChar.java and ZString.java from an XML file. I can think of several approaches: 1) Gnast approach: src/vm, src/xsl, src/java directories 2) Java lives in src, template files live in another directory called templates or xsl or whatever Another question is where the generated source code should go in. It could go into src, but then the clean target is difficult to write. Each generated file has to be removed and it is likely to forget one. Another possibility is to put it into build/src and compile into build/classes. Then the clean target just needs to remove the build directory. Example files are currently distributed randomly in the project tree. Some are in zml/examples, unicode examples are in jedit, and some subprojects like the parser also have their own locale example files. I wonder whether it is a good idea to have just one location for example files so that they can be used by different czt subprojects. Another point of confusion are the file endings. It would be nice to have a common schema for the different file types (latex, utf8, utf16, xml, z, oz, tcoz) so that tools can use that information. Are there existing conventions? As far as I know tex and zed are used for latex specifications. What about Object Z latex specifications? Any ideas, suggestions, etc.? Petra |