Great this seems good though If I can write an out put file in a specific format I dont even need to go through the hectic process of making a parser in C#.
But after converting to prefix the new issue is to right it into a specific format. e.g. the following
==k13 +-4932.697781948424` *-1.156160458452722` k11
should be
(assert (= k13 (+ -4932.697781948424 ( * -1.156160458452722 k11) ) ))
which means every sub expression should be seperated by "()" so that compiler can understand which parts are seperated. Is there any way to write file ? according to some rules as you mentioned before in StringReplace command ?
{"Equal" -> "==", "Plus" -> "+", "Times" -> "*", "," -> "", "[" -> "", "]" -> ""}]
In simple Can I make a parser or can I define gramer? my main goal is to convert the resut into this context:
(assert (= k13 (+ -4932.697781948424 ( * -1.156160458452722 k11) ) ))
I tried writing a file via opening a stream or channel at a specific location but I am failed so far it seems there is no way to creat/access a file for writing other then "Export command": I used following but I am unable to access the file stored at a specific location.
In[10]:= ftest = FileNameJoin[{$Mathematica Solvings, "Test"}]
Out[10]= FileNameJoin[{Solvings $Mathematica, "Test"}]
Although it gives me no error but when I tried to acess this file I received error:
In[11]:= test = OpenWrite[ftest]
During evaluation of In[11]:= OpenWrite::fstr: File specification FileNameJoin[{Solvings $Mathematica,Test}] is not a string of one or more characters. >>
Out[11]= $Failed