EVAL FINAL ESAYYYYYYY

This commit is contained in:
2016-04-19 11:58:53 +02:00
parent 69f4de0a90
commit 4841633f92
60 changed files with 4031 additions and 7634 deletions

View File

@@ -44,12 +44,13 @@ n_instr *instructionPour (void);
n_instr *instructionVide (void);
n_exp *expression (void);
n_exp *expressionBis (n_exp *herite);
n_exp *condition (void);
n_exp *conditionBis(n_exp *herite);
n_exp *conjonction (void);
n_exp *conjonctionBis(n_exp *herite);
n_exp *negation (void);
n_exp *comparaison (void);
n_exp *comparaisonBis (n_exp *herite);
n_exp *expression (void);
n_exp *expArith (void);
n_exp *expArithBis(n_exp *herite);
n_exp *terme (void);

View File

@@ -2,7 +2,7 @@
#define EPSILON 0
#define NB_NON_TERMINAUX 43
#define NB_NON_TERMINAUX 45
#define _listeDecVariables_ 1
#define _listeDecFonctions_ 2
@@ -45,11 +45,13 @@
#define _instructionFaire_ 40
#define _optListeDecVariables_ 41
#define _instructionPour_ 42
#define _condition_ 43
#define _conditionBis_ 44
/* symboles terminaux */
#define NB_TERMINAUX 32
#define NB_TERMINAUX 34
#define POINT_VIRGULE 1
#define PLUS 2
@@ -81,4 +83,6 @@
#define NOMBRE 28
#define FIN 29
#define VIRGULE 30
#define POUR 31
#define POUR 31
#define INTERROGATION 32
#define DEUXPOINTS 33

View File

@@ -39,12 +39,12 @@ n_dec *cree_n_dec_fonc(char *nom, n_l_dec *param, n_l_dec *variables, n_instr *c
/* ATTENTION : negatif => - unaire, comme dans -5
non => négation logique
Le opérateurs unaires ont op2 = NULL par convention */
typedef enum {plus, moins, fois, divise, modulo, egal, diff, inf, sup, infeg, supeg, ou, et, non, negatif} operation;
typedef enum {plus, moins, fois, divise, modulo, egal, diff, inf, sup, infeg, supeg, ou, et, non, negatif, cond} operation;
struct n_exp_ {
enum{varExp, opExp, intExp, appelExp, lireExp, incrExp} type;
union{
struct{operation op; struct n_exp_ *op1; struct n_exp_ *op2;} opExp_;
struct{operation op; struct n_exp_ *op1; struct n_exp_ *op2; struct n_exp_ *op3;} opExp_;
n_var *var;
n_var *incr;
int entier;
@@ -52,7 +52,7 @@ struct n_exp_ {
}u;
};
n_exp *cree_n_exp_op(operation type, n_exp *op1, n_exp *op2);
n_exp *cree_n_exp_op(operation type, n_exp *op1, n_exp *op2, n_exp *op3);
n_exp *cree_n_exp_entier(int entier);
n_exp *cree_n_exp_var(n_var *var);
n_exp *cree_n_exp_appel(n_appel *app);