|
|
Re: Whitespace-Aware Languages with unindented Single line comment [message #1748857 is a reply to message #1748692] |
Tue, 29 November 2016 12:09   |
Stefan Thoeni Messages: 6 Registered: November 2016 |
Junior Member |
|
|
Hi Christian,
Thanks for your response. Sadly this does not resolve the issue i have.
Referring to following home-automation example this still gives me the error "missing RULE_BEGIN at 'fire'":
Device Window can be open, closed
Device Heater can be on, off, error
Rule 'Save energy' when Window.open then
fire(Heater.off)
// Some comment
fire(Heater.off)
Do you have any other ideas on how to tackle this?
Regards,
Stefan
Edit: edited the example-syntax
[Updated on: Tue, 29 November 2016 12:19] Report message to a moderator
|
|
|
|
|
|
|
|
Re: Whitespace-Aware Languages with unindented Single line comment [message #1748959 is a reply to message #1748949] |
Wed, 30 November 2016 13:52   |
Stefan Thoeni Messages: 6 Registered: November 2016 |
Junior Member |
|
|
Hi Uli,
Thanks for your response. The repetition of Expressions or Variable declarations are not the problem here.
The then part of the rule 'Rule' consists of a XBlockExpression:
Rule:
'Rule' description=STRING
'when' deviceState=[State|QualifiedName]
'then' thenPart=XBlockExpression;
Which is a block filled with zero or many XExpressionOrVariableDeclaration:
XBlockExpression returns xbase::XExpression:
{xbase::XBlockExpression}
BEGIN
(expressions+=XExpressionOrVarDeclaration ';'?)*
END;
This makes this .rules file valid under the grammar:
Device Window can be open, closed
Device Heater can be on, off, error
Rule 'Save energy' when Window.open then
var someDeclaration = "Anystring";
fire(Heater.off)
// Some Comment
main(["mainArgs..."]);
But this is not because of the aforementioned problem considering block statements and comments:
Device Window can be open, closed
Device Heater can be on, off, error
Rule 'Save energy' when Window.open then
var someDeclaration = "Anystring";
fire(Heater.off)
// Some Comment
main(["mainArgs..."]);
What i would like is to have comments similar to most WS aware languages such as e.g. phyton whereas this is a syntactically valid program:
x = 1
if x == 1:
print("x is 1.")
# syntactically correct comment line
print("some other output")
Regards,
Stefan
edit: i fixed some typos.
[Updated on: Wed, 30 November 2016 13:53] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02763 seconds