EGG - Easy Generator Generator for 'xml-to-text' transformations ================================================================ Hints for running egg-templates ------------------------------- Attach the '.egg' file-extension with the 'open' command in your file-explorer to 'egg.bat' on Windows or 'egg.sh' on UNIX. By this, you can just double-click on the egg-files in order to build the generators. Use drag-n-drop to start the generator startup-scripts with the xml-input files. Of course, you can also build and start the demo-generators via commandline. If you change an egg-template, simply start the generator with the startup-script as you did before. The generator detects the template-change and rebuilds itself via Egg. Every egg-template contains additional documentation in lines starting with './/'. DialogmodellGenerator --------------------- .// Simple demo for generating Java-code from the real world. Demo is in german because .// it's described in section 2 'Generator-Entwicklungsprozess' of the documentation (see 'egg.doc'). - build: egg.{bat|sh} DialogmodellGenerator.egg - run: DialogmodellGenerator.{bat|sh} Benutzerverwaltung.xml - output: BenutzerverwaltungDM.java FileVarDemo ----------- Feature-rich demo. It shows how to - use multiple input-files (@ egg-commandline-parameter) - use multiple output-files (first File-variable in an egg-pattern) - use command-line parameters in the generator - build a cross-reference over multiple input-files - integrate generated and manually written code via the 'sandwich' design-pattern - build: egg.{bat|sh} FileVarDemo.egg - run: makeDialogs.{bat|sh} - output: 'webapp'-folder The generated output is a Java-class that is derived from a manually written framework-class and derived by a manually written class for specialization of the generated code. IndentDemo ---------- .// The IndentDemo simply shows how to control the indentation of the generator-output .// using the 'indent'-option. - build: egg.{bat|sh} IndentDemo.egg - run: IndentDemo.{bat|sh} dummy.xml - output: 'gen'-folder InlineDemo ---------- .// The InlineDemo shows the use of the 'inline'-option. .// inline="no": output-lines in an egg-pattern is a separate line in the generator-ouput. .// inline="yes": output-lines in an egg-pattern end up in the same line in the generator-ouput. - build: egg.{bat|sh} InlineDemo.egg - run: InlineDemo.{bat|sh} NamespaceMgr.xml - output: 'gen'-folder MixedContentDemo ---------------- .// The MixedContentDemo shows how to handle mixed text- and element-nodes in a xml-input file. .// The xml-input file contains some mixed-content, that will be processed by in three ways .// by the test-patterns in the 'MixedContentDemo'-generator. - build: egg.{bat|sh} MixedContentDemo.egg - run: MixedContentDemo.{bat|sh} MixedContent.xml - output: 'gen'-folder PatternSetDemo -------------- .// The PatternSetDemo shows how to process input-nodes in the order defined by the input-document. .// .// Egg-patternsets can be compared to switch/case-constructs in common programming-languages. .// The current input-node processed by the generator is matched against a set of path-expressions. .// If one of the path-expressions matches, the associated pattern is applied. - build: egg.{bat|sh} PatternSetDemo.egg - run: PatternSetDemo.{bat|sh} toolbar.xml - output: 'gen'-folder StmtBodyDemo ------------ .// The 'StmtBodyDemo'-generator shows how to extend your generator with your own Java-methods .// and -fields. With 'body'-statement you can write Java-code that is placed verbatim into the .// generator-class created by Egg. The may be several 'body'-statements in an egg-file. - build: egg.{bat|sh} StmtBodyDemo.egg - run: StmtBodyDemo.{bat|sh} bean-def.xml - output: 'gen'-folder StmtHeadDemo ------------ .// The 'StmtHeadDemo'-generator shows how to import third-party classes. .// By default, every generator-class created by egg imports 'java.io.*', 'java.util.*' .// and 'org.w3c.*' (and some classes used for xml-parsing). .// With 'head'-statement you can extend the imports to your needs. - build: egg.{bat|sh} StmtHeadDemo.egg - run: StmtHeadDemo.{bat|sh} DateList.xml - output: 'gen'-folder