I don’t know if this is helpful, but is there a problem with ambiguity between
these parses:
(IF 1=1 THEN PRINT “3” ) : PRINT “4”
and
IF 1=1 THEN (PRINT “3” : PRINT “4”)
? Because if the shift/reduce conflict resolved toward the first one, then $4
really only has one statement anyway.
-Ch
I don’t know how you’ve set up your flex/bison interface, but I’m guessing from
your quoting that you have flex return each character as a token? Can you
special-case 0 to not have the token value 0? That is, flex does this:
\x00 { return ZERO; }
And then in your grammar:
%token ZERO
and
for each
> function it appears in
> Makefile:13: recipe for target 'lex.yy.o' failed
> make: *** [lex.yy.o] Error 1
>
>
> Bison likes it.
> Tried quoting the \x00 but thats not right it appears.
>
>
>
>> On Mar 30, 2021, at 16:15, Chris verBurg wrote:
Tom,
I'm thinking this is just the "LA" part of "LALR" parsing. Imagine if you
had another rule for "if" that included an "else" clause. The parser would
need to know if the token after '}' is an "else" or not, because it changes
whether it reduces the if-else rule or the just-if rule.
Even tho
Hey Steve,
My reading of your code is that PARATEXT will only ever be a single
character. I'm thinking you want the flex rule to be ".*" (etc) instead of
just ".".
I'm curious whether your paragraphs are allowed to contain NLs. If so,
you're going to have to include them in the PARATEXT token v
Indeed - note that flex is more aligned with posix-style patterns than
perl-style patterns, so it would rather have "[:space:]", and "\s" just
means "s".
-Chris
On Tue, Dec 12, 2023 at 12:07 AM Steve Litt
wrote:
> Hi all,
>
> I know this is a Bison and not a Flex venue, but just in case somebod
I think that belongs in the flex file (example6.l), not the yacc file
(example6.y).
-Chris
On Sun, Dec 27, 2009 at 9:55 PM, Peng Yu wrote:
> I have the following example6.y and example6.l files. The compilation
> gives me warnings. I'm not sure where to put '#define YYSTYPE char *'
> (it is cu
; issue didn't have the extra single_identifier. Ignore it.
>
> -Brad
>
> Chris verBurg wrote:
>
>> Hey Brad,
>>
>> Do you mean to have "single_identifier" listed twice for the first
>> method_header grammar? That's the only thing I can think
I think I see a few issues in your code, but without the complete source I
can't conclusively say what your problem might be.
First:
> if(strcmp($2, "+"))
Just to be sure: you know strcmp returns 0 when the strings match, right? I
ask because it looks like you're trying to convert "+" to "add",
On Fri, Aug 6, 2010 at 5:17 AM, Sasan Forghani wrote:
>
> ..
> expr : expr BL_ADDOP expr
> ...
>char bufferT[6];
> ...
>$$ = bufferT;
>
$$ is a char* isn't it? In which case this assigns it to the
temporary bufferT, which is going to get wiped out as soon as it goes out of
scope.
Maybe
(FYI)
-- Forwarded message --
From: Sasan Forghani
Date: Wed, Aug 11, 2010 at 8:18 AM
Subject: Re: how to send data up the stack
To: Chris verBurg
Phil and Chris thank you for the response. I actually figured out what was
wrong last night. I had my printf statements as there
I use flex/bison mainly for creating data-file parsers, such as LEF, DEF,
verilog, and liberty files, and the occasional custom file format. I still
have yet to use them to parse a programming language. :)
-Chris
On Sat, Jun 4, 2011 at 8:46 AM, Philip Herron wrote:
> Well i am working on my
Even though the crash is in a .yy file, an installation problem is something
for the qgis team to look at, not help-bison. :( Did they send you over
here?
-Chris
On Fri, Sep 23, 2011 at 9:09 AM, Jules Kouadio wrote:
> Hello
>
> After
> cd build-master
> cmake ..
> make
>
> I get :
>
> qgsex
One thing that's bitten me in the past is that yyrestart doesn't reset the
flex start-state. If you have any of those, maybe add a "BEGIN(INITIAL)"
to your other flush code?
-Chris
On Sat, Nov 17, 2012 at 4:56 PM, Tadej Borovšak wrote:
> Hi.
>
> Dne 18.11.2012 (ned) ob 01:20 +0100 je Hans Abe
Dear Test,
I have to start by saying I got a giggle out of your yyerror function,
because I saw the "EEK" and figured out it was my tutorial you read
through. Awesome! Glad it's still useful. :)
I think the core of your problem is this rule:
::=
which essentially turns into an arbitrar
On Sun, Jun 16, 2013 at 10:17 AM, Test User wrote:
> A new grammar in combination with %glr-parser worked.
>
Woot!
Question:
>
> (1)I understand that if I have a file of the form:
> ::= ::= , bison parses my rules by default
> as ( ::= ) ::= and generates a syntax error
> when it reaches
Hey Adam,
I have a couple ideas. First, you might try updating the precedence of ','
for just that one rule:
| rvalLoop ',' rval %prec '='
(though you might need to define a precedence-level higher than both ','
and '=' for that to work right).
A second, more straightforward, idea is to shuffl
Hey Grant,
I don't know the internals of how python and shells do it, but a project I
worked on a long time ago did it a completely different way. They
implemented two grammars: one was the real language grammar (used for
reading in scripts from files), and the second would parse just an isolated
Dear 562462894,
I would also suggest seeing if your 3.0 version is merely installed
somewhere else. Try 'where bison' to see if you get more than one hit. If
not, check the output from your install to see where it put it. Then,
update your $PATH to put that path in front of the one where your 2
Hey Adam,
My two cents is to paraphrase John Levine's Flex & Bison book (ha! I almost
said Adam Levine!):
- yes, after tweaking, your manual parser will probably be faster.
- but that assumes you put all the necessary time into tweaking
- and you put in all the necessary time to get it functionall
Whoa, this looks just like a question posted in Stackoverflow a few hours
ago! :)
A cursory googling gives me evidence that groff itself uses bison, which
would make jison a good match for parsing it, yes.
-Chris
On Thu, Nov 5, 2015 at 3:24 PM, Roberto Jesus Dip
wrote:
> Hello everyone,
>
>
f its really a good idea to use it.
>
> Thanks again!
>
> On Fri, Nov 6, 2015 at 3:46 AM, Chris verBurg
> wrote:
>
>>
>> Whoa, this looks just like a question posted in Stackoverflow a few hours
>> ago! :)
>>
>> A cursory googling gives me evidence
Hey Stephen,
I don't know that we see enough of your code to say for sure what's going
on, but my limited guess is that if "if_group" is your top-level pattern,
then it'll never understand ELSE because else_group is not referenced
anywhere downstream of if_group. If so, what about having the elem
I'm not sure there's a Bison limit -- tokens should be allocated by the
lexer (flex), and user code has full control over how big to make buffers
and char*s..
Or by "Bison input" do you mean the .y file, and it's a grammar rule that
exceeds 4096 characters?
-Chris
On Thu, Sep 22, 2016 at 8:20 A
Rob,
To ask a sanity question, you do strdup (or otherwise allocate fresh memory
for) yytext on the Flex side when returning tokens, yes?
-Chris
On Tue, Dec 18, 2018 at 9:15 AM Rob Casey wrote:
> Hello,
>
> I have a (large) grammar where I have code similar to that below:
>
> | identifier
25 matches
Mail list logo