|
@@ -48,19 +48,36 @@ syntax logoPlayer_syntax (logoPlayer_lexique) {
|
|
|
|
|
|
rule <move> {
|
|
|
select
|
|
|
- $FORWARD$
|
|
|
+ <move_forward>
|
|
|
or
|
|
|
- $ROTATE$
|
|
|
+ <move_rotate>
|
|
|
end
|
|
|
+ }
|
|
|
+
|
|
|
+ rule <move_forward> {
|
|
|
+ $FORWARD$
|
|
|
$integer$ ?let @luint moveLen
|
|
|
+
|
|
|
+ @instruction move = @forward.new { !moveLen }
|
|
|
+ }
|
|
|
+
|
|
|
+ rule <move_rotate> {
|
|
|
+ $ROTATE$
|
|
|
+ $integer$ ?let @luint moveAngle
|
|
|
+
|
|
|
+ @instruction move = @rotate.new { !moveAngle }
|
|
|
}
|
|
|
|
|
|
rule <set_pen> {
|
|
|
$PEN$
|
|
|
select
|
|
|
$UP$
|
|
|
+
|
|
|
+ @instruction setPen = @penUp.new {}
|
|
|
or
|
|
|
$DOWN$
|
|
|
+
|
|
|
+ @instruction setPen = @penDown.new {}
|
|
|
end
|
|
|
}
|
|
|
|