Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Whitespace in OpCompare's LessThan in Xbase grammar
Whitespace in OpCompare's LessThan in Xbase grammar [message #1750002] Thu, 15 December 2016 02:35 Go to next message
Larry LeBron is currently offline Larry LeBronFriend
Messages: 114
Registered: October 2015
Senior Member
I was having issues implementing my own versions of boolean comparison operators in my grammar, which extends Xbase.

I was having issues with "<=" only, while all the rest were working fine.

I looked at Xbase and found that the OpCompare rule is written as:

OpCompare:
	'>=' | '<' '=' | '>' | '<' ;


The less than equals operator is written to allow whitespace between the symbols. When I replicated it in my grammar, my problems went away. What is the reason for this?

[Updated on: Thu, 15 December 2016 03:09]

Report message to a moderator

Re: Whitespace in OpCompare's LessThan in Xbase grammar [message #1750347 is a reply to message #1750002] Tue, 20 December 2016 08:48 Go to previous message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 67
Registered: January 2016
Location: Kiel
Member

It is because it otherwise wouldn't be able to parse typereferences like `List<=>String>`, which is a shorthand for `List<()=>String>`
Previous Topic:install Xtext 2.7 in Indigo
Next Topic:mismatch between a grammar expression and its corresponding model
Goto Forum:
  


Current Time: Thu Mar 30 16:58:33 GMT 2017

Powered by FUDForum. Page generated in 0.01445 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software