home *** CD-ROM | disk | FTP | other *** search
-
-
- 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 --> . ---------------------------------------->
-