Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Disappearing arguments? (Outline)(noob level)
Disappearing arguments? (Outline) [message #1133890] Sat, 12 October 2013 01:05 Go to next message
Eclipse UserFriend
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 10:59 Go to previous messageGo to next message
Eclipse UserFriend
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 11:01] by Moderator

Re: Disappearing arguments? (Outline) [message #1134755 is a reply to message #1134510] Sat, 12 October 2013 15:00 Go to previous message
Eclipse UserFriend
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

[Updated on: Sat, 12 October 2013 15:03] by Moderator

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


Current Time: Mon Jul 07 02:48:06 EDT 2025

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

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

Back to the top