Advertisement
Guest User

Untitled

a guest
Sep 21st, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- Program ::= Stmts
  2.  
  3. -- Stmts ::= Stmt
  4. --         | Stmt ‘;’ Stmts
  5.  
  6. -- Stmt ::= ident ‘=’ Expr
  7. --         | Expr
  8.  
  9. -- Expr ::= Term Expr'
  10.  
  11. -- Expr' ::= e
  12. --         | LogicalExpr
  13. --         | not Expr'
  14.  
  15. -- LogicalExpr ::= MathExpr
  16. --               | RelOp Term LogicalExpr
  17.  
  18. -- MathExpr    ::= MathExpr'
  19. --               | AddOp  Term Expr'
  20.  
  21. -- MathExpr'    ::= Term
  22. --               | AddOp  Term Expr'
  23.  
  24. -- Term ::= numConst
  25. --        | stringConst
  26. --        | BoolVal
  27. --        | ident IdentExpr
  28. --        | 'not' Expr
  29. --        | '(' Expr ')'
  30. --        | '[' Exprz ']'
  31. --        | ‘[’ Expr ForQual Qualz ‘]’
  32.  
  33. -- IdentExpr ::= e
  34. --             | '(' Exprz ')'
  35.  
  36. -- BoolVal ::= 'None' | 'True ' | 'False'
  37.  
  38. -- Oper ::= AddOp
  39. --        | MultOp
  40. --        | RelOp
  41.  
  42. -- AddOp   ::= ‘+’ | ‘-’
  43. -- MultOp  ::= ‘*’ | ‘//’ | ‘%’
  44. -- RelOp   ::= ‘==’ | ‘!=’ | ‘<’ | ‘<=’ | ‘>’ | ‘>=’ | ‘in’ | ‘not’ ‘in’
  45.  
  46.  
  47. -- ForQual ::= ‘for’ ident ‘in’ Expr
  48.  
  49. -- IfQual ::= ‘if’ Expr
  50.  
  51. -- Qualz ::= e
  52. --         | ForQual Qualz
  53. --         | IfQual Qualz
  54.  
  55. -- Exprz ::= e
  56. --         | Exprs
  57.  
  58. -- Exprs ::= Expr
  59. --         | Expr ‘,’ Exprs
  60.  
  61. -- ident ::= (see text)
  62. -- numConst ::= (see text)
  63. -- stringConst ::= (see text)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement