c.ebnf
contains grammar ofr C99. Note that this is ANSI C, not ISO C, so there are some omissions. The reason I wrote this is, I am currently writing a C compiler, with my own backend (and hopefully, frontend) in OCaml. And I needed to collect the grammar in one place.
Reading EBNF grammars is pretty simple:
- Enclosed within two
?
s is a global capture, it does not mean optional. It means 'I am writing a free-style sentence'. - Enclosed within
{
and}
means : repeat at least zero times - Enclosed within
[
and]
means : this is optional - Enclosed within
(
and)
means : this is a group