version 1.49, 2012/09/29 17:53:02
|
version 1.50, 2012/09/30 20:46:46
|
Line 358 compilation(struct_processus *s_etat_pro
|
Line 358 compilation(struct_processus *s_etat_pro
|
================================================================================ |
================================================================================ |
*/ |
*/ |
|
|
logical1 |
enum t_condition { AN_IF = 1, AN_IFERR, AN_THEN, AN_ELSE, AN_ELSEIF, |
analyse_syntaxique(struct_processus *s_etat_processus) |
AN_END, AN_DO, AN_UNTIL, AN_WHILE, AN_REPEAT, AN_SELECT, |
{ |
AN_CASE, AN_DEFAULT, AN_UP, AN_DOWN, AN_FOR, AN_START, |
enum t_condition { AN_IF = 1, AN_IFERR, AN_THEN, AN_ELSE, AN_ELSEIF, |
AN_NEXT, AN_STEP, AN_CRITICAL, AN_FORALL }; |
AN_END, AN_DO, AN_UNTIL, AN_WHILE, AN_REPEAT, AN_SELECT, |
|
AN_CASE, AN_DEFAULT, AN_UP, AN_DOWN, AN_FOR, AN_START, |
|
AN_NEXT, AN_STEP, AN_CRITICAL, AN_FORALL }; |
|
|
|
unsigned char *instruction; |
|
unsigned char registre; |
|
|
|
typedef struct pile |
|
{ |
|
enum t_condition condition; |
|
struct pile *suivant; |
|
} struct_pile_analyse; |
|
|
|
struct_pile_analyse *l_base_pile; |
typedef struct pile |
struct_pile_analyse *l_nouvelle_base_pile; |
{ |
|
enum t_condition condition; |
|
struct pile *suivant; |
|
} struct_pile_analyse; |
|
|
|
static inline struct_pile_analyse * |
|
empilement_analyse(struct_pile_analyse *ancienne_base, |
|
enum t_condition condition) |
|
{ |
|
struct_pile_analyse *nouvelle_base; |
|
|
inline struct_pile_analyse * |
if ((nouvelle_base = malloc(sizeof(struct_pile_analyse))) == NULL) |
empilement_analyse(struct_pile_analyse *ancienne_base, |
|
enum t_condition condition) |
|
{ |
{ |
struct_pile_analyse *nouvelle_base; |
return(NULL); |
|
} |
|
|
if ((nouvelle_base = malloc(sizeof(struct_pile_analyse))) == NULL) |
(*nouvelle_base).suivant = ancienne_base; |
{ |
(*nouvelle_base).condition = condition; |
return(NULL); |
|
} |
|
|
|
(*nouvelle_base).suivant = ancienne_base; |
return(nouvelle_base); |
(*nouvelle_base).condition = condition; |
} |
|
|
return(nouvelle_base); |
static inline struct_pile_analyse * |
} |
depilement_analyse(struct_pile_analyse *ancienne_base) |
|
{ |
|
struct_pile_analyse *nouvelle_base; |
|
|
inline struct_pile_analyse * |
if (ancienne_base == NULL) |
depilement_analyse(struct_pile_analyse *ancienne_base) |
|
{ |
{ |
struct_pile_analyse *nouvelle_base; |
return(NULL); |
|
} |
|
|
if (ancienne_base == NULL) |
nouvelle_base = (*ancienne_base).suivant; |
{ |
free(ancienne_base); |
return(NULL); |
|
} |
|
|
|
nouvelle_base = (*ancienne_base).suivant; |
return(nouvelle_base); |
free(ancienne_base); |
} |
|
|
return(nouvelle_base); |
static inline logical1 |
|
test_analyse(struct_pile_analyse *l_base_pile, enum t_condition condition) |
|
{ |
|
if (l_base_pile == NULL) |
|
{ |
|
return(d_faux); |
} |
} |
|
|
inline logical1 |
return(((*l_base_pile).condition == condition) ? d_vrai : d_faux); |
test_analyse(struct_pile_analyse *l_base_pile, enum t_condition condition) |
} |
{ |
|
if (l_base_pile == NULL) |
|
{ |
|
return(d_faux); |
|
} |
|
|
|
return(((*l_base_pile).condition == condition) ? d_vrai : d_faux); |
static inline void |
} |
liberation_analyse(struct_pile_analyse *l_base_pile) |
|
{ |
|
struct_pile_analyse *l_nouvelle_base_pile; |
|
|
inline void |
while(l_base_pile != NULL) |
liberation_analyse(struct_pile_analyse *l_base_pile) |
|
{ |
{ |
struct_pile_analyse *l_nouvelle_base_pile; |
l_nouvelle_base_pile = (*l_base_pile).suivant; |
|
free(l_base_pile); |
|
l_base_pile = l_nouvelle_base_pile; |
|
} |
|
|
while(l_base_pile != NULL) |
return; |
{ |
} |
l_nouvelle_base_pile = (*l_base_pile).suivant; |
|
free(l_base_pile); |
|
l_base_pile = l_nouvelle_base_pile; |
|
} |
|
|
|
return; |
logical1 |
} |
analyse_syntaxique(struct_processus *s_etat_processus) |
|
{ |
|
unsigned char *instruction; |
|
unsigned char registre; |
|
|
|
struct_pile_analyse *l_base_pile; |
|
struct_pile_analyse *l_nouvelle_base_pile; |
|
|
l_base_pile = NULL; |
l_base_pile = NULL; |
l_nouvelle_base_pile = NULL; |
l_nouvelle_base_pile = NULL; |