Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Issues with terminal STRING which always outputs an error
Issues with terminal STRING which always outputs an error [message #1817535] Mon, 25 November 2019 14:33 Go to next message
Tijmen Rijmen is currently offline Tijmen RijmenFriend
Messages: 11
Registered: November 2019
Junior Member
I got another question about XText.

I got the following code in my dsl:
Foot:
    name="foot" ':' ('off' |
    ((('bgcolor' ':' bgcolor=COLOR) | ('bgpattern' ':' bgpattern=PATTERN) | ('bgimage' ':' bgimage=IMAGESRC))?
    & ('position' ':' position=SIZE_POS)? 
    & ('size' ':' size=SIZE_POS)?
    & ('text' ':' text=STRING)? ))
;


In the user environment (sorry for my terminology) I'm using this:

foot:
position: 200x200
size: 299x200
text: asdffsadfsad


However, text is returning an error for every combination of characters. The error is: mismatched input 'asdffsadfsad' expecting RULE_STRING. Why does it give me this error? I would like to be able to also use colons(:) or spaces in that field. How can I achieve this?

I started with a clean XText project and I did not override the terminal STRING.
Re: Issues with terminal STRING which always outputs an error [message #1817536 is a reply to message #1817535] Mon, 25 November 2019 14:35 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14669
Registered: July 2009
Senior Member
"Thisisastring"

ThisisanID


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Issues with terminal STRING which always outputs an error [message #1817537 is a reply to message #1817536] Mon, 25 November 2019 14:48 Go to previous messageGo to next message
Tijmen Rijmen is currently offline Tijmen RijmenFriend
Messages: 11
Registered: November 2019
Junior Member
Having this in the user environment will generate the same error message:
[code]foot:
position: 200x200
size: 299x200
text: "sadfsad"/code]



Thanks already for your response XText god (C. Dietrich).

[Updated on: Mon, 25 November 2019 15:28]

Report message to a moderator

Re: Issues with terminal STRING which always outputs an error [message #1817542 is a reply to message #1817537] Mon, 25 November 2019 15:28 Go to previous message
Tijmen Rijmen is currently offline Tijmen RijmenFriend
Messages: 11
Registered: November 2019
Junior Member
I believe I fixed it myself. I changed almost all the terminal rules to parser rules. And that fixed it, now I can use a string between '' . The reason for this is unknown to me but it works so thanks!
Previous Topic:Programmatically Generate DSL Files - Head Spinning
Next Topic:Title: Issue with serializing cross reference with same name
Goto Forum:
  


Current Time: Sat Apr 27 00:21:54 GMT 2024

Powered by FUDForum. Page generated in 0.02738 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top