[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bison can not create LR table
From: |
zdprikryl |
Subject: |
Bison can not create LR table |
Date: |
Fri, 18 Aug 2006 07:39:20 -0000 |
User-agent: |
Thunderbird 1.5.0.4 (X11/20060713) |
Hello,
If I write grammar like below, than bison prints this:
conflicts: 1 reduce/reduce
warning: rule never reduced because of conflicts: ireg_MOVE_INDIRECT_A: ireg
warning: rule never reduced because of conflicts:
ireg_MOVE_INDIRECT_DATA: ireg
But grammar is LR for sure, because I can construct it by hand on paper.
Thanks
ZP
--------
Grammar:
--------
MOVE_INDIRECT_DIRECT: "MOV" "@" "R" ireg_MOVE_INDIRECT_DIRECT ","
dir_MOVE_INDIRECT_DIRECT
{
...
};
MOVE_INDIRECT: "MOV" "@" "R" ireg_MOVE_INDIRECT_A "," "A"
{
...
};
MOVE_INDIRECT_DATA: "MOV" "@" "R" ireg_MOVE_INDIRECT_DATA "," "#"
data_MOVE_INDIRECT_DATA
{
...
};
ireg_MOVE_INDIRECT_DIRECT: ireg
{
$$ = $1;
};
ireg_MOVE_INDIRECT_A: ireg
{
$$ = $1;
};
ireg_MOVE_INDIRECT_DATA: ireg
{
$$ = $1;
};
dir_MOVE_INDIRECT_DIRECT: byte
{
$$ = $1;
};
data_MOVE_INDIRECT_DATA: byte
{
$$ = $1;
};
ireg: const_num //decadical value from lex
{
...
};
byte: const_num //decadical value from lex
{
...
};
- Bison can not create LR table,
zdprikryl <=