Click here to Skip to main content
15,889,176 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
See more:
hey guys,

i am making a programming language but i am a little stuck. i nearly everything that i want in it and i would keep working on it, but i need some things.

1. i would like to add and 'if' statement to my language. any ideas on how to do that?
2. i would like to add classes to my language. any ideas on how to do that?
3. i would like to add '{}' to my language. any ideas on how to do that?

i know that i am asking for a lot, but can you please help me?
Posted
Comments
Sergey Alexandrovich Kryukov 12-Mar-12 2:42am    
Yes, I do have some ideas, but I'm afraid writing a whole book on this topic will take an year of research and development, plus writing itself. And I'm not sure it worth it. Trying to address your particular items 1 to 3? They are hard to be considered out of the context, and anyway, it's hardly a topic for Quick Questions & Answers.

By the way, looking at the items where you "a little stuck", I feel that the statement "I am making a programming language" sound a bit of exaggeration. :-)
--SA
Member 8378691 13-Mar-12 3:56am    
hey, i am not doing this for a school assignment(i am only in year 9) but i am just doing this for fun. i am not actually making a programming language. my code structure at the moment is:
<pre lang="vb">
for each a as string in textbox1.text.split(system.environment.newline())
if a.contains("write ")
console.writeline(a.substring(6))
end</pre>

i am using the console and the form together.
Sergey Alexandrovich Kryukov 14-Mar-12 2:59am    
I actually respect your passion; I just wanted to give you a little warning about complexity of the matter. Don't over-simplify the problem. Not to worry, in worse case you will just learn some elementary parsing technique. You know what? You really need to learn about parser's designs, there are quite a few, and learning them is very effective compared to your home-baked approach. I understand you very well, because I always try to solve every new problem by myself before reading on the available works. This way, I get to much better understanding. But I see your approach to parsing is very naive. The real parsers are much less ad-hoc, very regular and data-driven (are you familiar with the concept?).
--SA
Member 8378691 6-Apr-12 4:01am    
i know what parsing technique i am going to use. i am actually making my programming language at the moment. i have 3 different classes to make my programming language with. there is the...

1. file opener, to open the file
2. tokeniser, to scan and split up the file
3. the parser, to scan the tokens and recognize some commands, then sends it off to the generator
4. to generate the code for the exe file.

i have based making this programming language on how real programming languages are made. and i am making my programming language for a challenge at school, there is the I.T. teacher at school who is teaching some year 12s how to program. he has a challenge for whoever can make a programming language the first and the best. i want to win both, and i am only in year 9!
Sergey Alexandrovich Kryukov 8-Apr-12 0:43am    
Great. My best wishes.
--SA

1 solution

Take a look at this article on CP Create Your Own Programming Language[^]. It will give you some good ideas on how to get started and what to look out for.
 
Share this answer
 
Comments
Member 8378691 13-Mar-12 3:59am    
hey, sorry about this but i am making my programming language in Visual Basic 2010 Express and in this tutorial, it is making one in Java.
Sergey Alexandrovich Kryukov 14-Mar-12 2:59am    
So what?! Are you a programmer or not? A different language, big deal!
--SA
Member 8378691 25-Mar-12 0:44am    
yeah, i am a programmer. thanks for this topic because it really helped and i am still writing my programming language in C#. if i need to, i will go onto a website that i found that translates c# programming into Visual Basic 2010 programming. But thanks for this.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900