Example #1
0
/*
 *   Initialize the compiler 
 */
void CTcMain::init(CTcHostIfc *hostifc, CResLoader *res_loader,
                   const char *default_charset)
{
    /* initialize the error subsystem */
    tc_err_init(1024, res_loader);
    
    /* remember the host interface */
    G_hostifc = hostifc;

    /* perform static initializations on the parser symbol table class */
    CTcPrsSymtab::s_init();

    /* 
     *   Set the image file structure sizes for the current T3 VM spec we're
     *   targeting.  When we're doing dynamic compilation, the DynamicFunc
     *   object will overwrite these with the actual settings for the loaded
     *   image file before it invokes the code generator.  
     */
    G_sizes.mhdr = TCT3_METHOD_HDR_SIZE;
    G_sizes.exc_entry = TCT3_EXC_ENTRY_SIZE;
    G_sizes.dbg_hdr = TCT3_DBG_HDR_SIZE;
    G_sizes.dbg_line = TCT3_LINE_ENTRY_SIZE;
    G_sizes.lcl_hdr = TCT3_DBG_LCLSYM_HDR_SIZE;
    G_sizes.dbg_fmt_vsn = TCT3_DBG_FMT_VSN;
    G_sizes.dbg_frame = TCT3_DBG_FRAME_SIZE;

    /* assume we won't have a loaded image file metaclass table */
    G_metaclass_tab = 0;

    /* we don't have a dynamic compiler interface yet */
    G_vmifc = 0;

    /* create the compiler main object */
    G_tcmain = new CTcMain(res_loader, default_charset);
}
/*
 *   Initialize the compiler 
 */
void CTcMain::init(CTcHostIfc *hostifc, CResLoader *res_loader,
                   const char *default_charset)
{
    /* initialize the error subsystem */
    tc_err_init(1024, res_loader);
    
    /* remember the host interface */
    G_hostifc = hostifc;

    /* perform static initializations on the parser symbol table class */
    CTcPrsSymtab::s_init();

    /* create the compiler main object */
    G_tcmain = new CTcMain(res_loader, default_charset);
}