For example, the following php source code:

We will obtain the following Tree (with the php lexer & grammar in input):

Using this compiler structure, the common visitors of a traditional compiler becomes xslt style sheet. A toEval visitor becomes a toEval xslt style sheet etc... I already wrote a very simple toWrite visitor which just take care of writing the text into tokens.
The hardest part is now to perform weaving using xslt and the main limitation is that xslt variables are constants.
I keep you in touch ;o)
No comments:
Post a Comment