So, this is a WIP. But it's enough that I can parse non-trivial trees, e.g.
VERSION {
VERS_1.1 { global: x; *; local: zelda; }; VERS_1.2 { local: z; }; VERS_1.3 { global: y; } VERS_1.1; VERS_1.4 { x; } VERS_1.3;
}
There are a couple of issues with the current code:
- It's not able to parse 'extern' : extern "C++" { ns::*; "f(int, double)"; };
- It currently thinks ':' is a token (which I'm not completely sure it's right). So, when parsing namespaces (see example above) it will fail.
Still, this is expressive enough to parse almost every single version script FreeBSD base system ships with (modulo bugs). I hope to collect feedback, implement semantic action, and only after that commit.