Possible Duplicates:
Methodologies for designing a simple programming language
Learning to write a compiler
I would like to write a programming language with a syntax similar to QBasic but even simpler. I want it to be for beginning programmers. Its simplicity will encourage aspiring programmers not to give up and get them interested in programming. For example: Instead of QBasic's PRINT "Hello World!"
I would use
Write "Hello World!"
or a little more like VB
Write ("Hello World")
How would I go about adapting the basic syntax to make my language?
This is not a simple task. Language parsing and compiler theory are pretty hefty subjects. Lots o' math. You also have to decide what platform you want to target, which will also determine whether your language is fully compiled (eg. C/C++, Pascal), compiled into bytecode (e.g. Python, Java), or interpreted at runtime (eg. VBScript, JavaScript). For specifying the language itself, brush up on the Backus-Naur format.
To help you along, there are several robust parser generators out there, including:
And many more. A comparison can be found here, while yet another list can be found here
If you're really interested in the full theory, you want to check out The Dragon Book.
But I must reiterate: This is a big subject. There are many, many tools to help you along the way, but the rabbit hole goes pretty deep.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With