+ 1

Best Language to Create Your own Language

I tried to make my own language on C#. I made a winform Application with richtextbox. Added a menustrip, some tools to exexute code. My language works like that: it check all lines in richtextbox using foreach(string s in richtextbox1.Lines) And after foreach line, it checks for function, like if(s.Contains("print)) If function found, a code gets a string from function, I made my Own .dll with GetBetween(char one, char two) method. I used that method to get a string between a double quotes in function When code got a string from function, that string Is adds to another richtextbox, i called it output. I know i made a language on C# wrong. But i dont understand how to do interpreter, etc... I check all topics and tutorials on Google. And its not explain where Is got a methods like Parse,Token, from what library Is it, or Is people MADE that methods?

9th Sep 2018, 11:32 AM
Dark Coder
Dark Coder - avatar
1 Answer
+ 2
making a language requires using lexers and parsers which will recognize language syntax and translate it into a different language (usually either C or ASM) behind the scenes when your program is executed. for a lexer you can use the program "flex" and for a parser, the program "bison" (there are more, these are just my recommendations)
9th Sep 2018, 1:21 PM
hinanawi
hinanawi - avatar