GRAM2.RIG 504 B

12345678910111213141516171819
  1. -- source grammar for SL
  2. #program
  3. (. (* #stmt * ';' ) .) ##
  4. #stmt
  5. ( #assignment ! #while_op ) ##
  6. #assignment
  7. $Id ':=' #expression ##
  8. #while_op
  9. 'while' #expression 'do'
  10. (* #stmt * ';' ) 'od' ##
  11. #expression
  12. #arithm_expr [ '<' #arithm_expr ] ##
  13. #arithm_expr
  14. #term ;;
  15. '(' #arithm_expr '+' #arithm_expr ')' ##
  16. #term
  17. ( 1 ! #variable ) ##
  18. #variable
  19. ( w ! v ! x ! y ! z ) ##