Found a VERY cool utility call
ACK.
It's like grep on steroids (grep is a *nix tool to search files for matching strings).
It's written in perl (which is ok on Windows too, because perl is installed with the Git Windows package) which makes it totally cross-platform.
I'm using it to create a Keywords.txt file, without having to manually type in the keywords, or cut and paste.
Here's an example, pulling the keywords out of #define statements:
ack '#define (\w+)' cppbas.inc --output='$1'
And here is the output, ready for piping to a file:
MAIN
ENDMAIN
DECLARE
FUNCTION
ENDFUNCTION
DIM
AS
SUB
ENDSUB
BEGIN
END
AND
OR
CLASS
TYPE
ADDRESS
INCR
DECR
NEXT
PRIOR
BYREF
NOT
IF
THEN
ELSE
ENDIF
FOR
TO
STEP
SELECT
CASE
_TO_
ENDCASE
CASE_ELSE
ENDSELECT
WHILE
CONSTANT
STR
BOOL
integer
INTEGER
VECTOR
MAP
TRUE
FALSE
Now that only shows you your #defines. What if you also created functions for this project, and wanted to output those including those with a return type identifier like "$" for strings?
ack '^FUNCTION \w+ (\w+.|\w+)' cppbasrt.inc --output='$1''
REVERSE$
LTRIM$
RTRIM$
TRIM$
LEFT$
MID$
RIGHT$
INSTR
LCASE$
UCASE$
MCASE$
LOADFILE$
SPLITPATH$
ENC$
REPLACE$
And how about outputting the actual function prototypes?
ack '^FUNCTION (.+\))' cppbasrt.inc --output='$1'
CSTRING REVERSE$(CSTRING src)
CSTRING LTRIM$ (CSTRING s)
CSTRING RTRIM$ (CSTRING s)
CSTRING TRIM$ (CSTRING s)
CSTRING LEFT$ (CSTRING s, INTEGER length)
CSTRING MID$ (CSTRING s, INTEGER start, INTEGER length)
CSTRING RIGHT$ (CSTRING s, INTEGER length)
INTEGER INSTR (CSTRING s,CSTRING match,INTEGER offset)
CSTRING LCASE$ (CSTRING str)
CSTRING UCASE$ (CSTRING str)
CSTRING MCASE$ (CSTRING S)
CSTRING LOADFILE$ (CSTRING N)
CSTRING SPLITPATH$ (CSTRING FPATH, INTEGER mask)
CSTRING ENC$ (CSTRING A, INTEGER L, INTEGER R)
CSTRING REPLACE$(CSTRING subject, CONSTANT CSTRING& search, CONSTANT CSTRING& replace)
Having the ability to do this so easily will make it easier to document your keywords.
A.