goto S1SS1;
}
if (isAlphaNum()) {
- token[tokenFound].value[i] = c;
tokenValue[i] = c;
i++;
c = fgetwc(source);
MC1:
if (c == L'A' && !wcscmp(fgetws(m, 6, source), L"uteur")) {
- wcscpy((wchar_t*)token[tokenFound].value, L">Auteur");
wcscpy((wchar_t*)tokenValue, L">Auteur");
c = fgetwc(source);
goto MC2;
}
if (c == L'T' && !wcscmp(fgetws(m, 5, source), L"itre")) {
- wcscpy((wchar_t*)token[tokenFound].value, L">Titre");
wcscpy((wchar_t*)tokenValue, L">Titre");
c = fgetwc(source);
goto MC2;
M1:
if (isAlphaNum()) {
- token[tokenFound].value[i] = c;
tokenValue[i] = c;
i++;
c = fgetwc(source);
goto initLV1LV2;
}
if (isAlphaNum()) {
- token[tokenFound].value[i] = c;
tokenValue[i] = c;
i++;
c = fgetwc(source);
return EXIT_SUCCESS;
MOT:
- tokenValue[i] = 0;
tokenType = MOT;
+ tokenValue[i] = 0;
+ wcscpy((wchar_t*)token[tokenFound].value, (wchar_t*)tokenValue);
return EXIT_SUCCESS;
MC2:
MOTCLE:
tokenType = MOTCLE;
+ wcscpy((wchar_t*)token[tokenFound].value, (wchar_t*)tokenValue);
return EXIT_SUCCESS;
FIN:
fwprintf(stderr, L"%s error with token type: %s and value: %ls\n",
__func__,
tokenTypestr[tokenType],
- token[tokenFound].value);
+ tokenValue);
} else {
fwprintf(stderr, L"%s error with token type: %s\n",
__func__,
scanner();
wprint_token(target);
token[tokenFound].type = tokenTypestr[tokenType];
+ wcscpy((wchar_t*)tokenValue, (wchar_t*)token[tokenFound].value);
tokenFound++;
} while (tokenType != FIN); // tant que la fin du fichier n'est pas atteinte
}
if (target != NULL) {
fputws(L"\n<body>\n", target);
}
+ #if PRINT_TOKEN
+ wprint_ctoken(stdout);
+ #endif /* PRINT_TOKEN */
if (tokenType != FIN) {
fprintf(stderr, "%s follows error on %s\n", __func__, tokenTypestr[tokenType]);
fflush(stderr);