| Summary: | Infinite Loop on unordered groups if all elements are optional | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Daniel Mising name <danielku15> | ||||||
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> | ||||||
| Status: | CLOSED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | sebastian.zarnekow | ||||||
| Version: | 2.1.0 | Flags: | sebastian.zarnekow:
indigo+
|
||||||
| Target Milestone: | SR2 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows 7 | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Daniel Mising name
Created attachment 205128 [details]
A demo grammar causing the problem
I added a second sample grammar which demonstrates the problem. This time there's no recursion in the grammar but the error is caused by the unordered group. The Parser tries to find all available proposals but gets stuck because all elements are optional. (That's how it seems to be) The parser loops within rule__ClassDeclaration__Group__4__Impl because the input.LA(1) always returns EOF in this case the rule__ClassDeclaration__MembersAssignment_4 is called over and over. Somehow the empty group causes the parser to never change the alt3 value and there the problem starts. To test the second grammar: Simply add an empty file and hit ctrl+space Created attachment 205129 [details]
A second grammar without recursive rule calls.
Good catch.
Things like
Foo:
{Foo} (a | b?);
can cause an infinite recursion.
Pushed to master. Closing all bugs that were set to RESOLVED before Neon.0 Closing all bugs that were set to RESOLVED before Neon.0 |