From: Maciej L. <Mac...@be...> - 2005-10-13 19:46:26
|
Hi All, I’ve made the latest version of OpenC++ based on the snapshot given by some of this list expert on Cygwin 1.5.18-1 (gcc 3.4.4.). Then, I was trying to compile one of the example that is injected with the distribution, as follows: $ occ2 BeforeClass.mc occ2: command failed: /usr/local/bin/occ --private--external-driver -E <BeforeClass.ii --private--output BeforeClass.occ.tmp 2>BeforeClass.feedback ..and the content of the BeforeClass.feedback is: $ cat BeforeClass.feedback /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/cpp_type_traits.h:83: parse error before `>' /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/cpp_type_traits.h:90: parse error before `template' /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/cpp_type_traits.h:102: parse error before `>' /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_tree.h:72: parse error before `std' /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_map.h:66: parse error before `std' /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_map.h:119: parse error before `typedef' /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_map.h:126: parse error before `typedef' /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_map.h:624: parse error before `template' /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_multimap.h:66: parse error before `std' /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/char_traits.h:49: parse error before `__gnu_cxx' The same output I get when I try to use other examples. Any suggestion? Best Rgds, Maciek Leks |
From: Jonathan G. <gt...@ma...> - 2005-10-13 20:00:58
|
Maciej Leks wrote: > Hi All, > > I=E2=80=99ve made the latest version of OpenC++ based on the snapshot g= iven > by some of this list expert on Cygwin 1.5.18-1 (gcc 3.4.4.). > > Then, I was trying to compile one of the example that is injected with > the distribution, as follows: > > $ occ2 BeforeClass.mc > occ2: command failed: /usr/local/bin/occ --private--external-driver > -E <BeforeClass.ii --private--output BeforeClass.occ.tmp=20 > 2>BeforeClass.feedback > > ..and the content of the BeforeClass.feedback is: > > $ cat BeforeClass.feedback > /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/cpp_type_traits.h:83= :=20 > parse error before `>' > /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/cpp_type_traits.h:90= :=20 > parse error before `template' > /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/cpp_type_traits.h:10= 2:=20 > parse error before `>' > /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_tree.h:72: > parse error before `std' > /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_map.h:66: > parse error before `std' > /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_map.h:119: > parse error before `typedef' > /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_map.h:126: > parse error before `typedef' > /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_map.h:624: > parse error before `template' > /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_multimap.h:66:=20 > parse error before `std' > /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/char_traits.h:49: > parse error before `__gnu_cxx' > > The same output I get when I try to use other examples. > > Any suggestion? > > Best Rgds, > Maciek Leks > > > ------------------------------------------------------- > This SF.Net email is sponsored by: > Power Architecture Resource Center: Free content, downloads, discussion= s, > and more. http://solutions.newsforge.com/ibmarch.tmpl > _______________________________________________ > Opencxx-users mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/opencxx-users > Hi, I used the following commands to run the before example: occ2 ./BeforeClass.mc -o BeforeClass.exe ./BeforeClass.exe -- -g -o before-test ./before-test.cc Try them to see if they work or on which one the failure occures. Sincerely, Jonathan Gdalevich Georgia Institute of Technology, Atlanta Georgia, 30332 Email: gt...@pr... |
From: Scott D. F. <sd...@cs...> - 2005-10-13 20:07:07
|
Hi Maciek, Your problem looks like one that I've reported (and suggested a patch for) twice in recent history to the OpenC++ mailing list. I'm sure the maintainers will add a patch to the CVS repository and update the CVS snapshots soon (hint hint). Here's a copy of my previous post: There is a mistake in the grammar that OpenC++'s parser expects. Prior to GCC 3.4, this was never a problem, but since GCC 3.4, the STL library uses the syntax that the broken grammar doesn't accept. In particular OpenC++ expects template declarations to look like this: template<typename T>... With an identifier like "T" following typename, but in fact the following is legal C++: template<typename>... This causes occ to issue errors whenever it parses the GCC library files that include the latter syntax (e.g., bits/cpp_type_traits.h). I fixed the problem by changing the Parser::rTempArgDeclaration member function definition in parser/Parser.cc. I changed this line (roughly the third line in the function): if(t0 =3D=3D CLASS && lex->LookAhead(1) =3D=3D Identifier){ To this: if(t0 =3D=3D CLASS && !(lex->LookAhead(1) =3D=3D Identifier)){ lex->GetToken(tk1); decl =3D PtreeUtil::List(new Leaf(tk1)); } else if(t0 =3D=3D CLASS && lex->LookAhead(1) =3D=3D Identifier){ I am not positive that my Ptree representation for the template argument declaration (temp.arg.declaration) is exactly what the OpenC++ maintainers would want, but it seemed to make sense to me. Cheers, Scott On 10/13/05, Maciej Leks <Mac...@be...> wrote: > Hi All, > > I've made the latest version of OpenC++ based on the snapshot given by > some of this list expert on Cygwin 1.5.18-1 (gcc 3.4.4.). > > Then, I was trying to compile one of the example that is injected with th= e > distribution, as follows: > > $ occ2 BeforeClass.mc > occ2: command failed: /usr/local/bin/occ --private--external-driver -E > <BeforeClass.ii --private--output BeforeClass.occ.tmp > 2>BeforeClass.feedback > > ..and the content of the BeforeClass.feedback is: > > $ cat BeforeClass.feedback > /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/cpp_type_traits.h:83: > parse error before `>' > /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/cpp_type_traits.h:90: > parse error before `template' > /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/cpp_type_traits.h:102: > parse error before `>' > /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_tree.h:72: parse > error before `std' > /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_map.h:66: parse > error before `std' > /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_map.h:119: parse > error before `typedef' > /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_map.h:126: parse > error before `typedef' > /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_map.h:624: parse > error before `template' > /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_multimap.h:66: > parse error before `std' > /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/char_traits.h:49: pars= e > error before `__gnu_cxx' > > The same output I get when I try to use other examples. > > Any suggestion? > > Best Rgds, > Maciek Leks > > > ------------------------------------------------------- > This SF.Net email is sponsored by: > Power Architecture Resource Center: Free content, downloads, discussions, > and more. http://solutions.newsforge.com/ibmarch.tmpl > _______________________________________________ > Opencxx-users mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/opencxx-users > |
From: Grzegorz J. <sof...@ya...> - 2005-10-16 13:38:01
|
--- "Scott D. Fleming" <sd...@cs...> wrote: > Hi Maciek, > Your problem looks like one that I've reported (and suggested a patch > for) twice in recent history to the OpenC++ mailing list. I'm sure > the > maintainers will add a patch to the CVS repository and update the CVS > snapshots soon (hint hint). Here's a copy of my previous post: Scott, I am sorry, in the past few months I had very little resources to put into this. If you want to apply the patch yourself, go ahead (e-mail me if you need privledges). Guilles will be releasing 2.9 soon, ask him if he will be willing to sneak your contribution under this release. Even if not, take your time, apply the patch and we can release 2.10 then, even if it is soon after 2.9. BR Grzegorz > > There is a mistake in the grammar that OpenC++'s parser expects. > Prior > to GCC 3.4, this was never a problem, but since GCC 3.4, the STL > library > uses the syntax that the broken grammar doesn't accept. In > particular > OpenC++ expects template declarations to look like this: > > template<typename T>... > > With an identifier like "T" following typename, but in fact the > following is legal C++: > > template<typename>... > > This causes occ to issue errors whenever it parses the GCC library > files > that include the latter syntax (e.g., bits/cpp_type_traits.h). I > fixed > the problem by changing the Parser::rTempArgDeclaration member > function > definition in parser/Parser.cc. I changed this line (roughly the > third > line in the function): > > if(t0 == CLASS && lex->LookAhead(1) == Identifier){ > > To this: > > if(t0 == CLASS && !(lex->LookAhead(1) == Identifier)){ > lex->GetToken(tk1); > decl = PtreeUtil::List(new Leaf(tk1)); > } > else if(t0 == CLASS && lex->LookAhead(1) == Identifier){ > > I am not positive that my Ptree representation for the template > argument > declaration (temp.arg.declaration) is exactly what the OpenC++ > maintainers would want, but it seemed to make sense to me. > > Cheers, Scott > > > On 10/13/05, Maciej Leks <Mac...@be...> wrote: > > Hi All, > > > > I've made the latest version of OpenC++ based on the snapshot given > by > > some of this list expert on Cygwin 1.5.18-1 (gcc 3.4.4.). > > > > Then, I was trying to compile one of the example that is injected > with the > > distribution, as follows: > > > > $ occ2 BeforeClass.mc > > occ2: command failed: /usr/local/bin/occ --private--external-driver > -E > > <BeforeClass.ii --private--output BeforeClass.occ.tmp > > 2>BeforeClass.feedback > > > > ..and the content of the BeforeClass.feedback is: > > > > $ cat BeforeClass.feedback > > > /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/cpp_type_traits.h:83: > > parse error before `>' > > > /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/cpp_type_traits.h:90: > > parse error before `template' > > > /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/cpp_type_traits.h:102: > > parse error before `>' > > /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_tree.h:72: > parse > > error before `std' > > /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_map.h:66: > parse > > error before `std' > > /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_map.h:119: > parse > > error before `typedef' > > /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_map.h:126: > parse > > error before `typedef' > > /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_map.h:624: > parse > > error before `template' > > > /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_multimap.h:66: > > parse error before `std' > > > /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/char_traits.h:49: > parse > > error before `__gnu_cxx' > > > > The same output I get when I try to use other examples. > > > > Any suggestion? > > > > Best Rgds, > > Maciek Leks > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by: > > Power Architecture Resource Center: Free content, downloads, > discussions, > > and more. http://solutions.newsforge.com/ibmarch.tmpl > > _______________________________________________ > > Opencxx-users mailing list > > Ope...@li... > > https://lists.sourceforge.net/lists/listinfo/opencxx-users > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: > Power Architecture Resource Center: Free content, downloads, > discussions, > and more. http://solutions.newsforge.com/ibmarch.tmpl > _______________________________________________ > Opencxx-users mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/opencxx-users > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Stefan S. <se...@sy...> - 2005-10-13 20:23:13
|
Maciej Leks wrote: > Hi All, > > I’ve made the latest version of OpenC++ based on the snapshot given by > some of this list expert on Cygwin 1.5.18-1 (gcc 3.4.4.). > > Then, I was trying to compile one of the example that is injected with > the distribution, as follows: > > $ occ2 BeforeClass.mc > occ2: command failed: /usr/local/bin/occ --private--external-driver -E > <BeforeClass.ii --private--output BeforeClass.occ.tmp > 2>BeforeClass.feedback > > ..and the content of the BeforeClass.feedback is: Could you please post the actual code which occ complains about ? (Just the surrounding lines will probably do.) Chances are indeed that occ is getting to its limits with modern C++ code (such as the type traits). The problem stems from occ being a 'context-free' parser, when the actual C++ grammar is not context-free. Specifically, a conformant parser has to consider a symbol's type when it attemps to decide on a particular production. Depending on whether a given symbol corresponds to a variable, type, or template, the token stream is interpreted differently (expression or type-id ? relational-expression or template-id ? Etc.) As occ builds its symbol table only after the parsing stage is over, it has to rely on heuristics, which sometimes fail. I have been able to work with a (slightly enhanced) form of the OpenC++ parser class for some time, but as I'm now trying to parse template-heavy code, even my version fails. In the context of the synopsis project (http://synopsis.fresco.org) I have thus started to rewrite the Parser class from scratch. Regards, Stefan |
From: Maciej L. <Mac...@be...> - 2005-10-14 21:39:25
|
> Stefan wrote: > Could you please post the actual code which occ complains about ? (Just > the surrounding lines will probably do.) > > Chances are indeed that occ is getting to its limits with modern C++ > code (such as the type traits). > > The problem stems from occ being a 'context-free' parser, > when the actual C++ grammar is not context-free. Specifically, a > conformant > parser has to consider a symbol's type when it attemps to decide on > a particular production. Depending on whether a given symbol corresponds > to a variable, type, or template, the token stream is interpreted > differently > (expression or type-id ? relational-expression or template-id ? Etc.) > > As occ builds its symbol table only after the parsing stage is over, it > has to rely on heuristics, which sometimes fail. > > I have been able to work with a (slightly enhanced) form of the OpenC++ > parser class for some time, but as I'm now trying to parse template-heavy > code, even my version fails. > In the context of the synopsis project (http://synopsis.fresco.org) I > have thus started to rewrite the Parser class from scratch. > Thanks to all for rescue me :) Scott are right it is a problem with template parameter identifier, i.e. the error message I’ve attached in the first post: /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/cpp_type_traits.h:83: parse error before `>' points at: // Compare for equality of type template<typename, typename> I’ve made change in Parser.cc file as Scott wrote, and now it’s working well. At least I can start working with OpenC++ :) P.S. It’s worth taking Scott’s patch and make a new snapshot. Sincerely, Maciek Leks |