Skip to main content



      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 09:33 Go to next message
Eclipse UserFriend
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 09:35 Go to previous messageGo to next message
Eclipse UserFriend
"Thisisastring"

ThisisanID
Re: Issues with terminal STRING which always outputs an error [message #1817537 is a reply to message #1817536] Mon, 25 November 2019 09:48 Go to previous messageGo to next message
Eclipse UserFriend
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 10:28] by Moderator

Re: Issues with terminal STRING which always outputs an error [message #1817542 is a reply to message #1817537] Mon, 25 November 2019 10:28 Go to previous message
Eclipse UserFriend
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: Fri Jul 11 22:31:32 EDT 2025

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

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

Back to the top