Usage of EOF to consume a file in Xtext [message #1810303] |
Wed, 07 August 2019 05:37 |
Eclipse User |
|
|
|
Hi everyone,
I'm new using Xtext and I'm trying to define my own grammar for reading some configuration files, looking for create a meta model.
This is an example of a configuration file:
apiVersion: myApiVersion
kind: myKind
metadata: label: service: myNameService name: myName
spec: replicas: numberOfReplicas and something else...
In my application I don't need the "and something else..." part, so i'm looking for a way to write my grammar correctly without taking care of that part.
Looking at:
https://www.eclipse.org/Xtext/documentation/301_grammarlanguage.html
I found that in Xtext you can define terminal UNCLOSED_STRING:
terminal UNCLOSED_STRING : '"' (!'"')* EOF;
but, after the declaration, I don't know how to use it.
can someone help me to find a way? or maybe are there other approaches to do this?
thank you in advance for everything you will advice
|
|
|
Powered by
FUDForum. Page generated in 0.03653 seconds