-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve syntax of generated Turtle files #118
Comments
The grammar of ttl has a lot of those separators like ';' in it, maybe even a postfix like '.' for the statement:
When generating a segment, you are never sure whether to put a seperator. There are two approaches to fix this: lookahead or postprocessing. Lookahead is a bit annoying since you have to implement the specific logic for every feature (btw: this is unavoidable when implementing xtext formatting 2). Postprocessing on the other hand only comes with the cost of processing power - during generation phase one generates marker into the file. As soon as we are done generating, we can call the stateful context per file and execute the postprocessing, which just replaces the markers with the separator or postfix token (since these contexts are able to make the decision which one to chose). Solution: Introducing IJoinContext, which implements postprocessing. TTL files look neat. This also replaces GlueingContext and stuff like extension 'jsonListSeparator' Therefore the generated syntax of the Json files also has improved. This solution also looks also sustainable for future changes. For examples see *.ttl and *.json files here: how generated ttl and json files changed in this feature branch |
Nice and tidy solution with the JoinContext, I like it. Closing this. |
Improve the syntax of the generated
.ttl
files.Original issue: #138
I suspect that the irregular punctuation leads to the mentioned parsing issues.
Here's the turtle spec: https://www.w3.org/TR/turtle/#sec-grammar
The text was updated successfully, but these errors were encountered: