What are the initial requirement that i need to know to develop a programming language like coffee script that basically has its own syntax but after compilation changes into another language. I did Google on that but couldn't find the right answer.
CoffeeScript Variables (No var Keyword) In JavaScript, we declare a variable using the var keyword before creating it, as shown below. While creating variables in CoffeeScript, there is no need to declare them using the var keyword. We can directly create a variable just by assigning a value to it as shown below.
CoffeeScript is a programming language that compiles to JavaScript. It adds syntactic sugar inspired by Ruby, Python, and Haskell in an effort to enhance JavaScript's brevity and readability.
Specify your language with a basic formal grammar in something like EBNF.
statement = if-statement
| return-statement
| expression
| ...
if-statement = "if" "(" expression ")" "{" statements "}"
return-statement = "return" expression ";"
...
Learn about simple parsing by recursive descent and operator precedence.
Write a parser that creates an abstract syntax tree from a source file.
Write a code generator that converts this AST into your target language; or
Write an interpreter that merely evaluates the AST.
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