Made to work with troff
This commit is contained in:
@@ -90,18 +90,22 @@ and let the null item be 0.
|
||||
Then the tree of fig. 3.1(a)
|
||||
can be represented as in fig. 3.1(b).
|
||||
.DS
|
||||
.ft 5
|
||||
4
|
||||
|
||||
/ \e
|
||||
9 12
|
||||
|
||||
/ \e / \e
|
||||
12 3 4 6
|
||||
|
||||
/ \e \e /
|
||||
8 1 5 1
|
||||
.ft R
|
||||
|
||||
Fig. 3.1(a) A binary tree
|
||||
|
||||
|
||||
.ft 5
|
||||
4 9 12 0 0 3 8 0 0 1 0 0 12 4 0 5 0 0 6 1 0 0 0
|
||||
.ft R
|
||||
|
||||
Fig. 3.1(b) Its sequential representation
|
||||
.DE
|
||||
|
||||
229
doc/ego/ic/ic3
229
doc/ego/ic/ic3
@@ -21,12 +21,15 @@ The syntactic structure of every component
|
||||
is described by a set of context free syntax rules,
|
||||
with the following conventions:
|
||||
.DS
|
||||
x a non-terminal symbol
|
||||
A a terminal symbol (in capitals)
|
||||
x: a b c; a grammar rule
|
||||
a | b a or b
|
||||
(a)+ 1 or more occurrences of a
|
||||
{a} 0 or more occurrences of a
|
||||
.TS
|
||||
l l.
|
||||
x a non-terminal symbol
|
||||
A a terminal symbol (in capitals)
|
||||
x: a b c; a grammar rule
|
||||
a | b a or b
|
||||
(a)+ 1 or more occurrences of a
|
||||
{a} 0 or more occurrences of a
|
||||
.TE
|
||||
.DE
|
||||
.NH 3
|
||||
The object table
|
||||
@@ -70,21 +73,24 @@ identifying number
|
||||
(see previous section for their use).
|
||||
.DS
|
||||
.UL syntax
|
||||
object_table:
|
||||
{datablock} ;
|
||||
datablock:
|
||||
D_ID -- unique identifying number
|
||||
PSEUDO -- one of ROM,CON,BSS,HOL,UNKNOWN
|
||||
SIZE -- # bytes declared
|
||||
FLAGS
|
||||
{value} -- contents of rom
|
||||
{object} ; -- objects of the datablock
|
||||
object:
|
||||
O_ID -- unique identifying number
|
||||
OFFSET -- offset within the datablock
|
||||
SIZE ; -- size of the object in bytes
|
||||
value:
|
||||
argument ;
|
||||
.TS
|
||||
lw(1i) l l.
|
||||
object_table:
|
||||
{datablock} ;
|
||||
datablock:
|
||||
D_ID -- unique identifying number
|
||||
PSEUDO -- one of ROM,CON,BSS,HOL,UNKNOWN
|
||||
SIZE -- # bytes declared
|
||||
FLAGS
|
||||
{value} -- contents of rom
|
||||
{object} ; -- objects of the datablock
|
||||
object:
|
||||
O_ID -- unique identifying number
|
||||
OFFSET -- offset within the datablock
|
||||
SIZE ; -- size of the object in bytes
|
||||
value:
|
||||
argument ;
|
||||
.TE
|
||||
.DE
|
||||
A data block has only one flag: "external", indicating
|
||||
whether the data label is externally visible.
|
||||
@@ -102,26 +108,29 @@ The table has one entry for
|
||||
every procedure.
|
||||
.DS
|
||||
.UL syntax
|
||||
procedure_table:
|
||||
{procedure}
|
||||
procedure:
|
||||
P_ID -- unique identifying number
|
||||
#LABELS -- number of instruction labels
|
||||
#LOCALS -- number of bytes for locals
|
||||
#FORMALS -- number of bytes for formals
|
||||
FLAGS -- flag bits
|
||||
calling -- procedures called by this one
|
||||
change -- info about global variables changed
|
||||
use ; -- info about global variables used
|
||||
calling:
|
||||
{P_ID} ; -- procedures called
|
||||
change:
|
||||
ext -- external variables changed
|
||||
FLAGS ;
|
||||
use:
|
||||
FLAGS ;
|
||||
ext:
|
||||
{O_ID} ; -- a set of objects
|
||||
.TS
|
||||
lw(1i) l l.
|
||||
procedure_table:
|
||||
{procedure}
|
||||
procedure:
|
||||
P_ID -- unique identifying number
|
||||
#LABELS -- number of instruction labels
|
||||
#LOCALS -- number of bytes for locals
|
||||
#FORMALS -- number of bytes for formals
|
||||
FLAGS -- flag bits
|
||||
calling -- procedures called by this one
|
||||
change -- info about global variables changed
|
||||
use ; -- info about global variables used
|
||||
calling:
|
||||
{P_ID} ; -- procedures called
|
||||
change:
|
||||
ext -- external variables changed
|
||||
FLAGS ;
|
||||
use:
|
||||
FLAGS ;
|
||||
ext:
|
||||
{O_ID} ; -- a set of objects
|
||||
.TE
|
||||
.DE
|
||||
.PP
|
||||
The number of bytes of formal parameters accessed by
|
||||
@@ -231,38 +240,41 @@ of arguments), then the list is terminated by a special
|
||||
argument of type CEND.
|
||||
.DS
|
||||
.UL syntax
|
||||
em_text:
|
||||
{line} ;
|
||||
line:
|
||||
INSTR -- opcode
|
||||
OPTYPE -- operand type
|
||||
operand ;
|
||||
operand:
|
||||
empty | -- OPTYPE = NO
|
||||
SHORT | -- OPTYPE = SHORT
|
||||
OFFSET | -- OPTYPE = OFFSET
|
||||
LAB_ID | -- OPTYPE = INSTRLAB
|
||||
O_ID | -- OPTYPE = OBJECT
|
||||
P_ID | -- OPTYPE = PROCEDURE
|
||||
{argument} ; -- OPTYPE = LIST
|
||||
argument:
|
||||
ARGTYPE
|
||||
arg ;
|
||||
arg:
|
||||
empty | -- ARGTYPE = CEND
|
||||
OFFSET |
|
||||
LAB_ID |
|
||||
O_ID |
|
||||
P_ID |
|
||||
string | -- ARGTYPE = STRING
|
||||
const ; -- ARGTYPE = ICON,UCON or FCON
|
||||
string:
|
||||
LENGTH -- number of characters
|
||||
{CHARACTER} ;
|
||||
const:
|
||||
SIZE -- number of bytes
|
||||
string ; -- string representation of (un)signed
|
||||
-- or floating point constant
|
||||
.TS
|
||||
lw(1i) l l.
|
||||
em_text:
|
||||
{line} ;
|
||||
line:
|
||||
INSTR -- opcode
|
||||
OPTYPE -- operand type
|
||||
operand ;
|
||||
operand:
|
||||
empty | -- OPTYPE = NO
|
||||
SHORT | -- OPTYPE = SHORT
|
||||
OFFSET | -- OPTYPE = OFFSET
|
||||
LAB_ID | -- OPTYPE = INSTRLAB
|
||||
O_ID | -- OPTYPE = OBJECT
|
||||
P_ID | -- OPTYPE = PROCEDURE
|
||||
{argument} ; -- OPTYPE = LIST
|
||||
argument:
|
||||
ARGTYPE
|
||||
arg ;
|
||||
arg:
|
||||
empty | -- ARGTYPE = CEND
|
||||
OFFSET |
|
||||
LAB_ID |
|
||||
O_ID |
|
||||
P_ID |
|
||||
string | -- ARGTYPE = STRING
|
||||
const ; -- ARGTYPE = ICON,UCON or FCON
|
||||
string:
|
||||
LENGTH -- number of characters
|
||||
{CHARACTER} ;
|
||||
const:
|
||||
SIZE -- number of bytes
|
||||
string ; -- string representation of (un)signed
|
||||
-- or floating point constant
|
||||
.TE
|
||||
.DE
|
||||
.NH 3
|
||||
The control flow graphs
|
||||
@@ -306,24 +318,27 @@ the identifiers of every
|
||||
that the block belongs to (see next section for loops).
|
||||
.DS
|
||||
.UL syntax
|
||||
control_flow_graph:
|
||||
{basic_block} ;
|
||||
basic_block:
|
||||
B_ID -- unique identifying number
|
||||
#INSTR -- number of EM instructions
|
||||
succ
|
||||
pred
|
||||
idom -- immediate dominator
|
||||
loops -- set of loops
|
||||
FLAGS ; -- flag bits
|
||||
succ:
|
||||
{B_ID} ;
|
||||
pred:
|
||||
{B_ID} ;
|
||||
idom:
|
||||
B_ID ;
|
||||
loops:
|
||||
{LP_ID} ;
|
||||
.TS
|
||||
lw(1i) l l.
|
||||
control_flow_graph:
|
||||
{basic_block} ;
|
||||
basic_block:
|
||||
B_ID -- unique identifying number
|
||||
#INSTR -- number of EM instructions
|
||||
succ
|
||||
pred
|
||||
idom -- immediate dominator
|
||||
loops -- set of loops
|
||||
FLAGS ; -- flag bits
|
||||
succ:
|
||||
{B_ID} ;
|
||||
pred:
|
||||
{B_ID} ;
|
||||
idom:
|
||||
B_ID ;
|
||||
loops:
|
||||
{LP_ID} ;
|
||||
.TE
|
||||
.DE
|
||||
The flag bits can have the values 'firm' and 'strong',
|
||||
which are explained below.
|
||||
@@ -387,28 +402,30 @@ strong nor firm, as it may be skipped during some iterations
|
||||
.DS
|
||||
loop
|
||||
if cond1 then
|
||||
... -- this code will not
|
||||
-- result in a firm or strong block
|
||||
... \kx-- this code will not
|
||||
\h'|\nxu'-- result in a firm or strong block
|
||||
end if;
|
||||
... -- strong (always executed)
|
||||
exit when cond2;
|
||||
... -- firm (not executed on
|
||||
-- last iteration).
|
||||
... \kx-- firm (not executed on last iteration).
|
||||
end loop;
|
||||
|
||||
Fig. 3.2 Example of firm and strong block
|
||||
.DE
|
||||
.DS
|
||||
.UL syntax
|
||||
looptable:
|
||||
{loop} ;
|
||||
loop:
|
||||
LP_ID -- unique identifying number
|
||||
LEVEL -- loop nesting level
|
||||
entry -- loop entry block
|
||||
end ;
|
||||
entry:
|
||||
B_ID ;
|
||||
end:
|
||||
B_ID ;
|
||||
.TS
|
||||
lw(1i) l l.
|
||||
looptable:
|
||||
{loop} ;
|
||||
loop:
|
||||
LP_ID -- unique identifying number
|
||||
LEVEL -- loop nesting level
|
||||
entry -- loop entry block
|
||||
end ;
|
||||
entry:
|
||||
B_ID ;
|
||||
end:
|
||||
B_ID ;
|
||||
.TE
|
||||
.DE
|
||||
|
||||
@@ -57,24 +57,27 @@ indicating which part of the EM text belongs
|
||||
to that block.
|
||||
.DS
|
||||
.UL syntax
|
||||
intermediate_code:
|
||||
object_table_file
|
||||
proctable_file
|
||||
em_text_file
|
||||
cfg_file ;
|
||||
object_table_file:
|
||||
LENGTH -- number of objects
|
||||
object_table ;
|
||||
proctable_file:
|
||||
LENGTH -- number of procedures
|
||||
procedure_table ;
|
||||
em_text_file:
|
||||
em_text ;
|
||||
cfg_file:
|
||||
{per_proc} ; -- one for every procedure
|
||||
per_proc:
|
||||
BLENGTH -- number of basic blocks
|
||||
LLENGTH -- number of loops
|
||||
control_flow_graph
|
||||
looptable ;
|
||||
.TS
|
||||
lw(1i) l l.
|
||||
intermediate_code:
|
||||
object_table_file
|
||||
proctable_file
|
||||
em_text_file
|
||||
cfg_file ;
|
||||
object_table_file:
|
||||
LENGTH -- number of objects
|
||||
object_table ;
|
||||
proctable_file:
|
||||
LENGTH -- number of procedures
|
||||
procedure_table ;
|
||||
em_text_file:
|
||||
em_text ;
|
||||
cfg_file:
|
||||
{per_proc} ; -- one for every procedure
|
||||
per_proc:
|
||||
BLENGTH -- number of basic blocks
|
||||
LLENGTH -- number of loops
|
||||
control_flow_graph
|
||||
looptable ;
|
||||
.TE
|
||||
.DE
|
||||
|
||||
@@ -93,8 +93,11 @@ Objects are recognized by looking at the operands
|
||||
of instructions that reference global data.
|
||||
If we come across the instructions:
|
||||
.DS
|
||||
LDE X+6 -- Load Double External
|
||||
LAE X+20 -- Load Address External
|
||||
.TS
|
||||
l l.
|
||||
LDE X+6 -- Load Double External
|
||||
LAE X+20 -- Load Address External
|
||||
.TE
|
||||
.DE
|
||||
we conclude that the data block
|
||||
preceded by the data label X contains an object
|
||||
|
||||
Reference in New Issue
Block a user