Anda di halaman 1dari 17

Nama : Archy Renaldy Pratama Nugraha NIM: 10116371

Kelas : Teknik Kompilasi


1. <program> ::= program <identifier> ; <block> .

2. <identifier> ::= <letter > {<letter or digit>}

3. <letter or digit> ::= <letter> | <digit>

4. <block> ::= <label declaration part> <constant definition part> <type definition
part> <variable declaration part> <procedure and function declaration part>
<statement part>

5. <label declaration part> ::= <empty> | label <label> {, <label>} ;

6. <label> ::= <unsigned integer>


Nama : Archy Renaldy Pratama Nugraha NIM: 10116371
Kelas : Teknik Kompilasi

7. <constant definition part> ::= <empty> | const <constant definition> { ;


<constant definition>} ;

8. <constant definition> ::= <identifier> = <constant>

9. <constant> ::= <unsigned number> | <sign> <unsigned number> | <constant


identifier> | <sign> <constant identifier> | <string>
Nama : Archy Renaldy Pratama Nugraha NIM: 10116371
Kelas : Teknik Kompilasi

10. <unsigned number> ::= <unsigned integer> | <unsigned real>

11. <unsigned integer> ::= <digit> {<digit>}

12. <unsigned real> ::= <unsigned integer> . <unsigned integer> | <unsigned


integer> . <unsigned integer> E <scale factor>| <unsigned integer> E
<scale factor>
Nama : Archy Renaldy Pratama Nugraha NIM: 10116371
Kelas : Teknik Kompilasi

13. <scale factor> ::= <unsigned integer> | <sign> <unsigned integer>

14. <sign> ::= + | -

15. <constant identifier> ::= <identifier>


Nama : Archy Renaldy Pratama Nugraha NIM: 10116371
Kelas : Teknik Kompilasi

16. <string> ::= '<character> {<character>}'

17. <type definition part> ::= <empty> | type <type definition> {;<type definition>};

18. <type definition> ::= <identifier> = <type>

19. <type> ::= <simple type> | <structured type> | <pointer type>


Nama : Archy Renaldy Pratama Nugraha NIM: 10116371
Kelas : Teknik Kompilasi

20. <simple type> ::= <scalar type> | <subrange type> | <type identifier>

21. <scalar type> ::= (<identifier> {,<identifier>})

22. <subrange type> ::= <constant> .. <constant>


Nama : Archy Renaldy Pratama Nugraha NIM: 10116371
Kelas : Teknik Kompilasi

23. <type identifier> ::= <identifier>

24. <structured type> ::= <array type> | <record type> | <set type> | <file type>

25. <array type> ::= array [<index type>{,<index type>}] of <component type>
Nama : Archy Renaldy Pratama Nugraha NIM: 10116371
Kelas : Teknik Kompilasi
26. <index type> ::= <simple type>

27. <component type> ::= <type>

28. <record type> ::= record <field list> end

29. <field list> ::= <fixed part> | <fixed part> ; <variant part> | <variant part>
Nama : Archy Renaldy Pratama Nugraha NIM: 10116371
Kelas : Teknik Kompilasi
30. <fixed part> ::= <record section> {;<record section>}

31. <record section> ::= <field identifier> {, <field identifier>} : <type> | <empty>

32. <variant type> ::= case <tag field> <type identifier> of <variant> { ; <variant>}

33. <tag field> ::= <field identifier> : | <empty>

34. <variant> ::= <case label list> : ( <field list> ) | <empty>

35. <case label list> ::= <case label> {, <case label>}


Nama : Archy Renaldy Pratama Nugraha NIM: 10116371
Kelas : Teknik Kompilasi

36. <case label> ::= <constant>

37. <set type> ::=set of <base type>

38. <base type> ::= <simple type>

39. <file type> ::= file of <type>

40. <pointer type> ::= <type identifier>


Nama : Archy Renaldy Pratama Nugraha NIM: 10116371
Kelas : Teknik Kompilasi
41. <variable declaration part> ::= <empty> | var <variable declaration> {; <variable
declaration>} ;

42. <variable declaration> ::= <identifier> {,<identifier>} : <type>

43. <procedure and function declaration part> ::= {<procedure or function


declaration > ;}

44. <procedure or function declaration > ::= <procedure declaration > | <function
declaration >

45. <procedure declaration> ::= <procedure heading> <block>


Nama : Archy Renaldy Pratama Nugraha NIM: 10116371
Kelas : Teknik Kompilasi
46. <procedure heading> ::= procedure <identifier> ; | procedure <identifier> (
<formal parameter section> {;<formal parameter section>} );

47. <formal parameter section> ::= <parameter group> | var <parameter group> |
function <parameter group> | procedure <identifier> { , <identifier>}

48. <parameter group> ::= <identifier> {, <identifier>} : <type identifier>

49. <function declaration> ::= <function heading> <block>

50. <function heading> ::= function <identifier> : <result type> ; | function


<identifier> ( <formal parameter section> {;<formal parameter section>} ) :
<result type> ;
Nama : Archy Renaldy Pratama Nugraha NIM: 10116371
Kelas : Teknik Kompilasi

51. <result type> ::= <type identifier>

52. <statement part> ::= <compund statement>

53. <statement> ::= <unlabelled statement> | <label> : <unlabelled statement>

54. <unlabelled statement> ::= <simple statement> | <structured statement>


Nama : Archy Renaldy Pratama Nugraha NIM: 10116371
Kelas : Teknik Kompilasi
55. <simple statement> ::= <assignment statement> | <procedure statement> | <go
to statement> | <empty statement>

56. <assignment statement> ::= <variable> := <expression> | <function identifier>


:= <expression>

57. <variable> ::= <entire variable> | <component variable> | <referenced variable>


Nama : Archy Renaldy Pratama Nugraha NIM: 10116371
Kelas : Teknik Kompilasi

58. <entire variable> ::= <variable identifier>

59. <variable identifier> ::= <identifier>

60. <component variable> ::= <indexed variable> | <field designator> | <file buffer>
Nama : Archy Renaldy Pratama Nugraha NIM: 10116371
Kelas : Teknik Kompilasi
61. <indexed variable> ::= <array variable> [<expression> {, <expression>}]

62. <array variable> ::= <variable>

63. <field designator> ::= <record variable> . <field identifier>

64. <record variable> ::= <variable>

65. <field identifier> ::= <identifier>

66. <file buffer> ::= <file variable>

67. <file variable> ::= <variable>


Nama : Archy Renaldy Pratama Nugraha NIM: 10116371
Kelas : Teknik Kompilasi

68. <referenced variable> ::= <pointer variable>

69. <pointer variable> ::= <variable>