Hello everybody. I am new to Xtext and I am facing the following problem.
I have written a simple grammar and use it to parse a file but I get the "missin EOF at ''" error. I think that the grammar is correct. What is wrong?
Why do I get this error at the first line? No other error alerts are generated.
I use the above grammar to parse the contents of the file below. The error points that some is wrong with the first line of the file. As you see in the grammar I have added the '\r\n' as terminal so that after parses the first line to jump to the 2nd. At the 2nd line it loops every other lines it finds until the end of the file.
If I remove the Type rule the parser works well as it manages to parse recursively all the lines of the file. E.g. Reads second line (=Section), then changes line (=\r\n) and then again the same etc.
However, when I add the Type rule it alerts me with the EOF error after parsing the first line.
So I thought if I add '\r\n' at the end of first line it would push the parser to start reading the second line and then entering the loop.
I now realize where this EOF is coming from. I will apply some modifications and see where it takes me.
I noticed the highlighting but I thought it was the other way around. Pretty useful info.
Btw, do you know of any good guide existing for practicing on writing grammars? Have you learned by the xtext user guide? I find it hard to follow. Would be appreciated if you can propose some useful links.