The first chapter, Pascal introduction
First, the basic grammatical unit of Pascal
1. Basic symbols
A--z;a--z;0--9;+,-,*,/,=,<>,<=,>=,<,>, (,), [,],{,},:=,,,;,.,:,.., ', ^
Note: Pascal language must not use any other symbols other than the basic symbols set out above.
2. Reserved words
And,array,begin,case,const,div,do,diwnto,else,end,file,for,funtion,goto,if,label,mod,nil,of,or,packed, Procedure,program,record,repeat,set,then,to,type,until,var,while,with.
Note: The file name cannot be the same as the reserved word.
3. Identifiers
An alphanumeric string that starts with a letter and is less than or equal to 8 in length.
Standard identifiers (39 total):
Standard constants:
False,true,maxint
Standard type:
Integer,real,char,boolean,text
Standard file:
Input,output
Standard functions:
ABS,ARCTAN,CHR,COS,EOF,EOLN,EXP,LN,ODD,ORD,ORED,ROUND,SIN,SQR,
Sqrt,succ,trunc
Standard process:
Get,new,pack,page,put,read,readln,reset,rewrite,unpack,write, Writeln
II. Structure of the program
1, consists of three parts: the first part of the program, the Description section, the statement part.
Program name (input,output);
{......} Explain
CONST
pi=3.14159;
Var
R,l,s:real;
BEGIN
Write (' Input r: ');
Read (R);
L:=2*pi*r;
Write (' l= ', L, ' s= ', s);
END;
2, a large number of use of punctuation, reserved words without punctuation (end except).
Delphi's Basic Pascal Syntax (Chapter I. PASCAL introduction)