Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. wanted to write an interpreter for a language of my own

wanted to write an interpreter for a language of my own

Scheduled Pinned Locked Moved C#
helptutorialquestion
10 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    amitmohanty
    wrote on last edited by
    #1

    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

    S Z 2 Replies Last reply
    0
    • A amitmohanty

      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

      S Offline
      S Offline
      S Senthil Kumar
      wrote on last edited by
      #2

      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

      A 1 Reply Last reply
      0
      • A amitmohanty

        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

        Z Offline
        Z Offline
        zitniet
        wrote on last edited by
        #3

        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

        A 1 Reply Last reply
        0
        • S S Senthil Kumar

          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

          A Offline
          A Offline
          amitmohanty
          wrote on last edited by
          #4

          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 prompt A=[1,2,3; 3,4,5; 6,7,8]; This should define a matrix A. >>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

          S 1 Reply Last reply
          0
          • A amitmohanty

            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 prompt A=[1,2,3; 3,4,5; 6,7,8]; This should define a matrix A. >>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

            S Offline
            S Offline
            S Senthil Kumar
            wrote on last edited by
            #5

            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 of CommandEnteredEventArgs. You can then do whatever processing you want and print to the console using the WriteText method. Regards Senthil _____________________________ My Blog | My Articles | WinMacro

            A 1 Reply Last reply
            0
            • S S Senthil Kumar

              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 of CommandEnteredEventArgs. You can then do whatever processing you want and print to the console using the WriteText method. Regards Senthil _____________________________ My Blog | My Articles | WinMacro

              A Offline
              A Offline
              amitmohanty
              wrote on last edited by
              #6

              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

              S 1 Reply Last reply
              0
              • A amitmohanty

                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

                S Offline
                S Offline
                S Senthil Kumar
                wrote on last edited by
                #7

                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

                A 1 Reply Last reply
                0
                • S S Senthil Kumar

                  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

                  A Offline
                  A Offline
                  amitmohanty
                  wrote on last edited by
                  #8

                  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

                  S 1 Reply Last reply
                  0
                  • Z zitniet

                    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

                    A Offline
                    A Offline
                    amitmohanty
                    wrote on last edited by
                    #9

                    Thanks :) Zitniet

                    1 Reply Last reply
                    0
                    • A amitmohanty

                      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

                      S Offline
                      S Offline
                      S Senthil Kumar
                      wrote on last edited by
                      #10

                      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

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups