wanted to write an interpreter for a language of my own
-
I am writing an interpreter for a language of my own language. It will be basically a command line application. What if I wanted to embed it in a Windows application? I don't know how to creat a command line application which I can integrate with other windowns form application. CAn anyone help me with any tutorials with that purpose? AMit
-
I am writing an interpreter for a language of my own language. It will be basically a command line application. What if I wanted to embed it in a Windows application? I don't know how to creat a command line application which I can integrate with other windowns form application. CAn anyone help me with any tutorials with that purpose? AMit
I don't know if you're expecting the actual command line shell (cmd.exe) to be embedded in an application. If you just want the UI, this[^] might help. Regards Senthil _____________________________ My Blog | My Articles | WinMacro
-
I am writing an interpreter for a language of my own language. It will be basically a command line application. What if I wanted to embed it in a Windows application? I don't know how to creat a command line application which I can integrate with other windowns form application. CAn anyone help me with any tutorials with that purpose? AMit
No i dont, but start looking here: http://home.earthlink.net/~huston2/dp/interpreter.html[^] or here: http://wiki.cs.uiuc.edu/patternStories/InterpreterPattern[^] i wish you goodluck soldier! Zitniet
-
I don't know if you're expecting the actual command line shell (cmd.exe) to be embedded in an application. If you just want the UI, this[^] might help. Regards Senthil _____________________________ My Blog | My Articles | WinMacro
Dear Senthil, Thanks for your reply. In fact your code is my inspiration. I just don't want a command line interpretor like cmd.exe. I want a more powerful add-in components. I am trying to write a computational software. My idea is something like this.
>> A=[1,2,3;3,4,5;6,7,8];
output should be displayed in the command promptA=[1,2,3; 3,4,5; 6,7,8];
This should define a matrixA
.>>Inverse(A)
this should call function Inverse and display the result from the function Inverse. So, i want to know how modification I need to make in your code to understand these kind of commands at my command promt in the software. Regards, Amit -
Dear Senthil, Thanks for your reply. In fact your code is my inspiration. I just don't want a command line interpretor like cmd.exe. I want a more powerful add-in components. I am trying to write a computational software. My idea is something like this.
>> A=[1,2,3;3,4,5;6,7,8];
output should be displayed in the command promptA=[1,2,3; 3,4,5; 6,7,8];
This should define a matrixA
.>>Inverse(A)
this should call function Inverse and display the result from the function Inverse. So, i want to know how modification I need to make in your code to understand these kind of commands at my command promt in the software. Regards, AmitThe control that I wrote takes care of the UI part. What you do in response to user commands is up to you. You need to subscribe to the
CommandEntered
event, there, you'll get the command the user entered (in your case, Inverse(A)) as part ofCommandEnteredEventArgs
. You can then do whatever processing you want and print to the console using theWriteText
method. Regards Senthil _____________________________ My Blog | My Articles | WinMacro -
The control that I wrote takes care of the UI part. What you do in response to user commands is up to you. You need to subscribe to the
CommandEntered
event, there, you'll get the command the user entered (in your case, Inverse(A)) as part ofCommandEnteredEventArgs
. You can then do whatever processing you want and print to the console using theWriteText
method. Regards Senthil _____________________________ My Blog | My Articles | WinMacroDear Senthil, Thanks a lot. I think your last message cleared almost everything I wanted to know. Right now, I am trying to understand your code. The command promt control tool, you have designed , is it a multiline textbox control? I wanted to fundamental building unit of the command promt you have used to make the shell command. Regards, Amit
-
Dear Senthil, Thanks a lot. I think your last message cleared almost everything I wanted to know. Right now, I am trying to understand your code. The command promt control tool, you have designed , is it a multiline textbox control? I wanted to fundamental building unit of the command promt you have used to make the shell command. Regards, Amit
Yes, it is a multiline textbox. The code is not that big, you should be able to quickly understand what's going on. I only hope you're not planning to write your own user control, because then the purpose of me writing a user control will be lost :) Regards Senthil _____________________________ My Blog | My Articles | WinMacro
-
Yes, it is a multiline textbox. The code is not that big, you should be able to quickly understand what's going on. I only hope you're not planning to write your own user control, because then the purpose of me writing a user control will be lost :) Regards Senthil _____________________________ My Blog | My Articles | WinMacro
Thanks Senthil! As a matter of fact, I want to use your control for one of my applications. But I have seen one problem with that, I can't come out of the directory in which the testapp.exe is staying, i.e. as I start the application and type the following command. >>> cd .. it does not work. I woudl like to hear from you before I get into your code and figure out what is going on. And also I had asked this question in the forum and Nobody could answer me. Can I change the opacity of the control? Regards, Amit
-
No i dont, but start looking here: http://home.earthlink.net/~huston2/dp/interpreter.html[^] or here: http://wiki.cs.uiuc.edu/patternStories/InterpreterPattern[^] i wish you goodluck soldier! Zitniet
Thanks :) Zitniet
-
Thanks Senthil! As a matter of fact, I want to use your control for one of my applications. But I have seen one problem with that, I can't come out of the directory in which the testapp.exe is staying, i.e. as I start the application and type the following command. >>> cd .. it does not work. I woudl like to hear from you before I get into your code and figure out what is going on. And also I had asked this question in the forum and Nobody could answer me. Can I change the opacity of the control? Regards, Amit
amitmohanty wrote: As a matter of fact, I want to use your control for one of my applicatio Great :) amitmohanty wrote: I can't come out of the directory... That's because the sample application that uses the control spawns a new shell (cmd.exe) for every command, so it doesn't remember previous commands. Hitting cd.. will make the current cmd.exe go up one directory, but then the next dir will run on a new cmd.exe and therefore would show the same directory. If you want to, you can spawn a single cmd.exe and redirect output/input to just that single exe, that would do what you want. amitmohanty wrote: Can I change the opacity of the control? I don't know if we can modify opacity for individual controls within a window, but you can try pinvoking
SetLayeredWindowAttributes
/ Regards Senthil _____________________________ My Blog | My Articles | WinMacro