Skip to main content

Posts

Showing posts with the label parser

Writing a Scripting Language

One of the projects that I am working on is how to write a scripting language using c++.  At first thought, I imagined the task to be hard, but to my surprise it is quiet easy. In this post I will introduce the basics.  However, I do suggest you visit my youtube channel and watch the video series . token evaluation process  As you can see from the image to the left, my script engine basically takes a string expression, converts it to tokens, determines its meaning, and then compiles the effective byte code. Byte code is the instruction set for my script language.  It will tell our virtual machine or virtual process what an instruction is suppose to do. In more detail, the script engine does a recursive call with the tokens to successfully generate all the corresponding byte code. Source Code This link contains the source code and is version 1 of script.