From c78dbd204a6e0bc4b4057d872ab6058d52347a23 Mon Sep 17 00:00:00 2001 From: Xawirses Date: Fri, 22 Jan 2016 11:19:02 +0100 Subject: [PATCH] Debug Analyseur --- src/analyseur_lexical.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/analyseur_lexical.c b/src/analyseur_lexical.c index 5733b58..eb073a2 100644 --- a/src/analyseur_lexical.c +++ b/src/analyseur_lexical.c @@ -107,6 +107,7 @@ int yylex(void) c = lireCar(); + // Symbole simple for( int i = 0; tableSymbole[i] != '\0'; ++i ) { if( c == tableSymbole[i] ) { @@ -117,8 +118,7 @@ int yylex(void) // Nombre if( is_num( c ) ) { - do - { + do { lireCar(); } while( is_num( yytext[yyleng-1] ) ); delireCar(); @@ -130,8 +130,7 @@ int yylex(void) if( c == '$' ) { i = 1; // 1 pour $ - do - { + do { lireCar(); i++; } while( is_alphanum( yytext[yyleng-1] ) ); @@ -150,7 +149,7 @@ int yylex(void) // Mot clefs do { lireCar(); - } while( !isspace( yytext[yyleng-1] ) ); + } while( is_alphanum( yytext[yyleng-1] ) ); delireCar(); for( int i = 0; tableMotsClefs[i] != '\0'; ++i ) @@ -160,17 +159,18 @@ int yylex(void) } } + for(; yyleng != 1; delireCar() ); + //id_fct if( is_alpha( c ) ) { int i = 1; // 1 pour $ - - do - { + + do { lireCar(); i++; + } while( is_alphanum( yytext[yyleng-1] ) ); i--; - delireCar(); if(i > 99) {