Loading ...
Sorry, an error occurred while loading the content.
 

Problem with ANTLR generated C++ code

Expand Messages
  • Rich Heller
    Hey, I m running RedHat Linux using the g++ compiler. I downloaded ANTLR 2.7.1 and there seems to be a problem with the way the code is generated for C++.
    Message 1 of 1 , Dec 8, 2000
      Hey,

      I'm running RedHat Linux using the g++ compiler. I downloaded ANTLR 2.7.1
      and there seems to be a problem with the way the code is generated for
      C++. The problem happens when it prints something that looks like

      if(some stuff){
      ...
      } else if true {
      } else
      ...
      }


      The "else if true" part has an empty body. The problem is that not
      having parenthesis around "true" is a syntax error with the GNU
      compiler. Looking through CppCodeGenerator.java, there are places where

      println("else if " + e +" {");

      is used. This should probably be changed to

      println("else if (" + e +") {");

      Thanks,
      Rich
    Your message has been successfully submitted and would be delivered to recipients shortly.