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

Re: C++ code generation

Expand Messages
  • Per Bernhardsson
    This discussion is heading a bit off topic, bu I can t let this go unanswered. Gcc 2.7.2 does not support STL very well to say the least, I think it s got
    Message 1 of 12 , Jun 15 11:21 PM
      This discussion is heading a bit off topic, bu I can't let this go
      unanswered. Gcc 2.7.2 does not support STL very well to say the least,
      I think it's got something to do with a bad template
      implementation. If you instead use egcs 1.1 (I think) or later you
      will be able to compile the generated code without problem. There is a
      gcc 2.8 now which I haven't tried so it might work also.

      Other interesting things about egcs it is a modified gcc so that the
      improvements there will be merged into the main gcc branch and create
      (I things go as planned) gcc 2.9 which will then naturally support the
      full STL implementation.

      / Per
    • Henk Jansen
      Antlr 2.6.0 + egcs-19990524 (snapshot) works FINE for me on Linux, RedHat 5.2. (don t know about earlier versions). -- -Ir. Henk Jansen -
      Message 2 of 12 , Jun 16 4:53 AM
        Antlr 2.6.0 + egcs-19990524 (snapshot) works FINE for me on
        Linux, RedHat 5.2. (don't know about earlier versions).

        --
        -Ir. Henk Jansen - hjansen@... - phone/fax +31(0)15-278-7295/7209-
        - Dept. of Mathematics and Computer Science - Delft University of Technology -
        ----------- http://ta.twi.tudelft.nl/users/hjansen/H.Jansen.html -------------
      • vivek bhaskar
        Hi, I am working on antlr 2.7.1, to generate C++ code. Actually i had started with antlr 2.7.2, but even after repeated try, i was not able to produce static
        Message 3 of 12 , Apr 28, 2003
          Hi,
          I am working on antlr 2.7.1, to generate C++ code. Actually i had started
          with antlr 2.7.2, but even after repeated try, i was not able to produce
          static lib for c++ given in antlr/lib/cpp, due to one consistent error in
          code and thus shifted to 2.7.1.

          Here, i tried to generate C++ code, in which i call a function say,
          void myfunction(string &mystruing)
          and use a global variable
          string myvar;

          so i put both in header as
          header{
          #include ...

          void myfunction(string &mystruing);
          string myvar;
          }

          But to my utter surprise it start throwing error as it doesnt' recognise
          "string" as a type, and so had to shift to char*. Although i am able to get
          correct result yet(i hope i will), but now it successfully compiled.

          so, my question is this:
          Is any body working on antlr, taking care of C++ features, as the current
          versions, support antlr only for namesake?


          Lastly:
          when in java parser i did,

          left: r=right { use r}..it worked.

          But when i tried same in parser, to generate C++, it gave error and
          thus i had only choice, to use tree parser. Can anbody illustrate this
          problem?

          vivek














          _________________________________________________________________
          Hot picks. Free downloads. http://www.msn.co.in/musicnew/musicshop Visit
          music shop
        • Ric Klaren
          Hi, ... 2.7.1 is buggy YMMV. Check the archives for fixes for MSVC that were posted after 2.7.2 release. When I get some time I plan to release or a devel
          Message 4 of 12 , Apr 28, 2003
            Hi,

            On Mon, Apr 28, 2003 at 04:04:03PM +0530, vivek bhaskar wrote:
            > I am working on antlr 2.7.1, to generate C++ code. Actually i had started
            > with antlr 2.7.2, but even after repeated try, i was not able to produce
            > static lib for c++ given in antlr/lib/cpp, due to one consistent error in
            > code and thus shifted to 2.7.1.

            2.7.1 is buggy YMMV. Check the archives for fixes for MSVC that were posted
            after 2.7.2 release. When I get some time I plan to release or a devel
            snapshot or see if we can get a official release with fixes for MSVC and
            other stuff that popped up after 2.7.2 release.

            > Here, i tried to generate C++ code, in which i call a function say,
            > void myfunction(string &mystruing)
            > and use a global variable
            > string myvar;
            >
            > so i put both in header as
            > header{
            > #include ...
            >
            > void myfunction(string &mystruing);
            > string myvar;
            > }

            The header section is not really the place to place a declaration like
            that. Check out the docs:

            http://www.antlr.org/doc/cpp-runtime.html#_template

            Also could be that you omitted a std:: prefix somewhere, depending on your
            compiler and it's settings. Also try looking at the generated code and see
            if things are in the places where you expect them.

            > so, my question is this:
            > Is any body working on antlr, taking care of C++ features, as the current
            > versions, support antlr only for namesake?

            I take care of C++ stuff mostly. Yet off late I'm having trouble finding
            time. Development platform is the Gnu C++ compiler. Compilers I test on
            before release are various gcc's and one or two Sun CC version, I don't
            have access to more. MSVC I usually receive post mortem fixes for (after
            release)

            > Lastly:
            > when in java parser i did,
            >
            > left: r=right { use r}..it worked.
            >
            > But when i tried same in parser, to generate C++, it gave error and
            > thus i had only choice, to use tree parser. Can anbody illustrate this
            > problem?

            If you illustrate what your problem exactly is I might be able to help. It
            is really no help to post the working java code and not the non working C++
            code. Rest assured that I use this stuff daily and it works.

            Cheers,

            Ric
            --
            -----+++++*****************************************************+++++++++-------
            ---- Ric Klaren ----- j.klaren@... ----- +31 53 4893722 ----
            -----+++++*****************************************************+++++++++-------
            "I think we better split up."
            "Good idea. We can do more damage that way."
            --- Ghostbusters
          Your message has been successfully submitted and would be delivered to recipients shortly.