Tech Off Thread

5 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

How to convert custom code to CSharp?

Back to Forum: Tech Off
  • User profile image

    I'm trying to make an application where you can input a custom code language I made in one textbox, press a button and it should convert it to CSharp into another textbox.

    I have no problem with converting simple voids and brackets, but how can I use variables, and statements like if..then etc.?

    I would really like some help on this, thanks.

  • User profile image

    Probably you should read the SharpDevelop source code, and learn how SharpDevelop does it in C#.


  • User profile image
    Sven Groot

    You're talking about writing a compiler for your language that outputs C#. Depending on how different your language is from C#, this could be very, very complex.

    You will probably need to write a parser for your language. Rarely anybody writes parsers by hand anybody, instead they use parser generators, somtimes called compiler compilers. One such toolset for C# are the Compiler tools for C# (scroll down a bit to find the download). But even just learning the ins and outs of using a parser generator, especially if you're not already familiar with existing ones such as lex/yacc, can be quite a time-consuming task.

  • User profile image
    Deactivated User

    Comment removed at user's request.

  • User profile image

    yman wrote:
    I created a language in VB.NET which transfered the language's code into VB.NET which is then compiled using codedom.

    Yeah exactly, well I know how to use codedom, but I dunno how to transfer the custom language...

    Like this for example:


    should become:


Conversation locked

This conversation has been locked by the site admins. No new comments can be made.