Luca wrote:
Hello!
I have written a compiler for a pascal-like language, using flex and bison.
The compiler is built under Windows using Visual Studio and works very
well, however how can I provide an internationalization?
I need to translate syntax error messages generated by bison's parser in
Jonas Stahl wrote:
>> Try running the application under valgrind or some other memory debugger.
>> If possible also try slightly different releases of gcc (4.1.1 or 4.2);
>> there's an outside chance that it's a bug in gcc.
>
> Thanks. I think this isolated the fault a bit more.
> I tried debuggin
Jonas Stahl wrote:
> In the version with segmentation fault (gcc 4.1.2):
>
> 33117 if (yychar == YYEMPTY)
> (gdb)
> 33120 yychar = YYLEX;
> (gdb)
>
> Program received signal SIGSEGV, Segmentation fault.
> yyparse () at fullParser.tab.c:33120
> 33120 yychar = YYLEX;
>
>
> I
Jonas Stahl wrote:
> Hi,
>
> I'm a german student (so sorry for my bad english).
>
> I'm working at my bachelor thesis and I'm having a little problem with
> Bison/Flex.
> [snip]
> Does Anybody have a good hint for me?
Well, is the use of bison/flex required? My initial reaction when I saw
the c
Alessandro Di Marco wrote:
> Hi all.
>
> It seems that both the options above are valid, so they need
> disambiguation. I've tried '%dprec' (as also suggested in bison
manual), but
> without any success.
>
> For your convenience I have stripped down the grammar to the below few
lines,
> which produ
Frans Englich wrote:
> The intent of the grammar is to enforce that declarations appear in a certain
> order(FirstProlog, SecondProlog), that the declarations are optional, and
> they take the form of "declare ".
>
> This is something that naturally leads to a shift/reduce conflict. As far as
>
Frans Englich wrote:
> Hello,
>
> What direction do you recommend me to take?
>
> I like the C skeleton because it's simple and it doesn't have dependencies on
> the STL, which is a no go for me, unfortunately. So, I simply need a
> parser(GLR, or non GLR, if necessary) that can have non-POD se
Fangzhou Jiao wrote:
> 2007/3/24, Satya <[EMAIL PROTECTED]>:
>> Hello!
>> I am looking at implementing the XML *. output in Bison this summer.
>> The one thing I did not understand on the project ideas page
>> (http://www.gnu.org/software/soc-projects/ideas.html) is
>>
>> " Define an XML grammar fo
Edsko de Vries wrote:
> if(...)
> {
> blah
> // TODO: must do something else here
> }
>
> f();
>
> the comment is not associated with the call to f, but with a NOP
> instruction which is the last instruction in the body of the if. That
I would expect a } to be a token, so the comment
Edsko de Vries wrote:
> On Fri, Mar 02, 2007 at 12:55:29PM +0100, [EMAIL PROTECTED] wrote:
>> On Friday 02 March 2007 12:30, Edsko de Vries wrote:
>>> Hi,
>>>
>>> Is there any way I can make Bison ignore tokens when it can't deal with
>>> them? I'll try to explain. For every completely blank line i
Martin Bock wrote:
> Hi everybody,
>
>
> I have have a question concerning memory allocation for yyval in bison:
> I' looking for the memory reserved for yyval, how it is done and how
> much it is. In the .c-file generated by bison, I found yyval is of the
> type YYSTYPE. But I cannot find any in
Bob Smith wrote:
> The language uses token as "INT" "BOOL" or "FALSE"; when I compile the
> project using
> Visual Studio 6.0 the following message is displayed:
>
> "'BOOL' : redefinition; typedef cannot be overloaded with any other
> symbol"
>
> How about #undef BOOL, etc
Hans Aberg wrote:
> On 16 Nov 2006, at 11:41, Giampaolo Fadel wrote:
>
>> I need to write a simple compiler for a pascal-like linguage, using
>> flex and bison.
>> The language uses token as "INT" "BOOL" or "FALSE"; when I compile the
>> project using
>> Visual Studio 6.0 the following message is
s88 wrote:
> On 10/11/06, Tim Van Holder <[EMAIL PROTECTED]> wrote:
>>
>> s88 wrote:
>> > Hi all:
>> > I'm confused with the bison and malloc right now...
>> > I'm using the Bison 2.0 on Ubuntu(Linux) 6.06, and everytime when I use
>&
s88 wrote:
> Hi all:
> I'm confused with the bison and malloc right now...
> I'm using the Bison 2.0 on Ubuntu(Linux) 6.06, and everytime when I use
> the malloc(actually is strdup) in the production rules. It will cause an
> unpredictable
> segmentation fault. The stack size on my system is set
Heiko Wundram wrote:
> Am Montag, 25. September 2006 10:34 schrieb Tim Van Holder:
>> If seeing a portion of the actual grammar where I encountered the
>> behaviour would be clearer, let me know and I'll post it.
>
> Sure, please post that.
I consider the topic more or
Heiko Wundram wrote:
> Am Montag, 25. September 2006 08:49 schrieben Sie:
>>
>>
>> Except that it actually takes the entire "opt_C opt_D E" path - if an A
>> is seen, it will reduce opt_C and opt_D then error out on the "E" rule,
>> while it should have reduced up to the "bar" nterm, and only try
Heiko Wundram wrote:
> Am Freitag, 22. September 2006 15:26 schrieb Tim Van Holder:
>> I would expect this to accept any input starting with A(B|C?D?E)+,
>> but in practice, it only accepts input starting with A(B|CDE)+,
>> because for the xyzzy nterm, it always trie
Given a simple grammar
%token A B C D E F
%%
foo
: bar { YYACCEPT; }
;
bar
: A plus_xyzzy
;
plus_xyzzy
: xyzzy
| plus_xyzzy xyzzy
;
xyzzy
: B
| opt_C opt_D E
;
opt_C
:
| C
;
opt_D
:
| D
;
%%
I would expect this to accept any input starting with A(B|C?D?E)+,
but in practice, it only accept
Akim Demaille wrote:
"Frans" == Frans Englich <[EMAIL PROTECTED]> writes:
> > Opening the source and printing it is surely a good idea and a very nice
> > complement to regular reporting, but I still think that improving regular
> > reporting is significant.
>
> I was not proposing to re
Guillaume Rousse wrote:
> Which is really not meaningful for user :/ I'd prefer to at least
> display current line, and avoid refering to internal grammar symbols.
Part 2 - not referring to internal grammar symbols: use string aliases
for your tokens, like so:
%token MY_IDENTIFIER "identifier"
%
Nicholas Crosbie wrote:
> I would like to set a a Bison project which processes
> a an expresssion of the form
>
> gate = r3 AND r5 NOT (r5 OR r7)
>
> i.e. a Boolean expression of arbitrary
> length/complexity, where r3, r5 etc. are
> variables containing integer data (e.g. an array, or
> stored
Ismael Moreno wrote:
> First of all, i've included an "old" version of this piece of code. I fixed
> after ask the yyin field, so sorry.
>
> Well, after using yyrestart and all what you said, now looks like the
> problem is in the first yyparse() function.
>
> I made an diagram with an "assigment
Ismael Moreno wrote:
> void cAssigNode::translate(cVM& vm) throw(std::exception)
> {
> char* Text;
> Text = strdup(RValue.c_str());
>
> FILE* yyin = fmemopen(Text, strlen(Text), "r");
> if(yyin == NULL)
> throw(cError("Can't open yyin stream"));
>
> yyparse();
yypars
Leon Mergen wrote:
> g++ -c -g -O0 asm_parser.cpp
> asm_parser.y: In member function `virtual int yy::Parser::parse()':
> asm_parser.y:84: error: request for member `char_t' in `(this +
>44)->yy::Stack::operator[] [with T = yystype, S =
> std::dequestd::allocator >](0)', which is of non-cla
Jonathan Selander wrote:
> Hi, I'm trying to do a very trivial thing using flex/bison. I want to
> make a sort of cookie replacement function, that finds a pattern in a
> string and replaces it with something else.
>
> The string to look for is in the format "%{text}" and later on perhaps
> "%{tex
Frans Englich wrote:
> Hello,
>
> I've managed to get the parser & scanner generated from Bison & Flex to leak
> -- and not from my own actions. I don't know whether it is caused by me using
> them in a wrong way, or because Flex and/or Bison contains bugs. Below
> comments have as background B
Paul Eggert wrote:
> Bison version 2.1 has been released.
It would be nice if you added a step
- freeze messages and submit pot files to the TP one week before
release
to the Bison release procedure (or alternatively, make 'submit .pot
file to the TP' part of the alpha release procedure).
I
Evan Lavelle wrote:
> I've got a problem where I need some communication back from Bison to
> Flex (in this case, I need Flex to return two different tokens for the
> same input, depending on context).
>
> The procedure is something like:
>
> 1 - parser determines context and sets global flag for
Evan Lavelle wrote:
> I'd like to pass a token class from Flex to Bison (ideally, a
> tr1::shared_ptr - a reference counted smart pointer class). However, in
> Bison itself I need to deal with a number of symbol types - tokens, AST
> nodes, and so on.
>
> This means that I need to use a %union, bu
Frans Englich wrote:
> On Tuesday 14 June 2005 11:36, Akim Demaille wrote:
>
>"Frans" == Frans Englich <[EMAIL PROTECTED]> writes:
>>
>> >
>> > I would prefer to do this at the Bison/Parser level because it is
>> > convenient: I have access to various information passed to the
>> > parse funct
31 matches
Mail list logo