Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

agent (5836)


Agent Zhang (章亦春) is a happy Yahoo! China guy who loves Perl more than anything else.

Journal of agent (5836)

Thursday April 28, 2005
06:54 AM

My First TXL Program

[ #24424 ]

=from 2005.4.28.8:15.AM
=to ...4.28.8:55.AM

Yesterday afternoon I successfully wrote and tested my first TXL program that could perform algebraic expansion and bracket reduction. The whole source file implementing a parser, an AST transformer, and an implicit code generator was only 120 lines long. I saw how TXL manages to automate the complete process of compiler construction by combining the syntax of BNF and the concept of subtree pattern match and substitution (subtree insertion).

TXL may be considered as a typed programming language where the subtree pattern and the goal tree must be of the same type (in other words, be corresponding to the same BNF entity name). This feature guarantees that the final AST gained by various transformations always remain "well-formed". In contrast, In my Trop (Tree Operation) project developed in last term, I allowed the user to perform subtree substitution directly on physical AST data structure where the resulting tree may be valid in grammar, but by no means certain. The Canadians should be given credit for their creative work on unifying BNF and subtree insertion. I must say they did a good job!

My discovery of TXL on the web was quite unexpected. It was in the syntax file (.stx file) list on EditPlus official site that I first saw this exotic language's name!

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.