loading...
 This Article 
   
 Share 
   
 Bibliographic References 
   
 Add to: 
 
Digg
Furl
Spurl
Blink
Simpy
Google
Del.icio.us
Y!MyWeb
 
 Search 
   
4th International Workshop on Program Comprehension (WPC '96)
Fast, Flexible Syntactic Pattern Matching and Processing
Berlin, GERMANY
March 29-March 31
ISBN: 0-8186-7283-8
William G. Griswold, University of California, San Diego
Darren C. Atkinson, University of California, San Diego
Collin McCurdy, Rice University
Program understanding can be assisted by tools that match patterns in the program source. Lexical pattern matchers provide excellent performance and ease of use, but have a limited vocabulary. Syntactic matchers provide more precision, but may sacrifice performance, retargetability, ease of use, or generality. To achieve more of the benefits of both models, we extend the pattern syntax of AWK to support matching of abstract syntax trees, as demonstrated in a tool called TAWK. Its pattern syntax is language-independent, based on abstract tree patterns. As in AWK, patterns can have associated actions, which in TAWK are written in C for generality, familiarity, and performance. The use of C is simplified by high-level libraries and dynamic linking. To allow processing of program files containing non-syntactic constructs, mechanisms have been designed that allow transparent matching in a syntactic fashion. So far, TAWK has been retargeted to the MUMPS and C programming languages. We survey and apply prototypical approaches to concretely demonstrate the tradeoffs. Our results indicate that TAWK can be used to quickly and easily perform a variety of common software engineering tasks, and the extensions to accommodate non-syntactic features significantly extend the generality of syntactic matchers.
Index Terms:
pattern matching, macros, lexical, syntactic
Citation:
William G. Griswold, Darren C. Atkinson, Collin McCurdy, "Fast, Flexible Syntactic Pattern Matching and Processing," wpc, pp.144, 4th International Workshop on Program Comprehension (WPC '96), 1996
Usage of this product signifies your acceptance of the Terms of Use.