>
> It is easy to recover the number of the dimensions. But I want to find
> what
> are the dimensions as well. If I count the brackets, that won't give much
> of
> information will it ?
>
> Stratis
It was just an example of how to keep track of information that's
available during parsing. If you
>> Oh, I see. I thought you were writing a C-like interpreter that
>> would actually execute the loop. In that case, you're right, and my
>> point is irrelevant. I suppose what ultimately gets output is
>> machine-code or assembler with a branch and a goto for the loop?
>
> Yes! you're righ
> I'm not really fussed if we call them methods or functions, so no worries
> there. :) I'm not sure if it's so important that we need to distinguish
> the
> two things (talking also on the topic of Bison only), but perhaps it would
> help.
If I may be allowed to drift slightly into the realm of p
> YYTYPE is a massive union. funccall is declared %type [...]
If you've got lots of types in your union, you might want to consider
using `void*' for some of them instead and casting to the correct type
where needed in the rules. If you're just setting the `$$' from another
symbol and both have
"Arlen Cuss" <[EMAIL PROTECTED]> wrote:
> On Feb 20, 2008 10:19 PM, <[EMAIL PROTECTED]> wrote:
> In Ruby, everything is an object, and all functions return objects (even
> if
> it's `nil'). This makes it easy for us, since we assume (or rather, we
> know)
> that all functions return objects and h
> I've been trying to nut out a problem for a week or so in a bison parser
> I've been writing, and I'm failing. Please excuse me if this isn't the
> correct place to ask - I haven't convened with anyone about bison parsers
> before.
It is one correct place to ask. If it's more about compilers in
Aaron Jackson wrote:
> Thanks for the response.
You're welcome.
> On Feb 11, 2008, at 5:03 AM, [EMAIL PROTECTED] wrote:
>
>> To the best of my knowledge, you would need to modify the skeleton
file. [...]
> I wanted to avoid this since I want my .y code to be portable.
It would be. You'd just
> I would like to declare some variables that are local to yyparse.
To the best of my knowledge, you would need to modify the skeleton file.
When I wanted to do this, I determined that it was not possible otherwise.
I may be wrong, but I don't think this has changed with more recent
versions.
>
> Well, I can't go into details about the system on which this problem is
> occurring, but I have it from someone who knows for certain that the
> version
> of the operating system on which this problem is occurring does not
> include
> stdint.h. So, again, how is configure finding this non-existe
> > Well, this is correct if this header file is available.
> >
>
> That's the thing, it's not available. Or at least, it's not where the
> other
> standard headers are located.
This may be the problem.
> And from the log and such, I can't figure
> out why
> configure thinks that it is a
> I have a platform on which I am trying to build bison 2.1 for which I
would like HAVE_STDINT_H not defined. Running the configure script
generates a config.h which has the following lines:
>
> /* Define to 1 if you have the header file. */
> #define HAVE_STDINT_H 1
Well, this is correct if thi
Please "cc" any replies to the help-bison list.
> The problem is that I must call the parser in another program. My program
> read some strings and I would like pass these strings to bison. So, I have
> a
> grammar like this:
>
> S1 = lemon S2 | apricot S2
> S2 = kiwi orange | S3
> S3 = banana S3
> S1: token1 S2
> S2: token2 S3 | token3 S2
> S3: token4
>
> Now, If I call bison and I try to validate "token1 token2" sequence, the
> parser fails because token2 must be followed by S3, but in my situation
> lex
> have no others tokens for bison at a certain moment...
I don't understand. D
> How I can run bison from C source code passing a string to parse?
`yyparse' works by calling `yylex' which, in effect, passes token-value
pairs to `yyparse'. There is a difference depending on whether your
parser is reentrant or not. If it is, `yyparse' doesn't use global
variables. Passing a
> After writing a simple interpreter for my simplified C language using
> bison, I'm currently planning to write a small and a really simple
> compiler for it using flex and bison as a front-end.
The difference between a compiler and an interpreter is not clearly
defined. _Very_ roughly speaking,
> Thanks for the feedback. The parser really does need to refer to
> large strings, these are descriptions of very large biological
> networks with motifs that include thousands of genes, with
> potentially tens of thousands total. The parser then turns them into
> Systems Biology Markup Language (
>> 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 debugging under valgrind.
> The result of debugging in short:
> 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 = YYL
> I'm a german student (so sorry for my bad english).
It doesn't seem that bad to me, but if you have trouble with anything,
just write in German. I understand it and I think some other people here
do, too.
> I'm using a Bison/Flex application, that was written by another student
> for
> his bac
Ilyes Gouta wrote:
> Hmm.. So bison is able to read from data buffers instead of a FILE*.
> How can I achieve that?
I don't remember off-hand. It's documented in the manual, or you can look
in my source code. It involves `yyin'.
>> I think it's usually not a good idea to execute code in the mi
> I'm in the process of writing an interpreter for my simplified C-like
> language. I've already added the support for expressions and "if then
> else" statements but I'm having some hard time figuring out how to
> support loops.
I suggest you take a look through the archives, since this topic has
> Laurence: Thanks for extensive explanation! It's really great! :)
You're welcome.
>
> So to summarize , I have two choices:
>
> 1. An extensive type checking in the actions, i.e for my case (JIT
> mode, native x86 instructions will be generated by the parser) emit
> the right arithmetic operat
> I'm new to Bison. I'm writing an interpreter for a lightweight C-like
> language using flex and bison. My language has to support the *two*
> types *int* and *float* used by the identifiers.
>
> My question is, do I have to write separate rules for both types in my
> .y file, where each set of ru
The `%union' declaration for GNU 3DLDF looks like this:
%union
{
char string_value[64];
double real_value;
signed int int_value;
unsigned long long ulong_long_value;
void* pointer_value;
};
I use the members of the union other than `pointer_value' for the values
of symbols where it's co
> On 2 Oct 2007, at 23:48, Randy Smith wrote:
>
>> I'm trying to incorporate c++ stl constructs into the %union { }
>> block of yacc. Specifically, I'm trying to do something similar to
>> this:
>>
>> %union {
>> ...
>>std::list* int_list;
>> ...
>> }
>>
>> This yields the error:
>>
>> eidd.y:
>
> One solution to this (and the solution I used), is to define
> a simple class that wraps a pointer of this type. This works fine, but
> it is a bit of a kludge, and I'm really curious why the direct stl
> reference doesn't work. Can anybody explain this to me or point me to
> a reference?
>
I wrote:
> It was not difficult to integrate a Bison parser with a Visual C++
program, but I've
> forgotten the details. I eventually gave up on Visual C++ and used GCC on
> the Windows machine instead. This project is currently on ice.
The sources for this project are here:
http://cvs.savanna
> I'm attempting to build bison 2.1 on Windows with both mks and cygwin.
> I've gotten a little ways with mks and am just starting with cygwin.
> Several questions:
Aren't there binaries available? This would be much easier. If you're
just starting with Cygwin, you might want to consider using D
> On Sat, 8 Sep 2007, Bob Rossi wrote:
>
>> The first issue is that I probably need a way to tell the parser that
>> I'm done giving it tokens. That way, it will finish all of it's rules.
>> Is there already a way to do this?
>
> Yacc-generated parsers expect the last token in the input stream to b
> Even though Bison is a bottom up parser, if I need to pass a variable's
> content top-down, what are the possible ways (except using global
> variable)?
One way is to use the optional parameter that you can pass to `yyparse'.
It is a `void*' that can point to an object of whatever type you like.
> feel free to send me a copy and I will try to see if I can help you.
Thank you very much for your offer.
The package is quite large, so it would best to download it.
Instructions on downloading the source files from the repository at the
GNU Project's Savannah website can be found here:
http:/
31 matches
Mail list logo