Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Data Type rule help? [RESOLVED](Noob)
Data Type rule help? [RESOLVED] [message #1161936] Wed, 30 October 2013 04:04 Go to next message
Gary Worsham is currently offline Gary WorshamFriend
Messages: 176
Registered: September 2013
Senior Member
Here's what I'm trying to parse:

buffer
buffer+20
buffer-20
buffer^
buffer^+20
buffer^-20
buffer#
buffer#+20
buffer#-20

Here's what I've tried as a Data Type rule:

SPINMEM: {SPINMEM} ID ('#' | '^')? ('+' INT)?;


However, it doesn't work properly.

Ideally, I would get two String parameters:

"buffer", and everything after "buffer" (or null). Although the Data Type rule above only maps to 1 argument.

[Updated on: Wed, 30 October 2013 22:12]

Report message to a moderator

Re: Data Type rule help? [message #1162104 is a reply to message #1161936] Wed, 30 October 2013 06:41 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi

this is not a datatype rule.

it would look like

SPINMEM: ID ('#' | '^')? ('+' INT)?;



you could use a valueconverter to handle the buffer cutting.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Data Type rule help? [message #1162578 is a reply to message #1162104] Wed, 30 October 2013 13:29 Go to previous message
Gary Worsham is currently offline Gary WorshamFriend
Messages: 176
Registered: September 2013
Senior Member
Thanks again Christian, that worked great! I started putting the { RULENAME } in, because I had some rules with no arguments, and Xtend gave me a warning that those rules wouldn't be instantiated unless I added the { RULENAME } in curly brackets. However I don't know WHY this is the case and I obviously used this inappropriately.
Previous Topic:how to open a file in the actual project
Next Topic:Error in polymorphic dispatcher
Goto Forum:
  


Current Time: Thu Apr 25 18:14:26 GMT 2024

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

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

Back to the top