Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Plain Language parser in xtext xbase(Need docs/examples on plain language to java conversion using xbase)
Plain Language parser in xtext xbase [message #1794784] Thu, 06 September 2018 12:58 Go to next message
Sreedharan C is currently offline Sreedharan CFriend
Messages: 1
Registered: September 2018
Junior Member
Hi,

I want to convert the plain language into java code using xext, xbase.
Please provide some docs or share the example code for below sample scenario.

If employee age is greater than 60 then print "sixty"

I want to know how xtext file will be for this simple statement. How the xtext file can be converted to java?

Thanks.
Re: Plain Language parser in xtext xbase [message #1794800 is a reply to message #1794784] Thu, 06 September 2018 17:23 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6037
Registered: July 2009
Senior Member
Hi

You want to look at natural language processing. Sometimes I gather it even achieves 95% accuracy. Conversely that means 5% of programs are wrong, a far worse error rate than most programmers achieve.

I very much doubt that Xtext is suitable for natural language parsing.

Regards

Ed Willink

Re: Plain Language parser in xtext xbase [message #1794801 is a reply to message #1794800] Thu, 06 September 2018 17:24 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12229
Registered: July 2009
Senior Member
xbase makes only sense if you have a java like semantics and syntax/expressions.
to generate java from a dsl simply produce the java code you wish using a normal IGenerator(2)


Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Customize DSL file location in (maven) projects
Next Topic:Need help to implement an ambiguous grammar (ACSL grammar)
Goto Forum:
  


Current Time: Wed Sep 19 23:04:54 GMT 2018

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

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

Back to the top