syntax logoPlayer_syntax (logoPlayer_lexique) { rule { # Routine definition $PROGRAM$ @routineMap routineArray = {} @instructionList baseProgram = {} !? routineArray $BEGIN$ !? routineArray !? baseProgram $END$ $.$ } rule ?! @routineMap routineArray { repeat while !? routineArray end } rule ?! @routineMap ioRoutineArray { $ROUTINE$ $identifier$ ?let @lstring routineId @instructionList routineProgram = {} $BEGIN$ !? ioRoutineArray !? routineProgram $END$ [ !? ioRoutineArray insertKey !routineId ] } rule ?! @routineMap ioRoutineArray ?! @instructionList program { repeat while !? ioRoutineArray !? program end } rule ?! @routineMap ioRoutineArray ?! @instructionList program { select !? program or !? program or !? ioRoutineArray !? program end $;$ } rule ?! @instructionList program { select !? program or !? program end } rule ?! @instructionList program { $FORWARD$ $integer$ ?let @luint moveLen @instruction move = @forward.new { !moveLen } program += !move } rule ?! @instructionList program { $ROTATE$ $integer$ ?let @luint moveAngle @instruction move = @rotate.new { !moveAngle } program += !move } rule ?! @instructionList program { $PEN$ @instruction setPen select $UP$ setPen = @penUp.new {} or $DOWN$ setPen = @penDown.new {} end program += !setPen } rule ?! @routineMap ioRoutineArray ?! @instructionList program { $CALL$ $identifier$ ?let @lstring routineId [ ioRoutineArray searchKey !routineId ] } }