Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 324297 - [ConcreteSyntaxValidator] False Positive
Summary: [ConcreteSyntaxValidator] False Positive
Status: CLOSED WONTFIX
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 1.0.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: 333986 333976
Blocks:
  Show dependency tree
 
Reported: 2010-09-02 08:31 EDT by Moritz Eysholdt CLA
Modified: 2016-07-21 04:52 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Moritz Eysholdt CLA 2010-09-02 08:31:34 EDT
This error message is a false positive because the constraint is fulfilled if no value is set.

Feature LineSimple.x2 must be set. Constraint: ((x1 fn?)?|(x2 df?)) Quantities: x1:0, x2:0, fn:0, df:0
Comment 1 Moritz Eysholdt CLA 2011-01-11 10:03:41 EST
as of bug 333976, this use case will be handled by the sequencer and render this report obsolete.
Comment 2 Moritz Eysholdt CLA 2011-10-18 04:17:55 EDT
The new serializer still invokes the ConcreteSyntaxValdiator (1) because the new serializer still uses local backtracking and there are cases where the ConcreteSyntaxValidator's error messages are more precise then the serialier's.

1: org.eclipse.xtext.serializer.impl.Serializer.serialize(EObject, ITokenStream, SaveOptions)
Comment 3 Christian Dietrich CLA 2015-07-31 07:14:11 EDT
we are affected by this bug

Here is our pretty simple grammar

Model:
	things+=Thing*
	aktionen+=ThingPruefung*;
Thing:
	"thing" name=ID;
ThingPruefung:
	{ThingPruefung} "pruefe" "thing" meldung=[Thing] (("vorhanden" "=" ((vorhanden?="ja") | "nein")) |
	"=" thingText=TestdatenAusdruck);
TestdatenAusdruck:
	STRING;

And Test

@RunWith(XtextRunner)
@InjectWith(MyDslInjectorProvider)
class BugTest {

	@Inject extension ParseHelper<Model>

	@Test
	def void testIt() {
		val model = '''
			thing a
			thing b
			pruefe thing a vorhanden = nein
		'''.parse
		val r = model.eResource

		println(r.errors)
		val s = new ByteArrayOutputStream
		try {
			r.save(s, null)
			println(new String(s.toByteArray))
		} catch (Exception e) {
			e.printStackTrace
		}

	}

}

Workaround: Change the grammar to 3 ors
Comment 4 Moritz Eysholdt CLA 2016-07-21 04:52:09 EDT
won't fix because of https://github.com/eclipse/xtext-core/issues/48