OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Create a special purpose programming language, in XML, using statetransitions

Hi Folks,

Occasionally I find that I need to create a special-purpose programming language, to be used to describe how to process XML documents.

In creating the language I would mimic other programming languages such as Java, e.g.,



Then I would write an interpreter (using XSLT) to interpret "programs" written in my new programming language.

However, I recently realized that there is another approach. This illustrates the approach:

        <Transition currentState="Number" read="0" write="0"
                            nextState=Number" />
        <Transition currentState="Number" read="1" write="1"
                            nextState=Number" />
        <Transition currentState="Number" read=" " write="0"
                            nextState=Halt" />

Instructions and algorithms are expressed using state transition rules.

The neat thing about this approach is:

(1) It is very regular. I don't need to invent a bunch of new elements, such as <if> and <while>.

(2) It is very powerful - it can express any algorithm [1]. 

(3) No need to constantly extend the language to support new features.

I was inspired to this approach after reading this fantastic article [2], which represents Turing Machines in XML. 

Have you created your own special purpose programming language, formatted as XML? If so, what approach did you take to create your language?


[1] You may recognize that this is essentially a Turing machine. Turing machines are known to be capable of expressing any algorithm.

[2] See section 2 of:

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS