Named open and closing tags in xtext grammar? [message #765790] |
Wed, 14 December 2011 12:30  |
Eclipse User |
|
|
|
Hi!
I'm trying to implement an xtext grammar for my dsl atm and am pretty thrilled about the good results so far!
There is one point though thats troubling me:
considering I have a DSL with something like this:
Person Jimbo <- opening tag with name of person
fullName = JamesJeronimoSmith
Address = Somewhere
end Jimbo <- closing tag with name of person
then i would instinctively use a grammar like
(not tested)
Person:
'Person' name=ID
('fullName = ' fullName=ID )?
('Address = ' address=ID )?
'end' ID // <- PROBLEM HERE?
;
the thing is, does this imply that the name at the start and end tag are the same? in my opinion it does not, it just states that there will be another ID that is not saved? So how can i make xtext check if the ID behind 'end' is the same as the ID behind 'Person' ?
I have of course tried to google, but could not find anything, which might be because i don't really know a name for this problem. an xtext grammar for XML would also have to address this problem and might be helpful, but I couldn't find one either.
Can anyone help me?
Regards
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.25137 seconds