Advertisement
Guest User

Untitled

a guest
May 24th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.52 KB | None | 0 0
  1.  
  2. Declarations −→ {VarDeclaration SEMICOLON | FuncDeclaration SEMICOLON}
  3.  
  4. Declarations:
  5. VarDeclaration SEMICOLON {;}
  6. |FuncDeclaration SEMICOLON {;}
  7. |Declarations VarDeclaration SEMICOLON {;}
  8. |Declarations FuncDeclaration SEMICOLON {;}
  9. ;
  10.  
  11.  
  12. VarSpec −→ ID {COMMA ID} Type
  13.  
  14. VarSpec:
  15. ID VarSpec_2 Type {;}
  16. ;
  17.  
  18. VarSpec_2:
  19. COMMA ID VarSpec_2 {;}
  20. | {;}
  21. ;
  22.  
  23.  
  24. FuncDeclaration −→ FUNC ID LPAR [Parameters] RPAR [Type] FuncBody
  25.  
  26. FuncDeclaration:
  27. FuncHeader FuncBody {;}
  28. ;
  29.  
  30. FuncHeader:
  31. FUNC ID LPAR RPAR {;}
  32. |FUNC ID LPAR Parameters RPAR {;}
  33. |FUNC ID LPAR RPAR Type {;}
  34. |FUNC ID LPAR Parameters RPAR Type {;}
  35. ;
  36.  
  37.  
  38. VarsAndStatements −→ VarsAndStatements [VarDeclaration | Statement] SEMICOLON | ε
  39.  
  40. VarsAndStatements:
  41. VarsAndStatements SEMICOLON {;}
  42. |VarsAndStatements VarDeclaration SEMICOLON {;}
  43. |VarsAndStatements Statement SEMICOLON {;}
  44. | {;}
  45. ;
  46.  
  47.  
  48. FuncInvocation −→ ID LPAR [Expr {COMMA Expr}] RPAR
  49.  
  50. FuncInvocation:
  51. ID LPAR RPAR {;}
  52. |ID LPAR Expression FuncInvocation_2 RPAR {;}
  53. |ID LPAR Expression RPAR {;}
  54. |ID LPAR error RPAR {;}
  55. ;
  56.  
  57. FuncInvocation_2:
  58. COMMA Expression {;}
  59. |FuncInvocation_2 COMMA Expression {;}
  60. ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement