Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » xtext grammar(starting with xtext)
xtext grammar [message #1822322] Wed, 04 March 2020 03:19 Go to next message
I M is currently offline I MFriend
Messages: 1
Registered: March 2020
Junior Member
Hello,

I was trying to write the basic grammar in xtext. But it is showing me the error

required (...)+ loop did not match anything at input 'grammar'

Please, how to clear this error.

Thank you

---- Below is the xtext code---

grammar org.eclipse.xtext.common.Terminals hidden(WS, ML_COMMENT, SL_COMMENT)

import "http://www.eclipse.org/emf/2002/Ecore" as ecore

terminal ID: '^'?('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*;
terminal INT returns ecore::EInt: ('0'..'9')+;
terminal STRING:
'"' ( '\\' . /* 'b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\' */ | !('\\'|'"') )* '"' |
"'" ( '\\' . /* 'b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\' */ | !('\\'|"'") )* "'"
;
terminal ML_COMMENT : '/*' -> '*/';
terminal SL_COMMENT : '//' !('\n'|'\r')* ('\r'? '\n')?;

terminal WS : (' '|'\t'|'\r'|'\n')+;

terminal ANY_OTHER: .;


Re: xtext grammar [message #1822367 is a reply to message #1822322] Thu, 05 March 2020 05:05 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14664
Registered: July 2009
Senior Member
Can you please give a complete minimal grammar and the complete error message

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:CaseInsensitiv Scoping - how to do it?
Next Topic:Generating code from attributes in CSV
Goto Forum:
  


Current Time: Tue Apr 16 06:52:43 GMT 2024

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

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

Back to the top