XExpressions and Statements [message #1842367] |
Thu, 17 June 2021 04:32  |
Eclipse User |
|
|
|
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?
|
|
|
|
Powered by
FUDForum. Page generated in 0.03509 seconds