The source for the grammar is
Richards, Martin, and Colin Whitby-Strevens. BCPL:
the language and its compiler. Cambridge University Press, 1981.,
Chapter 8. The grammar was entered by hand and the adapted to Antlr4.
Afterwards, the script transform.sh
, which uses Trash to
remove mutual left recursion, and define an appropriate partition between
lexer and parser.
The examples included we[re gathered from the Internet. The best source is the source for the compiler, bcpl.gtz.
March 14, 2021.