Changeset 385
- Timestamp:
- Jul 5, 2008, 5:58:51 PM (17 years ago)
- Location:
- trunk/nomc
- Files:
-
- 6 edited
-
c/util.c (modified) (1 diff)
-
parser_c/class_parser.c (modified) (3 diffs)
-
parser_c/classmethod_parser.c (modified) (4 diffs)
-
parser_c/interface_parser.c (modified) (2 diffs)
-
parser_c/interfacemethod_parser.c (modified) (2 diffs)
-
parser_c/typespec_parser.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/nomc/c/util.c
r383 r385 258 258 void exitIfNotMatchNextKind(guint uiKind, gchar* msg) 259 259 { 260 printToken(gScanner->token); 260 261 if(!matchNextKind(uiKind)) 261 262 { -
trunk/nomc/parser_c/class_parser.c
r383 r385 160 160 } 161 161 162 /* Check if the token is a known (registered) type */ 163 if(matchNextKind(KIND_TYPESPEC)) /* Be aware that we don't compare types here */ 164 { 165 /* Get name, parameters and stuff. Print the body. */ 166 parseClassMethod(); 167 } 168 else 169 { 170 getNextToken(); 171 g_scanner_unexp_token(gScanner, 172 G_TOKEN_IDENTIFIER, 173 NULL, NULL, NULL, 174 "Expected return type specifier.", 175 TRUE); /* is_error */ 176 cleanupAndExit(1); 177 } 162 /* Get name, parameters and stuff. Print the body. */ 163 parseClassMethod(); 178 164 }; 179 165 … … 225 211 else 226 212 { 227 if(matchNext(G_TOKEN_SYMBOL)) 228 { 229 /* If the interface name is a symbol, it means the interface was 230 already registered before. Maybe because of a forward statement. 231 We will check that in the function which called us. */ 232 233 /* Check if it's one of our interface symbols */ 234 PSYMBOL pCurSymbol; 235 GTokenValue value; 236 237 value=gScanner->value; 238 pCurSymbol=value.v_symbol; 239 if(IDL_SYMBOL_REGINTERFACE!=pCurSymbol->uiSymbolToken) 240 { 241 /* No, some other symbol */ 242 g_scanner_unexp_token(gScanner, 243 G_TOKEN_SYMBOL, 244 NULL, NULL, NULL, 245 "Keyword 'class' is not followed by a valid identifier.", 246 TRUE); /* is_error */ 247 cleanupAndExit(1); 248 } 249 250 /* Save interface name */ 251 return g_strdup(pCurSymbol->chrSymbolName); 252 } 253 else 254 { 213 PSYMBOL pCurSymbol; 214 GTokenValue value; 215 216 /* If the interface name is a symbol, it means the interface was 217 already registered before. Maybe because of a forward statement. 218 We will check that in the function which called us. */ 219 exitIfNotMatchNext(G_TOKEN_SYMBOL, "Keyword 'class' must be followed by an identifier"); 220 221 /* Check if it's one of our interface symbols */ 222 value=gScanner->value; 223 pCurSymbol=value.v_symbol; 224 if(IDL_SYMBOL_REGINTERFACE!=pCurSymbol->uiSymbolToken) 225 { 226 /* No, some other symbol */ 255 227 g_scanner_unexp_token(gScanner, 256 G_TOKEN_ IDENTIFIER,228 G_TOKEN_SYMBOL, 257 229 NULL, NULL, NULL, 258 "Keyword 'class' must be followed by an identifier",230 "Keyword 'class' is not followed by a valid identifier.", 259 231 TRUE); /* is_error */ 260 232 cleanupAndExit(1); 261 233 } 234 235 /* Save interface name */ 236 return g_strdup(pCurSymbol->chrSymbolName); 262 237 } 263 238 } … … 352 327 | CLASSIDENT ':' PARENTCLASSIDENT CLASSBODY // Subclass (not used yet!) 353 328 | CLASSIDENT CLASSBODY 354 355 329 */ 356 330 void parseClass(GTokenType token) -
trunk/nomc/parser_c/classmethod_parser.c
r383 r385 109 109 } 110 110 111 parseTypeSpec(pParam); 112 #if 0 111 113 /* Typespec */ 112 114 if(matchNextKind(KIND_TYPESPEC)) /* Be aware that we don't compare types here */ … … 124 126 cleanupAndExit(1); 125 127 } 126 128 #endif 127 129 //pParam->chrType=getTypeSpecStringFromCurToken(); 128 130 //g_printf("%s %d", __FUNCTION__, __LINE__); … … 312 314 /* Parse method */ 313 315 parseMethod(pMethod); 314 315 316 } 316 317 … … 318 319 319 320 CLASSMETHODS:= IMPL METHOD 320 ^| IMPL METHOD CLASSMETHODS321 | IMPL METHOD CLASSMETHODS 321 322 */ 322 323 void parseClassMethods(void) -
trunk/nomc/parser_c/interface_parser.c
r383 r385 137 137 //printToken(gScanner->token); 138 138 139 parseInterfaceMethod(); 140 141 #if 0 139 142 /* Typespec check must be first */ 140 143 if(matchNextKind(KIND_TYPESPEC)) /* Be aware that we don't compare types here */ … … 189 192 exit(1); 190 193 } 194 #endif 191 195 }while(g_scanner_peek_next_token(gScanner)!='}'); 192 196 //g_printf("%d: ", __LINE__); -
trunk/nomc/parser_c/interfacemethod_parser.c
r383 r385 107 107 108 108 /* Typespec */ 109 parseTypeSpec(pParam); 110 111 #if 0 109 112 if(matchNextKind(KIND_TYPESPEC)) /* Be aware that we don't compare types here */ 110 113 parseTypeSpec(pParam); … … 121 124 cleanupAndExit(1); 122 125 } 123 126 #endif 127 124 128 //pParam->chrType=getTypeSpecStringFromCurToken(); 125 129 //g_printf("%s %d", __FUNCTION__, __LINE__); -
trunk/nomc/parser_c/typespec_parser.c
r383 r385 54 54 55 55 */ 56 void parseTypeSpec 2(PMETHODPARAM pMethodParam)56 void parseTypeSpec(PMETHODPARAM pMethodParam) 57 57 { 58 58 char *chrTemp; … … 68 68 } 69 69 70 70 #if 0 71 71 /* 72 72 Parse a typespec e.g. 'gulong' or 'gulong*'. … … 103 103 pMethodParam->uiStar++; 104 104 } 105 #endif 105 106 106 107 108 109
Note:
See TracChangeset
for help on using the changeset viewer.
