![]() |
Whitespace characters in element names |
Post Reply
|
| Author | |
stefanvw
Member
Joined: 04.Jul.2008 Location: Munich, Germany Points: 1 |
Post Options
Thanks(0)
Quote Reply
Topic: Whitespace characters in element namesPosted: 10.Jul.2008 at 18:17 |
|
Hej,
in my state machine using the WatchApplication DSL I have names with whitespaces and dot-characters. This causes problems for compilation of the generated c files. Is it possible to replace these characters in the generator on the fly by underscore characters? I would not like using the oid property, because it would impair the readability of the generated code. Thanks in advance! Stefan |
|
![]() |
|
janne
MetaCase
Joined: 25.Mar.2008 Points: 58 |
Post Options
Thanks(0)
Quote Reply
Posted: 11.Jul.2008 at 09:26 |
|
Yes, translators can be used for that.
In the generator script you had to have call to the subreport '_translators', which initializes the predefined translators. Then you may use e.g. %var translator, which makes a legal variable name by mapping non-alphanumerics to underscore. e.g. subreport '_translators' run foreach .State [Watch] { id%var newline } In the sample above all the State [Watch] id property values are translated to have only alphanumeric values (all other characters are replaced with underscore). Subreport '_translators' is stored in the Graph, so any DSM language can access it. In the _translator script there exists predefiened translators e.g. having upper or lower case, XML, adding and removing indentations etc. See more details from the online manual Translating stings |
|
![]() |
|
Post Reply
|
|
| Tweet |
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |