Papa !!!!!!!
This commit is contained in:
@@ -41,17 +41,23 @@ void syntaxErrorMsg( const char * msg )
|
||||
exit( 1 );
|
||||
}
|
||||
|
||||
void programme() {
|
||||
n_prog *programme() {
|
||||
openSection( __func__ );
|
||||
|
||||
n_l_dec *herite_var;
|
||||
n_l_dec *herite_func;
|
||||
n_prog *sreturn;
|
||||
|
||||
if( !est_premier( _optDecVariables_, uniteCourante ) && !est_premier( _listeDecFonctions_, uniteCourante ) && !est_suivant( _listeDecFonctions_, uniteCourante )) {
|
||||
syntaxError();
|
||||
} else {
|
||||
optDecVariables();
|
||||
listeDecFonctions();
|
||||
herite_var = optDecVariables();
|
||||
herite_func = listeDecFonctions();
|
||||
sreturn = cree_n_prog(herite_var, herite_func);
|
||||
}
|
||||
|
||||
closeSection( __func__ );
|
||||
return sreturn;
|
||||
}
|
||||
|
||||
void optDecVariables() {
|
||||
@@ -608,7 +614,7 @@ void comparaisonBis() {
|
||||
closeSection( __func__ );
|
||||
}
|
||||
|
||||
n_exp expArith()
|
||||
n_exp *expArith()
|
||||
{
|
||||
openSection( __func__ );
|
||||
|
||||
@@ -626,7 +632,7 @@ n_exp expArith()
|
||||
return sreturn;
|
||||
}
|
||||
|
||||
n_exp expArithBis(n_exp *herite) {
|
||||
n_exp *expArithBis(n_exp *herite) {
|
||||
openSection( __func__ );
|
||||
|
||||
n_exp *s;
|
||||
@@ -645,8 +651,8 @@ n_exp expArithBis(n_exp *herite) {
|
||||
uniteCourante = yylex();
|
||||
|
||||
s = terme();
|
||||
erite_fils = cree_n_exp_op(moins, herite, s);
|
||||
sreturn = expArithBis();
|
||||
herite_fils = cree_n_exp_op(moins, herite, s);
|
||||
sreturn = expArithBis(herite_fils);
|
||||
} else if( !est_suivant( _expArithBis_, uniteCourante ) ) {
|
||||
syntaxError();
|
||||
} else {
|
||||
@@ -657,7 +663,7 @@ n_exp expArithBis(n_exp *herite) {
|
||||
return sreturn;
|
||||
}
|
||||
|
||||
n_exp terme() {
|
||||
n_exp *terme() {
|
||||
openSection( __func__ );
|
||||
|
||||
n_exp *sreturn;
|
||||
@@ -705,7 +711,7 @@ n_exp *termeBis(n_exp *herite) {
|
||||
return sreturn;
|
||||
}
|
||||
|
||||
n_exp facteur() {
|
||||
n_exp *facteur() {
|
||||
openSection( __func__ );
|
||||
|
||||
n_exp *sreturn;
|
||||
@@ -727,10 +733,11 @@ n_exp facteur() {
|
||||
elementConsome();
|
||||
uniteCourante = yylex();
|
||||
} else if( est_premier( _appelFct_, uniteCourante ) ) {
|
||||
appelFct(); // TODOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
|
||||
sreturn = appelFct();
|
||||
} else if( est_premier( _var_, uniteCourante ) ) {
|
||||
var();
|
||||
sreturn = var();
|
||||
} else if( uniteCourante == LIRE ) {
|
||||
sreturn = cree_n_exp_lire();
|
||||
elementConsome();
|
||||
uniteCourante = yylex();
|
||||
|
||||
@@ -752,6 +759,7 @@ n_exp facteur() {
|
||||
}
|
||||
|
||||
closeSection( __func__ );
|
||||
return sreturn;
|
||||
}
|
||||
|
||||
void var() {
|
||||
@@ -791,10 +799,15 @@ void optIndice() {
|
||||
closeSection( __func__ );
|
||||
}
|
||||
|
||||
void appelFct() {
|
||||
n_exp *appelFct() {
|
||||
openSection( __func__ );
|
||||
|
||||
n_l_exp *herite_fils;
|
||||
n_appel *sreturn;
|
||||
|
||||
if( uniteCourante == ID_FCT ) {
|
||||
char appelName[100];
|
||||
strcpy(appelName, yytext);
|
||||
elementConsome();
|
||||
uniteCourante = yylex();
|
||||
|
||||
@@ -802,7 +815,9 @@ void appelFct() {
|
||||
elementConsome();
|
||||
uniteCourante = yylex();
|
||||
|
||||
listeExpressions();
|
||||
herite_fils = listeExpressions();
|
||||
sreturn = cree_n_appel(appelName, herite_fils);
|
||||
|
||||
|
||||
if( uniteCourante == PARENTHESE_FERMANTE ) {
|
||||
elementConsome();
|
||||
@@ -818,6 +833,7 @@ void appelFct() {
|
||||
}
|
||||
|
||||
closeSection( __func__ );
|
||||
return cree_n_exp_appel(sreturn);
|
||||
}
|
||||
|
||||
void listeExpressions() {
|
||||
|
||||
Reference in New Issue
Block a user