Hi,
On Sat, May 13, 2017 at 10:33 PM, Matthias Simon wrote:
> Hi,
>
> It's a good practice to keep grammar rather general and deal with the
> semantics (like type-compatibility) in a later semantic-phase.
>
> Cheers,
> Matthias
>
Thanks. That makes perfect sense.
___
Hi,
although the second solution is simpler, I'd go with the first one.
As soon as you plan to extend the grammar, for example by allowing user
defined types or expressions as initialization-value, you'll run into
trouble:
// parser has no idea if `mytype` requires an INT_CONST
mytype x =
Hi,
On Sat, May 13, 2017 at 9:48 PM, Mike Aubury wrote:
> Doesn't that depend on whether you want to allow :
>
> char a=;
> int i='A'
>
>
I don't want to allow that.
Regards.
___
help-bison@gnu.org https://lists.gnu.org/mailman/listinfo/help-biso
Doesn't that depend on whether you want to allow :
char a=;
int i='A'
?
On 13 May 2017 at 13:54, Prashant Shah wrote:
> Hi,
>
> I am using bison with flex (I am quite new with parsers).
>
> I want to parse a grammar as given below:
>
> char a = 'A'
> int i =
> float f = 23.456
>
> Wha
> On 13 May 2017, at 14:54, Prashant Shah wrote:
> I am using bison with flex (I am quite new with parsers).
>
> I want to parse a grammar as given below:
>
> char a = 'A'
> int i =
> float f = 23.456
>
> What is the best way to represent the grammar ?
>
> 1) declaration : datatype IDEN
Hi,
I am using bison with flex (I am quite new with parsers).
I want to parse a grammar as given below:
char a = 'A'
int i =
float f = 23.456
What is the best way to represent the grammar ?
1) declaration : datatype IDENTIFIER '=' CONSTANT;
datatype : CHAR
| INT