Commit 3372c331 authored by Fabien Triolet's avatar Fabien Triolet
Browse files

Removed all links with TProcessFactory . Transmorpher can run without this class now

parent 07149dec
/**
* $Id: tidy.java,v 1.8 2002-11-14 15:46:45 triolet Exp $
* $Id: tidy.java,v 1.9 2002-11-25 16:09:11 triolet Exp $
*
* Transmorpher
*
......@@ -26,7 +26,6 @@ package fr.fluxmedia.tmcontrib.generator;
// Imported Transmorpher classes
import fr.fluxmedia.transmorpher.engine.TProcessFactory;
import fr.fluxmedia.transmorpher.engine.TReader;
import fr.fluxmedia.transmorpher.utils.Parameters;
import fr.fluxmedia.transmorpher.utils.StringParameters;
......@@ -61,6 +60,9 @@ import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.XMLReaderFactory;
import javax.xml.transform.sax.SAXTransformerFactory;
import javax.xml.transform.TransformerFactory;
/**
* read a HTML file which coordinates (local path or URL) is give in the
......@@ -72,6 +74,8 @@ import org.xml.sax.helpers.XMLReaderFactory;
*/
public final class tidy extends TReader {
protected SAXTransformerFactory tfactory = null;
/**
*Constructor for the tidy object
......@@ -112,7 +116,8 @@ public final class tidy extends TReader {
Node document = cleaner.parseDOM(getInputStream(), null);
Transformer transformer = null;
try {
transformer = TProcessFactory.getSAXTFactory().newTransformer();
tfactory = (SAXTransformerFactory)TransformerFactory.newInstance();
transformer = tfactory.newTransformer();
} catch (TransformerConfigurationException e) {
throw new TMRuntimeException(e, "Cannot create SAX transformer");
}
......
/**
* $Id: BufferingHandler.java,v 1.1 2002-11-06 14:08:21 serge Exp $
* $Id: BufferingHandler.java,v 1.2 2002-11-25 16:09:11 triolet Exp $
*
* Transmorpher
*
......@@ -54,7 +54,9 @@ import org.xml.sax.SAXException;
*@see "SAX 2.0 & JDK 1.3"
*/
class BufferingHandler implements TmHandler {
import org.xml.sax.helpers.DefaultHandler;
class BufferingHandler extends DefaultHandler implements TmHandler {
/** the stack of events info */
Fifo iStack = null;
......
/**
* $Id: TTransformation.java,v 1.3 2002-11-22 16:07:33 triolet Exp $
* $Id: TTransformation.java,v 1.4 2002-11-25 16:09:11 triolet Exp $
*
* Transmorpher
*
......@@ -158,12 +158,12 @@ public abstract class TTransformation extends TProcessBasic {
String systemID = xsltFile.toURL().toExternalForm();
StreamSource SS = new StreamSource(systemID);
// Create a TransformerHandler for each stylesheet.
templates = TProcessFactory.getSAXTFactory().newTemplates(SS);
templates = getTransformerFactory().newTemplates(SS);
entry = new MapEntry(xslLastModified, templates);
cache.put(fileName, entry);
}
templates = entry.templates;
iTransformerHandler = TProcessFactory.getSAXTFactory().newTransformerHandler(templates);
iTransformerHandler = getTransformerFactory().newTransformerHandler(templates);
setOutputProperties();
} catch (Exception e) {
throw new TMRuntimeException(e, "TTransformation initialization failled");
......@@ -211,7 +211,7 @@ public abstract class TTransformation extends TProcessBasic {
public void reset() {
try {
iTransformerHandler = null;
iTransformerHandler = TProcessFactory.getSAXTFactory().newTransformerHandler(templates);
iTransformerHandler = getTransformerFactory().newTransformerHandler(templates);
setOutputProperties();
} catch (Exception e) {
}
......@@ -219,11 +219,13 @@ public abstract class TTransformation extends TProcessBasic {
protected SAXTransformerFactory getTransformerFactory() {
if (tfactory == null) {
String key = "javax.xml.transform.TransformerFactory";
String value = "org.apache.xalan.xsltc.trax.TransformerFactoryImpl";
Properties props = System.getProperties();
props.put(key, value);
System.setProperties(props);
// String key = "javax.xml.transform.TransformerFactory";
// String value = "org.apache.xalan.xsltc.trax.TransformerFactoryImpl";
// Properties props = System.getProperties();
// props.put(key, value);
// System.setProperties(props);
// tfactory = (SAXTransformerFactory)TransformerFactory.newInstance();
tfactory = (SAXTransformerFactory)TransformerFactory.newInstance();
}
return tfactory;
......
/**
* $Id: ApplyExternal.java,v 1.2 2002-11-22 16:07:33 triolet Exp $
* $Id: ApplyExternal.java,v 1.3 2002-11-25 16:09:11 triolet Exp $
*
* Transmorpher
*
......@@ -29,7 +29,6 @@ import java.io.IOException;
import fr.fluxmedia.transmorpher.utils.Writer;
import fr.fluxmedia.transmorpher.engine.TProcess;
import fr.fluxmedia.transmorpher.engine.TProcessComposite;
import fr.fluxmedia.transmorpher.engine.TProcessFactory;
/**
* Transmorpher graph call node interface
......@@ -143,13 +142,12 @@ public class ApplyExternal extends ApplyImpl {
*@param currentProcess The container of this component.
*@param iProcessFactory Used to create the TApplyProcess.
*/
public final void createProcess(TProcessComposite currentProcess, TProcessFactory iProcessFactory) {
public final void createProcess(TProcessComposite currentProcess) {
String[] vPortIn = inPorts().toStringList();
String[] vPortOut = outPorts().toStringList();
TProcess vCurrent = (TProcess) TProcessFactory.newExternal(vPortIn, vPortOut,
getAttributes().getStringParameter("type"),
getParameters(),
getAttributes());
String className = this.getProcess().getTransmorpher().getClassForType(getType());
Object [] params = {(Object)vPortIn,(Object)vPortOut, (Object)getParameters(), (Object)getAttributes()};
TProcess vCurrent = this.newProcess(className,params);
currentProcess.addProcess(vCurrent);
update(vCurrent);
}//end proc
......
/**
* $Id: ApplyProcess.java,v 1.2 2002-11-22 16:07:33 triolet Exp $
* $Id: ApplyProcess.java,v 1.3 2002-11-25 16:09:11 triolet Exp $
*
* Transmorpher
*
......@@ -36,7 +36,6 @@ import java.io.IOException;
import fr.fluxmedia.transmorpher.utils.Writer;
import fr.fluxmedia.transmorpher.utils.LinearIndexedStruct ;
import fr.fluxmedia.transmorpher.engine.TProcessFactory;
import fr.fluxmedia.transmorpher.engine.TProcessComposite;
import fr.fluxmedia.transmorpher.engine.TApplyProcess;
import fr.fluxmedia.transmorpher.engine.TProcess;
......@@ -88,10 +87,12 @@ public class ApplyProcess extends ApplyImpl {
}
} //end generate XML
public final void createProcess(TProcessComposite currentProcess, TProcessFactory iProcessFactory){
public final void createProcess(TProcessComposite currentProcess){
try{
String[] vPortIn = inPorts().toStringList();
String[] vPortOut = outPorts().toStringList();
// get the name corresponding to the generated stylesheet and pass it in parameter
String ref = getAttributes().getStringParameter("ref");
Transmorpher t = getProcess().getTransmorpher() ;
......@@ -100,8 +101,7 @@ public class ApplyProcess extends ApplyImpl {
//System.out.println("[ExecutionStructure]ApplyProcess : findTransformation"
// +((fr.fluxmedia.transmorpher.graph.Process)iTransmorpher.getTransformation(ref)));
TProcessComposite vCurrent =
(TProcessComposite)TProcessFactory.newApplyProcess(vPortIn,vPortOut,
getAttributes().getStringParameter("type"),
(TProcessComposite)new TApplyProcess(vPortIn,vPortOut,
getParameters(),
getAttributes());
PortList LocIn = p.inPorts();
......@@ -109,10 +109,15 @@ public class ApplyProcess extends ApplyImpl {
((TApplyProcess)vCurrent).setLocalName(LocIn.getNames(),LocOut.getNames());
for( ListIterator l = vCalls.listIterator(); l.hasNext() ; ){
((Call)l.next()).createProcess(vCurrent,iProcessFactory);
((Call)l.next()).createProcess(vCurrent);
}
currentProcess.addProcess(vCurrent);
update(vCurrent);
}
catch(Exception e){
System.out.println("[ApplyProcess] Error : cannot create Process");
System.out.println("[ApplyProcess] "+e);
}
} //end proc
public void setUp() {
......
/**
* $Id: ApplyQuery.java,v 1.2 2002-11-22 16:07:33 triolet Exp $
* $Id: ApplyQuery.java,v 1.3 2002-11-25 16:09:11 triolet Exp $
*
* Transmorpher
*
......@@ -33,7 +33,6 @@ package fr.fluxmedia.transmorpher.graph ;
import fr.fluxmedia.transmorpher.utils.Parameters;
import fr.fluxmedia.transmorpher.utils.Writer;
import fr.fluxmedia.transmorpher.engine.TProcessFactory;
import fr.fluxmedia.transmorpher.engine.TProcessComposite;
import fr.fluxmedia.transmorpher.engine.TProcess;
......@@ -83,11 +82,13 @@ public class ApplyQuery extends ApplyImpl {
}
}
public final void createProcess(TProcessComposite currentProcess, TProcessFactory iProcessFactory)
public final void createProcess(TProcessComposite currentProcess)
//throws TransformerException, TransformerConfigurationException, SAXException, IOException
{
String[] vPortIn = inPorts().toStringList();
String[] vPortOut = outPorts().toStringList();
String[] vPortOut = outPorts().toStringList();
String className = this.getProcess().getTransmorpher().getClassForType(getType());
// get the name corresponding to the generated stylesheet and pass it in parameter
String ref = getAttributes().getStringParameter("ref");
Transmorpher tr = getProcess().getTransmorpher() ;
......@@ -95,10 +96,8 @@ public class ApplyQuery extends ApplyImpl {
// static because generated by Transmorpher from the query name
// NOTE: this is specific from tmq and not the query constructor...
getParameters().setParameter("file",f);
TProcess vCurrent = (TProcess)TProcessFactory.newApplyQuery(vPortIn,vPortOut,
getAttributes().getStringParameter("type"),
getParameters(),
getAttributes());
Object [] params = {(Object)vPortIn,(Object)vPortOut, (Object)getParameters(), (Object)getAttributes()};
TProcess vCurrent = this.newProcess(className,params);
currentProcess.addProcess(vCurrent);
update(vCurrent);
......
/**
* $Id: ApplyRuleset.java,v 1.2 2002-11-22 16:07:33 triolet Exp $
* $Id: ApplyRuleset.java,v 1.3 2002-11-25 16:09:11 triolet Exp $
*
* Transmorpher
*
......@@ -34,9 +34,7 @@ package fr.fluxmedia.transmorpher.graph ;
import java.io.IOException;
import fr.fluxmedia.transmorpher.utils.Writer;
import fr.fluxmedia.transmorpher.engine.TProcessFactory;
import fr.fluxmedia.transmorpher.engine.TProcessComposite;
import fr.fluxmedia.transmorpher.engine.TProcess;
import fr.fluxmedia.transmorpher.engine.*;
public class ApplyRuleset extends ApplyImpl {
......@@ -101,8 +99,9 @@ public class ApplyRuleset extends ApplyImpl {
}
}
public final void createProcess(TProcessComposite currentProcess, TProcessFactory iProcessFactory)
public final void createProcess(TProcessComposite currentProcess)
{
try{
String[] vPortIn = inPorts().toStringList();
String[] vPortOut = outPorts().toStringList();
// get the name corresponding to the generated stylesheet and pas it in parameter
......@@ -111,13 +110,17 @@ public class ApplyRuleset extends ApplyImpl {
String f = t.findTransformation(ref).getAttributes().getStringParameter("file");
// static because generate by Transmorpher from the ruleset name
getParameters().setParameter("file",f);
TProcess vCurrent = (TProcess)TProcessFactory.newApplyRuleset(vPortIn,vPortOut,
getAttributes().getStringParameter("type"),
TProcess vCurrent = new TApplyRuleset(vPortIn,vPortOut,
getParameters(),
getAttributes());
currentProcess.addProcess(vCurrent);
update(vCurrent);
}
catch (Exception e){
System.out.println("[ApplyRuleset] Error : cannot create Process");
System.out.println("[ApplyRuleset] "+e);
}
} //end proc
public final void setUp(){
......
/**
* $Id: Call.java,v 1.1 2002-11-06 14:08:21 serge Exp $
* $Id: Call.java,v 1.2 2002-11-25 16:09:11 triolet Exp $
*
* Transmorpher
*
......@@ -34,7 +34,6 @@ package fr.fluxmedia.transmorpher.graph ;
import fr.fluxmedia.transmorpher.utils.Writer;
import fr.fluxmedia.transmorpher.utils.Parameters;
import fr.fluxmedia.transmorpher.utils.StringParameters;
import fr.fluxmedia.transmorpher.engine.TProcessFactory;
import fr.fluxmedia.transmorpher.engine.TProcessComposite;
import java.io.Serializable;
......@@ -61,6 +60,6 @@ public interface Call extends Serializable{
public void setUp();
public void clearVisited();
public void clearNull();
public void createProcess(TProcessComposite composite, TProcessFactory pFactory);
public void createProcess(TProcessComposite composite);
}
/**
* $Id: CallImpl.java,v 1.1 2002-11-06 14:08:21 serge Exp $
* $Id: CallImpl.java,v 1.2 2002-11-25 16:09:11 triolet Exp $
*
* Transmorpher
*
......@@ -39,8 +39,7 @@ import java.io.IOException;
import fr.fluxmedia.transmorpher.utils.Parameters;
import fr.fluxmedia.transmorpher.utils.StringParameters;
import fr.fluxmedia.transmorpher.utils.Writer;
import fr.fluxmedia.transmorpher.engine.TProcessFactory;
import fr.fluxmedia.transmorpher.engine.TProcessComposite;
import fr.fluxmedia.transmorpher.engine.*;
import fr.fluxmedia.transmorpher.action.*;
public abstract class CallImpl extends Observable implements Call {
......@@ -215,12 +214,26 @@ public abstract class CallImpl extends Observable implements Call {
} //end proc
// By default do nothing
public void createProcess(TProcessComposite composite, TProcessFactory pFactory){};
public void createProcess(TProcessComposite composite){};
public void update(Object object){
setChanged();
notifyObservers(object);
}
public static final TProcess newProcess(String type, Object[] params) {
TProcess process=null;
//System.err.println("Creating "+type+" process with "+type+" class");
try {
Class processClass = Class.forName(type);
java.lang.reflect.Constructor[] processConstructors = processClass.getConstructors();
//System.err.println("Result : "+processConstructors[0].getName());
process=(TProcess)processConstructors[0].newInstance(params);
} catch (Exception e) {
System.out.println("[CallImpl] Error : cannot create Process");
System.out.println("[CallImpl] "+e);
}
return process;
}
} //end call impl
/**
* $Id: Dispatch.java,v 1.2 2002-11-22 16:07:33 triolet Exp $
* $Id: Dispatch.java,v 1.3 2002-11-25 16:09:11 triolet Exp $
*
* Transmorpher
*
......@@ -34,7 +34,6 @@ package fr.fluxmedia.transmorpher.graph ;
import java.io.IOException;
import fr.fluxmedia.transmorpher.utils.Writer;
import fr.fluxmedia.transmorpher.engine.TProcessFactory;
import fr.fluxmedia.transmorpher.engine.TProcessComposite;
import fr.fluxmedia.transmorpher.engine.TProcess;
......@@ -86,13 +85,12 @@ public class Dispatch extends CallImpl {
System.out.println("\"/>");
}
public final void createProcess(TProcessComposite currentProcess, TProcessFactory iProcessFactory) {
public final void createProcess(TProcessComposite currentProcess) {
String[] vPortIn = inPorts().toStringList();
String[] vPortOut = outPorts().toStringList();
TProcess vCurrent = (TProcess)TProcessFactory.newDispatcher(vPortIn,vPortOut,
getAttributes().getStringParameter("type"),
getParameters());
String className = this.getProcess().getTransmorpher().getClassForType(getType());
Object [] params = {(Object)vPortIn,(Object)vPortOut, (Object)getParameters()};
TProcess vCurrent = this.newProcess(className,params);
currentProcess.addProcess(vCurrent);
update(vCurrent);
} //end proc
......
/**
* $Id: Generate.java,v 1.2 2002-11-22 16:07:33 triolet Exp $
* $Id: Generate.java,v 1.3 2002-11-25 16:09:11 triolet Exp $
*
* Transmorpher
*
......@@ -36,7 +36,6 @@ package fr.fluxmedia.transmorpher.graph ;
import java.io.IOException;
import fr.fluxmedia.transmorpher.utils.Writer;
import fr.fluxmedia.transmorpher.engine.TProcessFactory;
import fr.fluxmedia.transmorpher.engine.TProcessComposite;
import fr.fluxmedia.transmorpher.engine.TProcess;
......@@ -100,15 +99,18 @@ public class Generate extends CallImpl {
}
}//end generate xml
public final void createProcess(TProcessComposite currentProcess, TProcessFactory iProcessFactory){
public final void createProcess(TProcessComposite currentProcess){
String[] vPortOut = outPorts().toStringList();
String className = this.getProcess().getTransmorpher().getClassForType(getType());
Object [] params = {(Object)vPortOut, (Object)getParameters(), (Object)getAttributes()};
TProcess vCurrent = this.newProcess(className,params);
//System.out.println(" vPortOut "+ vPortOut);
//System.out.println("[ExecutionStructure]Creation d'un TReader "+ getParameters());
TProcess vCurrent = (TProcess)iProcessFactory.newGenerator(vPortOut,
getAttributes().getStringParameter("type"),
getParameters(),
getAttributes());
// TProcess vCurrent = (TProcess)iProcessFactory.newGenerator(vPortOut,
// getAttributes().getStringParameter("type"),
// getParameters(),
// getAttributes());
currentProcess.addProcess(vCurrent);
update(vCurrent);
......
/**
* $Id: Iterator.java,v 1.2 2002-11-22 16:07:33 triolet Exp $
* $Id: Iterator.java,v 1.3 2002-11-25 16:09:11 triolet Exp $
*
* Transmorpher
*
......@@ -26,11 +26,7 @@ package fr.fluxmedia.transmorpher.graph;
// imported fr.fluxmedia.transmorpher classes
import fr.fluxmedia.transmorpher.utils.Writer;
import fr.fluxmedia.transmorpher.engine.TIterator;
import fr.fluxmedia.transmorpher.engine.TLoop;
import fr.fluxmedia.transmorpher.engine.TProcess;
import fr.fluxmedia.transmorpher.engine.TProcessComposite;
import fr.fluxmedia.transmorpher.engine.TProcessFactory;
import fr.fluxmedia.transmorpher.engine.*;
import fr.fluxmedia.transmorpher.utils.Parameters;
//imported java classes
......@@ -144,6 +140,18 @@ public class Iterator {
return parameters;
}
public TIterator newIterator(String type,Object[] params){
try {
Class processClass = Class.forName(type);
java.lang.reflect.Constructor[] processConstructors = processClass.getConstructors();
return (TIterator)processConstructors[0].newInstance(params);
} catch (Exception e) {
System.out.println("[Iterator] Error : cannot create Iterator");
System.out.println("[Iterator] "+e);
return (TIterator)null;
}
}
/**
* Creates a new TIterator corresponding to the iterator and adds it to the
* current composite process (this must be a TLoop because iterators cannot be
......@@ -152,9 +160,11 @@ public class Iterator {
*@param process the current TLoop.
*@param factory used for creating the TIterator.
*/
public void createIterator(TProcessComposite process, TProcessFactory factory) {
public void createIterator(TProcessComposite process) {
String className = this.getRepeat().getProcess().getTransmorpher().getClassForType(getType());
Object [] params = {(Object)name,(Object)parameters};
TIterator iterator = TProcessFactory.newIterator(name, type, getParameters());
TIterator iterator = newIterator(className, params);
if (process instanceof TLoop) {
((TLoop) process).addIterator(iterator);
} else {
......
/**
* $Id: Main.java,v 1.2 2002-11-22 16:07:33 triolet Exp $
* $Id: Main.java,v 1.3 2002-11-25 16:09:11 triolet Exp $
*
* Transmorpher
*
......@@ -39,8 +39,7 @@ import java.io.IOException;
import fr.fluxmedia.transmorpher.utils.Writer;
import fr.fluxmedia.transmorpher.utils.Parameters;
import fr.fluxmedia.transmorpher.utils.LinearIndexedStruct;
import fr.fluxmedia.transmorpher.engine.TProcessFactory;
import fr.fluxmedia.transmorpher.engine.TProcessComposite;
import fr.fluxmedia.transmorpher.engine.*;
public class Main extends MainProcess {
......@@ -59,15 +58,22 @@ public class Main extends MainProcess {
System.out.println();
}
public TProcessComposite createMainProcess(TProcessFactory iProcessFactory) {
String[] vPortIn = inPorts().toStringList();
String[] vPortOut = outPorts().toStringList();
TProcessComposite vCurrent = (TProcessComposite)TProcessFactory.newMain(vPortIn,vPortOut,getParameters());
for( ListIterator l = calls.listIterator(); l.hasNext() ; ){
Call call = (Call)l.next();
call.createProcess(vCurrent,iProcessFactory);
}
return vCurrent ;
public TProcessComposite createMainProcess(){
// String[] vPortIn = inPorts().toStringList();
// String[] vPortOut = outPorts().toStringList();
try{
TProcessComposite vCurrent = new TMain(getParameters());
for( ListIterator l = calls.listIterator(); l.hasNext() ; ){
Call call = (Call)l.next();
call.createProcess(vCurrent);
}
return vCurrent ;
}
catch (Exception e){
System.out.println("[Main] Error : cannot create Process");
System.out.println("[Main] "+e);
return null;
}
}
public void generateImport(Writer iFile,LinearIndexedStruct externs) throws IOException {
......@@ -81,9 +87,8 @@ public class Main extends MainProcess {
public void generateMainHeader(Writer iFile) throws IOException {
iFile.writeln(2,"public static void main(String[] argc) throws Exception {");
//iFile.writeln(4,"tmProcessFactory = new TProcessFactory(newDefexterns(),debug_mode);");
iFile.writeln(4,"tmProcessStack = new Stack();");
iFile.writeln(4,"vSR = new SystemResources();");
//iFile.writeln(4,"vSR = new SystemResources();");
}
public void generateReadParameters(Writer iFile) throws IOException {
......
/**
* $Id: MainProcess.java,v 1.2 2002-11-22 16:07:33 triolet Exp $
* $Id: MainProcess.java,v 1.3 2002-11-25 16:09:11 triolet Exp $
*
* Transmorpher
*
......@@ -41,7 +41,6 @@ import java.io.IOException;
import fr.fluxmedia.transmorpher.utils.LinearIndexedStruct;
import fr.fluxmedia.transmorpher.utils.Version;
import fr.fluxmedia.transmorpher.utils.Writer;
import fr.fluxmedia.transmorpher.engine.TProcessFactory;
import fr.fluxmedia.transmorpher.engine.TProcessComposite;
import fr.fluxmedia.transmorpher.engine.TApplyProcess;
import fr.fluxmedia.transmorpher.engine.TProcess;
......@@ -53,7 +52,7 @@ public abstract class MainProcess extends fr.fluxmedia.transmorpher.graph.Proces
super(n,t,nin,nout);
}
public abstract TProcessComposite createMainProcess(TProcessFactory iProcessFactory);
public abstract TProcessComposite createMainProcess();
public void generateJavaCode(Writer iFile,LinearIndexedStruct externs) throws IOException {
iFile.writeln("/** Generated by "+Version.NAME+" "+Version.RELEASE);
......@@ -71,7 +70,7 @@ public abstract class MainProcess extends fr.fluxmedia.transmorpher.graph.Proces
iFile.writeln();
generateClassHeader(iFile);
iFile.writeln(4," // ressource manager");
iFile.writeln(4,"static SystemResources vSR = null;");
//iFile.writeln(4,"static SystemResources vSR = null;");
iFile.writeln();
iFile.writeln(4,"//global variables for port");
iFile.writeln(4,"static String[] portIn = null ;");
......@@ -81,17 +80,16 @@ public abstract class MainProcess extends fr.fluxmedia.transmorpher.graph.Proces
iFile.writeln();
iFile.writeln(4," // global variable for the processFactory");
// BUG: This is not really compiling since stuff are created at runtime!
//iFile.writeln(4,"static TProcessFactory tmProcessFactory = null;");
iFile.writeln();
iFile.writeln(4,"private static LinearIndexedStruct newDefexterns(){");
iFile.writeln(6,"LinearIndexedStruct defs = new LinearIndexedStruct();");
Enumeration keys = externs.getKeys();
while(keys.hasMoreElements()){
String name = (String) keys.nextElement();
iFile.writeln(6,"defs.add(\""+name+"\", (Object)\""+(String)externs.get(name)+"\");");
};
iFile.writeln(6,"return defs;");
iFile.writeln(4,"}");
// iFile.writeln(4,"private static LinearIndexedStruct newDefexterns(){");
// iFile.writeln(6,"LinearIndexedStruct defs = new LinearIndexedStruct();");
// Enumeration keys = externs.getKeys();
// while(keys.hasMoreElements()){
// String name = (String) keys.nextElement();