Hi,
I am working on a parser/translator script in hopes of sharing variables across different tool language domains. Because most EDA tools support TCL as the native language, I decided to tackle my first TCL script. Below is a rough description of what I've done so far:
1.) read all variable definitions (from file) into memory and build list of variables to translate.
2.) Determine if the variable is an array, list, or string.
3.) Call the appropriate translation procedure.
I'm using the built-in tcl function [array exists] to test variable for an array. However, I am having alot of trouble distinguishing between a string and a list. This test is needed in order to translate variables to different languages successfully. Perhaps an example of what Im tryin to acheive would help:
TCL vars:
set string "Im a string"
set simple {"Im a simple list"}
set list {"Im" {"a"} "list"}
set num 10
output (Scheme format)
define string "Im a string"
define simple '("Im a simple list")
define list '("Im ("a") "list")
define num 10
Any help is greatly appreciated.
Thanks!
I am working on a parser/translator script in hopes of sharing variables across different tool language domains. Because most EDA tools support TCL as the native language, I decided to tackle my first TCL script. Below is a rough description of what I've done so far:
1.) read all variable definitions (from file) into memory and build list of variables to translate.
2.) Determine if the variable is an array, list, or string.
3.) Call the appropriate translation procedure.
I'm using the built-in tcl function [array exists] to test variable for an array. However, I am having alot of trouble distinguishing between a string and a list. This test is needed in order to translate variables to different languages successfully. Perhaps an example of what Im tryin to acheive would help:
TCL vars:
set string "Im a string"
set simple {"Im a simple list"}
set list {"Im" {"a"} "list"}
set num 10
output (Scheme format)
define string "Im a string"
define simple '("Im a simple list")
define list '("Im ("a") "list")
define num 10
Any help is greatly appreciated.
Thanks!