0% found this document useful (0 votes)
272 views

Appendix A. Pascal Syntax Flow

The document provides a Pascal syntax flow graph copied from the "Pascal User Manual and Report" by Kathleen Jensen and Niklaus Wirth. The flow graph outlines the syntax rules and hierarchy of Pascal language elements such as programs, blocks, statements, expressions, variables, types and constants. It displays the components and order of these elements through graphical notation.

Uploaded by

kims3515354178
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
272 views

Appendix A. Pascal Syntax Flow

The document provides a Pascal syntax flow graph copied from the "Pascal User Manual and Report" by Kathleen Jensen and Niklaus Wirth. The flow graph outlines the syntax rules and hierarchy of Pascal language elements such as programs, blocks, statements, expressions, variables, types and constants. It displays the components and order of these elements through graphical notation.

Uploaded by

kims3515354178
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 7

Appendix A

Pascal Syntax Flow Graph


This Pascal syntax flow graph is a copy from “Pascal User Manual and Report” by Kathleen Jensen and Niklaus
Wirth (Springer-Verlag, 1974) with a courtesy of the publisher. Refer this book for further details of Pascal
grammar.

1
Pascal Syntax Flow Graph
<program>
PROGRAM identifier ( identifier ) ; block .

<block> ,
LABEL Unsigned integer
,
;

CONSTANT identifier = constant

TYPE identifier = type

VAR identifier : type


,
;

; block ;

PROCEDURE identifier parameter list

FUNCTION identifier parameter list : identifier

BEGIN statement END


2
unsigned integer : <statement> Pascal Syntax Flow Graph

variable := expression

function identifier ,

function identifier ( expression )

; procedure identifier

BEGIN statement END

IF expression THEN statement ELSE statement

CASE expression OF constant : statement END

,
;
WHILE expression DO statement

REPEAT expression UNTIL statement


statement
; DOWNTO

FOR Variable identifier := expression TO expression DO

WITH variable DO statement

,
GOTO unsigned integer 3
Pascal Syntax Flow Graph

<identifier>
letter <unsigned integer>
letter
digit
digit

<unsigned number>
+
unsigned integer . unsigned integer E unsigned integer
-

<unsigned constant> <constant>


constant identifier + constant identifier

unsigned number unsigned number


-
NIL
' character '
' character '

4
Pascal Syntax Flow Graph
<type>
simple type
<simple type>
 type identifier
type identifier
PACKED ,
( identifier ) simple type type
ARRAY [ ] OF
,
FILE OF type
constant .. constant
SET OF simple type

<field list> RECORD field list END


;

identifier : type

CASE identifier : type identifier OF

;
,
constant : ( field list )
5
Pascal Syntax Flow Graph
<variable>
variable identifier

field identifier [ identifier ]

. field identifier <term>


 factor

<factor> factor
unsigned constant
*
variable
,
/
function identifier ( expression )
DIV
( expression )
MOD
NOT factor

AND
[ ]

expression .. expression

,
6
Pascal Syntax Flow Graph
<simple Expression>
+
term
-
+ - OR

<expression> term

simple expression

= < >    IN

simple expression
<parameter list>

( identifier : type identifier )

FUNCTION ,

VAR ,

PROCEDURE identifier

You might also like