Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Parsing of language fragments
Parsing of language fragments [message #1742999] Fri, 09 September 2016 04:58 Go to next message
Eclipse UserFriend
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 16:25 Go to previous messageGo to next message
Eclipse UserFriend
hmm sounds like https://github.com/eclipse/xtext-core/issues/16
Re: Parsing of language fragments [message #1743050 is a reply to message #1743045] Fri, 09 September 2016 21:17 Go to previous messageGo to next message
Eclipse UserFriend
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 01:30 Go to previous message
Eclipse UserFriend
It is a missing Feature
Previous Topic:Problems parsing ruby on rails files with xtext
Next Topic:XBase language + Matlab code generation?
Goto Forum:
  


Current Time: Thu Jul 17 00:41:10 EDT 2025

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

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

Back to the top