[abst]
Pattern search of programs is a fundamental func- tion for supporting
programming. In this paper, we propose a search method for
unpreprocessed programs, which are difficult to parse. Our parser
directly parses them by rewriting token sequences, and allows minor
errors in syntax trees. The search tool takes queries that are the
same as the format of program fragments. By using the same parser for
both queries and target programs, programmers have no need to describe
the detail structures of syntax trees in queries. To support accurate
search, we also show an alignment tool for branch directives, which
converts undisciplined directives to discipline ones, and a reverse
macro expansion tool, which integrates the use of macro
calls. Finally, we present some experiments in which we have applied
the tools to an open source application, and discuss how to improve
our tools.