I’m very interested in creating flexible code in AS3 which reflects best practice in other Programming Languages, and primarily follows the topics covered in the Pragmatic Programmer.
One chapter deals with Domain Languages, which seems a good approach to make more adaptable, robust, readable and testable code. In envisage creating a text file in an easy to read format which can change the behaviour of my Flash app in runtime.
- Domain Specific Languages in AS3 ( part 1 ), it’s good to see another AS3 developer interested in DSL
- An Introductory Example is great example from Martin Fowler
First Step – Using a simple text file
I created a simple AS3 Class which reads a text file and returns values. The text file is formed in the following way:
Whilst the AS3 Class can be called in the following way:
var foo:String = Scriptparser.getData("foo");
This post is much of a ‘stub’ for my only personal use, to add to as I continue with this project. From Martin Fowlers article, it seems I need an External DSL which uses a Semantic Model.