Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: DXL parsing
Topic Summary:
Created On: 24-Jan-2004 14:13
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
Answer This question was answered by Stian Aase, on Saturday, January 24, 2004 5:41 PM

Answer:
Thanks, Roger!

Your theory makes sense, and explains nicely the actual symptoms I experienced in the broader context of my code. I would have saved time had I had the brains to think like a DXL interpretor during my debugging. I'll leave to the core developers of the DXL interpretor to explain why a single parameter in a function call gets concatenated in this way (with or without parentheses around that parameter) when the last parameter in a multiple parameter function call doesn't...:-)

-------------------------------------------
Stian Aase, Computas AS, Norway
 24-Jan-2004 14:13
User is offline View Users Profile Print this message


Stian Aase

Posts: 11
Joined: 13-Nov-2003

I find the DXL doc a little sparse on parsing, so can somebody state the parsing rule that causes this DXL...

//start
string testReturnString(string str) {
return "*" str "*"
}

print testReturnString("string") "\n"
//end

...to print the following:
*string
*

It seems concatenation has higher presedence than the end bracket in the call to testReturnString(). It would be great if the doc more clearly states exactly how DXL is parsed (and hence in this case why wrapping the call to testReturnString in parantheses, e.g. (testReturnString()), produces the intended result...:-)

-------------------------------------------
Stian Aase, Computas AS, Norway
Report this to a Moderator Report this to a Moderator
 24-Jan-2004 17:41
User is offline View Users Profile Print this message


Stian Aase

Posts: 11
Joined: 13-Nov-2003

Answer Answer
Thanks, Roger!

Your theory makes sense, and explains nicely the actual symptoms I experienced in the broader context of my code. I would have saved time had I had the brains to think like a DXL interpretor during my debugging. I'll leave to the core developers of the DXL interpretor to explain why a single parameter in a function call gets concatenated in this way (with or without parentheses around that parameter) when the last parameter in a multiple parameter function call doesn't...:-)

-------------------------------------------
Stian Aase, Computas AS, Norway
Report this to a Moderator Report this to a Moderator
 26-Jan-2004 16:25
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Well well well. That has just about got to be the stupidist "feature" I've ever seen. The other was a compiler that tried to figure out what you "must" have meant, translated it that way, and then run the program anyway.

I guess it only matters when the function expects a single string parameter.

That explains why I have to routinely:

[A] get the value of the function call, THEN print it:
Results = testReturnString("string")
print Results "\n"

Insure that all function calls within print statements are themselves bracketed:
print (testReturnString("string")) "\n"

Curious, however, is that I never seem to have this problem when I'm not calling print. Maybe I've NEVER before done something like this:
string Results = testReturnString("string") "\n"

- Louie
Report this to a Moderator Report this to a Moderator
 29-Jan-2004 18:18
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Got no problem with allowing "null next sibling o". But it should NOT automatically remove parenthesis when they exist, even for functions with one parameter.

- Louie
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.