Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2023-12

string-type

2 messages · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Adriaan van Os

Section 3.2.4 of the FreePascal Language Reference defines <string-type>

string-type = "STRING" [ "[" unsigned-integer "]" ] | "TYPE" ( "STRING" | "ansistring" ) "(" unsigned-integer ")" .

Ansistring is shown in the syntax diagram in boldface and thus as a keyword. But it is not listed as either a modifier or a reserved word in section 1.3. I suggest instead to define <ansistring> as a type-identifier.

string-type = "STRING" [ "[" unsigned-integer "]" ] | "TYPE" ( "STRING" | ansistring ) "(" unsigned-integer ")" .
ansistring = type-identifier .

Regards,

Adriaan van Os

Adriaan van Os
to Adriaan van Os
Adriaan van Os wrote 12 lines
Section 3.2.4 of the FreePascal Language Reference defines <string-type> string-type = "STRING" [ "[" unsigned-integer "]" ] | "TYPE" ( "STRING" | "ansistring" ) "(" unsigned-integer ")" . Ansistring is shown in the syntax diagram in boldface and thus as a keyword. But it is not listed as either a modifier or a reserved word in section 1.3. I suggest instead to define <ansistring> as a type-identifier. string-type = "STRING" [ "[" unsigned-integer "]" ] | "TYPE" ( "STRING" | ansistring ) "(" unsigned-integer ")" . ansistring = type-identifier .

For other reasons, the indicated rule for <string-type> is not correct, as the size specifier and the codepage specifier can both be a <constant-identifier>. So, with that I think we get

string-type = "STRING" [ "[" ( unsigned-integer | constant-identifier ) "]" ] | "TYPE" ( "STRING" | ansistring ) "(" ( unsigned-integer | constant-identifier ) ")" .

Regards,

Adriaan van Os