Hey,
I have modified the domainmodel example into a whitespace DSL, see as follows:
datatype String
entity Blog
title: String
many posts: Post
entity HasAuthor
author: String
entity Post extends HasAuthor
title: String
content: String
many comments: Comment
entity Comment extends HasAuthor
content: String
it's quite nice, but the problem now is that I have to type in an element underneath an entity, even though I have make the expression "(features+=Feature)*" optional. See as follows:
datatype String
entity Blog
title: String
many posts: Post
entity HasAuthor
entity Post extends HasAuthor
title: String
content: String
many comments: Comment
entity Comment extends HasAuthor
content: String
Then I would receive error message at line "entity Post...", that:
mismatched input 'entity' expecting RULE_BEGIN.
So how could I make it allow empty element exist?
[Updated on: Wed, 27 October 2021 04:40] by Moderator