home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / SIMTEL / CPMUG / CPMUG050.ARK / PASYNTAX.DOC < prev    next >
Text File  |  1984-04-29  |  6KB  |  213 lines

  1.  
  2.  
  3. UPPER CASE means that this reserved word must appear literaly.
  4.  
  5.  
  6.  
  7. identifier
  8. ------------> letter ------------------------>
  9.             ^          |
  10.             |-- letter <--|
  11.             |-- digit  <--|
  12.  
  13.  
  14. number
  15. ------------> digit -------->
  16.     ^            |
  17.     |---------------|
  18.  
  19.  
  20. constant
  21. -----------> number ---------------------------------------------->
  22.     |                             ^
  23.     |--> constant identifier ----------------------------|
  24.     |               ^              |  |
  25.     |               |-- constant <--  +  --|  |
  26.     |                             |
  27.     |                             |
  28.     |-->  '  --> character -->  '  ----------------------|
  29.  
  30.  
  31. simple type
  32. ----------------> type identifier ---------------->
  33.     |                       ^
  34.     |-->  (  ----> identifier ----->  )  --|
  35.     |       ^            |           |
  36.     |       |------  ,  <----|           |
  37.     |                       |
  38.     |--> constant -->  ..  --> constant ---|
  39.  
  40.  
  41. type
  42. ----------------> simple type -------------------------------->
  43.     |                        ^
  44.     |--> ARRAY -->  [  --> simple type -->  ] --|   |
  45.                             |   |
  46.        |----------------------------------------|   |
  47.        |                        |
  48.        |--> OF --> simple type ---------------------|
  49.  
  50.  
  51. variable
  52. ------------> variable identifier ---------------------------->
  53.                     |      |
  54.     |---------------------------|      |
  55.     |                  |
  56.     |-->  [  --> expression -->  ]  --|
  57.  
  58.  
  59. factor
  60. ------------>  '  -----> character ----->  '  ---------------->
  61.     |        ^             |            |
  62.     |        |----------------|            |
  63.     |                        |
  64.     |--> variable --------------------------------->|
  65.     |                        |
  66.     |--> function identifier ---------------------->|
  67.     |               |            |
  68.     |  |-----------------------|            |
  69.     |  |                        |
  70.     |  |-->  (  -----> expression ----->  )  ------>|
  71.     |          ^            |        |
  72.     |          |-----  ,  <------|        |
  73.     |                        |
  74.     |-->  (  --> expression -->  )  --------------->|
  75.     |                        |
  76.     |--> constant ----------------------------------|
  77.  
  78.  
  79. term
  80. ------------> factor -------------------------------->
  81.     ^             |
  82.     |-- factor <-----  *  <--|
  83.               ^         |
  84.               |--  /  <--|
  85.               |-- AND <--|
  86.  
  87. simple expression
  88. ----------->  +  -------> term -------------------------------->
  89.     |       ^ ^                |
  90.     |-->  -  --| |-- term <-----  +  <--|
  91.                  ^        |
  92.                  |--  -  <--|
  93.                  |--  OR <--|
  94.  
  95.  
  96. expression
  97. -----------> simple expression -------------------------------------->
  98.                 |                    ^
  99.                 |-->  =  -----> simple expression --|
  100.                 |       ^
  101.                 |-->  <  --|
  102.                 |-->  >  --|
  103.                 |-->  <> --|
  104.                 |-->  <= --|
  105.                 |-->  >= --|
  106.  
  107.  
  108. parameter list
  109. -------------------------------------------------------------------------->
  110.  |                                  |
  111.  |--> ( -----> identifier -----> : --> type identifier -----> ) --|
  112.      ^ ^            |                 |
  113.      | |-----  ,  <-----|                 |
  114.      |                         |
  115.      |-----------------------  ;  <------------------|
  116.  
  117.  
  118.  
  119. statement
  120. --------------------------------------------------------------------->
  121.  |                                  ^
  122.  |-----> variable ---------------->  :=  --> expression --------->|
  123.  |  |                   ^                  |
  124.  |  |--> function identifier --|                  |
  125.  |                                  |
  126.  |--> procedure identifier -------------------------------------->|
  127.  |                 |                      |
  128.  |  |<-----------------------|                      |
  129.  |  |                                  |
  130.  |  |-->  (  ------------------> expression ----->  )  ---------->|
  131.  |           |      ^ ^              |              |
  132.  |           |--> VAR --| |------  ,  <-----|              |
  133.  |                                  |
  134.  |--> BEGIN -----> statement -----> END ------------------------->|
  135.  |          ^               |                  |
  136.  |          |-----  ;  <-----|                  |
  137.  |                                  |
  138.  |--> IF --> expression --> THEN --> statement ------------------>|
  139.  |                             |          |
  140.  |                       |<--------|          |
  141.  |                       |              |
  142.  |                       |--> ELSE --> statement -->|
  143.  |                                  |
  144.  |--> CASE --> expression --> OF ------------------------> END -->|
  145.  |                   |              ^          |
  146.  |  |<-----------------------------|              |          |
  147.  |  |                                |          |
  148.  |  |-----> constant --> : --> statement ------------>|          |
  149.  |     ^                   | |          |          |
  150.  |     |---------------  ;  ---------------| |        |          |
  151.  |                         |        |          |
  152.  |        |<---------------------------|        |          |
  153.  |        |                      |          |
  154.  |        |--> ELSE --> statement ------------->|          |
  155.  |                                  |
  156.  |--> WHILE --> expression --> DO --> statement ----------------->|
  157.  |                                  |
  158.  |--> REPEAT -----> statement -----> UNTIL --> expression ------->|
  159.  |           ^        |                  |
  160.  |           |-----  ;  <-----|                  |
  161.  |                                  |
  162.  |--> GET -->  #  --> constant -->  (  --> variable -->  )  ----->|
  163.  |                                  |
  164.  |--> PUT -->  #  --> constant -->  (  --|              |
  165.  |                     |              |
  166.  |           |<--------------------|              |
  167.  |           |                          |
  168.  |           |-----> expression ------------------->  )  -->|
  169.  |              ^            |       ^  |          |
  170.  |              |            |-->  #  --|  |          |
  171.  |              |                      |          |
  172.  |              |----------  ,  <---------------|          |
  173.  |                                  |
  174.  |--> FOR --> variable identifier -->  :=  --> expression --|      |
  175.                                 |      |
  176.      |<-------------------------------------------------|      |
  177.      |                              |
  178.      |-----> DOWNTO -----> expression --> DO --> statement -->|
  179.         |          ^
  180.         |----> TO ----|
  181.  
  182.  
  183. block
  184. -----------> CONST -----> identifier -->  =  --> constant --|
  185.     |         ^                        |
  186.     |         |                        |
  187.     |<-------------------------------------  ;  <-------|
  188.     |
  189.     |--> TYPE ------> identifier -->  =  --> type ------|
  190.     |         ^                        |
  191.     |         |                        |
  192.     |<-------------------------------------  ;  <-------|
  193.     |
  194.     |--> VAR -------> identifier ----->  :  --> type identifier ---|
  195.     |         ^               |                       |
  196.     |         |<-----  ,  ------|                       |
  197.     |         ^                                   |
  198.     |<-------------------------------------------------------------|
  199.     |
  200.     |<-----  ;  <----- block <-----  ;  <--------------------|
  201.     |                             |
  202.     |-----> procedure -----> identifier --> parameter list --|
  203.     |  |            ^
  204.     |  |--> function ---|
  205.     |
  206.     |--> begin -----> statement -----> end -------------------->
  207.              ^              |
  208.              |-----  ;  <-----|
  209.  
  210.  
  211. program
  212. ------------> block -->  .  ---------------------------------------->
  213.