#include <stdio.h>
#include <ctype.h>

int lineno = 1;
int tokenval = NONE;

int lexan()   /*analyseur lexical*/
{

 int t;
 while(1) {
    t = getchar();
    if (t == ' ' || t == '\t')
        ; /*effacer les blancs*/
    else if (t == '\n')
      lineno = lineno + 1;
    else if (isdigit(t)) {  /* t est un chiffre*/
      tokenval = t - '0';
      t= getchar();
      while (isdigit(t)) {
         tokenval = tokenval*10 + t-'0';
         t = getchar();
      }
      ungetc(t,stdin); 
      return NUM;
    }
    else {
       tokenval = NONE;
       return t;
    }
  }
}
