Advertisement
Guest User

Untitled

a guest
Apr 24th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. FunctionsAndDeclarations: FunctionDefinition {;}
  2. | FunctionDefinition Expr2 {;}
  3. | FunctionDeclaration {;}
  4. | FunctionDeclaration Expr2 {;}
  5. | Declaration {;}
  6. | Declaration Expr2 {;}
  7. ;
  8.  
  9. Expr2: FunctionDefinition {;}
  10. | FunctionDeclaration {;}
  11. | FunctionDefinition Expr2 {;}
  12. | FunctionDeclaration Expr2 {;}
  13. | Declaration {;}
  14. | Declaration Expr2 {;}
  15. ;
  16.  
  17. FunctionDefinition: TypeSpec FunctionDeclarator FunctionBody {;}
  18. ;
  19.  
  20. FunctionBody: LBRACE DeclarationsAndStatements RBRACE {;}
  21. | LBRACE RBRACE {;}
  22.  
  23. ;
  24.  
  25. DeclarationsAndStatements: Statement {;}
  26. | Statement DeclarationsAndStatements {;}
  27. | Declaration {;}
  28. | Declaration DeclarationsAndStatements {;}
  29. ;
  30.  
  31. FunctionDeclaration:TypeSpec FunctionDeclarator SEMI {;}
  32. ;
  33.  
  34. FunctionDeclarator: ID LPAR ParameterList RPAR {;}
  35. ;
  36.  
  37. ParameterList: ParameterDeclaration {;}
  38. | ParameterDeclaration COMMA ParameterList {;}
  39. ;
  40.  
  41. ParameterDeclaration: TypeSpec ID {;}
  42. | TypeSpec {;}
  43. ;
  44.  
  45. Declaration: TypeSpec Declarator SEMI {;}
  46. | TypeSpec Declarator Expr3 SEMI {;}
  47. ;
  48.  
  49. Expr3: COMMA Declarator Declaration {;}
  50. ;
  51.  
  52. TypeSpec: CHAR {;}
  53. | INT {;}
  54. | VOID {;}
  55. | SHORT {;}
  56. | DOUBLE {;}
  57. ;
  58.  
  59. Declarator: ID {;}
  60. | ID ASSIGN Expr {;}
  61. ;
  62.  
  63. Statement: Expr SEMI {;}
  64. | SEMI {;}
  65. | LBRACE Statement RBRACE {;}
  66. | IF LPAR Expr RPAR Statement ELSE Statement {;}
  67. | IF LPAR Expr RPAR Statement {;}
  68. | WHILE LPAR Expr RPAR Statement {;}
  69. | RETURN Expr SEMI {;}
  70. | RETURN SEMI {;}
  71. ;
  72.  
  73.  
  74. Expr: Expr ASSIGN Expr {;}
  75. | Expr COMMA Expr {;}
  76. | Expr PLUS Expr {;}
  77. | Expr MINUS Expr {;}
  78. | Expr MUL Expr {;}
  79. | Expr DIV Expr {;}
  80. | Expr MOD Expr {;}
  81. | Expr OR Expr {;}
  82. | Expr AND Expr {;}
  83. | Expr BITWISEAND Expr {;}
  84. | Expr BITWISEOR Expr {;}
  85. | Expr BITWISEXOR Expr {;}
  86. | Expr EQ Expr {;}
  87. | Expr NE Expr {;}
  88. | Expr LE Expr {;}
  89. | Expr GE Expr {;}
  90. | Expr LT Expr {;}
  91. | Expr GT Expr {;}
  92. | PLUS Expr {;}
  93. | MINUS Expr {;}
  94. | NOT Expr {;}
  95. | ID LPAR RPAR {;}
  96. | ID LPAR Expr RPAR {;}
  97. | INTLIT {;}
  98. | CHRLIT {;}
  99. | REALLIT {;}
  100. ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement