Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 341647 - [Formatter] The ElementMatcher's state machine is not initialized properly
Summary: [Formatter] The ElementMatcher's state machine is not initialized properly
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: M7   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-01 12:41 EDT by Moritz Eysholdt CLA
Modified: 2011-04-01 13:05 EDT (History)
0 users

See Also:
moritz.eysholdt: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Moritz Eysholdt CLA 2011-04-01 12:41:38 EDT
The ElementMatcher traverses the grammar while consuming the tokens from a document one by one. To stay on the correct path, the ElementMatcher maintains a stack of RuleCalls. 

However, the start-parserrule is unknown to ElementMatcher. Consequently, if RuleCalls occur *before* the first token, then they are not put on the stack.

Solution:
ParseTreeConstructor and DefaultNodeModelFormatter should propagate the Root-ParserRule to the formatter/ElementMatcher via the TokenStream. That way, the ElementMatcher can be initialized properly.