Need help getting started on a grammar [message #1219861] |
Fri, 06 December 2013 05:20  |
Eclipse User |
|
|
|
I've been going at the documentation for a good 4 hours now and I'm just about at the end of my rope. I'm trying to write a simple grammar that resembles a programming language and I can't get all the warnings/errors To go away.
The problem is that I can get any specific one to go away, so I don't know what's wrong with my approach. I feel like I lack some fundamental concept in A few examples of the problems I've run into:
The documentation never explicitly states what a "feature" (assigned value) is. What are they?
The documentation does not properly explain the difference between terminal rules and data type rules. No, really! For example, search the page for "above mentioned reasons", and then try to find reasons above it; you won't find any.
I'm not sure why I would want to, because the tutorials were written from a Java perspective and glossed over data types entirely, but I cannot set return types on terminals:
terminal NUMBER returns ecore::EInt: Quote:- Couldn't resolve reference to AbstractMetamodelDeclaration 'ecore'
- Cannot create datatype EInt
This makes me suspect that my project setup is broken, but I just went with the default, so I don't know what gives.
And then this gives me a 'Cannot change type twice within a rule' error:
ArithmeticExpression:
Variable'++' |
Variable'--' |
((Variable | ParensExpression | NUMBER) ARITHMETIC_OPERATOR ArithmeticExpression)
; But I'm not explicitly declaring any types (the return type above was just illustrative, it's usually not there), so shouldn't everything just be EStrings or inferred?
If anyone can shed any light on any if these issues, it would be greatly appreciated. (Incidentally, since these sorts of topics usually elicit "what are you trying to do?" types of responses: ultimately my goal, if I can get XText working at all, is an editor with a syntax highlighter and error checker.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.29293 seconds