When compiling from the source on GitHub, you get this error:
I found a thread in Google groups that described how this problem could be resolved by using bison instead of Byacc. Even though I can confirm this is true, it still seems like an error that ought to be fixed? I'm not sure why Bison isn't report it. Explanation below:
In libpromises/cf3parse.y, both BUNDLE and BODY are declared on line 72 (https://github.com/cfengine/core/blob/master/libpromises/cf3parse.y#L72). YYEOF really isn't declared in this file, and that is why the error is showing up.
Here is the commit that added this code, in which YYEOF is not declared: https://github.com/cfengine/core/commit/3548a768220c95a6fd8f4ad8912b96d13c8495c6. This commit was first introduced in the tag 3.5.x-branchpoint.
I recommend removing the YYEOF condition in the if statement, or else declaring YYEOF with the others on line 72. Here's my pull request with my recommendation: https://github.com/cfengine/core/pull/2923