Ignore:
Timestamp:
Mar 25, 2007, 8:32:59 PM (18 years ago)
Author:
cinc
Message:

Code cleanups.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/idl-compiler/c/nom-idl-compiler.c

    r269 r271  
    109109
    110110GScanner *gScanner;
    111 GTokenType curToken=G_TOKEN_EOF;
    112 PINTERFACE pCurInterface=NULL;
    113111
    114112/* Holding info about current token. Referenced by gScanner. */
    115 SYMBOLINFO curSymbol;
     113//SYMBOLINFO curSymbol;
    116114
    117115/* Holding the current state of parsing and pointers to necessary lists. */
    118116PARSEINFO parseInfo={0};
     117PPARSEINFO pParseInfo=&parseInfo;
    119118
    120119/**
     
    151150  value=gScanner->value;
    152151
    153   switch(curToken)
     152  switch(gScanner->token)
    154153    {
    155154    case G_TOKEN_IDENTIFIER:
     
    395394    GTokenType token;
    396395
    397     curToken=g_scanner_get_next_token(gScanner);
    398     token=curToken;
     396    g_scanner_get_next_token(gScanner);
     397    token=gScanner->token;
    399398    GTokenValue value=gScanner->value;
    400399   
    401     switch(curToken)
     400    switch(token)
    402401      {
    403402      case '#':
     
    465464#endif
    466465      default:
    467         printToken(curToken);
     466        printToken(token);
    468467        break;
    469468      }
     
    535534  /* Vars for filename building */
    536535  char* chrOutputFileName="";
     536  char* chrTemp;
    537537
    538538  GError *gError = NULL;
     
    557557    a++;
    558558
    559 #if 0
    560559  if(!a){
    561560    g_printf("An emitter must be specified.\n\n");
     
    566565    outputCompilerHelp(gContext, argv[0]);
    567566  }
    568 #endif
    569567
    570568  if(strlen(chrOutputName)==0)
     
    602600    chrOutputFileName=chrOutputName;
    603601
    604   //g_message("Output file: %s", chrOutputFileName);
     602  /* Add emitter extension */
     603  if(fOptionEmitH)
     604    chrTemp=g_strconcat(chrOutputFileName, ".h", NULL);
     605  else if(fOptionEmitIH)
     606    chrTemp=g_strconcat(chrOutputFileName, ".ih", NULL);
     607  else if(fOptionEmitC)
     608    chrTemp=g_strconcat(chrOutputFileName, ".c", NULL);
     609  g_free(chrOutputFileName);
     610  chrOutputFileName=chrTemp;
     611
     612  g_message("Output file: %s", chrOutputFileName);
    605613
    606614  /* Open input */
     
    622630
    623631  gScanner=g_scanner_new(NULL);
    624   gScanner->user_data=(gpointer)&curSymbol;
    625   curSymbol.pSymbols=idlSymbols;
     632  //gScanner->user_data=(gpointer)&curSymbol;
    626633
    627634  gScanner->msg_handler=funcMsgHandler;
     
    650657  parseIt();
    651658
     659  /* Write the output file */
     660  if(fOptionEmitH)
     661    emitHFile(pInterfaceArray);
     662
     663#if 0
     664  else if(fOptionEmitIH)
     665
     666  else if(fOptionEmitC)
     667    a++;
     668
    652669  if(pInterfaceArray->len)
    653670    printInterface();
     671#endif
    654672
    655673  g_scanner_destroy(gScanner);
Note: See TracChangeset for help on using the changeset viewer.