From: Pablo R. M. <rod...@gm...> - 2008-03-11 18:21:34
|
Hi czt'ers! I would like to transform Java AST objects into a .tex file, so I make some attempts (using the release 1.0 of czt) with a program similar to the following: // ***************************************************************************************************************** import net.sourceforge.czt.print.util.LatexString; import net.sourceforge.czt.session.*; import net.sourceforge.czt.z.ast.*; import net.sourceforge.czt.z.impl.*; import net.sourceforge.czt.base.ast.*; import net.sourceforge.czt.base.ast.Term; import net.sourceforge.czt.util.ReflectionUtils; import java.io.*; public class TexPrinting{ public static void main(String[] args) { FileSource source = new FileSource("bbook.tex"); SectionManager manager = new SectionManager(); manager.put(new Key(source.getName(), Source.class), source); try{ Spec spec = (Spec) manager.get(new Key(source.getName(), Spec.class)); manager = new SectionManager(); manager.put(new Key("bbook", Spec.class), spec); LatexString latex = (LatexString) manager.get(new Key("bbook", LatexString.class)); System.out.println(latex); } catch(Exception e){ System.out.println (e); } } } // ***************************************************************************************************************** The results were correct (so quite useful for the tool I am developing) but it also prints the following warning messages: 11/03/2008 15:10:25 net.sourceforge.czt.parser.util.WarningManager warn ADVERTENCIA: Cannot get operator table for Specification; try to print anyway ... 11/03/2008 15:10:25 net.sourceforge.czt.print.z.CUP$Unicode2Latex$actionssetupMarkupTable ADVERTENCIA: Cannot get latex markup for section Specification caused by net.sourceforge.czt.session.SourceLocator$SourceLocatorException: Cannot find source location for section Specification I was trying to modify my local version of czt in order to avoid the printing of these warnings but the attempt was not successfull. Any suggestions? Which (source?) files I should modify? Thanks, Pablo |