Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
} tokenType;
const char* tokenTypestr[] = { "MOTCLE", "SECTION", "SSECTION", "NPARA", "MOT", "FIN" };
+/* This looks silly to check for each characters but for debugging, it's just the way to go */
bool istAlpha() {
if (c == 'a' || c == 'b' || c == 'c' || c == 'd' || c == 'e' || c == 'f' || c == 'g' || \
c == 'h' || c == 'i' || c == 'j' || c == 'k' || c == 'l' || c == 'm' || c == 'n' || \
}
S1SS1:
- if (isSeparator() || c == EOF) {
- goto SECTION;
- }
if (c == '=') {
c = fgetc(source);
tokenValue[i] = c;
i++;
goto SS2;
}
+ if (isSeparator() || c == EOF) {
+ goto SECTION;
+ }
+
SS2:
if (isSeparator() || c == EOF) {
- goto SECTION;
+ goto SSECTION;
}
SECTION:
tokenType = SECTION;
return 1;
+SSECTION:
+ tokenType = SSECTION;
+ return 1;
+
M1:
if (istAlpha()) {
c = fgetc(source);
i++;
goto S1SS1;
}
- if (c == EOF) {
- goto FIN;
- }
if (istAlpha()) {
goto NPARA;
}
+ if (c == EOF) {
+ goto FIN;
+ }
NPARA:
tokenType = NPARA;