Activity for cppbison

  • Lowell Boggs, Jr. Lowell Boggs, Jr. modified a comment on discussion General Discussion

    Optional grammar fragments can be a problem too. If you want to try using optional syntax, use google to search for that. I advise against it. Instead of thinking in terms of optional syntax fragments, instead think of two different fragments -- one with the seemingly optional part, and one without. The problem with optional fragments is that they seem to be magnets for bison errors. For example, a source module may or may not define any grammar fragments -- it might be empty or only comments. You...

  • Lowell Boggs, Jr. Lowell Boggs, Jr. posted a comment on discussion General Discussion

    Optional grammar fragments can be a problem too. Instead of thinking in terms of optional syntax fragments, instead thing of two different fragments -- one with the seemingly optional part, and one without. The problem with optional fragments is that they seem to be magnets for bsion errors. I try to reserve optional syntax for the one case it has to exist: An empty source file should be allowed, so you have a top level, module level grammar fragment that either has definitions in it or it does....

  • Lowell Boggs, Jr. Lowell Boggs, Jr. posted a comment on discussion General Discussion

    More good advice: don't duplicate syntax fragments textually -- instead make a grammar fragment and use it instead of the duplication. This doesn't prevent all painful debug sessions with bison error messages, but it does reduce them quite a bit. For example, don't do this: target: OPEN_PAREN FRED CLOSE_PAREN other stuff; second: OPEN_PAREN FRED CLOSE_PAREN even more stuff; I'm not positive this exact text will get you into trouble, but you get the idea: duplicating fragments will ultimately burn...

  • Lowell Boggs, Jr. Lowell Boggs, Jr. posted a comment on discussion General Discussion

    By the way, as bison runs, it writes several kinds of diagnostic information to the file, mc_parser.all. Please use google to find out what it all means. However, it does provide the raw data needed to think through most problems. However, if you make many changes at once, that process may be extremely painful.

  • Lowell Boggs, Jr. Lowell Boggs, Jr. posted a comment on discussion General Discussion

    Please address Makefile questions in this topic. Note that you can add new source files (.cpp and .h) to the directory without modifying the Makefile. They will be picked up automatically and dependencies will be created for them automatically. Note that this Makefile is meant only to build a single program from all the source in the directory -- so don't try to add a second program or a library to it -- unless you want to take on the challenge of keepign the automatic behaviors working correctly....

  • Lowell Boggs, Jr. Lowell Boggs, Jr. posted a comment on discussion General Discussion

    Understanding problems in a bison grammar can be challenging. The best advice I can give is to move slowly. That is, do not type in a bunch of grammar changes then expect to debug what is wrong with them. Instead, plan out the changes, then enter them into the grammar file one at a time, fully test all the language fragments your change is supposed to address. Run all your tests. Save the state the whole directory using "make backup", then add the next grammar fragment.

  • Lowell Boggs, Jr. Lowell Boggs, Jr. posted a comment on discussion General Discussion

    Althought I didn't create the basic mechanism for this solution, I can answer some questions about how to do things and would be happy to, given time limitations, in the forum. Google provides a lot of good examples on how to do things with flex and bison. Unfortunately, you may have to read more than the first search result to find what you are looking for. Good luck.

  • cppbison cppbison released /c++bison.zip

  • cppbison cppbison released /README.md

  • cppbison cppbison released /c++bison.zip

1
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.