Skip to main content



      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 08:07 Go to next message
Eclipse UserFriend
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 08:26] by Moderator

Re: Creating assembler language [message #645000 is a reply to message #644843] Wed, 15 December 2010 02:46 Go to previous messageGo to next message
Eclipse UserFriend
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 03:44 Go to previous message
Eclipse UserFriend
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: Thu Jul 03 10:37:42 EDT 2025

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

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

Back to the top