We will introduce a software development method to develop an efficient program for stream data with a logic program transformation technique. The program specification is represented with the graph representation which is transformed to declarative Prolog predicates directly. In the specification, the input/output data are abstracted with list structure and the problem is specified with the relations between input list and output list. Since Prolog program is regarded as not only declarative predicates but also procedural program, we can utilize Prolog description as a declarative specification and a procedural program. In our method, the declarative specification is transformed to an efficient procedural program by the Fold/Unfold program transformation technique. In this paper, we will apply our method to the lexical analysis problem of the compiler program.