Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Parsing of language fragments
Parsing of language fragments [message #1742999] Fri, 09 September 2016 08:58 Go to next message
Klaus Schulz is currently offline Klaus SchulzFriend
Messages: 2
Registered: September 2016
Junior Member
For better Unit testing of my language, I want to test every rule separately.

However, the ParseHelper can only parse input that fully corresponds to the defined grammar.

Consider a language like HTML. I want to test parsing paragraphs <p> without having to nest them in <html><head><body> etc.

I think ANTLR offers similar possibilities.

Is this achievable in Xtext too?
Re: Parsing of language fragments [message #1743045 is a reply to message #1742999] Fri, 09 September 2016 20:25 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
hmm sounds like https://github.com/eclipse/xtext-core/issues/16

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Parsing of language fragments [message #1743050 is a reply to message #1743045] Sat, 10 September 2016 01:17 Go to previous messageGo to next message
Eric Salemi is currently offline Eric SalemiFriend
Messages: 35
Registered: September 2016
Location: Belgium
Member
I think I just bumped into that issue. If I inject extension with ParserHelper<T> where T is a rule/type which is not the root of my model, then the ParseHelper.parse() method returns a null pointer. Is this a problem of the ParserHelper class or a general XText problem? Can we achieve this in another way?
Re: Parsing of language fragments [message #1743057 is a reply to message #1743050] Sat, 10 September 2016 05:30 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
It is a missing Feature

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Problems parsing ruby on rails files with xtext
Next Topic:XBase language + Matlab code generation?
Goto Forum:
  


Current Time: Sat Apr 20 01:32:52 GMT 2024

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

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

Back to the top