【正文】
cks and thus improves modularity and software reuse. Sequential Function Chart (SFC) is a graphical language. SFC elements are defined for structuring the anization of programmable controller programs. One problem with IEC 61 1313 is that there is no standardized format for the project information in a PLC programming tool. At the moment there are only vendor specific formats. This is also one reason for the restriction of formalization approaches to single programs or algorithms. However, recently the PLC users? anization PLCopen (see started a Technical Committee to define an XML based format for projects according to IEC 611313. This new format will ease the access of formalization tools to all relevant information of a PLC project. Ⅲ . REENGINEERING APPROACH The presented approach towards reengineering (cf. ) is based upon the conception that XML can be used as a medium in which PLC codes will be transformed. This transformation offers the advantage of obtaining avendor independent specification code. (Even if the PLCopen succeeds in defining a standardized format for PLC applications, there will remain a lot of existing programs that do not conform to this standard.) Based on this code a stepwise transformation to a formal model (automata) is planned. This model can then be used for analysis, simulation, formal verification and validation, and finally for the reimplementation of the optimized algorithm on the same or another PLC. Since reengineering of plete programs will, in most cases, be only a semiautomatic process, intermediate visualization of the code is an important point. At different stages of the process different aspects of the code and/or formal model have to be visualized in a way that a designer can guide the further work. XML with its powerful visualization and transformation tools is an ideal tool for solving this task. IV. XML AS A TOOL FOR VISUALIZATION XML (extensible Markup Language) is a simple and flexible metalanguage, , a language for describing other languages. Tailored by the World Wide Web Consortium (W3C) as a dialect of SGML [S], XML removes two constraints which were holding back Web developments [6]. The dependence on a single, inflexible document type (HTML) which was being much abused for tasks it was never designed for on one side。 and the plexity of full SGML, whose syntax allows many powerful but hardtoprogram options on the other side. While HTML describes how data should be presented, XML describes the data itself. A number of industries and scientific disciplinesmedical records and newspaper publishing among themare already using XML to exchange information across platforms and applications. XML can be tailored to describe virtually any kind of information in a form that the recipient of the information can use in a variety of ways. It is specifically designed to support information exchange between systems that use fundamentally different forms of data representation, as for example between CAD and scheduling applications. Using XML with its powerful parsers and inherent robustness in terms of syntactic and semantic grammar is more advantageous than the conventional method of using a lexical analyzer and a validating parser (cf. Fig. 2, [7]). The conventional method of analysis of program code requires a scanner (lexical analyser) which generates a set of terminal symbols (tokens) followed by a parser that checks the grammatical structure of the code and generates an object . In the object the internal structure of the program is represented by identified objects and the relations between them. Both the scanner and the parser to be used in this method are document oriented which implies that analysis of different types of documents requires rewriting the generated code for the scanner and the parser. An example of an application of this method can be found in [8]. The most promising aspect of using XML instead is that XML and its plementary applications for transformations are standardized so as to provide maximum flexibility to its user. The XML based method is advantageous, since the lexical specification is an invariant ponent of XML。 therefore the wellformedness is independent from the respective individual application. Hence, an XMLParser also can transfer wellshaped XML documents in an abstract representation called Document Object Model (DOM) without using a grammar. DOM is an application programming interface (APII) for valid HTML and wellformed XML documents. It defines the logical structure of documents and the way a document is accessed and manipulated. In the DOM specification, the term document is used in a broad sense increasingly. XML is used as a way of representing many different kind of information that may be stored in diverse systems, and much of this would traditionally be seen as data rather than as documents. Nevertheless, XML presents this data as documents, and the DOM can be used to manage this data[ 5] . XSLT, the transformation language for XML is capable of transforming XML not only to another XML or HTML but to many other userfriendly formats. Before the advent of XSLT, the transformation of XML to any other format was only possible through custom applications developed in a procedural language such as C++, Visual Basic or, Java. This procedure lacked the generality with respect to the structural variation of XML documents. Capitalizing on the concept that the custom applications for the transformations are all very similar, XSLT evolved as a highlevel declarative language [9]. XSLT functions in two steps. In the first step, it performs a structural transformation so as to convert the XML into a structure that reflects the desired output. The second stage is formatting the new structure into the required format, such