From: Petra M. <pe...@cs...> - 2005-02-27 22:54:22
|
Hi, Leo wrote: > I guess that I need to include another branch in the ant task Petra > produced to cover circus, is that right? I mean, once I have included > a new production into the XML files, what are the steps to follow to > produce the parser class? ... Just include something like > > <target name="generate-circus-parser" depends="circus-parser, > circus-lparser, circus-uparser, circus-parserutils"/> > > (plus the related targets) and then run the ant scripts? Yes, that's it. :-) For example, the Circus java_cup source is build by a target like this: <target name="circus-parser-cup" depends="init"> <xslt in="templates/Parser.xml" out="${build.src.circus.dir}/Parser.cup" style="${czt.home}/devtools/template2text.xsl"> <param name="class" expression="Parser"/> <param name="package" expression="net.sourceforge.czt.parser.circus"/> <param name="add" expression="{circus}"/> </xslt> </target> As you can see, the .cup file is generated by applying the XSL script devtools/template2text.xsl to the parser/templates/Parser.xml file. Params "class" and "package" are used to set the class and package name of the parser to be generated. I suggest to use a Circus package for your parser as shown above. Param "add" selects the parser version to be generated. Your parser needs, in addition to the Standard Z parser code, all code included in <add:circus> tags. It is also possible to have a list of tags that should be added as, for example, in "{oz}{tcoz}". Setting up the build file shouldn't be too difficult. I can do that for you if you want. Cheers, Petra |