=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!