Commit b1480d8c authored by Vincent's avatar Vincent

modification AnalyseCaractere.java

màj pour prendre en compte le type MAJ du lexème
parent 26886374
......@@ -94,6 +94,8 @@ public class AnalyseCaractere {
lex = new Lexeme(Lexeme.INT,lastChar);
if ('a' <= lastChar && lastChar <= 'z')
lex = new Lexeme(Lexeme.IDF, lastChar);
if ('A' <= lastChar && lastChar <= 'Z')
lex = new Lexeme(Lexeme.MAJ, lastChar);
switch(lastChar) {
case '+': lex = new Lexeme(Lexeme.ADD); break;
case '-': lex = new Lexeme(Lexeme.SUB); break;
......@@ -109,14 +111,6 @@ public class AnalyseCaractere {
case '\t':
case ' ': lex = new Lexeme(Lexeme.ESP); break;
case ';': lex = new Lexeme(Lexeme.END); finChaine = true; break;
case 'I': case 'N': case 'T': // INT
case 'F': case 'R': case 'A': case 'C': // FRAC
case 'P': case 'O': case 'L': case 'Y': // POLY
case 'S': // ANS
case 'D': case 'E': case 'G': // DEG
case 'Q': case 'U': // QUO
case 'M': // REM
lex = new Lexeme(Lexeme.TYP, lastChar);
}
if (lex == null) throw new AnalyseException("caractère " + lastChar + " non autorisé.");
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment