Hi there,
I have a problem compiling the following parser with gcc-3.3 in a 64 bit
environment: the compiler consumes a lot of cpu time, but never returns.
On my old 32 bit box I could compile a similar parser without problems. Also I
can compile this parser with gcc-3.3 -m32. With gcc-4.1 I can build a 64 bit
version but due to company restrictions I have to use the gcc-3.3.
Thanks for any suggestions.
Jörg
-----------------------
parser definition
my_parser.h
-----------------------
#ifndef my_parser_h
#define my_parser_h
#include
#include // closure
struct my_closure : boost::spirit::closure< my_closure, bool > {
member1 match;
};
struct my_parser : public boost::spirit::grammar < my_parser,
my_closure::context_t > {
my_parser () {}
template <typename ScannerT>
struct definition {
definition ( my_parser const& self ) {
top = boost::spirit::str_p( "a" )[ self.match = phoenix::arg1 ];
}
typedef boost::spirit::rule< ScannerT, my_closure::context_t > rule_t;
boost::spirit::rule< ScannerT > top;
boost::spirit::rule< ScannerT > const&
start () const {
return top;
}
};
};
#endif // my_parser_h
------------------
test program
------------------
#include "my_parser.h"
int main () {
my_parser parser;
bool match = false;
boost::spirit::parse_info<> info =
parse( "a and b or c",
parser[ phoenix::var( match ) = phoenix::arg1 ],
boost::spirit::space_p );
if ( info.full ) {
return match;
} else {
return -1;
}
}