Changeset 290 for trunk/idl-compiler/parser_c
- Timestamp:
- Apr 1, 2007, 3:50:13 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/idl-compiler/parser_c/interface_parser.c
r289 r290 47 47 PSYMBOL pNewSymbol=g_malloc0(sizeof(SYMBOL)); 48 48 49 // 49 //g_message("In %s for %s", __FUNCTION__, pParseInfo->pCurInterface->chrName); 50 50 51 51 pParseInfo->pCurInterface->pSymbolIFace=pNewSymbol; … … 81 81 static void deRegisterInterface(PINTERFACE pif) 82 82 { 83 // 83 //g_message("In %s", __FUNCTION__); 84 84 85 85 /* Remove the interface from our list */ … … 193 193 static void parseIFace(GTokenType token) 194 194 { 195 195 196 if(matchNext(G_TOKEN_IDENTIFIER)) 196 197 { … … 200 201 } 201 202 else 202 if(matchNext(G_TOKEN_SYMBOL)) 203 { 204 /* If the interface name is a symbol, it means the interface was 205 already registered before. Maybe because of a forward statement. 206 We will check that in the function which called us. */ 207 208 /* Check if it's one of our interface symbols */ 209 PSYMBOL pCurSymbol; 210 GTokenValue value; 211 212 value=gScanner->value; 213 pCurSymbol=value.v_symbol; 214 if(IDL_SYMBOL_REGINTERFACE!=pCurSymbol->uiSymbolToken) 215 { 216 //g_message("%s %d", pCurSymbol->chrSymbolName, pCurSymbol->uiKind); 217 g_scanner_unexp_token(gScanner, 218 G_TOKEN_SYMBOL, 219 NULL, 220 NULL, 221 NULL, 222 "Keyword 'interface' is not followed by a valid identifier.", 223 TRUE); /* is_error */ 224 exit(1); 225 } 226 227 /* Save interface info */ 228 pParseInfo->pCurInterface->chrName=g_strdup(value.v_identifier); 203 { 204 if(matchNext(G_TOKEN_SYMBOL)) 205 { 206 /* If the interface name is a symbol, it means the interface was 207 already registered before. Maybe because of a forward statement. 208 We will check that in the function which called us. */ 209 210 /* Check if it's one of our interface symbols */ 211 PSYMBOL pCurSymbol; 212 GTokenValue value; 213 214 value=gScanner->value; 215 pCurSymbol=value.v_symbol; 216 if(IDL_SYMBOL_REGINTERFACE!=pCurSymbol->uiSymbolToken) 217 { 218 //g_message("%s %d", pCurSymbol->chrSymbolName, pCurSymbol->uiKind); 219 g_scanner_unexp_token(gScanner, 220 G_TOKEN_SYMBOL, 221 NULL, 222 NULL, 223 NULL, 224 "Keyword 'interface' is not followed by a valid identifier.", 225 TRUE); /* is_error */ 226 exit(1); 227 } 228 /* Save interface info */ 229 pParseInfo->pCurInterface->chrName=g_strdup(pCurSymbol->chrSymbolName); 230 } 231 else{ 232 g_scanner_unexp_token(gScanner, 233 G_TOKEN_IDENTIFIER, 234 NULL, 235 NULL, 236 NULL, 237 "Keyword 'interface' must be followed by an identifier", 238 TRUE); /* is_error */ 239 exit(1); 229 240 } 230 else{231 g_scanner_unexp_token(gScanner,232 G_TOKEN_IDENTIFIER,233 NULL,234 NULL,235 NULL,236 "Keyword 'interface' must be followed by an identifier",237 TRUE); /* is_error */238 exit(1);239 241 } 240 242 } … … 378 380 { 379 381 PINTERFACE pif; 382 gchar *chrTemp=pParseInfo->pCurInterface->chrName; 380 383 381 384 /* Check if we already have a (maybe forward) declaration */ … … 401 404 } 402 405 } 406 pParseInfo->pCurInterface->chrName=chrTemp; 403 407 pParseInfo->pCurInterface->chrSourceFileName=g_strdup(pParseInfo->chrCurrentSourceFile); 404 408 /* It's save to register the interface right here even if the struct is almost empty.
Note:
See TracChangeset
for help on using the changeset viewer.