Keyword definitions in the gpc compiler

Waldek Hebisch hebisch at
Thu Dec 6 20:57:57 CET 2007

Markus Gerwinski wrote:
> Hi Folks,
> can someone please point me to the file(s) with the definitions of the GPC
> keywords?
> I would like to attempt some changes to the compiler, that would require the
> introduction of new keywords. ("try", "except", "finally" and "property", to be
> specific.) So I grepped the p-directory for "object", "abstract" and some other
> common keywords, but didn't find the definitions, neither in the parser.y file,
> nor in any of the .c or .h files.

Keywords are defined in predef.def.  Grepping you will find a commented
out section containing definitions of "try", "except", "finally" and
"property".  Note however that those are Delphi keywords (property
is also in Object Pascal) -- giving them different meaning is not a
good idea.

> Since this is my very first attempt to modify the compiler itself, I would also
> appreciate any input (beyond section 12 of the GPC Manual) and examples on the> how-tos: Which files to modify, how to correctly invoke Bison etc.

Details depend on what you want to do.  I normally just use 'make'
to rebuild gpc -- 'make' will run Bison etc. if needed.  If you
need to do a lot of work on grammar running 'bison -v' may be
helpful ('-v' flag creates detailed report of the grammar).

                              Waldek Hebisch
hebisch at 

More information about the Gpc mailing list