summaryrefslogtreecommitdiff
path: root/2003/i/buzz/src/automate/grammar.yy
diff options
context:
space:
mode:
Diffstat (limited to '2003/i/buzz/src/automate/grammar.yy')
-rw-r--r--2003/i/buzz/src/automate/grammar.yy18
1 files changed, 10 insertions, 8 deletions
diff --git a/2003/i/buzz/src/automate/grammar.yy b/2003/i/buzz/src/automate/grammar.yy
index af57931..114e322 100644
--- a/2003/i/buzz/src/automate/grammar.yy
+++ b/2003/i/buzz/src/automate/grammar.yy
@@ -34,7 +34,7 @@ Grafcet *input_grafcet;
%token <fl> FLOAT
%token <boolean> BOOL
%token <s> STRING
-%token ERR GOTO
+%token ERR GOTO SI
%token EQ NEQ LEQ GEQ
%token INITIALISATION
@@ -87,7 +87,7 @@ grafcet:
/* Rien */ { $$ = new Grafcet (); }
| grafcet etape { $$ = $1; $$->m_grafcet.push_back (Grafcet::Elem ($2)); }
| grafcet action { $$ = $1; $$->m_grafcet.push_back (Grafcet::Elem ($2)); }
- | grafcet receptivite { $$ = $1; $$->m_grafcet.push_back (Grafcet::Elem ($2)); }
+ | grafcet SI receptivite { $$ = $1; $$->m_grafcet.push_back (Grafcet::Elem ($3)); }
| grafcet transition { $$ = $1; $$->m_grafcet.push_back (Grafcet::Elem ($2)); }
;
@@ -95,6 +95,11 @@ etape: '#' NUM { $$ = new Etape ($2); }
;
action: PRINT STRING { $$ = new ActionPrint (*$2); delete $2; }
+ | AVANCER NUM { $$ = new ActionMotorGoDistance ($2); }
+ | AVANCER NUM NUM { $$ = new ActionMotorGoDistance ($2, $3); }
+ | RECULER NUM { $$ = new ActionMotorGoDistance (-$2); }
+ | RECULER NUM NUM { $$ = new ActionMotorGoDistance (-$2, $3); }
+
| INITIALISATION { $$ = new ActionInitialisation ();}
| RECHERCHER { $$ = new ActionRechercher ();}
| ROTATION { $$ = new ActionRotation ();}
@@ -104,15 +109,14 @@ action: PRINT STRING { $$ = new ActionPrint (*$2); delete $2; }
| MISE_EN_PLACE { $$ = new ActionMiseEnPlace ();}
| REPERER_COULEUR NUM { $$ = new ActionRepererCouleur ($2);}
| RETOURNER { $$ = new ActionRetourner ();}
- | AVANCER NUM { $$ = new ActionMotorGoDistance ($2); }
- | AVANCER NUM NUM { $$ = new ActionMotorGoDistance ($2, $3); }
- | RECULER NUM { $$ = new ActionMotorGoDistance (-$2); }
- | RECULER NUM NUM { $$ = new ActionMotorGoDistance (-$2, $3); }
| PLACER_PINCE NUM { $$ = new ActionPlacerPince ($2);}
;
receptivite:
BOOL { $$ = new ReceptiviteBool ($1); }
+ | ROBOT_RECULE { $$ = new ReceptMotorFinnish; }
+ | ROBOT_AVANCE { $$ = new ReceptMotorFinnish; }
+
| INIT { $$ = new ReceptInit (); }
| PALETS_TROUVES { $$ = new ReceptPaletsTrouves (); }
| PALETS NUM { $$ = new ReceptPalets ($2); }
@@ -120,8 +124,6 @@ receptivite:
| COULEUR_ADVERSE NUM { $$ = new ReceptCouleurAdverse ($2); }
| PINCE_ANGLE NUM { $$ = new ReceptPinceAngle ($2); }
| PINCE_POS NUM { $$ = new ReceptPincePos ($2); }
- | ROBOT_RECULE { $$ = new ReceptMotorFinnish; }
- | ROBOT_AVANCE { $$ = new ReceptMotorFinnish; }
| receptivite '&' receptivite
{ $$ = new ReceptiviteBoolOp ($1, '&', $3); }
| receptivite '|' receptivite