SDAP :: Introducing boost::spirit Parser
This lesson assumes you have downloaded and compiled boost. If not, visit http://www.boost.org and download, install and build it.
This lesson assumes boost 1.34.1 but will probably work with 1.35.x as well.
In this series of lessons, we're going to be creating a scripting language and an interpreter for that language.
These lessons will be a work in progress until the last one is finished, so periodically some things might change.
For the most flexibility and extensibility, we should split the script engine into two projects. The first one is a DLL and it contains the bulk of the script engine. The reason it's in a DLL is so the script engine can be easily embedded and extended.
The second project is an executable that will process command-line parameters and use the script engine DLL to parse and execute scripts.
Getting Started
Create two new projects in your SDAP solution.
The first should be a DLL. I named mine "ZenScriptEngine?".
The second project should be an EXE. I named mine "ZenScript?".
Next, modify the project dependencies so that "ZenScript?" (or the EXE) depends on "ZenScriptEngine?" (or the DLL).
You will probably also want to make "ZenScript?" be your startup project.
For the DLL, you will probably want to rearrange the virtual folders to the IndieZen standards. Erase the Header Files, Source Files and Resource Files and add Public and Private folders. In the Private folder add sub-folders named Header Files and Source Files.
I don't normally do this type of rearrangement for .EXE projects since everything should be considered private.
Components
The basic components of this project are the Grammer, Parser, ParseState? and Engine.
The Grammar is the basic grammar of the scripting language. It interacts with the ParseState? to create sub-components of the Engine. The Parser combines the three other components and provides helpers for things such as "include" files.
main.cpp
In the EXE project, create a main.cpp.
