|Beginner problems with simple grammar using the eclipse plugin [message #691852]
||Sat, 02 July 2011 15:39
| Sven Rudolph
Registered: July 2011
Hello forum members,|
this is my first post, so please excuse me if this is a FAQ.
I took my first steps with Xtext two days ago, read the 5 minutes tutorial, read the 15 minutes tutorial and started with my first Xtext project with eclipse (Indigo) using the Xtext plugin.
I chose to start with some simple text files I had to parse a while ago, which look like this:
$Name: This is the title - 1 2 123 - and it may contain special characters, e.g. öüäß
"This description may span across
+Value one: ( "String1" "String2" "etc." )
My xtext file looks like this:
"$Name: " value=IDNG;
"+Value one: ( "STRING*" )";
This works very well, I click Run as -> MWE2 Workflow and then Run as -> Eclipse Application, the application starts and I can start adding and editing files in an eclipse editor with syntax highlighting and content assist/auto completion.
But some things don't work and I don't know how to fix it:
The field $Name: is apparently a string, but the value is not inside quotation marks. So I can't use STRING in my grammar definition and thus I can't enter special characters in the eclipse editor.
The field +Flag: does not appear in the content assist/auto completion. If I enter it manually it receives its syntax highlighting but it doesn't appear in the outline tab of eclipse.
Is this caused by the leading plus sign?
The same happens with the field +Value one: which additionally contains a space.
Unlike +Flag: and +Value one: the field +Description: appears in the eclipse outline and it can be expanded and then it contains the field $Name:
If i link the outline tab with the editor and click on Description in the outline the whole text in the editor is marked.
Apparently there is something going wrong here and I think it is caused by the leading $ and + signs and the spaces in the fields.
I hope you can help me with some tips.
Thanks in advance
Powered by FUDForum
. Page generated in 0.01682 seconds