help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: should I use bison?


From: Henrik Sorensen
Subject: Re: should I use bison?
Date: Sat, 11 Mar 2006 12:51:18 +0000
User-agent: KMail/1.8.3

On Thursday 09 March 2006 09.36, Spikx wrote:
> Hello,
>
> I recently began to learn the basic principles of parsers, context free
> grammar and espcially bison, because I need it for a project. But I
> wondered if the use of bison would be suitable at all in my case.
imo, the question is can you write a grammar that is suitable for bison ?

If you can do that, then bison can offer you nummerous advantages over any 
other handwritten parsing, mostly bescause it is very easy to extend your 
grammar with bison.
On the other hand, if you cannot structure your grammar so it can be parsed 
using LALR(1), you are probably better off looking at some other tools.

>
> In this project, the content of a game (objects, visuals, logic, etc.)
> should be defined by a simple text file, which will be generated before.
> This file should be parsed and complete the game depending on its content.
> Perhaps one element coult look like this:
>
> object( ammount=10, position(0,0,random), texture(...), ... )

element: ID '(' parmcommalist ')';
parmcommalist: parm
 | parmcommalist ',' parm
 ;
parm: ID '=' expr
 | ID '(' parmcommalist ')'
;
expr: ... ;

>
> .. I don't know yet :)
> The game is written in C++ and I wonder now, if it is possible at all, to
> create a more or less complex behaviour with a parser.. and if.. what do I
> have to consider?
> I have to mention again, that I am practically a complete newbie to all
> this
well we all were at one point :-)

henrik




reply via email to

[Prev in Thread] Current Thread [Next in Thread]