[fpc-pascal] More syntax questions (part 2)

Adriaan van Os adriaan at adriaan.biz
Sat Dec 16 14:18:33 CET 2023


More questions about the FreePascal Language Reference (version 3.2.0)  part 2

17. For the following rules, I couldn't find a definition in the Language Reference. Can I assume 
they can all be defined as <identifier> ?

	object-type-identifier                 = identifier .
	field-identifier                       = identifier .
	interface-identifier                   = identifier .
	interface-type-identifier              = identifier .
	method-identifier                      = identifier .
	procedure-identifier                   = identifier .
	protocol-identifier                    = identifier .
	protocol-type-identifier               = identifier .
	qualified-method-identifier            = identifier .
	result-identifier                      = identifier .
	type-identifier                        = identifier .
	function-identifier                    = identifier .
	unit-identifier                        = identifier .
	variable-identifier                    = identifier .

18. Section 14.4.1 defines a rule <value-parameter>

	value-parameter = identifier-list ":" [ "ARRAY" "OF" ] parameter-type | identifier ":" 
type-identifier "=" default-parameter-value .

I couldn't find a rule for <parameter-type>. If <parameter-type> equals <type-identifier> then it 
may be easier to name it <type-identifier> ?

19. Sections 3.6, 14.2 and 15.2 refer to a rule <result-type>.

	function-header = "FUNCTION" formal-parameter-list ":" result-type .
	function-header = "FUNCTION" ( identifier | qualified-method-identifier ) formal-parameter-list 
":" result-type [ modifiers ] [ hintdirectives ] .
	operator-definition = "operator" ( assignment-operator-definition | arithmetic-operator-definition 
| comparision-operator-definition ) result-identifier ":" result-type ";" subroutine-block .

I couldn't find a rule for <result-type>. Can I assume ?

	result-type = type-identifier .

20. For the following rules, I couldn't find a definition in the Language Reference. Can I assume 
they can all be defined as <single-quoted-string> ?

	guid = single-quoted-string .
	string-constant-declaration = single-quoted-string .
	string-literal = single-quoted-string .
	stringconstant = single-quoted-string .

where <single-quoted-string> is a parser built-in rule that parses two consecutive single-quote 
chars as a literal single-quote char ? and that may not contain CR and LF characters  ? or any 
other control characters ?

21. Can I assume ?

	statement-list = statement { ";" statement } .
	statementlist = statement-list .

22. Various rules refer to a rule <variable-reference> for which I can't find the rule. What is it ?

23. Section 12.2 defines a rule <function-call> that references rules <qualified-method-designator> 
and <method-designator>.

	function-call = ( function-identifier | method-designator | qualified-method-designator | 
variable-reference ) [ actual-parameter-list ] .

I can't find the rules for <qualified-method-designator> and <method-designator>. What are they ?

24. Sections 14.4.1 and 14.4.4 define rules that refer to a rule <default-parameter-value>.

	value-parameter = identifier-list ":" [ "ARRAY" "OF" ] parameter-type | identifier ":" 
type-identifier "=" default-parameter-value .
	constant-parameter = "CONST" ( identifier-list [ ":" [ "ARRAY" "OF" ] type-identifier ] | 
identifier ":" type-identifier "=" default-parameter-value ) .

I can't find the rule for <default-parameter-value>. What is it ?

25. Section 16.2 defines a  rule <interface-part> that refers to a rule <property-declaration-part>

	interface-part = "INTERFACE"  [ uses-clause ]  { constant-declaration-part  | 
type-declaration-part | variable-declaration-part | property-declaration-part | 
procedure-headers-part } .

I can't find the rule <property-declaration-part>. What is it ?

(more to follow)






More information about the fpc-pascal mailing list