Skip to main content



      Home
Home » Modeling » TMF (Xtext) » How can I allow any character for a particular type
How can I allow any character for a particular type [message #707323] Mon, 01 August 2011 09:58 Go to next message
Eclipse UserFriend
Hello!
I have a type Freedom,


For example we have an ordinary type ;

Freedom: ID ;

terminal ID : '^'?('a'..'z'|'A'..'Z'|'_'|'.') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')* ;

I want to allow any character for this type, is there any easy way to do that?

BR
Caner

[Updated on: Mon, 01 August 2011 10:07] by Moderator

Re: How can I allow any character for a particular type [message #707328 is a reply to message #707323] Mon, 01 August 2011 10:11 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

check out the ANY_OTHER terminal rule in the default grammar.

ALex
Re: How can I allow any character for a particular type [message #707335 is a reply to message #707328] Mon, 01 August 2011 10:19 Go to previous messageGo to next message
Eclipse UserFriend
Hi Alex

terminal ANY_OTHER : '.' ;

there is no any explanation about this, what it does/ how acn i use it? can you explain or give a link?
Re: How can I allow any character for a particular type [message #707342 is a reply to message #707335] Mon, 01 August 2011 10:24 Go to previous message
Eclipse UserFriend
Hi,

it should be terminal ANY_OTHER : . ;
If no other rule terminal rule matches, ANY_OTHER will match as the dot is a wild card. And you use this terminal rule as any other terminal rule. (non-working illustration)

MyString: (ID|STRING|ANY_OTHER)*;

Alex
Previous Topic:Sorry for Spamming
Next Topic:Datatype rules
Goto Forum:
  


Current Time: Sat Jul 05 05:33:17 EDT 2025

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

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

Back to the top