Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Creating assembler language(Trying to create an assembler parser)
icon5.gif  Creating assembler language [message #644843] Tue, 14 December 2010 13:07 Go to next message
malo_nj  is currently offline malo_nj Friend
Messages: 33
Registered: December 2010
Member
Hi

I need some help with auto-complete and syntax coloring.

Cant get auto-complete to recognize my registers. When I hit control+space it offers %r but not the numbers.

About syntax coloring how to make registers and memory color different then st_w color. This is my first day with xtext so any help is welcome.

...

Data:
	Memory | Register ;
Store_Word:
	'st_w ' lo=Data ro=Data ; 
Register:
    GPR | SPR  ;

GPR:
	'%r' num=(NUM_0_7 | NUM_8_15 );

terminal NUM_0_7 returns ecore::EInt:
	'0'?('0'..'7');	

terminal NUM_8_15 returns ecore::EInt:
  '0'?('8'..'9') | '1'('0'..'5');

...

[Updated on: Tue, 14 December 2010 13:26]

Report message to a moderator

Re: Creating assembler language [message #645000 is a reply to message #644843] Wed, 15 December 2010 07:46 Go to previous messageGo to next message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
Hi,

there is no automatic code completion for non-standard terminal rules. You would manually implement the proposal rule for Register, GPR or SPR.

The highlighting you want will have to be done via semantic highlighting. There are forum entries, Xtext documentation and at least one blog post (if a bit outdated) http://blogs.itemis.de/stundzig/archives/467 that you may want to study.

Alex
Re: Creating assembler language [message #645012 is a reply to message #644843] Wed, 15 December 2010 08:44 Go to previous message
malo_nj  is currently offline malo_nj Friend
Messages: 33
Registered: December 2010
Member
Thanks for the reply. I managed to do it all just forgot to edit the post. Once more thanks this forum was of great help and I hope it continues to be.
Previous Topic:Strange problems with "Duplicate names validation"
Next Topic:Help writing EBNF - With statement
Goto Forum:
  


Current Time: Fri Apr 26 13:50:15 GMT 2024

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

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

Back to the top