Comments (1)
Hi,
Your grammar is not LALR(1) and not even LR(1). Bison implements LALR(1) and LR(1) (and IELR(1)), so these conflicts are expected.
Bison cannot easily massage grammars, because it would also need to adjust the actions accordingly. So, sorry, but indeed you'll have to reformulate your grammar anyway. For instance
%token END
%%
top
: body END
;
body
: RepeatI
| RepeatI RepeatD
;
RepeatI
: 'I' ';'
| 'I' ';' RepeatI
;
RepeatD
: 'D' ';'
| 'D' ';' RepeatD
;
%%
Bison should compile any grammar that unambiguously defines a state machine that can parse it
I would also want it to report when a grammar is ambiguous. The only problem is that this is an undecidable problem :-)
from bison.
Related Issues (20)
- Escaping dollar sign in a rule action
- Associating %prec with a rule without any occurrences of tokens
- [TC] Problem: Bad Variant Access errors are not explicit
- Request for latest release HOT 7
- Hello, if I want to print the full string content of the current child node, what do I need to do
- --file-prefix in the docs HOT 1
- FIXME - java HOT 2
- Broken for D parsers: %code lexer { HOT 1
- Compilation error: No rule to make target 'textstyle.h' HOT 2
- 3.8.2 testsuite segfault on armv6 HOT 3
- D skeleton file breaks recent D compilers with example code from manual HOT 6
- yynerrs unused-but-set-variable warning with Clang 15 HOT 1
- Can't build with conan, using clang compiler, having dependencies as shared libs HOT 4
- [BUG] reachable assertation in string_decode, bison HOT 1
- [BUG] abitset_set is reachable by crafted input, which cause the program abort HOT 1
- How to remove entries from the token list at runtime / from being passed to yysyntax_error? HOT 1
- [NonFetal Error]: use-of-uninitialized-value in bison(version 3.8.2.45, commit 25b3d0e1)
- No example code in the C++ examples HOT 2
- make fails HOT 9
- git shallow clone - error: Server does not allow request for unadvertised object - git.sv.gnu.org - git.savannah.gnu.org
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bison.