Skip to main content



      Home
Home » Modeling » TMF (Xtext) » XExpressions and Statements(Understanding the XExpression and behavior of ";")
XExpressions and Statements [message #1842367] Thu, 17 June 2021 04:32 Go to next message
Eclipse UserFriend
I wanted to rebuild the Java Syntax and use XBase for that.
I thought, that the XExpression was made for that, but then I've seen this:
Quote:
Expressions are the main language constructs which are used to express behavior and compute values. The concept of statements is not supported, but instead powerful expressions are used to handle situations in which the imperative nature of statements would be helpful.

And I found pretty much everything I need in the XExpressions. However, I Java does a ";" after every Statement. I know that Expressions are not Statements, but I prefer forcing them in the DSL (even though the Rules do not need them).
I've seen that, the XBlockExpression has a semicolon and thus an "if" with curly braces have them as well, but while statements with curly braces do not use semicolon (should be XBlockExpression as well).
if (i==2) {
  while (i< 3) {
    i++
  }
} else {
  j++;
}

Can you help me understanding the difference and is there a way to add semicolons?
Re: XExpressions and Statements [message #1842369 is a reply to message #1842367] Thu, 17 June 2021 04:34 Go to previous message
Eclipse UserFriend
maybe https://github.com/LorenzoBettini/jbase is what you are looking for
Previous Topic:xtext 2.25.0 + jdk 11.0.11
Next Topic:Cannot build old Xtext projects with maven since 2021-06-16
Goto Forum:
  


Current Time: Mon Jun 23 18:36:24 EDT 2025

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

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

Back to the top