Skip to content

[Bug] Bison file prefixes for C/C++ not generating correctly #172

Closed

Description

@dcavar

When generating C or C++ and using prefixes, the generated Bison-file is missing the prefixes in the error function. Example (take any well-formed and otherwise working Test.cf):

bnfc -m --cpp -p test Test.cf

the generated Test.y will have missing prefixes in the error function:

void testyyerror(const char *str)
{
  extern char *testyytext;
  fprintf(stderr,"error: line %d: %s at %s\n", 
    yy_mylinenumber, str, yytext);
}

but it should prepend the prefixes on all the variable references in that function:

void testyyerror(const char *str)
{
  extern char *testyytext;
  fprintf(stderr,"error: line %d: %s at %s\n", 
    testyy_mylinenumber, str, testyytext);
}

Activity

  1. pascalh commented on Mar 8, 2016

    @pascalh
    Contributor

    I applied the suggested changes to the C++-backend in my branch. Please confirm that my changes solve the issue.

  2. dcavar commented on Mar 8, 2016

    @dcavar
    Author

    Dear Pascal,

    As far as I can tell, the Bison-issue is not solved. The previous issues with multi-character comment delimiters seem to be solved, though.

    DC

    On 03/08/2016 08:20 AM, Pascal Hof wrote:

    I applied the suggested changes to the C++-backend in my branch
    https://github.com/pascalh/bnfc/tree/issue172. Please confirm that my
    changes solve the issue.

    —
    Reply to this email directly or view it on GitHub
    #172 (comment).

    Damir Cavar
    https://linguistlist.org/people/damir_cavar.html

  3. changed the title [-]Prefixes not generating correctly .y files [/-] [+][Bug] Bison file prefixes for C/C++ not generating correctly[/+] on Jun 26, 2016
  4. gdetrez commented on Aug 23, 2016

    @gdetrez
    Contributor

    I believe that @pascalh's pull request #174 is solving this issue. @dcavar if you have time to test it and there is still a problem, feel free to re-open it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions