[gcalctool] Revert most of the previous parser changes, as they caused regressions
- From: Robin Sonefors <rsonefors src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gcalctool] Revert most of the previous parser changes, as they caused regressions
- Date: Sat, 2 Oct 2010 18:18:57 +0000 (UTC)
commit 875bac7ed9d7cc068a9fbdb084de69fe50e23d76
Author: Robin Sonefors <ozamosi flukkost nu>
Date: Sat Oct 2 17:55:33 2010 +0200
Revert most of the previous parser changes, as they caused regressions
src/mp-equation-lexer.l | 49 ++++++++++++++++++++++++-----------------------
1 files changed, 25 insertions(+), 24 deletions(-)
---
diff --git a/src/mp-equation-lexer.l b/src/mp-equation-lexer.l
index ba246ca..6318a81 100644
--- a/src/mp-equation-lexer.l
+++ b/src/mp-equation-lexer.l
@@ -36,28 +36,31 @@
%}
-ZERO [0Ù Û°ß?०০੦૦à¦à¯¦à±¦à³¦àµ¦à¹?à»?༠á??á??á? á ?á¥?á§?á?á®°á±?á±?ê? ê£?ê¤?ê©?ð?? ]
-ONE [1Ù¡Û±ß?१১੧૧à§à¯§à±§à³§àµ§à¹?à»?༡á??á??á?¡á ?á¥?á§?á?á®±á±?á±?ê?¡ê£?ê¤?ê©?ð??¡]
-TWO [2Ù¢Û²ß?२২੨૨à¨à¯¨à±¨à³¨àµ¨à¹?à»?༢á??á??á?¢á ?á¥?á§?á?᮲á±?á±?ê?¢ê£?ê¤?ê©?ð??¢]
-THREE [3Ù£Û³ß?३৩੩૩à©à¯©à±©à³©àµ©à¹?à»?༣á??á??á?£á ?á¥?á§?á?᮳á±?á±?ê?£ê£?ê¤?ê©?ð??£]
-FOUR [4Ù¤Û´ß?४৪੪૪àªà¯ªà±ªà³ªàµªà¹?à»?༤á??á??á?¤á ?á¥?á§?á?á®´á±?á±?ê?¤ê£?ê¤?ê©?ð??¤]
-FIVE [5Ù¥Ûµß?५৫੫૫à«à¯«à±«à³«àµ«à¹?à»?༥á??á??á?¥á ?á¥?á§?á?᮵á±?á±?ê?¥ê£?ê¤?ê©?ð??¥]
-SIX [6Ù¦Û¶ß?६৬੬૬à¬à¯¬à±¬à³¬àµ¬à¹?à»?༦á??á??á?¦á ?á¥?á§?á?᮶á±?á±?ê?¦ê£?ê¤?ê©?ð??¦]
-SEVEN [7Ù§Û·ß?à¥à§à©à«àà¯à±à³àµà¹?à»?༧á??á??á?§á ?á¥?á§?á?á®·á±?á±?ê?§ê£?ê¤?ê©?ð??§]
-EIGHT [8Ù¨Û¸ß?८৮੮૮à®à¯®à±®à³®àµ®à¹?à»?༨á??á??á?¨á ?á¥?á§?á?᮸á±?á±?ê?¨ê£?ê¤?ê©?ð??¨]
-NINE [9Ù©Û¹ß?९৯੯૯à¯à¯¯à±¯à³¯àµ¯à¹?à»?༩á??á??á?©á ?á¥?á§?á?᮹á±?á±?ê?©ê£?ê¤?ê©?ð??©]
+ZERO "0"|"Ù "|"Û°"|"ß?"|"०"|"০"|"੦"|"૦"|"à¦"|"௦"|"౦"|"೦"|"൦"|"à¹?"|"à»?"|"༠"|"á??"|"á??"|"á? "|"á ?"|"á¥?"|"á§?"|"á?"|"á®°"|"á±?"|"á±?"|"ê? "|"ê£?"|"ê¤?"|"ê©?"|"ð?? "
+ONE "1"|"Ù¡"|"Û±"|"ß?"|"१"|"১"|"੧"|"૧"|"à§"|"௧"|"౧"|"೧"|"൧"|"à¹?"|"à»?"|"༡"|"á??"|"á??"|"á?¡"|"á ?"|"á¥?"|"á§?"|"á?"|"á®±"|"á±?"|"á±?"|"ê?¡"|"ê£?"|"ê¤?"|"ê©?"|"ð??¡"
+TWO "2"|"Ù¢"|"Û²"|"ß?"|"२"|"২"|"੨"|"૨"|"à¨"|"௨"|"౨"|"೨"|"൨"|"à¹?"|"à»?"|"༢"|"á??"|"á??"|"á?¢"|"á ?"|"á¥?"|"á§?"|"á?"|"᮲"|"á±?"|"á±?"|"ê?¢"|"ê£?"|"ê¤?"|"ê©?"|"ð??¢"
+THREE "3"|"Ù£"|"Û³"|"ß?"|"३"|"৩"|"à©©"|"à«©"|"à©"|"௩"|"౩"|"೩"|"൩"|"à¹?"|"à»?"|"༣"|"á??"|"á??"|"á?£"|"á ?"|"á¥?"|"á§?"|"á?"|"᮳"|"á±?"|"á±?"|"ê?£"|"ê£?"|"ê¤?"|"ê©?"|"ð??£"
+FOUR "4"|"Ù¤"|"Û´"|"ß?"|"४"|"৪"|"੪"|"૪"|"àª"|"௪"|"౪"|"೪"|"൪"|"à¹?"|"à»?"|"༤"|"á??"|"á??"|"á?¤"|"á ?"|"á¥?"|"á§?"|"á?"|"á®´"|"á±?"|"á±?"|"ê?¤"|"ê£?"|"ê¤?"|"ê©?"|"ð??¤"
+FIVE "5"|"Ù¥"|"Ûµ"|"ß?"|"५"|"৫"|"à©«"|"à««"|"à«"|"௫"|"౫"|"೫"|"൫"|"à¹?"|"à»?"|"༥"|"á??"|"á??"|"á?¥"|"á ?"|"á¥?"|"á§?"|"á?"|"᮵"|"á±?"|"á±?"|"ê?¥"|"ê£?"|"ê¤?"|"ê©?"|"ð??¥"
+SIX "6"|"Ù¦"|"Û¶"|"ß?"|"६"|"৬"|"੬"|"૬"|"à¬"|"௬"|"౬"|"೬"|"൬"|"à¹?"|"à»?"|"༦"|"á??"|"á??"|"á?¦"|"á ?"|"á¥?"|"á§?"|"á?"|"᮶"|"á±?"|"á±?"|"ê?¦"|"ê£?"|"ê¤?"|"ê©?"|"ð??¦"
+SEVEN "7"|"Ù§"|"Û·"|"ß?"|"à¥"|"à§"|"à©"|"à«"|"à"|"à¯"|"à±"|"à³"|"àµ"|"à¹?"|"à»?"|"༧"|"á??"|"á??"|"á?§"|"á ?"|"á¥?"|"á§?"|"á?"|"á®·"|"á±?"|"á±?"|"ê?§"|"ê£?"|"ê¤?"|"ê©?"|"ð??§"
+EIGHT "8"|"Ù¨"|"Û¸"|"ß?"|"८"|"৮"|"à©®"|"à«®"|"à®"|"௮"|"à±®"|"à³®"|"൮"|"à¹?"|"à»?"|"༨"|"á??"|"á??"|"á?¨"|"á ?"|"á¥?"|"á§?"|"á?"|"᮸"|"á±?"|"á±?"|"ê?¨"|"ê£?"|"ê¤?"|"ê©?"|"ð??¨"
+NINE "9"|"Ù©"|"Û¹"|"ß?"|"९"|"৯"|"੯"|"૯"|"à¯"|"௯"|"౯"|"೯"|"൯"|"à¹?"|"à»?"|"༩"|"á??"|"á??"|"á?©"|"á ?"|"á¥?"|"á§?"|"á?"|"᮹"|"á±?"|"á±?"|"ê?©"|"ê£?"|"ê¤?"|"ê©?"|"ð??©"
/* FIXME: DECIMAL and TSEP needs to figure out, at runtime, the correct
* character. I can't figure out how to make flex do this.
*/
DECIMAL [,.]
TSEP [ ,]
-DEC {ZERO}|{ONE}|{TWO}|{THREE}|{FOUR}|{FIVE}|{SIX}|{SEVEN}|{EIGHT}|{NINE}
-HEX {DEC}|[A-F]|[a-f]
-SUPER_DIGITS [�¹²³������]
+/* FIXME: TSEP is not a number, but if I try to handle it properly, the parser
+ * gets too many NFA states.
+ */
+DEC {ZERO}|{ONE}|{TWO}|{THREE}|{FOUR}|{FIVE}|{SIX}|{SEVEN}|{EIGHT}|{NINE}|{TSEP}
+HEX {DEC}|[A-Fa-f]
+SUPER_DIGITS "�"|"¹"|"²"|"³"|"�"|"�"|"�"|"�"|"�"|"�"
SUPER_MINUS "â?»"
-SUB_DIGITS [â??â??â??â??â??â??â??â??â??â??]
-FRACTION [½â??â??¼¾â??â??â??â??â??â??â??â??â??â??]
-GREEKS [αβγδεζηθικλμνξοÏ?Ï?Ï?Ï?Ï?Ï?Ï?Ï?Ï?Ï?]
+SUB_DIGITS "â??"|"â??"|"â??"|"â??"|"â??"|"â??"|"â??"|"â??"|"â??"|"â??"
+FRACTION "½"|"â??"|"â??"|"¼"|"¾"|"â??"|"â??"|"â??"|"â??"|"â??"|"â??"|"â??"|"â??"|"â??"|"â??"
+GREEKS "α"|"β"|"γ"|"δ"|"ε"|"ζ"|"η"|"θ"|"ι"|"κ"|"λ"|"μ"|"ν"|"ξ"|"ο"|"Ï?"|"Ï?"|"Ï?"|"Ï?"|"Ï?"|"Ï?"|"Ï?"|"Ï?"|"Ï?"|"Ï?"
DEGREES "°"
MINUTES "'"
SECONDS "\""
@@ -67,21 +70,19 @@ SUP_NUM {SUPER_DIGITS}+
NSUP_NUM {SUPER_MINUS}{SUPER_DIGITS}+
SUB_NUM {SUB_DIGITS}+
WORD {LETTERS}+
-DEC_TSEP {DEC}{1,3}({TSEP}?{DEC}{3})*
-HEX_TSEP {HEX}{1,3}({TSEP}?{HEX}{3})*
-DEC_NUM {DEC_TSEP}|{DEC_TSEP}?{DECIMAL}{DEC}+
-DEF_NUM {HEX_TSEP}|{HEX_TSEP}?{DECIMAL}{HEX}+
-BASE_NUM {HEX_TSEP}{SUB_NUM}|{HEX_TSEP}?{DECIMAL}{HEX}+{SUB_NUM}
+DEC_NUM {DEC}+|{DEC}*{DECIMAL}{DEC}+
+DEF_NUM {HEX}+|{HEX}*{DECIMAL}{HEX}+
+BASE_NUM {HEX}+{SUB_NUM}|{HEX}*{DECIMAL}{HEX}+{SUB_NUM}
ANGLE_NUM {DEC_NUM}{DEGREES}|{DEC}+{DEGREES}{DEC_NUM}{MINUTES}|{DEC}+{DEGREES}{DEC}+{MINUTES}{DEC_NUM}{SECONDS}
NUMBER {DEF_NUM}|{BASE_NUM}|{FRACTION}|{DEC}+{FRACTION}|{ANGLE_NUM}
-VARIABLE {WORD}|{WORD}{SUB_NUM}|{GREEKS}
+VARIABLE {WORD}|{WORD}{SUB_NUM}
MOD [mM][oO][dD]
AND "â?§"|[aA][nN][dD]
OR "â?¨"|[oO][rR]
-XOR [â?»â??]|[xX][oO][rR]
-NOT [¬~]|[nN][oO][tT]
+XOR "â?»"|"â??"|[xX][oO][rR]
+NOT "¬"|"~"|[nN][oO][tT]
RE "â?°â??"
IM "â??"
IN [iI][nN]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]