wn project uses, hacked up everytime I think of a new
test, and not necessarily something everyone generally wants.
David Fang
Computer Systems Laboratory
Electrical & Computer Engineering
Cornell University
http://www.csl.cornell.edu/~fang/
-- (2400 baud? Net
fferent, I'm not
asking for a feature of one to be ported to the other. However, for
compatibility reasons, I cannot ask my users to use the experimental C++
parser, just not yet.
Fang
David Fang
Computer Systems Laboratory
Electrical & Computer Engineering
Cornell University
h
utput is still supported with C++
compilation given the success I've had with it, and seeing evidence of
accommodating C++ in the resulting output. (It would be a good thing to
maintain!) Since this (above) seems like an easy and safe fix, I hope
that it might be adopted. I can generate the pr
s to malloc in C++ mode. Thoughts?
Actually, I misspoke about the platform: it was occuring on ubuntu6 not 7.
Fang
David Fang
Computer Systems Laboratory
Electrical & Computer Engineering
Cornell University
http://www.csl.cornell.edu/~fang/
-- (2400 baud? Netscape 3.0?? lynx?
portable.
This issue is the same on at least 2.1 and 2.3. Does anyone else
see this issue on ubuntu7 or other UNIX system? (Another ubuntu7 distro
didn't have this issue, so I need to get more feedback from my bug
reporter.)
Fang
David Fang
Computer Systems Laboratory
Electri
> > When i run my parser on a VRML 2.0 file
> > or the DIVE VRML 1.0 parser on a VRML 1.0 file,
> > i get the following error, which is not too
> > informative:
> >
> > redblue.wrl:5: Error:
> > syntax error before '?'
> >
> > How can i get these error messages more informative,
> > for example ho
be made easier by exposing some sort of meta-skeleton, whereby the pieces
of the generated parser can be expressed as a framework and pieced
together using per-language templates. The common work of computing state
transition tables can be done in a front-end, like the old y.tab.cc.
Each "back-e
stomized allocator (e.g.
pool-allocator) to the container type, you can get significant speedup.
Also, std::vector has a useful reserve() member function that allows you
to pre-allocate memory, which can reduce expensive reallocations as a
result of push_back().
HTH,
Fang
David Fang
> Pick down some later version of Bison (2.3+); then, if you use the C
> parser, there is a %destructor command, that can be used to handle
> clean-up during error recovery. Another way is to use a C++ parser,
> and a semantic type that does cleanup via the C++ language, but one
> cannot then use %
> I tried before your solution using a common .h file for .lex and .yacc,
> however since I'm using "%pure-parser" in my .yacc, the YYSTYPE used in
> "yylex" proto is not visible to the .h itself.
Hi,
If you pass '-d' to bison, it should produce a header file with
enumerations and the definition
> bison --debug -px -o x.c -dv x_yacc.c
> g++ -c -o x_yacc.o x_yacc.c
>
> I got a compilation error:
>
> x_yacc.c: In function `int x_parse(char*, char*, int)':
> x_yacc.c:1382: error: `x_lex' was not declared in this scope
> make: *** [linux32/x_yacc.o] Error 1
Hi,
You need to declare a matchin
em in
CLEANFILES += ...
Alternatively, you can define:
clean-local:
rm ...
and remove them manually there.
HTH,
David Fang
Computer Systems Laboratory
Electrical & Computer Engineering
Cornell University
http://www.csl.cornell.edu/~fang/
-- (2400 baud? Netscape 3.0
> > I know this is the help-bison group, but I can't find a yacc group
> > for my problem, and I want to do the basics in yacc, before I move on
> > to learning bison (mainly for the C++ support).
>
> Why'd you want to learn writing parsers with yacc? bison basically implements
> everything that ya
> I want to encapsulate a C++ class ,which can works like a calculator,its
> structure seems like this:
> Class Calc
> {
> //in yylex, result will be evaluated...
>
> };
> In an other word, Can yylex ,yyparse() be encapsulated in a C++ Class ?
Hi,
"Can...". Yes, but you will nee
> Thanks for the response.
> But I'm not sure I understood what you have mentioned.
> Could you please give an example or a bit more detail?
Sure, (at the risk of being slightly off-topic)...
> > nonterminal X:
> > #ifdef FEATURE
> > { rule 1 }
> > #else
> > { rule 1; rule 2 }
> > #endif
Place
> Is there a way to conditionally generate grammar rules?
> For example, I need to do something like
>
> nonterminal X:
> #ifdef FEATURE
> { rule 1 }
> #else
> { rule 1; rule 2 }
> #endif
>
> I know that ifdefs dont work with the grammar but is there anything
> else that can be done? Or is it pos
elete-ing the appropriate union-member will also
call its destructors, thereby taking care of recursive deallocation.
(I would not want to write a free_me function for each union member
type by hand in C.)
I haven't included the crucial scripts in this post, but I hope I
17 matches
Mail list logo