/*
 *  Do not modify this file; it is automatically 
 *  generated and any modifications will be overwritten.
 *
 * @(#) xdc-x20
 */
import java.util.*;
import org.mozilla.javascript.*;
import xdc.services.intern.xsr.*;
import xdc.services.spec.Session;

public class eclipsegen
{
    static final String VERS = "@(#) xdc-x20\n";

    static final Proto.Elm $$T_Bool = Proto.Elm.newBool();
    static final Proto.Elm $$T_Num = Proto.Elm.newNum();
    static final Proto.Elm $$T_Str = Proto.Elm.newStr();
    static final Proto.Elm $$T_Obj = Proto.Elm.newObj();

    static final Proto.Fxn $$T_Met = new Proto.Fxn(null, null, 0, -1, false);
    static final Proto.Map $$T_Map = new Proto.Map($$T_Obj);
    static final Proto.Arr $$T_Vec = new Proto.Arr($$T_Obj);

    static final XScriptO $$DEFAULT = Value.DEFAULT;
    static final Object $$UNDEF = Undefined.instance;

    static final Proto.Obj $$Package = (Proto.Obj)Global.get("$$Package");
    static final Proto.Obj $$Module = (Proto.Obj)Global.get("$$Module");
    static final Proto.Obj $$Instance = (Proto.Obj)Global.get("$$Instance");
    static final Proto.Obj $$Params = (Proto.Obj)Global.get("$$Params");

    static final Object $$objFldGet = Global.get("$$objFldGet");
    static final Object $$objFldSet = Global.get("$$objFldSet");
    static final Object $$proxyGet = Global.get("$$proxyGet");
    static final Object $$proxySet = Global.get("$$proxySet");
    static final Object $$delegGet = Global.get("$$delegGet");
    static final Object $$delegSet = Global.get("$$delegSet");

    Scriptable xdcO;
    Session ses;
    Value.Obj om;

    boolean isROV;
    boolean isCFG;

    Proto.Obj pkgP;
    Value.Obj pkgV;

    ArrayList<Object> imports = new ArrayList<Object>();
    ArrayList<Object> loggables = new ArrayList<Object>();
    ArrayList<Object> mcfgs = new ArrayList<Object>();
    ArrayList<Object> icfgs = new ArrayList<Object>();
    ArrayList<Object> proxies = new ArrayList<Object>();
    ArrayList<Object> sizes = new ArrayList<Object>();
    ArrayList<Object> tdefs = new ArrayList<Object>();

    void $$IMPORTS()
    {
        Global.callFxn("loadPackage", xdcO, "xdc");
        Global.callFxn("loadPackage", xdcO, "xdc.corevers");
        Global.callFxn("loadPackage", xdcO, "xdc.tools.product");
    }

    void $$OBJECTS()
    {
        pkgP = (Proto.Obj)om.bind("eclipsegen.Package", new Proto.Obj());
        pkgV = (Value.Obj)om.bind("eclipsegen", new Value.Obj("eclipsegen", pkgP));
    }

    void UiactoolsProduct$$OBJECTS()
    {
        Proto.Obj po, spo;
        Value.Obj vo;

        po = (Proto.Obj)om.bind("eclipsegen.UiactoolsProduct.Module", new Proto.Obj());
        vo = (Value.Obj)om.bind("eclipsegen.UiactoolsProduct", new Value.Obj("eclipsegen.UiactoolsProduct", po));
        pkgV.bind("UiactoolsProduct", vo);
        // decls 
        om.bind("eclipsegen.UiactoolsProduct.HelpToc", om.findStrict("xdc.tools.product.IProduct.HelpToc", "eclipsegen"));
        om.bind("eclipsegen.UiactoolsProduct.Target", om.findStrict("xdc.tools.product.IProduct.Target", "eclipsegen"));
        om.bind("eclipsegen.UiactoolsProduct.UrlDescriptor", om.findStrict("xdc.tools.product.IProduct.UrlDescriptor", "eclipsegen"));
        om.bind("eclipsegen.UiactoolsProduct.PluginDescriptor", om.findStrict("xdc.tools.product.IProduct.PluginDescriptor", "eclipsegen"));
        om.bind("eclipsegen.UiactoolsProduct.MacroDescriptor", om.findStrict("xdc.tools.product.IProduct.MacroDescriptor", "eclipsegen"));
    }

    void UiactoolsProduct$$CONSTS()
    {
        // module UiactoolsProduct
    }

    void UiactoolsProduct$$CREATES()
    {
        Proto.Fxn fxn;
        StringBuilder sb;

    }

    void UiactoolsProduct$$FUNCTIONS()
    {
        Proto.Fxn fxn;

    }

    void UiactoolsProduct$$SIZES()
    {
    }

    void UiactoolsProduct$$TYPES()
    {
        Scriptable cap;
        Proto.Obj po;
        Proto.Str ps;
        Proto.Typedef pt;
        Object fxn;

        po = (Proto.Obj)om.findStrict("eclipsegen.UiactoolsProduct.Module", "eclipsegen");
        po.init("eclipsegen.UiactoolsProduct.Module", om.findStrict("xdc.tools.product.IProduct.Module", "eclipsegen"));
                po.addFld("$hostonly", $$T_Num, 1, "r");
        po.addFld("name", $$T_Str, "System Analyzer (UIA cTools Target)", "wh");
        po.addFld("id", $$T_Str, "com.ti.uiactools", "wh");
        po.addFld("version", $$T_Str, "1.01.00.09", "wh");
        po.addFld("companyName", $$T_Str, "Texas Instruments", "wh");
        po.addFld("productDescriptor", (Proto)om.findStrict("xdc.tools.product.IProduct.UrlDescriptor", "eclipsegen"), Global.newObject("url", "http://www.ti.com", "text", "UIA cTools"), "wh");
        po.addFld("licenseDescriptor", (Proto)om.findStrict("xdc.tools.product.IProduct.UrlDescriptor", "eclipsegen"), Global.newObject("text", "Texas Instruments Incorporated - Technology Software Publicly Available license"), "wh");
        po.addFld("copyRightNotice", $$T_Str, "Copyright Texas Instruments 2012", "wh");
        po.addFld("repositoryArr", new Proto.Arr($$T_Str, false), Global.newArray(new Object[]{"packages"}), "wh");
        po.addFld("docsLocArr", new Proto.Arr($$T_Str, false), Global.newArray(new Object[]{".", "docs", "docs/cdoc"}), "wh");
        po.addFld("templateModule", $$T_Str, "ti.uiactools.examples.Examples", "wh");
        po.addFld("productViewModule", $$T_Str, "ti.uiactools.productview.UiactoolsProductView", "wh");
        po.addFld("bundleName", $$T_Str, "uiactools", "wh");
        po.addFld("helpTocArr", new Proto.Arr((Proto)om.findStrict("xdc.tools.product.IProduct.HelpToc", "eclipsegen"), false), Global.newArray(new Object[]{Global.newObject("label", "uiactools Release Notes", "filePath", "uiactools_1_01_00_09_release_notes.html"), Global.newObject("label", "System Analyzer WIKI", "filePath", "http://processors.wiki.ti.com/index.php/Multicore_System_Analyzer"), Global.newObject("label", "uiactools API Reference (cdoc)", "filePath", "cdoc/toc.xml", "tocFile", true)}), "wh");
    }

    void UiactoolsProduct$$ROV()
    {
    }

    void $$SINGLETONS()
    {
        pkgP.init("eclipsegen.Package", (Proto.Obj)om.findStrict("xdc.IPackage.Module", "eclipsegen"));
        pkgP.bind("$capsule", $$UNDEF);
        pkgV.init2(pkgP, "eclipsegen", Value.DEFAULT, false);
        pkgV.bind("$name", "eclipsegen");
        pkgV.bind("$category", "Package");
        pkgV.bind("$$qn", "eclipsegen.");
        pkgV.bind("$vers", Global.newArray());
        Value.Map atmap = (Value.Map)pkgV.getv("$attr");
        atmap.seal("length");
        imports.clear();
        pkgV.bind("$imports", imports);
        StringBuilder sb = new StringBuilder();
        sb.append("var pkg = xdc.om['eclipsegen'];\n");
        sb.append("if (pkg.$vers.length >= 3) {\n");
            sb.append("pkg.$vers.push(Packages.xdc.services.global.Vers.getDate(xdc.csd() + '/..'));\n");
        sb.append("}\n");
        sb.append("pkg.build.libraries = [\n");
        sb.append("];\n");
        sb.append("pkg.build.libDesc = [\n");
        sb.append("];\n");
        Global.eval(sb.toString());
    }

    void UiactoolsProduct$$SINGLETONS()
    {
        Proto.Obj po;
        Value.Obj vo;

        vo = (Value.Obj)om.findStrict("eclipsegen.UiactoolsProduct", "eclipsegen");
        po = (Proto.Obj)om.findStrict("eclipsegen.UiactoolsProduct.Module", "eclipsegen");
        vo.init2(po, "eclipsegen.UiactoolsProduct", $$DEFAULT, false);
        vo.bind("Module", po);
        vo.bind("$category", "Module");
        vo.bind("$capsule", $$UNDEF);
        vo.bind("$package", om.findStrict("eclipsegen", "eclipsegen"));
        tdefs.clear();
        proxies.clear();
        mcfgs.clear();
        icfgs.clear();
        vo.bind("HelpToc", om.findStrict("xdc.tools.product.IProduct.HelpToc", "eclipsegen"));
        tdefs.add(om.findStrict("xdc.tools.product.IProduct.HelpToc", "eclipsegen"));
        vo.bind("Target", om.findStrict("xdc.tools.product.IProduct.Target", "eclipsegen"));
        tdefs.add(om.findStrict("xdc.tools.product.IProduct.Target", "eclipsegen"));
        vo.bind("UrlDescriptor", om.findStrict("xdc.tools.product.IProduct.UrlDescriptor", "eclipsegen"));
        tdefs.add(om.findStrict("xdc.tools.product.IProduct.UrlDescriptor", "eclipsegen"));
        vo.bind("PluginDescriptor", om.findStrict("xdc.tools.product.IProduct.PluginDescriptor", "eclipsegen"));
        tdefs.add(om.findStrict("xdc.tools.product.IProduct.PluginDescriptor", "eclipsegen"));
        vo.bind("MacroDescriptor", om.findStrict("xdc.tools.product.IProduct.MacroDescriptor", "eclipsegen"));
        tdefs.add(om.findStrict("xdc.tools.product.IProduct.MacroDescriptor", "eclipsegen"));
        vo.bind("$$tdefs", Global.newArray(tdefs.toArray()));
        vo.bind("$$proxies", Global.newArray(proxies.toArray()));
        vo.bind("$$mcfgs", Global.newArray(mcfgs.toArray()));
        vo.bind("$$icfgs", Global.newArray(icfgs.toArray()));
        ((Value.Arr)pkgV.getv("$modules")).add(vo);
        ((Value.Arr)om.findStrict("$modules", "eclipsegen")).add(vo);
        vo.bind("$$instflag", 0);
        vo.bind("$$iobjflag", 1);
        vo.bind("$$sizeflag", 1);
        vo.bind("$$dlgflag", 0);
        vo.bind("$$iflag", 1);
        vo.bind("$$romcfgs", "|");
        vo.bind("$$nortsflag", 0);
        Proto.Str ps = (Proto.Str)vo.find("Module_State");
        if (ps != null) vo.bind("$object", ps.newInstance());
        vo.bind("$$meta_iobj", om.has("eclipsegen.UiactoolsProduct$$instance$static$init", null) ? 1 : 0);
        vo.bind("$$fxntab", Global.newArray());
        vo.bind("$$logEvtCfgs", Global.newArray());
        vo.bind("$$errorDescCfgs", Global.newArray());
        vo.bind("$$assertDescCfgs", Global.newArray());
        Value.Map atmap = (Value.Map)vo.getv("$attr");
        atmap.seal("length");
        pkgV.bind("UiactoolsProduct", vo);
        ((Value.Arr)pkgV.getv("$unitNames")).add("UiactoolsProduct");
    }

    void $$INITIALIZATION()
    {
        Value.Obj vo;

        if (isCFG) {
        }//isCFG
        Global.callFxn("module$meta$init", (Scriptable)om.findStrict("eclipsegen.UiactoolsProduct", "eclipsegen"));
        Global.callFxn("init", pkgV);
        ((Value.Obj)om.getv("eclipsegen.UiactoolsProduct")).bless();
        ((Value.Arr)om.findStrict("$packages", "eclipsegen")).add(pkgV);
    }

    public void exec( Scriptable xdcO, Session ses )
    {
        this.xdcO = xdcO;
        this.ses = ses;
        om = (Value.Obj)xdcO.get("om", null);

        Object o = om.geto("$name");
        String s = o instanceof String ? (String)o : null;
        isCFG = s != null && s.equals("cfg");
        isROV = s != null && s.equals("rov");

        $$IMPORTS();
        $$OBJECTS();
        UiactoolsProduct$$OBJECTS();
        UiactoolsProduct$$CONSTS();
        UiactoolsProduct$$CREATES();
        UiactoolsProduct$$FUNCTIONS();
        UiactoolsProduct$$SIZES();
        UiactoolsProduct$$TYPES();
        if (isROV) {
            UiactoolsProduct$$ROV();
        }//isROV
        $$SINGLETONS();
        UiactoolsProduct$$SINGLETONS();
        $$INITIALIZATION();
    }
}
