You could use for example following in the *.uew file used to syntax highlight the language:
Code: Select all
/TGBegin "Procedures"
/TGFindStr = "^[\t ]*proc[\t ]+([a-z_][0-9a-z_]*)"
/TGBegin "Parameters"
/TGFindStr = "\s*([a-z_][0-9a-z_]*)[\t ]+As[\t ]+[a-z]+,?"
/TGFindBStart = "\("
/TGFindBEnd = "\)"
/TGEnd
/TGEnd
/Regexp Type = Perl
This block contains two
case-insensitive Perl regular expression search strings.
The first one is for finding procedures.
^ ... start each search at begin of a line.
[\t ]* ... find a horizontal tab or space
zero or more times. So a procedure line can have leading tabs/spaces.
proc ... after optional leading tabs/spaces the line must have the keyword
Proc.
[\t ]+ ... find a horizontal tab or space
one or more times.
(...
) ... capturing/tagging group. The string found by the expression inside the group should be displayed in the hierarchical function list.
[a-z_] ... find case-insensitive a single letter in range A-Z or an underscore.
[0-9a-z_]* ... find case-insensitive any digit or letter in range A-Z or underscore
zero or more times.
The inner group defines first a block start and a block end condition with
\( and
\). The block to search with the second regular expression should start after first occurrence of an opening
( found from beginning of a found procedure line and end before first occurrence of a closing
) found after opening
). This means for the example procedure line that the block to search with second regular expression is:
TaskID As Word,
TaskAddr As Dword,
Priority As Word,
Start As Word
The meaning of second Perl regular expression is:
\s* ... find any whitespace character according to Unicode standard including newline characters
zero or more times. So the parameters of a procedure can span also over multiple lines.
(...
) ... once again a capturing group for getting just the string matched by the expression inside this group displayed in hierarchical function list.
[a-z_] ... find case-insensitive a single letter in range A-Z or an underscore.
[0-9a-z_]* ... find case-insensitive any digit or letter in range A-Z or underscore
zero or more times.
[\t ]+ ... find a horizontal tab or space
one or more times.
As ... the next word must be
as in any case.
[a-z]+ ... find case-insensitive any letter in range A-Z
one or more times to match the type of the variable.
,? ... find a comma
zero or
one times, i.e. optionally matching a single comma.