spirit giving error C1067 in VC++7

Lucian Wischik <lu.nn@wischik.com>
6 Feb 2003 00:08:34 -0500

          From comp.compilers

Related articles
spirit giving error C1067 in VC++7 lu.nn@wischik.com (Lucian Wischik) (2003-02-06)
Re: spirit giving error C1067 in VC++7 djowel@gmx.co.uk (Joel de Guzman) (2003-02-11)
| List of all articles for this month |

From: Lucian Wischik <lu.nn@wischik.com>
Newsgroups: comp.compilers
Date: 6 Feb 2003 00:08:34 -0500
Organization: University of Bologna
Keywords: parse, tools, question
Posted-Date: 06 Feb 2003 00:08:34 EST

I'm trying to use Spirit in my VisualC++7 project. It worked fine at
first. But now that the grammar has got bigger, it fails every time
with an error "C1047 compiler limit: debug information module size
exceeded". Does anyone have any advice, please?


There are two causes for the message: either a symbol has a decorated
name exceeding 247 characters, or that a "particular item such as an
enum has exceeded the 64k limit on the size of its debug record - when
you put merge lots of enums together it's not uncommon to exceed this
limit". I don't know which is the cause. I suspect it's the latter,
since the addition of even a trivial rule is enough to trigger the
problem.


One thing I should do, I suppose, is break it up into separate "units"
of some kind. Except I'm completely new to Spirit (this is my second
day of using it) so I don't have an idea of what kind of
breakups-into-units it allows. Can anyone advise, please?


Thanks in advance for any help! I've included my grammar, below. (I've
already written the grammar in JavaCC, and also on Yacc, but abandoned
yacc because I couldn't figure out how to C++ify it and unicodify it
and make it reentrant and and all that.)




struct pi_parser : public grammar<pi_parser>
{ vector<Expr>& estack; vector<PiTerm>& tstack;
    pi_parser(vector<Expr>& estack_, vector<PiTerm>& tstack_)
          : estack(estack_), tstack(tstack_) {}
    //
    template <typename ScannerT> struct definition
    { definition(pi_parser const& self)
        { integer = int_p[push_const<int>(self.estack)];
                  real = real_p[push_const<double>(self.estack)];
              string = confix_p('"', *c_escape_ch_p,'"')
                                                    [push_string(self.estack)];
            boolean = str_p("true")[push_bool(self.estack,true)]
                                        | str_p("false")[push_bool(self.estack,false)];
                  chan = lexeme_d[ (str_p("@@") >>
                                                *(alnum_p | ':') >>
                                                  "@@")[push_chan(self.estack)] ];
                      id = lexeme_d[ (alpha_p
                                              >> *(alnum_p | '_'))[push_var(self.estack)] ];
                  expr = integer | real | string | boolean | chan | id;
                exprs = !(expr >> *(',' >> expr));
          chanexpr = chan | id;
                  decl = (id >> id);
                decls = !(decl >> *(',' >> decl));
                    snd = (chanexpr >> '.' >> str_p("snd") >>
                                                !( '(' >> exprs >> ')'));
                    rcv = (chanexpr >> '.' >> str_p("rcv") >>
                                                !( '(' >> decls >> ')'));
              invoke = (chanexpr >> '(' >> exprs >> ')');
                sched = (decl >> '(' >> !(decl >> *(','>>decl)) >> ')'
                                          >> '{' >> prog >> '}');
                  prog = !(loose >> *('|' >> loose));
                loose = tight >> *('+' >> tight);
                tight = cmd >> *(';' >> cmd) >> !(str_p(";"));
                    cmd = snd | rcv>>'{'>>prog>>'}' | '{' >> prog >> '}'
                                        | !(decl >> '=') >> invoke;
        }
        rule<ScannerT> id, chan, boolean, string, real, integer;
        rule<ScannerT> expr, chanexpr, exprs, decl, decls;
        rule<ScannerT> snd, rcv, invoke;
        rule<ScannerT> prog, sched, loose, tight, cmd;
        rule<ScannerT> const& start() const {return integer;}
    };
};


--
Lucian Wischik, University of Bologna. www.wischik.com/lu


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.