+-------------+ +-------------+ +-----------------+ | Лексический |-->| Диагностика | |+---------------+| Вход | анализ | +-------------+ || Поток лексем +|| ---->|-------------|------------------>|| таблицы имен ||-+ | Конечные | || и констант || | | автоматы | |+---------------+| | +-------------+ +-----------------+ | +-----------------------------------------------+ v +-------------------+ +-------------+ +------------------+ | Синтаксический |->| Диагностика | |+----------------+| | анализ | +-------------+ || Дерево разбора || |-------------------+----------------> || + таблицы ||+ | Контекстно-сво- | || имен и констант||| | бодные грамматики | |+----------------+|| +-------------------+ +------------------+| +------------------------------------------------+ v +-------------+ +-----------++----------------------+ | Контекстный |-->|Диагностика||+--------------------+| | анализ | +-----------+|| Атрибутированное || |-------------|--------------->|| дерево или дерево ||-+ | Атрибутные | || + таблица символов || | | грамматики | |+--------------------+| | +-------------+ +----------------------+ | +--------------------------------------------+ v +----------------+ +--------------------------+ | Генерация | |+------------------------+| | промежуточного | || Промежуточная форма || | представления | || (префиксная, пост- || |----------------|--->|| фиксная, тройки и др.)||---+ | СУ-трансляция | |+------------------------+| | +----------------+ +--------------------------+ | +--------------------------------------------+ | +-------------------------------------+ v v | +-------------+ +-------------------------+ | | Оптимизация | |+-----------------------+| | |-------------|-->|| Промежуточная форма || | | Потоковый | || (ориентированный граф)||--> | | анализ | |+-----------------------+| | +-------------+ +-------------------------+ | +----------------------------------------+ | v +-----------------------+ +-------------+ | Генерация кода | |+-----------+| |-----------------------+---->|| || | Таблицы решений, | || Объектный || | динамическое | || модуль || | программирование и др.| |+-----------+| +-----------------------+ +-------------+ Рис. 1.1 +------------------+ | Синт. анализатор |<-----+ +------------------+ | ^| | +---------------------+ || +----------+ | Тип, Значение | ... | Тип || | Значение | +---------------------+ лексемы || +----------+ | |v ^ | +---------+ +------------------+ | +--->| Таблица | | Лекс. анализатор |------+ +---------+ +------------------+ Файл лексем "Дай лексему" Рис. 2.1 Рис. 2.2 +-----------+ | Состояние | +-----------+ | v +---------------------------------------+ | | a | .............. | +---------------------------------------+ Прочитанная Текущий Непрочитанная часть входной входной часть входной входной цепочки символ цепочки Рис. 2.3 | v +---+ | 1 | +---+ | Цифра +------ v | \---+Не (цифра,Е,"." +-----+ | Цифра | 2 |--------------->|| 3 || | /---\ +-----+ +------ |. \ E v --------------------+ +---+ | | 4 | | +---+ | | Цифра | +------- v | | \--- Не цифра,Е +-----+ | | Цифра | 5 |------------>|| 6 || | | /--- +-----+ | +------- |E | v | +---+ | | 7 |<--------------------+ +---\ +,- | \ Цифра v \ +---+ | | 8 | | +---+ | Цифра | / +------- v / | \---/ Не цифра +------+ | Цифра | 9 |--------->|| 10 || | /--- +------+ +------- Рис. 2.4 узел n nullable(n) firstpos(n) lastpos(n) --------------------------------------------------------- лист е | true | 0 | 0 --------+-------------+------------------+-------------- лист i | false | {i} | {i} --------+-------------+------------------+-------------- U | nullable(a) | firstpos(a) | lastpos(a) / \ | or | U | U a b | nullable(b) | firstpos(b) | lastpos(b) --------+-------------+------------------+-------------- . | nullable(a) | if nullable(a) |if nullable(b) / \ | and | then firstpos(a) |then lastpos(a) | | U firstpos(b) | U lastpos(b) a b | nullable(b) | else firstpos(a) |else lastpos(b) --------+-------------+------------------+-------------- * | | | | | true | firstpos(a) | lastpos(a) a | | | -------------------------------------------------------- Рис. 2.5 {1,2,3}.{6} / \ {1,2,3}.{5} {6}#{6} / \ позиция | followpos {1,2,3}.{4} {5}b{5} --------+------------- / \ 1 | {1,2,3} {1,2,3}.{3} {4}b{4} 2 | {1,2,3} / \ 3 | {4} {1,2}*{1,2} {3}a{3} 4 | {5} | 5 | {6} {1,2}U{1,2} 6 | - / \ ---------------------- {1}a{1} {2}b{2} Рис. 2.6 Рис. 2.7 a: {1,2,3,4} T={1(a),2(b),3(a)} b: {1,2,3} / / \ v v v {1,2,3} {4} +------------+ +----+ a: {1,2,3,4} T={1(a),2(b),3(a),4(b)} |+----+ | | | b: {1,2,3,5} / / | | ||b | | | | v v v v ||----+------+-+>Sb | {1,2,3} {4} {5} ||{pb}|+----+| |----| |+----+|a || | | a: {1,2,3,4} T={1(a),2(b),3(a),5(b)} | |----++-+>Sa | b: {1,2,3,6} / / | | | |{pa}|| | | v v v v | +----+| | | {1,2,3} {4} {6} +------------+ +----+ a: {1,2,3,4} T={1(a),2(b),3(a),6(#)} b: {1,2,3} / / | v v v {1,2,3} {4} Рис. 2.8 Рис. 2.9 +--------------------b--------------------+ | +-----------a--------------+ | +-+ | +-+ | +----a-----+ | | |b| | |a| | | | | | V | V a V | V V b | b | | ---->{1,2,3}--->{1,2,3,4}----->{1,2,3,5}----->[1,2,3,6] Рис. 2.10 +---+ +-+ +-+ +-----|s,t|-----+ |s| |t| | +---+ | +-+ +-+ |a a| | | | +---+ | v v +---->| |<----+ +-+ +-+ +---+ | | | | +-+ +-+ Рис. 2.11 +----------+ ------------------->| ключевое | +---+ f +---/не буква и не цифра | слово if | | i |--->| | +----------+ +---\ +---\буква или цифра +---------------+ | \ ---------------->| Идентификатор | n| \ +---------------+ | \ ^ ^ ^ | \ Не f и не t | | | v --------------------------+ | | +---+ Не t | | | |--------------------------------+ | +---+ | t| | v | +---+ Буква или цифра | | |-----------------------------------+ +---+ | Не буква и не цифра v +--------------------+ | Ключевое слово int | +--------------------+ Рис. 2.12 N N +----------------+ +-------------------+ | | | | # | # | +----------------+ +-------------------+ ^ ^ ^ ^ | |Продвижение | |Продвижение |Начало лексемы (cp) |Начало лексемы Рис. 2.13 Рис. 2.14 +----------+ +-----+ | N | | N | v v v v +------------------+ +-------------+ | | |\n| | | | #| +------------------+ +-------------+ | | |Граница | | |Граница | |Барьер | |Барьер |Текущий |Текущий а) Пока текущий < барьер б) После чтения Рис. 2.15 S S S / | \ / | \ X1 X2... X1 X2... / / | ........... ............. / / | Y Y | /|\ /|\ Z / ... / ... /|\ a..........$ a...........$ a........b.......$ а) б) в) Рис. 3.1 +---------------+ Вход | a | + | b | $ | +---------------+ ^ | +-+ +----------------------+ |X| | Программа предсказы- | Выход Магазин |-|<---| вающего анализатора |---> |Y| +----------------------+ |Z| | |-| v |$| +---------------------+ +-+ | Таблица анализатора | +---------------------+ Рис. 3.2 --------------------------------------------------- Нетер-| Входной символ |-------------------------------------------- минал | id | + | * | ( | ) | $ ------+------+--------+--------+------+-----+------ E |E->TE'| | |E->TE'| | E' | |E'->+TE'| | |E'->e|E'->e T |T->FT'| | |T->FT'| | T' | |T'->e |T'->*FT'| |T'->e|T'->e F |F->id | | |F->(E)| | ----------------------------------------------------- Рис. 3.4 ---------------------------------- Магазин | Вход | Выход --------+-----------+------------- $E | id+id*id$ | $E'T | id+id*id$ | E->TE' $E'T'F | id+id*id$ | T->FT' $E'T'id | id+id*id$ | F->id $E'T' | +id*id$ | E $E' | +id*id$ | T'->e / \ $E'T+ | +id*id$ | E'->+TE' / \ $E'T | id*id$ | T E' $E'T'F | id*id$ | T->FT' /| / | \ $E'T'id | id*id$ | F->id F T' + T E' $E'T' | *id$ | | / | $E'T'F* | *id$ | T'->*FT' id / | $E'T'F | id$ | F T' $E'T'id | id$ | F->id | /|\ $E'T' | $ | id * F T' $E' | $ | T'->e | $ | $ | E'->e id ---------------------------------- Рис. 3.5 Рис. 3.6 St St /|\ /| \ / | \ / | \ / St \ / St ... / / \ \ / / \ \ / / \ \ / / \ \ if E then if E then S else S if E then if E then S else S а) б) Рис. 3.7 St / | \ / | \ St / St St' / | \ / / \\ / | \ / / \ \ / St St' / / \ St' / / | \ \ / / \ | / / | \ \ if E then if E then S else S if E then if E then S S' else S а) б) Рис. 3.8 +---+ T +---+ E'+-----+ +---+ + +---+ T +---+ E'+-----+ E:| 0 |-->| 1 |-->|| 2 ||E':| 3 |-->| 4 |-->| 5 |-->|| 6 || +---+ +---+ +-----+ +---+ +---+ +---+ +-----+ | ^ | e | +------------------------+ +---+ T +---+ E'+-----+ +----+ + +----+ T +----+ E'+----+ E:| 7 |-->| 8 |-->|| 9 ||E':| 10 |-->| 11 |-->| 12 |-->||13|| +---+ +---+ +-----+ +----+ +----+ +----+ +----+ | ^ | e | +---------------------------+ 51 +----+ ( +----+ E +----+ ) +------+ F: | 14 |---->| 15 |---->| 16 |---->|| 17 || +----+ +----+ +----+ +------+ | ^ | id | +---------------------------------+ Рис. 3.10 e +---------------------+ +---------+ | | | T | v | v | +---+ + +---+ T +-----+ +---+ + +---+ E': | 3 |----->| 4 |---->|| 5 || => E':| 3 |---->| 4 | +---+ +---+ +-----+ +---+ +---+ |e |e | +-----+ | +-----+ +-------->|| 6 || +----->|| 6 || +-----+ +-----+ +-------+ +---------+ | T | | + | v | v | e +---+ T +---+ + +---+ +---+ T +---+ +-----+ E: | 0 |-->| 3 |-->| 4 | => E: | 0 |---->| 3 |-->|| 6 || +---+ +---+ +---+ +---+ +---+ +-----+ | e +-----+ +--->|| 6 || +-----+ Рис. 3.11 +---------+ +---------+ | + | | * | v | e v | e +---+ T +---+ +-----+ +---+ F +---+ +------+ E: | 0 |---->| 3 |---->|| 6 || T: | 7 |---->| 8 |--->|| 13 || +---+ +---+ +-----+ +---+ +---+ +------+ +----+ ( +----+ E +----+ ) +------+ F: | 14 |---->| 15 |---->| 16 |---->|| 17 || +----+ +----+ +----+ +------+ | ^ | e | +---------------------------------+ Рис. 3.12 S S S / | \ X1 X2... / | ............. / | Y Y | /|\ /|\ Z / ... / ... /|\ a.........$ a...........$ a........b.......$ а) б) в) Рис. 3.13 E->E+T->E+T*F->E+T*c->E+F*c->E+b*c->T+b*c->F+b*c->a+b*c --- --- - - - - - - E -> E + T а+b*c E E -> T F+b*c /+\ T -> T*F T+b*c E T T -> F E+b*c | |\ F -> id E+F*c T T F E+T*c | | \ E+T*F F F id E+T | | c E a b а) б) в) Рис. 3.14 +------------------------------+ Вход | A1 | ... | Ai | ... | An | $ | +------------------------------+ ^ | +------+ +-------------+ Выход Магазин | Sm |<---------| LR |--------> |------| | анализатор | | Xm | +-------------+ |------| | | Sm-1 | | |------| +--------+ | Xm-1 | | | |------| v v | .... | +---------------+ |------| | action | goto | | S0 | +---------------+ +------+ Рис. 3.15 +--------------------------------------+ |Состо-| action | goto | | яния |------------------+------------| | | id + * $ | E T F | |------+------------------+------------| | 0 | S6 | 1 2 3 | | 1 | S4 acc | | | 2 | R2 S7 R2 | | | 3 | R4 R4 R4 | | | 4 | S6 | 5 3 | | 5 | R1 S7 R1 | | | 6 | R5 R5 R5 | | | 7 | S6 | 8 | | 8 | R3 R3 R3 | | +--------------------------------------+ Рис. 3.16 +---------------------------------------------------------+ |Активный| Магазин | Вход | Действие| |префикс | | | | |--------+-----------------------+--------------+---------| | |0 |id + id * id $| сдвиг | | id |0 id 6 | + id * id $| F -> id | | F |0 F 3 | + id * id $| T -> F | | T |0 T 2 | + id * id $| E -> T | | E |0 E 1 | + id * id $| сдвиг | | E+ |0 E 1 + 4 | id * id $| сдвиг | | E+id |0 E 1 + 4 id 6 | * id $| F -> id | | E+F |0 E 1 + 4 F 3 | * id $| T -> F | | E+T |0 E 1 + 4 T 5 | id $| сдвиг | | E+T* |0 E 1 + 4 T 5 * 7 | id $| сдвиг | | E+T*id |0 E 1 + 4 T 5 * 7 id 6 | $| F -> id | | E+T*F |0 E 1 + 4 T 5 * 7 F 8 | $| T -> T*F| | E+T |0 E 1 + 4 T 5 | $| E -> E+T| | E |0 E 1 | | допуск | +---------------------------------------------------------+ Рис. 3.17 S /|\ / | \ / A \ / /\ \ / / \ \ y u v a... ---- ---- z w Рис. 3.18 +-------------+ E +-------------+ + +-------------+ | I0 |--->| I1 |--->| I4 | | E'-> .E, $ | | E'-> E., $ | | E -> E+.T,$ | | E -> .E+T,$ | | E -> E.+T,$ | | E -> E+.T,+ | | E -> .T, $ | | E -> E.+T,+ | | T -> .T*F,$ | | T -> .T*F,$ | +-------------+ | T -> .F, $ | | T -> .F, $ | T +-------------+ | T -> .T*F,+ | | F -> .id, $ |--->| I2 | | T -> .F, + | | E -> .E+T,+ | | E -> T., $ | | F -> .id, $ | | E -> .T, + | | T -> T.*F,$ | | F -> .id, + | | T -> .T*F,+ | | E -> T., + | | T -> .T*F,* | | T -> .F, + | | T -> T.*F,+ | | T -> .F, * | | T -> .T*F,* | | T -> T.*F,* | | F -> .id, * | | T -> .F, * | +-------------+ +-------------+ | F -> .id, * | | F| | | | F -> .id, + |-------+---+ +-------------+ | | +-------------+ | F | | T | | id | +-------------+ | | | +------+ +-+ | * | | | | | v v v v | | +-------------+ +-----------+ +-------------+ | | | I7 | | I3 | | I5 | | | | T -> T*.F,$ | | T -> F.,$ | | E -> E+T.,$ | | | | T -> T*.F,+ | | T -> F.,+ | | E -> E+T.,+ | | | | T -> T*.F,* | | T -> F.,* | | T -> T.*F,$ | | | | F -> .id, $ | +-----------+ * | T -> T.*F,+ | | | | F -> .id, + |<----------------------| T -> T.*F,* | | | | F -> .id,* | id +-------------+ | | +-------------+ +----+ | | F | id | | id | +---------------------------------+ | +------+----------------------------------+ | | | | | | v v v v +-------------+ F +------------+ | I8 | | I6 | | T -> T*F.,$ | | F -> id.,+ | | T -> T*F.,+ | | F -> id.,* | | T -> T*F.,* | | F -> id.,$ | +-------------+ +------------+ Рис. 3.19 := := /\ /\ / \ / \ a + a + / \ / \ / \ | | * * \ / / \ / \ * / \ / \ / \ b - b - / \ | | b - | | | c c | c а) б) Рис. 4.1 66 +------------+ +------------+ 10 | := | | | | | 0 | id | b | | +------+---+-+ |----+---+---| v | 1 | id | c | | +--------+ | |----+---+---| 9 | id | a | | 2 | - | 1 | | +--------+ v |----+---+---| +------------+ 3 | * | 0 | 2 | 7 | + | | | | | |----+---+---| +------+---+-+ 4 | id | b | | +-+ +------------+ |----+---+---| | | 5 | id | c | | v v |----+---+---| +------------+ +------------+ 6 | - | 5 | | 3 | * | | | | 8 | * | | | | | |----+---+---| +----------+-+ +------+---+-+ 7 | + | 3 | 8 | v | v | |----+---+---| +--------+ | +--------+ | 8 | * | 4 | 6 | 0 | id | b | | 4 | id | b | | |----+---+---| +--------+ v +--------+ v 9 | id | a | | +------------+ +------------+ |----+---+---| 2 | - | | | | 6 | - | | | | 10| := | 9 | 7 | +------+-----+ +------+-----+ +------------+ v v +--------+ +--------+ 1 | id | c | 5 | id | c | б) +--------+ +--------+ а) Рис. 4.2 +----------------------------++------------------------+ | |op |arg1 | arg2 |result|| | op | arg1 | arg2 | |---+----+-----+------+------||-----+----+------+------| |(0)| - | c | | t1 || (0) | - | c | | |(1)| * | b | t1 | t2 || (1) | * | b | (0) | |(2)| - | c | | t3 || (2) | - | c | | |(3)| * | b | t3 | t4 || (3) | * | b | (2) | |(4)| + | t2 | t4 | t5 || (4) | + | (1) | (3) | |(5)| := | t5 | | a || (5) | := | a | (4) | +----------------------------++------------------------+ а) четверки б) тройки Рис. 4.4 +------------------------+ +-------------------------+ | | op | arg1 | arg2 | | | op | arg1 | arg2 | |----+-----+------+------| |-----+-----+------+------| |(0) | []= | x | i | | (0) | =[] | y | i | |(1) | := | (0) | y | | (1) | := | x | (0) | +------------------------+ +-------------------------+ а) x[i]:=y б) x:=y[i] Рис. 4.5 +---------------+ +------------------------+ | | оператор | | | op | arg1 | arg2 | |----+----------+ |-----+----+------+------| |(0) | (14) | | |(14) | - | c | | |(1) | (15) | | |(15) | * | b | (14) | |(2) | (16) | | |(16) | - | c | | |(3) | (17) | | |(17) | * | b | (16) | |(4) | (18) | | |(18) | + | (15) | (17) | |(5) | (19) | | |(19) | := | a | (18) | +---------------+ +------------------------+ Рис. 4.6 Таблица уровней Таблица описаний процедур +-----+ +----------------------------+ | --+--------+ |Для типа:размер | |-----| | |----------------------------| | --+----+ | |Для переменной:указатель на | | ....|.. | | |тип и адрес (смещение) | |-----| | | |----------------------------| | --+--+ | +-->|Для процедуры: адрес, ... | +-----+ | | |----------------------------| | +--> |............................| | | | | |----------------------------| +-------->| | +----------------------------+ Рис. 4.9 /\ / \ / \ / \ / \ Раздел описаний / \ / \ \ / \ \ / \ \ Описание Описание Раздел типа переменной операторов +--------+ +--------+ +------+ | |<--+--- |<----------+--- | +--------+ +--------+ +------+ Рис. 4.10 Функция переходов определяется таблицей на рис. 5.1. +------------------------------------------------+ | Г | Q | T || Г* | Q | П | |----+-----+-------||------------+------+------- | | Z0 | q0 | буква || z | q0 | буква | | Z0 | q0 | ( || z( | q0 | | | Z0 | q0 | проч || z | проч | | |----+-----+-------||------------+------+------- | |( | ) | || e | q0 | | |+,* | ) | || e | ) | +,* | |----+-----+-------||------------+------+------- | | + | * | || +* | q0 | | | * | + | || *+ | q0 | | |проч| +,* | || проч {+,*} | q0 | | |----+-----+-------||------------+------+--------| |+,* | $ | || e | $ | +,* | | Z0 | $ | || e | | | +------------------++----------------------------+ Рис. 5.1 76 +--------------------------------+ | Стек |Состояние| Вход |Выход| |------+---------+---------+-----| |Z0 | q0 | a*(b+c)$| a | |Z0 | q0 | *(b+c)$| | |Z0 | * | (b+c)$| | |Z0* | q0 | (b+c)$| | |Z0*( | q0 | b+c)$| | |Z0*( | q0 | +c)$| b | |Z0*( | + | c)$| | |Z0*(+ | q0 | c)$| c | |Z0*(+ | q0 | )$| | |Z0*(+ | ) | $| + | |Z0*( | ) | $| | |Z0* | q0 | $| | |Z0* | $ | | * | |Z0 | $ | | | +--------------------------------+ Рис. 5.2 E E1=sin(cos(x))+x / \ E2=cos(cos(x)) E1=sin(cos(x)) / + \ *(-sin(x)*(1))+1 E2=cos(cos(x)) E T *(-sin(x)*(1)) | | T2=1 | | T1=x T1=sin(cos(x)) | | T2=cos(cos(x)) T F F1=x *(-sin(x)*(1)) | | F2=1 | | F1=sin(cos(x)) | | F2=cos(cos(x)) F x *(-sin(x)*(1)) | | sin ( E ) E1=cos(x) | E2=-sin(x)*(1) | T T1=cos(x) | T2=-sin(x)*(1) | F F1=cos(x) | F2=-sin(x)*(1) | cos ( E ) E1=x E2=1 | T T1=x T2=1 | F F1=x F2=1 | x Рис. 5.3 | ... . N . . / \ . . / \ . . /\ /\ . . / /\ /\ \ . . / -- -- \ . ...N...........N... /\ /\ -- -- Рис. 5.4 +-------------+ | Корневая | | компонента | | (программа) | +-------------+ +---------+ | +--------+ | | | +-----------++-----------++-----------+ | процедура || процедура || процедура | | (блок) || (блок) || (блок) | +-----------++-----------++-----------+ /|\ /|\ /|\ Рис. 6.1 Экспортирующий Компонента Импортирующий локальный модуль среды локальный модуль +------------+ +------------+ +------------+ | MODULE M1; | | +----+ | | MODULE X1; | | EXPORT A1;-+--------+-->| A1 |---+--+ | IMPORT A1; | | ......... | | +----+ | | | | +------------+ | | +--+------> A1 | | | +------------+ +--------------+ | | | MODULE M2; | | | +------------+ | EXPORT | | +----+ | | MODULE X2; | | QUALIFIED A2-+------+-->| M2 | | | FROM M2 | | ............ | | +----+ | | IMPORT A2; | +--------------+ | v | +---+---->A2 | | +----+ | | +------------+ | | A2 |---+-+ | +----+ | +-----------------+ | | | MODULE M3; | | +-----+ | | EXPORT M31;-----+---+-->| M31 | | +-------------+ | +-------------+| | +-----+ | | MODULE X3; | | | MODULE M31; || | +-----+ | | IMPORT A31; | | | EXPORT A31;-++---+-->| A31 |--+-----+--> A31 | | | .......... || | +-----+ | | +-------------+ | +-------------+| | | | | ................| | | | +-------------+ +-----------------+ | | | | MODULE X | | | | | IMPORT M31; | | | +--+---> A31 | v v +-------------+ +-------------------+ v v | MODULE M4; | | +-----+ | | EXPORT M41;-------+-+-->| M41 | | +-------------+ | +---------------+| | +-----+ | | MODULE X4; | | | MODULE M41; || | v | | FROM M41 | | | EXPORT || | +-----+ | | IMPORT A41; | | | QUALIFIED A41;|+-+-->| A41 |--+-----+----> A41 | | | .......... || | +-----+ | | +-------------+ | +---------------+| | | | +--------------+ | ..................| | | | | MODULE X | +-------------------+ | | | | IMPORT M41; | | | +--+-->A41 | | | +--------------+ +-----------------+ | +----+ | | MODULE M5; | | | M5 | | +-------------+ | EXPORT | | +----+ | | MODULE X5; | | QUALIFIED M51;--+---+-+ v | | FROM M5 | | +-------------+| | | +-----+ | | IMPORT M51; | | | MODULE M51; || | +->| M51 |-+------+-> M51.A51 | | | EXPORT A51;-++---+-+ +-----+ | +-------------+ | | .......... || | | v | | +-------------+| | | +-----+ | | ................| | +->| A51 | | +-----------------+ | +-----+ | +-------------------+ | +----+ | | MODULE M6; | | | M6 | | +-------------+ | EXPORT | | +----+ | | MODULE X6; | | QULIFIED M61;-----+-+-+ v | | FROM M6 | | +---------------+| | | +-----+ | | IMPORT M61; | | | MODULE M61; || | +->| M61 |-+------+--> M61.A61 | | | EXPORT || | +-----+ | +-------------+ | | QUALIFIED A61;|+-+-+ v | | | ............ || | | +-----+ | | +---------------+| | +->| A61 | | | ..................| | +-----+ | +-------------------+ +------------+ Рис. 6.2