Bug 360892 - [parser] Infinite loop in production parser
Summary: [parser] Infinite loop in production parser
Status: NEW
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.1.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-13 17:40 EDT by Sebastian Zarnekow CLA
Modified: 2012-11-09 06:02 EST (History)
2 users (show)

See Also:


Attachments
Stack Trace (18.48 KB, text/plain)
2012-04-19 08:30 EDT, Juerg Wanner CLA
no flags Details
Xtext grammar (455 bytes, text/plain)
2012-04-19 09:22 EDT, Juerg Wanner CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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