RUS  ENG
Full version
JOURNALS // Vestnik of Astrakhan State Technical University. Series: Management, Computer Sciences and Informatics // Archive

Vestn. Astrakhan State Technical Univ. Ser. Management, Computer Sciences and Informatics, 2015 Number 4, Pages 57–65 (Mi vagtu402)

COMPUTER SOFTWARE AND COMPUTING EQUIPMENT

Use of finite-state automation for getting universal intermediate representation of program source code

M. V. Zubov, A. N. Pustygin

Chelyabinsk State University

Abstract: Universal multilevel intermediate representations were introduced to perform static analysis. There were formalized the models of the following representations: to analyze the architecture of the project — a model of class level representation and to analyze the functional modules — a control-flow representation model. It is necessary to formalize a method for getting such representations, which will correspond to the current models. This could help add new language support by creating standard intermediate representation generator. It is proposed to use abstract digital machine with stack memory. Syntax analysis is used as a base transformation from text to machine data. Such finite-state automation processes series of input signals, which are nodes of syntax tree, and produces signals, which are nodes of universal intermediate representation tree. Storage of the previous states of the automation in stack memory makes it possible to analyze random nesting of the input tree. Special option in input and output signals is used to describe sequence of tree nodes according to depth-first tree search. For this program development Java language was chosen, intermediate representation is also based on Java. Each state of automation is represented as an active object that processes input signal sequence. These objects use several design patterns, such as "chain of responsibility", "state" and "strategy" to form state transition table of Mealy machine and to make stack memory. Input and output data is represented with XML documents. Testing performed by checking the result of processing language syntax constructions into text of universal intermediate representation using own source code and open-source projects showed absolute correspondence to the actualization of the proposed models.

Keywords: static analysis, intermediate representation, abstract machine, finite-state automaton, programming, source code.

UDC: 004.41

Received: 20.08.2015
Revised: 03.10.2015



© Steklov Math. Inst. of RAS, 2024