help-bison
[Top][All Lists]
Advanced

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

Re: Some problems with the grammar !


From: Hans Aberg
Subject: Re: Some problems with the grammar !
Date: Wed, 18 Apr 2001 11:55:18 +0200

At 12:21 +0530 2001/04/18, Rutu Raghu Manchiganti [T] wrote:
>I am facing one problem with a grammar of this type :
...
>Ok...the elements in caps are the tokens...now if i give a input like
...
>It gives me an syntax error..ideally i am trying 2 replace Another with
>REAL.

It is quite difficult to follow this kind of reports, because you do not
state how you tokenize, nor do you give tell what kind of syntax error you
get.

>Item:
>   NAME
> | INTEGER
> | REAL

But here you have defined an item to be both NAME and INTEGER, so I gather
that the lines
>VALUE = 1
>Another = REAL
will be read as "VALUE =" followed by the list (according to your grammar)
"1 Another".

So somehow you will have to improve your grammar. Alternatives are one or
more of: Terminate list by a punctuation mark; separate list items by a
punctuation mark; enclose lists in some kind of brackets; restrict the
items of the list so that they do not clash with subsequently read items.

  Hans Aberg





reply via email to

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