J'ai remplacé getch(0 par getche() dans la fonction gettoken() afin de voir
sur la fenêtre dos ce que j'écrivais.
La fonction gettoken() a été testé avec l'application dcl() de K&R page
122-123-124 et elle fonctionne normalement.
La fonction undcl(), elle ne fonctionne pas très bien en ce qu'il n'y a pas
moyen de la faire cesser avec la ligne:
while(gettoken() != EOF) dans main.
Voici un copie du programme donnée en exemple par KR chap 5.12
"Complicated declaration".
/*
undcl.c
"x is a function returning a pointer to an array of pointers to functions
returning char"
undcl convert word description to declaration
x () * [] * () char char (*(*x())[])()
void dcl(void);
void dirdcl(void);
int gettoken(void);
int tokentype; /* type of last token */
char token[MAXTOKEN]; /* last token string */
char name[MAXTOKEN]; /* identifyer name */
char datatype[MAXTOKEN]; /* data type = char, int, etc. */
char out[1000]; /* output string */
int gettoken(void){ /* return next token fonction commune a dcl() */
int c, getche(void);
void ungetch(int);
char *p = token;