summaryrefslogtreecommitdiff
path: root/Xenogears/compil.lex
diff options
context:
space:
mode:
Diffstat (limited to 'Xenogears/compil.lex')
-rw-r--r--Xenogears/compil.lex49
1 files changed, 44 insertions, 5 deletions
diff --git a/Xenogears/compil.lex b/Xenogears/compil.lex
index 21e0572..c52ebae 100644
--- a/Xenogears/compil.lex
+++ b/Xenogears/compil.lex
@@ -172,6 +172,8 @@
BEGIN(I);
}
+ /* The "primary" charset. */
+
<I>" " yputc(0x10, 2);
<I>"+" yputc(0x11, 2);
<I>"," yputc(0x12, 2);
@@ -229,6 +231,9 @@
<I>"<...>" yputc(0x8e, 3);
<I>"<'>" yputc(0x8f, 3);
+
+ /* Conversion for all the kanas */
+
<I>"<Extra1"\ +[[:digit:]]+">" {
int d = atoi(yytext + 7);
if (d > 255) {
@@ -251,6 +256,8 @@
}
}
+ /* All the unknow things */
+
<I>"<Bare"\ +[[:xdigit:]]{1,2}">" {
char str[5] = {'0', 'x', 0, 0, 0};
int d;
@@ -267,14 +274,35 @@
}
}
-<I>à|â|ä unput('a');
-<I>é|è|ê|ë unput('e');
-<I>î|ï unput('i');
-<I>ô|ö unput('o');
-<I>û|ü|ù unput('u');
+ /* The special characters that are/has to be translated */
+
+<I>à unput('a');
+<I>â unput('a');
+<I>ä unput('a');
+<I>é unput('e');
+<I>è unput('e');
+<I>ê unput('e');
+<I>ë unput('e');
+<I>î unput('i');
+<I>ï unput('i');
+<I>ô unput('o');
+<I>ö unput('o');
+<I>û unput('u');
+<I>ü unput('u');
+<I>ù unput('u');
+<I>Ä unput('A');
+<I>Ë unput('E');
+<I>Ï unput('I');
+<I>Ô unput('O');
+<I>Ö unput('O');
+<I>Ü unput('U');
<I>ç unput('c');
<I>"<oe>" unput('e'); unput('o');
<I>"<ae>" unput('e'); unput('a');
+<I>ß unput('s'); unput('s');
+
+
+ /* The Gears names. */
<I>"<Fei>" unputs("<Gear 00>");
<I>"<Elly>" unputs("<Gear 01>");
@@ -332,6 +360,7 @@
<O>\n num_lines++;
<O>. /* Eat up comments */
+ /* Translating all the "not common" (windows) charset. */
<I>\210 unputs("à");
<I>\211 unputs("â");
@@ -388,6 +417,16 @@ void yputc(int c, int a) {
putc(c, yyout);
}
+void ypute1c(int c, int a) {
+ putc(0xfe, yyout);
+ yputc(c, a);
+}
+
+void ypute2c(int c, int a) {
+ putc(0xff, yyout);
+ yputc(c, a);
+}
+
void unputs(char * s) {
int l = strlen(s), i;