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.yy47
1 files changed, 47 insertions, 0 deletions
diff --git a/2003/i/buzz/src/automate/grammar.yy b/2003/i/buzz/src/automate/grammar.yy
index 1fd4efc..a780777 100644
--- a/2003/i/buzz/src/automate/grammar.yy
+++ b/2003/i/buzz/src/automate/grammar.yy
@@ -36,7 +36,33 @@ Grafcet *input_grafcet;
%token <s> STRING
%token ERR GOTO
%token EQ NEQ LEQ GEQ
+
+/*TOKEN des actions
+%token INITIALISATION
+%token RECHERCHER
+%token ROTATION
+%token AVANCER_PALET
+%token NB_PALET_PILE
+%token NB_PALET_STOCKE
+%token MISE_EN_PLACE
+%token REPERER_COULEUR
+%token RETOURNER
+%token AVANCER
+%token RECULER
+%token PLACER_PINCE
%token PRINT
+
+/*TOKEN des conditions
+%token INIT
+%token PALETS_TROUVES
+%token PALETS
+%token STOCKE
+%token COULEUR_ADVERSE
+%token PINCE_ANGLE
+%token PINCE_POS
+%token ROBOT_RECULE
+%token ROBOT_AVANCE
+
%type <grafcet> grafcet
%type <etape> etape
%type <action> action
@@ -74,10 +100,31 @@ etape: '#' NUM { $$ = new Etape ($2); }
/*met les actions ici puis defini une classe pour l'action (avec parametres)
action: PRINT STRING { $$ = new ActionPrint (*$2); delete $2; }
+ | INITIALISATION { $$ = new ActionInit ();}
+ | RECHERCHER { $$ = new ActionRechercher ();}
+ | ROTATION { $$ = new ActionRotation ();}
+ | AVANCER_PALET { $$ = new ActionAvancerPalet ();}
+ | NB_PALET_PILE { $$ = new ActionNbPaletPile ();}
+ | NB_PALET_STOCKE { $$ = new ActionNbPaletStocke ();}
+ | MISE_EN_PLACE { $$ = new ActionMiseEnPlace ();}
+ | REPERER_COULEUR NUM { $$ = new ActionRepererCouleur ($2);}
+ | RETOURNER { $$ = new ActionRetourner ();}
+ | AVANCER NUM { $$ = new ActionAvancer ($2);}
+ | RECULER NUM { $$ = new ActionReculer ($2);}
+ | PLACER_PINCE NUM { $$ = new ActionPlacerPince ($2);}
;
receptivite:
BOOL { $$ = new ReceptiviteBool ($1); }
+ | INIT { $$ = new ReceptInit (false); }
+ | PALETS_TROUVES { $$ = new ReceptPaletsTrouves (false); }
+ | PALETS NUM { $$ = new ReceptPalets (false,$2); }
+ | STOCKE NUM { $$ = new ReceptStocke (false,$2); }
+ | COULEUR_ADVERSE NUM { $$ = new ReceptCouleurAdverse (false,$2); }
+ | PINCE_ANGLE NUM { $$ = new ReceptPinceAngle (false,$2); }
+ | PINCE_POS NUM { $$ = new ReceptPincePos (false,$2); }
+ | ROBOT_RECULE { $$ = new ReceptRobotRecule (false); }
+ | ROBOT_AVANCE { $$ = new ReceptRobotAvance (false); }
| receptivite '&' receptivite
{ $$ = new ReceptiviteBoolOp ($1, '&', $3); }
| receptivite '|' receptivite