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 >
Wrap
Text File
|
1984-04-29
|
6KB
|
213 lines
UPPER CASE means that this reserved word must appear literaly.
identifier
------------> letter ------------------------>
^ |
|-- letter <--|
|-- digit <--|
number
------------> digit -------->
^ |
|---------------|
constant
-----------> number ---------------------------------------------->
| ^
|--> constant identifier ----------------------------|
| ^ | |
| |-- constant <-- + --| |
| |
| |
|--> ' --> character --> ' ----------------------|
simple type
----------------> type identifier ---------------->
| ^
|--> ( ----> identifier -----> ) --|
| ^ | |
| |------ , <----| |
| |
|--> constant --> .. --> constant ---|
type
----------------> simple type -------------------------------->
| ^
|--> ARRAY --> [ --> simple type --> ] --| |
| |
|----------------------------------------| |
| |
|--> OF --> simple type ---------------------|
variable
------------> variable identifier ---------------------------->
| |
|---------------------------| |
| |
|--> [ --> expression --> ] --|
factor
------------> ' -----> character -----> ' ---------------->
| ^ | |
| |----------------| |
| |
|--> variable --------------------------------->|
| |
|--> function identifier ---------------------->|
| | |
| |-----------------------| |
| | |
| |--> ( -----> expression -----> ) ------>|
| ^ | |
| |----- , <------| |
| |
|--> ( --> expression --> ) --------------->|
| |
|--> constant ----------------------------------|
term
------------> factor -------------------------------->
^ |
|-- factor <----- * <--|
^ |
|-- / <--|
|-- AND <--|
simple expression
-----------> + -------> term -------------------------------->
| ^ ^ |
|--> - --| |-- term <----- + <--|
^ |
|-- - <--|
|-- OR <--|
expression
-----------> simple expression -------------------------------------->
| ^
|--> = -----> simple expression --|
| ^
|--> < --|
|--> > --|
|--> <> --|
|--> <= --|
|--> >= --|
parameter list
-------------------------------------------------------------------------->
| |
|--> ( -----> identifier -----> : --> type identifier -----> ) --|
^ ^ | |
| |----- , <-----| |
| |
|----------------------- ; <------------------|
statement
--------------------------------------------------------------------->
| ^
|-----> variable ----------------> := --> expression --------->|
| | ^ |
| |--> function identifier --| |
| |
|--> procedure identifier -------------------------------------->|
| | |
| |<-----------------------| |
| | |
| |--> ( ------------------> expression -----> ) ---------->|
| | ^ ^ | |
| |--> VAR --| |------ , <-----| |
| |
|--> BEGIN -----> statement -----> END ------------------------->|
| ^ | |
| |----- ; <-----| |
| |
|--> IF --> expression --> THEN --> statement ------------------>|
| | |
| |<--------| |
| | |
| |--> ELSE --> statement -->|
| |
|--> CASE --> expression --> OF ------------------------> END -->|
| | ^ |
| |<-----------------------------| | |
| | | |
| |-----> constant --> : --> statement ------------>| |
| ^ | | | |
| |--------------- ; ---------------| | | |
| | | |
| |<---------------------------| | |
| | | |
| |--> ELSE --> statement ------------->| |
| |
|--> WHILE --> expression --> DO --> statement ----------------->|
| |
|--> REPEAT -----> statement -----> UNTIL --> expression ------->|
| ^ | |
| |----- ; <-----| |
| |
|--> GET --> # --> constant --> ( --> variable --> ) ----->|
| |
|--> PUT --> # --> constant --> ( --| |
| | |
| |<--------------------| |
| | |
| |-----> expression -------------------> ) -->|
| ^ | ^ | |
| | |--> # --| | |
| | | |
| |---------- , <---------------| |
| |
|--> FOR --> variable identifier --> := --> expression --| |
| |
|<-------------------------------------------------| |
| |
|-----> DOWNTO -----> expression --> DO --> statement -->|
| ^
|----> TO ----|
block
-----------> CONST -----> identifier --> = --> constant --|
| ^ |
| | |
|<------------------------------------- ; <-------|
|
|--> TYPE ------> identifier --> = --> type ------|
| ^ |
| | |
|<------------------------------------- ; <-------|
|
|--> VAR -------> identifier -----> : --> type identifier ---|
| ^ | |
| |<----- , ------| |
| ^ |
|<-------------------------------------------------------------|
|
|<----- ; <----- block <----- ; <--------------------|
| |
|-----> procedure -----> identifier --> parameter list --|
| | ^
| |--> function ---|
|
|--> begin -----> statement -----> end -------------------->
^ |
|----- ; <-----|
program
------------> block --> . ---------------------------------------->