iAdd in grammar :
- var
- /
- -
This commit is contained in:
@@ -8,5 +8,6 @@ void affiche_balise_ouvrante(const char *fct_, int trace_xml);
|
||||
void affiche_balise_fermante(const char *fct_, int trace_xml);
|
||||
void affiche_element(char *fct_, char *texte_, int trace_xml);
|
||||
void affiche_texte(char *texte_, int trace_xml);
|
||||
void affiche_xml_texte( char *texte_ );
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
int uniteCourante;
|
||||
extern char yytext[100];
|
||||
|
||||
|
||||
|
||||
void expArith (void) {
|
||||
affiche_balise_ouvrante("expArith", 1);
|
||||
|
||||
@@ -17,7 +15,7 @@ void expArith (void) {
|
||||
void expArithBis (void) {
|
||||
affiche_balise_ouvrante("expArithBis", 1);
|
||||
|
||||
if(uniteCourante == PLUS) {
|
||||
if(uniteCourante == PLUS || uniteCourante == MOINS ) {
|
||||
uniteCourante = yylex();
|
||||
affiche_xml_texte(yytext);
|
||||
|
||||
@@ -39,7 +37,7 @@ void terme (void) {
|
||||
void termeBis (void) {
|
||||
affiche_balise_ouvrante("termeBis", 1);
|
||||
|
||||
if(uniteCourante == FOIS) {
|
||||
if(uniteCourante == FOIS || uniteCourante == DIVISE) {
|
||||
uniteCourante = yylex();
|
||||
affiche_xml_texte(yytext);
|
||||
|
||||
@@ -62,9 +60,15 @@ void facteur (void) {
|
||||
printf("Erreur de syntaxe");
|
||||
exit(-1);
|
||||
}
|
||||
uniteCourante = yylex();
|
||||
affiche_xml_texte(yytext);
|
||||
|
||||
} else if(uniteCourante == NOMBRE) {
|
||||
uniteCourante = yylex();
|
||||
affiche_xml_texte(yytext);
|
||||
} else if(uniteCourante == ID_VAR) {
|
||||
uniteCourante = yylex();
|
||||
affiche_xml_texte(yytext);
|
||||
} else {
|
||||
printf("Erreur de syntaxe");
|
||||
exit(-1);
|
||||
|
||||
1
test/expressionMenosDivised
Normal file
1
test/expressionMenosDivised
Normal file
@@ -0,0 +1 @@
|
||||
4 + 8 * (5 / 8) - (9 + 4 / 8) * ($var + $vart)
|
||||
1
test/expressionPara
Normal file
1
test/expressionPara
Normal file
@@ -0,0 +1 @@
|
||||
(5 + 8) + (9 * 4)
|
||||
1
test/expressionVar
Normal file
1
test/expressionVar
Normal file
@@ -0,0 +1 @@
|
||||
4 + $var + 5 * 6
|
||||
Reference in New Issue
Block a user