Skip to main content
Log in

Agile Parsing in TXL

  • Published:
Automated Software Engineering Aims and scope Submit manuscript

Abstract

Syntactic analysis forms a foundation of many source analysis and reverse engineering tools. However, a single standard grammar is not always appropriate for all source analysis and manipulation tasks. Small custom modifications to the grammar can make the programs used to implement these tasks simpler, clearer and more efficient. This leads to a new paradigm for programming these tools: agile parsing. In agile parsing the effective grammar used by a particular tool is a combination of two parts: the standard base grammar for the input language, and a set of explicit grammar overrides that modify the parse to support the task at hand. This paper introduces the basic techniques of agile parsing in TXL and discusses several industry proven techniques for exploiting agile parsing in software source analysis and transformation.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Similar content being viewed by others

References

  • Badros, G. 2000. JavaML: A markup language for Java source code. Computer Networks, n33(1–6):159–177.

    Google Scholar 

  • Baxter, I.D. and Pidgeon, C.W. 1997. Software change through design maintenance. Proc. 1997 International Conference on Software Maintenance, Bari, Italy, pp. 250–259.

  • Bell Canada. (2000). Datrix Abstract Semantic Graph: Reference Manual, Version 1.4, Bell Canada Inc., Montreal Canada, May 01.

    Google Scholar 

  • van den Brand, M., Sellink, A., and Verhoef, C. 1998. Current parsing techniques in software renovation considered harmful. Proc. 6th International Workshop on Program Comprehension (IWPC 98), Ischia, Italy, pp. 108–117.

  • van den Brand, M., van Deursen, A., Heering, J., de Jong, H., de Jonge, M., Kuipers, T., Klint, P., Moonen, L., Olivier, P., Scheerder, J., Vinju, J., Visser, C., and Visser, J. 2001. The ASF+SDF Meta-Environment: A component-based language development environment. In R. Wilhelm, editors, Compiler Construction 2001 (CC 2001), Lecture Notes in Computer Science, Springer Verlag, vol. 1827, pp. 365–370.

  • van den Brand, M., Heering, J., Klint, P., and Olivier, P. 2002. Compiling rewrite systems: The ASF+SDF compiler. ACM Transactions on Programming Languages and Systems, 24(4):334–368.

    Google Scholar 

  • Cordy, J.R., Halpern, C.D., and Promislow, E. 1991. TXL: A rapid prototyping system for programming language dialects. Computer Languages, 16(1):97–107.

    Google Scholar 

  • Cordy, J.R., Carmichael, I.H., and Halliday, R. 2000. The TXL programming language-Version 10, Kingston: Queen's University at Kingston and Legasys Corporation.

  • Cordy, J., Schneider, K., Dean, T., and Malton, A. 2001. HSML: Design directed source code hot spots. Proc. 9th International Workshop on Program Comprehension (IWPC 01), Toronto, Canada, pp. 145–154.

  • Cordy, J., Dean, T., Malton, A., and Schneider, K. 2002. Source transformation in software engineering using the TXL transformation system. Special Issue on Source Code Analysis and Manipulation. Journal of Information and Software Technology, 44(13):827–837.

    Google Scholar 

  • Cordy, J. 2003. Generalized selective XML markup of source code using agile parsing. Proc. 11th International Workshop on Program Comprehension (IWPC 03), Portland, pp. 144–153.

  • Cox, A. and Clarke, C. 2000. A comparative evaluation of techniques for syntactic level source code analysis. Proc. 7th Asia-Pacific Software Engineering Conference (APSEC'00), Singapore, pp. 282–291.

  • Dean, T., Cordy, J., Schneider, K., and Malton, A. 2001. Experience using design recovery techniques to transform legacy systems. Proc. International Conference on Software Maintenance (ICSM 2001), Florence, Italy, pp. 622–631.

  • van Deursen, A. and Kuipers, T. 1999. Building documentation generators. Proc. International Conference on Software Maintenance (ICSM 99), Oxford, England, pp. 40–49.

  • Guo, X., Cordy, J., and Dean, T. 2003. Unique renaming of Java code using source transformation. Proc. 10th International Workshop on Source Code Analysis and Manipulation (SCAM 2003), Amsterdam, to appear.

  • Johnson, S.C. 1975. Yacc: Yet another compiler-compiler. Computing Science Technical Report No. 32. Murray Hill, N.J.: Bell Laboratories.

    Google Scholar 

  • Lamb, D. and Schneider, K. 1992. Formalization of information hiding design methods. '92), Toronto, Canada, pp. 201–214.

  • Lämmel, R. 2001. Grammar adaptation. Proc. International Symposium on Formal Methods Europe (FME'01), Berlin, pp. 550–570.

  • Lämmel, R. and Verhoef, C. 2001. Semi-automatic Grammar Recovery. Software Practice & Experience, 31(15):1395–1438.

    Google Scholar 

  • Lethbridge, T., Plödereder, E., Tichelaar, S., Riva, C., and Linos, P. 2001. The Dagstuhl Middle Model (DMM), Version 0.003, http://scgwiki.iam.unibe.ch:8080/Exchange/2.

  • Lesk, M.E. and Schmidt, E. 1975. Lex-A Lexical Analyzer Generator. Computing Science Technical Report No. 39. Murray Hill, NJ: Bell Laboratories.

    Google Scholar 

  • Maletic, J., Collard, M., and Marcus, A. 2002. Source code files as structured documents. Proc. 10th International Workshop on Program Comprehension (IWPC 02), Paris, France, pp. 289–292.

  • Malton, A.J., Schneider, K.A., Cordy, J.R., Dean, T.R., Cousineau, D., and Reynolds, J. 2001. Processing software source text in automated design recovery and transformation. Proc. 9th International Workshop on Program Comprehension (IWPC 2001), Toronto, Canada, pp. 127–134.

  • Moonen, L. 2001. Generating robust parsers using island grammars. Proc. 8th Working Conference on Reverse Engineering (WCRE 01), Stuttgart, Germany, pp 13–22.

  • Moonen, L. 2002. Lightweight impact using island grammars. Proceedings 10th International Workshop on Program Comprehension (IWPC 02), Paris France, pp. 343–352.

  • Müller, H. and Klashinsky, K. 1988. Rigi-A System for Programming-in-the-Large. Proc. 10th International Conference on Software Engineering (ICSE 88), Singapore, pp. 80–86.

  • Neighbors, J. 1984. The Draco approach to constructing software from reusable components. IEEE Transactions on Software Engineering, 10(5):564–574.

    Google Scholar 

  • Reasoning Systems. 1992. Refine User's Manual. Palo Alto, California.

  • Sellink, A. and Verhoef, C. 1998. Native patterns. Proc. 5th Working onference on Reverse Engineering, Honolulu, Hawaii, pp. 89–103.

  • Sellink, A. and Verhoef, C. 1999. An architecture for automated software maintenance. Proc. 7th International Workshop on Program Comprehension (IWPC 99), Pittsburgh, Pennsylvania, pp. 38–48.

  • TXL Project. 2003. FreeTXL 10.2e. http://www.txl.ca/ndownload.html.

  • Visser, E. 2001. Stratego: A language for program transformation based on rewriting strategies. In A. Middeldorp, editor, System Description of Stratego 0.5. '01), Lecture Notes in Computer Science, SpringerVerlag, pp. 357–361.

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

About this article

Cite this article

Dean, T.R., Cordy, J.R., Malton, A.J. et al. Agile Parsing in TXL. Automated Software Engineering 10, 311–336 (2003). https://doi.org/10.1023/A:1025801405075

Download citation

  • Issue Date:

  • DOI: https://doi.org/10.1023/A:1025801405075

Navigation