close
Warning:
Can't synchronize with repository "(default)" (/var/svn/tolp does not appear to be a Subversion repository.). Look in the Trac log for more information.
- Timestamp:
-
Feb 22, 2012, 10:27:11 AM (13 years ago)
- Author:
-
Víctor de Buen Remiro
- Comment:
-
I think it could be possible, but the resulting expression will become the standarized form of initial one, not exactly the same.
There is no biyective relation between expressions and syntax trees. For example, you can add white spaces or line breaks or a final ';' to an expression without changing the resulting tree.
Set expr = [[
"Real x = a&b",
"Real x = a&b;",
"Real x = a & b;"
]];
Set table = For(1,Card(expr),Set(Real k_)
{[[
Real k = k_;
Text expression = expr[k];
Set tree = Parse(expression);
Text tree_dump = ""<<tree
]]});
Legend:
- Unmodified
- Added
- Removed
- Modified
-
initial
|
v1
|
|
1 | | |
2 | 1 | Hello, |
3 | 2 | ¿would it be posible to have the inverse function of Parse? |
4 | 3 | |
5 | 4 | This function would allow to build TOL expressions from a "Parse Set". Something like this: |
6 | | |
| 5 | {{{ |
7 | 6 | Text txt01 = Unparse(Parse(__TOL_EXPRESSION__)); |
8 | | |
| 7 | }}} |
9 | 8 | txt01 should be "the same" as __TOL_EXPRESSION__ |
10 | | |