Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 360892

Summary: [parser] Infinite loop in production parser
Product: [Modeling] TMF Reporter: Sebastian Zarnekow <sebastian.zarnekow>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: christian.kesselheim, jw
Version: 2.1.0   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
Stack Trace
none
Xtext grammar none

Description Sebastian Zarnekow CLA 2011-10-13 17:40:22 EDT
This is a follow up for bug 347012.

I think the main problem is this pattern in the grammar

Root: a=A*
A: b=B ..
B: {B} c=C*

which could be simplified to

Root: a=A*
A: b=B? ..
B: c=C+
Comment 1 Juerg Wanner CLA 2012-04-19 08:29:44 EDT
Is there any progress on this? I'm facing the same situation as described in bug 347012.

Look at the following situation:

File in Editor:

domain MyDomain {

    entity A

}

If I hit ctrl-space after the 'A' I get the situation described in this bug. On
the other hand if the file looks like the following:

domain MyDomain {

    entity A 

    entity B {
       name : String
    }
}

And I do the same as before (ctrl-space after 'A') everything works, i.e. I get the correct assistance.

The grammar at that particular point is:

Entity:
    'entity' name=ID (doc=STRING)? (ann+=Annotations)* '{'

where STRING starts with ' or " and Annotations starts with 'annotation'. I also tried the same with the following grammar:

Entity:
    'entity' name=ID '{'

but surprisingly the outcome is still the same (eclipse locking up).

See also the attached stack trace (look at Worker-12 and main)
Comment 2 Juerg Wanner CLA 2012-04-19 08:30:29 EDT
Created attachment 214235 [details]
Stack Trace
Comment 3 Sebastian Zarnekow CLA 2012-04-19 08:33:36 EDT
Which version do you use?
Comment 4 Juerg Wanner CLA 2012-04-19 08:37:16 EDT
The version is Xtext 2.2.1
Comment 5 Sebastian Zarnekow CLA 2012-04-19 08:40:08 EDT
Please provide a grammar file that allows to reproduce the issue if the grammar is different from the one in bug 347012
Comment 6 Juerg Wanner CLA 2012-04-19 09:22:33 EDT
Created attachment 214240 [details]
Xtext grammar

The grammar is similar and might actually be equivalent but I'm not quite sure.
I tried to strip it down as much as possible. In reality its much larger and the ecore is not generated but imported.
Comment 7 Sebastian Zarnekow CLA 2012-06-08 07:50:11 EDT
see also bug 382088