Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Disappearing arguments? (Outline)(noob level)
Disappearing arguments? (Outline) [message #1133890] Sat, 12 October 2013 05:05 Go to next message
Gary Worsham is currently offline Gary WorshamFriend
Messages: 176
Registered: September 2013
Senior Member
I'm looking at the outline being built by the parser.

http://img812.imageshack.us/img812/5750/32sq.png

Uploaded with ImageShack.us

For some reason I'm not getting entries from my single-argument instructions and the others only show the second argument. What am I doing wrong?

Here's the grammar:

grammar com.holycityaudio.spincad.SpinCAD with org.eclipse.xtext.common.Terminals

generate spinCAD "http://www.holycityaudio.com/spincad/SpinCAD"

Program:
	(equates += Equate*)
	(instructions += Instruction*)
	;
	
//-----------------------------------------------------------------------------	
Equate:
	EquDouble | EquInt	;

EquDouble:
	ename = ID 'EQU' value = SPINREAL
;

EquInt:
	ename = ID 'EQU' value = INT
;

Instruction:
	Inst_B15_S1_9 |
	Inst_B6_S1_14 |
	Inst_B6 |
	Inst_B24
	;

Inst_B6_S1_14:
	ReadRegister |
	WriteRegister |
	ReadRegisterFilter |
	Maxx |
	WriteRegisterHighPass |
	WriteRegisterLowPass
;

Inst_B15_S1_9:
	ReadDelay |
	WriteDelay 
;

Inst_B6:
	Mulx |
	Ldax
;

Inst_B24:
	And |
	Or |
	Xor
;

ReadRegister: 'RDAX' arg1 = INT ',' arg2 = SPINREAL;
WriteRegisterLowPass: 'WRLX' arg1 = INT ',' arg2 = SPINREAL;
WriteRegisterHighPass: 'WRHX' arg1 = INT ',' arg2 = SPINREAL;
WriteRegister: 'WRAX' arg1 = INT ',' arg2 = SPINREAL;
Maxx: 'MAXX' arg1 = INT ',' arg2 = SPINREAL;
ReadRegisterFilter: 'RDFX' arg1 = INT ',' arg2 = SPINREAL;
Mulx: 'MULX' arg1 = INT;
Ldax: 'LDAX' arg1 = INT;
WriteDelay: 'WRA' arg1 = INT ',' arg2 = SPINREAL;
ReadDelay: 'RDA' arg1 = INT ',' arg2 = SPINREAL;
And: 'AND' arg1 = INT;
Or: 'OR' arg1 = INT;
Xor: 'XOR' arg1 = INT;

//------------------------
terminal SPINREAL : ('0'..'1') '.' INT;
Re: Disappearing arguments? (Outline) [message #1134510 is a reply to message #1133890] Sat, 12 October 2013 14:59 Go to previous messageGo to next message
Gary Worsham is currently offline Gary WorshamFriend
Messages: 176
Registered: September 2013
Senior Member
It's also entirely possible that everything is OK, just that I don't grasp the significance of the "Outline" in this context.

Here's the ecore model generated by my Xtext file:

http://img850.imageshack.us/img850/5301/wmh2.png

Uploaded with ImageShack.us

Everything looks OK there, although I notice that the super-class "Instruction" has one EInt attribute and the subclasses have 1 EString attribute where appropriate (where I defined a SPINREAL).

Anyone want to try telling me what the proper interpretation of the "Outline" is in my original post?

Thanks,

GW

[Updated on: Sat, 12 October 2013 15:01]

Report message to a moderator

Re: Disappearing arguments? (Outline) [message #1134755 is a reply to message #1134510] Sat, 12 October 2013 19:00 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13667
Registered: July 2009
Senior Member
Hi,

the outline creates nodes "per eobject". labels by default are produced by MyDslLabelProvider which (by default) takes an attribute named name or the last one found.
you can change the tree structure by adopting MyDslOutlineTreeProvider


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Sat, 12 October 2013 19:03]

Report message to a moderator

Previous Topic:set type of custom xbase expression
Next Topic:ClassCastException & JobReconcilier
Goto Forum:
  


Current Time: Fri Dec 04 00:07:34 GMT 2020

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

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

Back to the top