Changeset 204

Show
Ignore:
Timestamp:
10/12/09 22:06:11 (2 years ago)
Author:
walter
Message:

initial json support

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/dmd-1.x/src/aggregate.h

    r190 r204  
    5757    DeleteDeclaration *aggDelete;   // deallocator 
    5858 
     59#if DMDV2 
     60    //CtorDeclaration *ctor; 
     61    Dsymbol *ctor;          // CtorDeclaration or TemplateDeclaration 
     62    CtorDeclaration *defaultCtor;   // default constructor 
     63    Dsymbol *aliasthis;         // forward unresolved lookups to aliasthis 
     64#endif 
     65 
    5966    FuncDeclarations dtors; // Array of destructors 
    6067    FuncDeclaration *dtor;  // aggregate destructor 
     
    7683 
    7784    void emitComment(Scope *sc); 
     85    void toJsonBuffer(OutBuffer *buf); 
    7886    void toDocBuffer(OutBuffer *buf); 
    7987 
  • branches/dmd-1.x/src/attrib.h

    r203 r204  
    5555    void addLocalClass(ClassDeclarations *); 
    5656    void toCBuffer(OutBuffer *buf, HdrGenState *hgs); 
     57    void toJsonBuffer(OutBuffer *buf); 
    5758    AttribDeclaration *isAttribDeclaration() { return this; } 
    5859 
     
    150151    void addComment(unsigned char *comment); 
    151152    void toCBuffer(OutBuffer *buf, HdrGenState *hgs); 
     153    void toJsonBuffer(OutBuffer *buf); 
    152154    void importAll(Scope *sc); 
    153155    void setScope(Scope *sc); 
  • branches/dmd-1.x/src/declaration.h

    r197 r204  
    111111 
    112112    void emitComment(Scope *sc); 
     113    void toJsonBuffer(OutBuffer *buf); 
    113114    void toDocBuffer(OutBuffer *buf); 
    114115 
     
    308309 
    309310    void emitComment(Scope *sc); 
     311    void toJsonBuffer(OutBuffer *buf); 
    310312 
    311313    Symbol *toSymbol(); 
     
    321323 
    322324    void emitComment(Scope *sc); 
     325    void toJsonBuffer(OutBuffer *buf); 
    323326 
    324327    Symbol *toSymbol(); 
     
    334337 
    335338    void emitComment(Scope *sc); 
     339    void toJsonBuffer(OutBuffer *buf); 
    336340 
    337341    Symbol *toSymbol(); 
     
    681685    int overloadInsert(Dsymbol *s); 
    682686    void emitComment(Scope *sc); 
     687    void toJsonBuffer(OutBuffer *buf); 
    683688 
    684689    PostBlitDeclaration *isPostBlitDeclaration() { return this; } 
     
    700705    int overloadInsert(Dsymbol *s); 
    701706    void emitComment(Scope *sc); 
     707    void toJsonBuffer(OutBuffer *buf); 
    702708 
    703709    DtorDeclaration *isDtorDeclaration() { return this; } 
     
    715721    int addPostInvariant(); 
    716722    void emitComment(Scope *sc); 
     723    void toJsonBuffer(OutBuffer *buf); 
    717724    void toCBuffer(OutBuffer *buf, HdrGenState *hgs); 
    718725 
     
    732739    int addPostInvariant(); 
    733740    void emitComment(Scope *sc); 
     741    void toJsonBuffer(OutBuffer *buf); 
    734742    void toCBuffer(OutBuffer *buf, HdrGenState *hgs); 
    735743 
     
    746754    int addPostInvariant(); 
    747755    void emitComment(Scope *sc); 
     756    void toJsonBuffer(OutBuffer *buf); 
    748757    void toCBuffer(OutBuffer *buf, HdrGenState *hgs); 
    749758 
  • branches/dmd-1.x/src/dsymbol.h

    r203 r204  
    144144    virtual void toCBuffer(OutBuffer *buf, HdrGenState *hgs); 
    145145    virtual void toDocBuffer(OutBuffer *buf); 
     146    virtual void toJsonBuffer(OutBuffer *buf); 
    146147    virtual unsigned size(Loc loc); 
    147148    virtual int isforwardRef(); 
  • branches/dmd-1.x/src/enum.h

    r190 r204  
    2828 
    2929struct EnumDeclaration : ScopeDsymbol 
    30 
     30{   /* enum ident : memtype { ... } 
     31     */ 
    3132    Type *type;         // the TypeEnum 
    3233    Type *memtype;      // type of the members 
     
    5657 
    5758    void emitComment(Scope *sc); 
     59    void toJsonBuffer(OutBuffer *buf); 
    5860    void toDocBuffer(OutBuffer *buf); 
    5961 
     
    7981 
    8082    void emitComment(Scope *sc); 
     83    void toJsonBuffer(OutBuffer *buf); 
    8184    void toDocBuffer(OutBuffer *buf); 
    8285 
  • branches/dmd-1.x/src/freebsd.mak

    r189 r204  
    3838    hdrgen.o delegatize.o aa.o ti_achar.o toir.o interpret.o traits.o \ 
    3939    builtin.o clone.o aliasthis.o \ 
    40     man.o arrayop.o port.o response.o async.o
     40    man.o arrayop.o port.o response.o async.o json.o
    4141    libelf.o elfobj.o 
    4242 
     
    5757    delegatize.c toir.h toir.c interpret.c traits.c cppmangle.c \ 
    5858    builtin.c clone.c lib.h libomf.c libelf.c libmach.c arrayop.c \ 
    59     aliasthis.h aliasthis.c
     59    aliasthis.h aliasthis.c json.h json.c
    6060    $C/cdef.h $C/cc.h $C/oper.h $C/ty.h $C/optabgen.c \ 
    6161    $C/global.h $C/parser.h $C/code.h $C/type.h $C/dt.h $C/cgcv.h \ 
     
    342342 
    343343interpret.o: interpret.c 
     344    $(CC) -c $(CFLAGS) $< 
     345 
     346json.o: json.c 
    344347    $(CC) -c $(CFLAGS) $< 
    345348 
     
    531534    gcov interpret.c 
    532535    gcov irstate.c 
     536    gcov json.c 
    533537    gcov lexer.c 
    534538    gcov libelf.c 
  • branches/dmd-1.x/src/linux.mak

    r189 r204  
    3838    hdrgen.o delegatize.o aa.o ti_achar.o toir.o interpret.o traits.o \ 
    3939    builtin.o clone.o aliasthis.o \ 
    40     man.o arrayop.o port.o response.o async.o
     40    man.o arrayop.o port.o response.o async.o json.o
    4141    libelf.o elfobj.o 
    4242 
     
    5757    delegatize.c toir.h toir.c interpret.c traits.c cppmangle.c \ 
    5858    builtin.c clone.c lib.h libomf.c libelf.c libmach.c arrayop.c \ 
    59     aliasthis.h aliasthis.c
     59    aliasthis.h aliasthis.c json.h json.c
    6060    $C/cdef.h $C/cc.h $C/oper.h $C/ty.h $C/optabgen.c \ 
    6161    $C/global.h $C/parser.h $C/code.h $C/type.h $C/dt.h $C/cgcv.h \ 
     
    342342 
    343343interpret.o: interpret.c 
     344    $(CC) -c $(CFLAGS) $< 
     345 
     346json.o: json.c 
    344347    $(CC) -c $(CFLAGS) $< 
    345348 
     
    531534    gcov interpret.c 
    532535    gcov irstate.c 
     536    gcov json.c 
    533537    gcov lexer.c 
    534538    gcov libelf.c 
  • branches/dmd-1.x/src/mars.c

    r203 r204  
    3131#include "lexer.h" 
    3232#include "lib.h" 
     33#include "json.h" 
    3334 
    3435#if WINDOWS_SEH 
     
    5455    doc_ext  = "html"; 
    5556    ddoc_ext = "ddoc"; 
     57    json_ext = "json"; 
    5658 
    5759#if TARGET_WINDOS 
     
    225227  -gc            add symbolic debug info, pretend to be C\n\ 
    226228  -H             generate 'header' file\n\ 
    227   -Hdhdrdir      write 'header' file to hdrdir directory\n\ 
     229  -Hddirectory   write 'header' file to directory\n\ 
    228230  -Hffilename    write 'header' file to filename\n\ 
    229231  --help         print help\n\ 
     
    251253  -version=ident compile in version code identified by ident\n\ 
    252254  -w             enable warnings\n\ 
     255  -X             generate JSON file\n\ 
     256  -Xffilename    write JSON file to filename\n\ 
    253257"); 
    254258} 
     
    317321    VersionCondition::addPredefinedGlobalIdent("Windows"); 
    318322    global.params.isWindows = 1; 
     323#if TARGET_NET 
     324    // TARGET_NET macro is NOT mutually-exclusive with TARGET_WINDOS 
     325    VersionCondition::addPredefinedGlobalIdent("D_NET"); 
     326#endif 
    319327#elif TARGET_LINUX 
    320328    VersionCondition::addPredefinedGlobalIdent("Posix"); 
     
    338346#else 
    339347#error "fix this" 
    340 #endif 
    341  
    342 #if TARGET_NET 
    343     // TARGET_NET macro is NOT mutually-exclusive with TARGET_WINDOS 
    344     VersionCondition::addPredefinedGlobalIdent("D_NET"); 
    345348#endif 
    346349 
     
    497500        } 
    498501#endif 
     502        else if (p[1] == 'X') 
     503        {   global.params.doXGeneration = 1; 
     504        switch (p[2]) 
     505        { 
     506            case 'f': 
     507            if (!p[3]) 
     508                goto Lnoarg; 
     509            global.params.xfilename = p + 3; 
     510            break; 
     511 
     512            case 0: 
     513            break; 
     514 
     515            default: 
     516            goto Lerror; 
     517        } 
     518        } 
    499519        else if (strcmp(p + 1, "ignore") == 0) 
    500520        global.params.ignoreUnsupportedPragmas = 1; 
     
    880900        } 
    881901 
     902        if (FileName::equals(ext, global.json_ext)) 
     903        { 
     904        global.params.doXGeneration = 1; 
     905        global.params.xfilename = (char *)files.data[i]; 
     906        continue; 
     907        } 
     908 
    882909#if TARGET_WINDOS 
    883910        if (FileName::equals(ext, "res")) 
     
    11511178 
    11521179    // Generate output files 
     1180 
     1181    if (global.params.doXGeneration) 
     1182    json_generate(&modules); 
     1183 
    11531184    if (global.params.oneobj) 
    11541185    { 
     
    12531284void getenv_setargv(const char *envvar, int *pargc, char** *pargv) 
    12541285{ 
    1255     char *env; 
    12561286    char *p; 
    1257     Array *argv; 
    1258     int argc; 
    1259  
    1260     int wildcard;       // do wildcard expansion 
     1287 
    12611288    int instring; 
    12621289    int slash; 
    12631290    char c; 
    1264     int j; 
    1265  
    1266     env = getenv(envvar); 
     1291 
     1292    char *env = getenv(envvar); 
    12671293    if (!env) 
    12681294    return; 
     
    12701296    env = mem.strdup(env);  // create our own writable copy 
    12711297 
    1272     argc = *pargc; 
    1273     argv = new Array(); 
     1298    int argc = *pargc; 
     1299    Array *argv = new Array(); 
    12741300    argv->setDim(argc); 
    12751301 
     
    12771303    argv->data[i] = (void *)(*pargv)[i]; 
    12781304 
    1279     j = 1;            // leave argv[0] alone 
     1305    int j = 1;            // leave argv[0] alone 
    12801306    while (1) 
    12811307    { 
    1282     wildcard = 1; 
     1308    int wildcard = 1;  // do wildcard expansion 
    12831309    switch (*env) 
    12841310    { 
  • branches/dmd-1.x/src/mars.h

    r190 r204  
    167167    char *hdrname;      // write 'header' file to docname 
    168168 
     169    char doXGeneration;     // write JSON file 
     170    char *xfilename;        // write JSON file to xfilename 
     171 
    169172    unsigned debuglevel;    // debug level 
    170173    Array *debugids;        // debug identifiers 
     
    177180    const char *defaultlibname; // default library for non-debug builds 
    178181    const char *debuglibname;   // default library for debug builds 
    179  
    180     const char *xmlname;    // filename for XML output 
    181182 
    182183    char *moduleDepsFile;   // filename for deps output 
     
    215216    const char *ddoc_ext;   // for Ddoc macro include files 
    216217    const char *hdr_ext;    // for D 'header' import files 
     218    const char *json_ext;   // for JSON files 
    217219    const char *copyright; 
    218220    const char *written; 
  • branches/dmd-1.x/src/module.h

    r203 r204  
    114114 
    115115    void toCBuffer(OutBuffer *buf, HdrGenState *hgs); 
     116    void toJsonBuffer(OutBuffer *buf); 
    116117    const char *kind(); 
    117118    void setDocfile();  // set docfile member 
  • branches/dmd-1.x/src/osx.mak

    r189 r204  
    77ENVP= MACOSX_DEPLOYMENT_TARGET=10.3 
    88SDK=/Developer/SDKs/MacOSX10.4u.sdk 
     9#SDK=/Developer/SDKs/MacOSX10.6.sdk 
    910LDFLAGS= -isysroot ${SDK} -Wl,-syslibroot,${SDK} 
    1011 
     
    4344    hdrgen.o delegatize.o aa.o ti_achar.o toir.o interpret.o traits.o \ 
    4445    builtin.o clone.o aliasthis.o \ 
    45     man.o arrayop.o port.o response.o async.o
     46    man.o arrayop.o port.o response.o async.o json.o
    4647    libmach.o machobj.o 
    4748 
     
    6263    delegatize.c toir.h toir.c interpret.c traits.c cppmangle.c \ 
    6364    builtin.c clone.c lib.h libomf.c libelf.c libmach.c arrayop.c \ 
    64     aliasthis.h aliasthis.c
     65    aliasthis.h aliasthis.c json.h json.c
    6566    $C/cdef.h $C/cc.h $C/oper.h $C/ty.h $C/optabgen.c \ 
    6667    $C/global.h $C/parser.h $C/code.h $C/type.h $C/dt.h $C/cgcv.h \ 
     
    347348 
    348349interpret.o: interpret.c 
     350    $(CC) -c $(CFLAGS) $< 
     351 
     352json.o: json.c 
    349353    $(CC) -c $(CFLAGS) $< 
    350354 
     
    536540    gcov interpret.c 
    537541    gcov irstate.c 
     542    gcov json.c 
    538543    gcov lexer.c 
    539544    gcov libmach.c 
  • branches/dmd-1.x/src/template.h

    r190 r204  
    7272 
    7373    void emitComment(Scope *sc); 
     74    void toJsonBuffer(OutBuffer *buf); 
    7475//    void toDocBuffer(OutBuffer *buf); 
    7576 
  • branches/dmd-1.x/src/win32.mak

    r196 r204  
    66 
    77D= 
     8#DMDSVN=\svnproj\dmd\trunk\src 
    89DMDSVN=\svnproj\dmd\branches\dmd-1.x\src 
    910SCROOT=$D\dm 
     
    8081    builtin.obj clone.obj libomf.obj arrayop.obj irstate.obj \ 
    8182    glue.obj msc.obj ph.obj tk.obj s2ir.obj todt.obj e2ir.obj tocsym.obj \ 
    82     util.obj bit.obj eh.obj toobj.obj toctype.obj tocvdebug.obj toir.obj 
     83    util.obj bit.obj eh.obj toobj.obj toctype.obj tocvdebug.obj toir.obj \ 
     84    json.obj 
    8385 
    8486# from C/C++ compiler optimizer and back end 
     
    114116    delegatize.c toir.h toir.c interpret.c traits.c builtin.c \ 
    115117    clone.c lib.h libomf.c libelf.c libmach.c arrayop.c \ 
    116     aliasthis.h aliasthis.c 
     118    aliasthis.h aliasthis.c json.h json.c 
    117119 
    118120# From C++ compiler 
     
    449451inline.obj : $(TOTALH) inline.c 
    450452interpret.obj : $(TOTALH) interpret.c 
     453json.obj : $(TOTALH) json.h json.c 
    451454lexer.obj : $(TOTALH) lexer.c 
    452455libomf.obj : $(TOTALH) lib.h libomf.c 
  • trunk/src/aggregate.h

    r192 r204  
    8787 
    8888    void emitComment(Scope *sc); 
     89    void toJsonBuffer(OutBuffer *buf); 
    8990    void toDocBuffer(OutBuffer *buf); 
    9091 
  • trunk/src/attrib.h

    r203 r204  
    5555    void addLocalClass(ClassDeclarations *); 
    5656    void toCBuffer(OutBuffer *buf, HdrGenState *hgs); 
     57    void toJsonBuffer(OutBuffer *buf); 
    5758    AttribDeclaration *isAttribDeclaration() { return this; } 
    5859 
     
    150151    void addComment(unsigned char *comment); 
    151152    void toCBuffer(OutBuffer *buf, HdrGenState *hgs); 
     153    void toJsonBuffer(OutBuffer *buf); 
    152154    void importAll(Scope *sc); 
    153155    void setScope(Scope *sc); 
  • trunk/src/declaration.h

    r197 r204  
    111111 
    112112    void emitComment(Scope *sc); 
     113    void toJsonBuffer(OutBuffer *buf); 
    113114    void toDocBuffer(OutBuffer *buf); 
    114115 
     
    308309 
    309310    void emitComment(Scope *sc); 
     311    void toJsonBuffer(OutBuffer *buf); 
    310312 
    311313    Symbol *toSymbol(); 
     
    321323 
    322324    void emitComment(Scope *sc); 
     325    void toJsonBuffer(OutBuffer *buf); 
    323326 
    324327    Symbol *toSymbol(); 
     
    334337 
    335338    void emitComment(Scope *sc); 
     339    void toJsonBuffer(OutBuffer *buf); 
    336340 
    337341    Symbol *toSymbol(); 
     
    681685    int overloadInsert(Dsymbol *s); 
    682686    void emitComment(Scope *sc); 
     687    void toJsonBuffer(OutBuffer *buf); 
    683688 
    684689    PostBlitDeclaration *isPostBlitDeclaration() { return this; } 
     
    700705    int overloadInsert(Dsymbol *s); 
    701706    void emitComment(Scope *sc); 
     707    void toJsonBuffer(OutBuffer *buf); 
    702708 
    703709    DtorDeclaration *isDtorDeclaration() { return this; } 
     
    715721    int addPostInvariant(); 
    716722    void emitComment(Scope *sc); 
     723    void toJsonBuffer(OutBuffer *buf); 
    717724    void toCBuffer(OutBuffer *buf, HdrGenState *hgs); 
    718725 
     
    732739    int addPostInvariant(); 
    733740    void emitComment(Scope *sc); 
     741    void toJsonBuffer(OutBuffer *buf); 
    734742    void toCBuffer(OutBuffer *buf, HdrGenState *hgs); 
    735743 
     
    746754    int addPostInvariant(); 
    747755    void emitComment(Scope *sc); 
     756    void toJsonBuffer(OutBuffer *buf); 
    748757    void toCBuffer(OutBuffer *buf, HdrGenState *hgs); 
    749758 
  • trunk/src/dsymbol.h

    r203 r204  
    144144    virtual void toCBuffer(OutBuffer *buf, HdrGenState *hgs); 
    145145    virtual void toDocBuffer(OutBuffer *buf); 
     146    virtual void toJsonBuffer(OutBuffer *buf); 
    146147    virtual unsigned size(Loc loc); 
    147148    virtual int isforwardRef(); 
  • trunk/src/enum.h

    r192 r204  
    5757 
    5858    void emitComment(Scope *sc); 
     59    void toJsonBuffer(OutBuffer *buf); 
    5960    void toDocBuffer(OutBuffer *buf); 
    6061 
     
    8182 
    8283    void emitComment(Scope *sc); 
     84    void toJsonBuffer(OutBuffer *buf); 
    8385    void toDocBuffer(OutBuffer *buf); 
    8486 
  • trunk/src/linux.mak

    r189 r204  
    3838    hdrgen.o delegatize.o aa.o ti_achar.o toir.o interpret.o traits.o \ 
    3939    builtin.o clone.o aliasthis.o \ 
    40     man.o arrayop.o port.o response.o async.o
     40    man.o arrayop.o port.o response.o async.o json.o
    4141    libelf.o elfobj.o 
    4242 
     
    5757    delegatize.c toir.h toir.c interpret.c traits.c cppmangle.c \ 
    5858    builtin.c clone.c lib.h libomf.c libelf.c libmach.c arrayop.c \ 
    59     aliasthis.h aliasthis.c
     59    aliasthis.h aliasthis.c json.h json.c
    6060    $C/cdef.h $C/cc.h $C/oper.h $C/ty.h $C/optabgen.c \ 
    6161    $C/global.h $C/parser.h $C/code.h $C/type.h $C/dt.h $C/cgcv.h \ 
     
    342342 
    343343interpret.o: interpret.c 
     344    $(CC) -c $(CFLAGS) $< 
     345 
     346json.o: json.c 
    344347    $(CC) -c $(CFLAGS) $< 
    345348 
     
    531534    gcov interpret.c 
    532535    gcov irstate.c 
     536    gcov json.c 
    533537    gcov lexer.c 
    534538    gcov libelf.c 
  • trunk/src/mars.c

    r203 r204  
    3131#include "lexer.h" 
    3232#include "lib.h" 
     33#include "json.h" 
    3334 
    3435#if WINDOWS_SEH 
     
    5455    doc_ext  = "html"; 
    5556    ddoc_ext = "ddoc"; 
     57    json_ext = "json"; 
    5658 
    5759#if TARGET_WINDOS 
     
    7981#endif 
    8082    ; 
    81     version = "v2.034"; 
     83    version = "v2.035"; 
    8284    global.structalign = 8; 
    8385 
     
    225227  -gc            add symbolic debug info, pretend to be C\n\ 
    226228  -H             generate 'header' file\n\ 
    227   -Hdhdrdir      write 'header' file to hdrdir directory\n\ 
     229  -Hddirectory   write 'header' file to directory\n\ 
    228230  -Hffilename    write 'header' file to filename\n\ 
    229231  --help         print help\n\ 
     
    252254  -vtls          list all variables going into thread local storage\n\ 
    253255  -w             enable warnings\n\ 
     256  -X             generate JSON file\n\ 
     257  -Xffilename    write JSON file to filename\n\ 
    254258"); 
    255259} 
     
    497501        } 
    498502#endif 
     503        else if (p[1] == 'X') 
     504        {   global.params.doXGeneration = 1; 
     505        switch (p[2]) 
     506        { 
     507            case 'f': 
     508            if (!p[3]) 
     509                goto Lnoarg; 
     510            global.params.xfilename = p + 3; 
     511            break; 
     512 
     513            case 0: 
     514            break; 
     515 
     516            default: 
     517            goto Lerror; 
     518        } 
     519        } 
    499520        else if (strcmp(p + 1, "ignore") == 0) 
    500521        global.params.ignoreUnsupportedPragmas = 1; 
     
    880901        } 
    881902 
     903        if (FileName::equals(ext, global.json_ext)) 
     904        { 
     905        global.params.doXGeneration = 1; 
     906        global.params.xfilename = (char *)files.data[i]; 
     907        continue; 
     908        } 
     909 
    882910#if TARGET_WINDOS 
    883911        if (FileName::equals(ext, "res")) 
     
    11511179 
    11521180    // Generate output files 
     1181 
     1182    if (global.params.doXGeneration) 
     1183    json_generate(&modules); 
     1184 
    11531185    if (global.params.oneobj) 
    11541186    { 
     
    12531285void getenv_setargv(const char *envvar, int *pargc, char** *pargv) 
    12541286{ 
    1255     char *env; 
    12561287    char *p; 
    1257     Array *argv; 
    1258     int argc; 
    1259  
    1260     int wildcard;       // do wildcard expansion 
     1288 
    12611289    int instring; 
    12621290    int slash; 
    12631291    char c; 
    1264     int j; 
    1265  
    1266     env = getenv(envvar); 
     1292 
     1293    char *env = getenv(envvar); 
    12671294    if (!env) 
    12681295    return; 
     
    12701297    env = mem.strdup(env);  // create our own writable copy 
    12711298 
    1272     argc = *pargc; 
    1273     argv = new Array(); 
     1299    int argc = *pargc; 
     1300    Array *argv = new Array(); 
    12741301    argv->setDim(argc); 
    12751302 
     
    12771304    argv->data[i] = (void *)(*pargv)[i]; 
    12781305 
    1279     j = 1;            // leave argv[0] alone 
     1306    int j = 1;            // leave argv[0] alone 
    12801307    while (1) 
    12811308    { 
    1282     wildcard = 1; 
     1309    int wildcard = 1;  // do wildcard expansion 
    12831310    switch (*env) 
    12841311    { 
  • trunk/src/mars.h

    r195 r204  
    170170    char *hdrname;      // write 'header' file to docname 
    171171 
     172    char doXGeneration;     // write JSON file 
     173    char *xfilename;        // write JSON file to xfilename 
     174 
    172175    unsigned debuglevel;    // debug level 
    173176    Array *debugids;        // debug identifiers 
     
    180183    const char *defaultlibname; // default library for non-debug builds 
    181184    const char *debuglibname;   // default library for debug builds 
    182  
    183     const char *xmlname;    // filename for XML output 
    184185 
    185186    char *moduleDepsFile;   // filename for deps output 
     
    218219    const char *ddoc_ext;   // for Ddoc macro include files 
    219220    const char *hdr_ext;    // for D 'header' import files 
     221    const char *json_ext;   // for JSON files 
    220222    const char *copyright; 
    221223    const char *written; 
  • trunk/src/module.c

    r203 r204  
    815815 
    816816void Module::inlineScan() 
    817 {   int i; 
    818  
     817
    819818    if (semanticstarted >= 4) 
    820819    return; 
     
    827826    //printf("Module = %p\n", sc.scopesym); 
    828827 
    829     for (i = 0; i < members->dim; i++) 
    830     {   Dsymbol *s; 
    831  
    832     s = (Dsymbol *)members->data[i]; 
     828    for (int i = 0; i < members->dim; i++) 
     829    {   Dsymbol *s = (Dsymbol *)members->data[i]; 
    833830    //if (global.params.verbose) 
    834831        //printf("inline scan symbol %s\n", s->toChars()); 
  • trunk/src/module.h

    r203 r204  
    115115 
    116116    void toCBuffer(OutBuffer *buf, HdrGenState *hgs); 
     117    void toJsonBuffer(OutBuffer *buf); 
    117118    const char *kind(); 
    118119    void setDocfile();  // set docfile member 
  • trunk/src/osx.mak

    r195 r204  
    4444    hdrgen.o delegatize.o aa.o ti_achar.o toir.o interpret.o traits.o \ 
    4545    builtin.o clone.o aliasthis.o \ 
    46     man.o arrayop.o port.o response.o async.o
     46    man.o arrayop.o port.o response.o async.o json.o
    4747    libmach.o machobj.o 
    4848 
     
    6363    delegatize.c toir.h toir.c interpret.c traits.c cppmangle.c \ 
    6464    builtin.c clone.c lib.h libomf.c libelf.c libmach.c arrayop.c \ 
    65     aliasthis.h aliasthis.c
     65    aliasthis.h aliasthis.c json.h json.c
    6666    $C/cdef.h $C/cc.h $C/oper.h $C/ty.h $C/optabgen.c \ 
    6767    $C/global.h $C/parser.h $C/code.h $C/type.h $C/dt.h $C/cgcv.h \ 
     
    348348 
    349349interpret.o: interpret.c 
     350    $(CC) -c $(CFLAGS) $< 
     351 
     352json.o: json.c 
    350353    $(CC) -c $(CFLAGS) $< 
    351354 
     
    537540    gcov interpret.c 
    538541    gcov irstate.c 
     542    gcov json.c 
    539543    gcov lexer.c 
    540544    gcov libmach.c 
  • trunk/src/template.h

    r192 r204  
    7474 
    7575    void emitComment(Scope *sc); 
     76    void toJsonBuffer(OutBuffer *buf); 
    7677//    void toDocBuffer(OutBuffer *buf); 
    7778 
  • trunk/src/win32.mak

    r195 r204  
    8080    builtin.obj clone.obj libomf.obj arrayop.obj irstate.obj \ 
    8181    glue.obj msc.obj ph.obj tk.obj s2ir.obj todt.obj e2ir.obj tocsym.obj \ 
    82     util.obj bit.obj eh.obj toobj.obj toctype.obj tocvdebug.obj toir.obj 
     82    util.obj bit.obj eh.obj toobj.obj toctype.obj tocvdebug.obj toir.obj \ 
     83    json.obj 
    8384 
    8485# from C/C++ compiler optimizer and back end 
     
    114115    delegatize.c toir.h toir.c interpret.c traits.c builtin.c \ 
    115116    clone.c lib.h libomf.c libelf.c libmach.c arrayop.c \ 
    116     aliasthis.h aliasthis.c 
     117    aliasthis.h aliasthis.c json.h json.c 
    117118 
    118119# From C++ compiler 
     
    449450inline.obj : $(TOTALH) inline.c 
    450451interpret.obj : $(TOTALH) interpret.c 
     452json.obj : $(TOTALH) json.h json.c 
    451453lexer.obj : $(TOTALH) lexer.c 
    452454libomf.obj : $(TOTALH) lib.h libomf.c