![]() |
Telelogic TAU (steve huntington) | ![]() |
profile :
search :
help :
dashboard :
calendar :
home
|
||
|
Topic Title: PARSE IN TCL Topic Summary: Created On: 22-May-2006 10:04 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
Hello, set expr [u2: std::SaveAll |
|
![]() |
|
![]() |
|
Javier
Nice smilies :D. Just in case you didn't know, you can turn off 'emoticon parsing' when you post a message so the smilies don't appear unintentionally. Having used u2::Parse to get a model fragment, you have to add this fragment into the model somewhere. Assuming you have a reference to e.g. a package in tcl variable pkg, you could do something like shown below (haven't tried this but it should work). This is what the comment in the help for Parse that quote:is about. You could get the pkg reference from e.g. the user selection, or your script could create a new package directly under the Model element and put the parsed definitions in it. ... set expr [u2::Parse $model "class Car {public Integer a; }" Definition] std::output "Expresion: $expr \n" # add the definition into the package pkg u2::SetEntity $pkg OwnedMember $expr ... Note I have added the Definition option to the u2::Parse; depending on what you are parsing this could be Expression or Action; refer the the help for Parse. These different types of parsing would be stored under different metafeatures from the result of parsing a Definition (i.e. not under OwnedMember). If I were you I would try to stick to parsing definitions because it's simpler to put them into the model. Technically speaking, any metaclass which derives from Namespace has a metafeature OwnedMember. You can find out which metaclasses these are by looking at the TTDMetamodel (under Library). HTH Ian ------------------------- ============= Ian Barnard Principal Consultant Telelogic UK, an IBM company Edited: 22-May-2006 at 20:32 by Ian Barnard |
|
![]() |
|
![]() |
|
Thanks for your advice (Do not parse emoticons) and reply.
|
|
![]() |
|
![]() |
|
If you are interested in browsing your model from a metamodel view, the SDK gives you a fascinating look. Grab it from the TAU SDK download page. Look on the left side of your screen.
Greg ------------------------- Greg Gorman Vice President, Product Management Modeling and Test Products Telelogic AB |
|
![]() |
Telelogic TAU
» TAU/Developer
»
PARSE IN TCL
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.