Using a Domain Specific Language in AS3


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.


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");

Further action

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.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s