|
ParserCode.grm
|
// FILE. . . . . /home/hak/ilt/src/ilog/rif/ParserCode.grm
// EDIT BY . . . Hassan Ait-Kaci
// ON MACHINE. . 4j4zn71
// STARTED ON. . Wed Apr 02 08:18:35 2008
// Last modified on Mon May 05 21:32:42 2008 by hak
%import java.io.PrintStream;
%import ilog.language.tools.Misc;
%{
long start;
boolean quiet = true;
boolean applet = false;
String xmlForm;
PrintStream out = System.out;
public void setStartTime ()
{
start = System.currentTimeMillis();
}
public void setApplet (boolean flag)
{
applet = flag;
}
public void setQuiet (boolean flag)
{
quiet = flag;
}
public void setOutputStream (PrintStream stream)
{
out = stream;
}
public String xmlForm ()
{
return xmlForm;
}
/*
* A function to show what happened.
*/
void showXml ()
{
if (applet)
{
xmlForm = xmlForm(currentNode().xmlDocument());
}
else
{
out.println("*** Total parsing time = "
+(System.currentTimeMillis()-start)
+" ms");
if (!quiet)
{
errorManager().tallyErrors();
if (Misc.askYesNo("*** Do you want to see the XML serialization"))
{
out.println();
try
{
writeXml(currentNode(),System.out);
}
catch (Exception e)
{
e.printStackTrace();
}
// currentNode().display();
out.println();
}
}
}
}
%}
This file was generated on Tue Jun 24 17:55:21 CEST 2008 from file ParserCode.grm
by the ilog.language.tools.Hilite Java tool written by Hassan Aït-Kaci