-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsprut-1.html
62 lines (58 loc) · 2.53 KB
/
sprut-1.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.66">
<TITLE>SPRUT (internal representation description translator): Introduction</TITLE>
<LINK HREF="sprut-2.html" REL=next>
<LINK HREF="sprut.html#toc1" REL=contents>
</HEAD>
<BODY>
<A HREF="sprut-2.html">Next</A>
Previous
<A HREF="sprut.html#toc1">Contents</A>
<HR>
<H2><A NAME="s1">1.</A> <A HREF="sprut.html#toc1">Introduction</A></H2>
<P>SPRUT is a translator of a compiler internal representation
description (IRD) into Standard Procedural Interface (SPI). The most
convenient form of the internal representation is a directed graph.
IRD defines structure of the graph. SPI provides general graph
manipulating functions. The defined graph nodes can be decorated with
attributes of arbitrary types.</P>
<P>IRD declares types of nodes of the graph. Nodes contains fields, part
of them represents links between nodes, and another part of them
stores attributes of arbitrary types. To make easy describing
internal representation the IRD supports explicitly single inheritance
in node types and also can model multiple inheritance. There can be
several levels of internal representation description in separate
files. The nodes of one level refer to the nodes of previous levels.
Therefore each next level enriches source program internal
representation. For example, the zero level representation may be
internal representation for scanner, the first level may be internal
representation for parser, and so on.</P>
<P>SPI can contains functions to construct and destroy graphs and graph
nodes, to copy graphs or graph nodes, to read and write graphs or
graph nodes from (to) files, to print graphs or graph nodes, to check
up constraints on graph, to traverse graphs, and to transform acyclic
graphs in some commonly used manners. SPI can also check up the most
important constraints on internal representation during work with node
fields. SPI can automatically maintain back links between internal
representation nodes.</P>
<P>Using SPRUT has the following advantages:
<OL>
<LI>brief and concise notation for internal representation
</LI>
<LI>improving maintainability and as consequence reliability of
the compiler
</LI>
<LI>user is freed from the task of writing large amounts of
relatively simple code</LI>
</OL>
</P>
<P>The following sections define the internal representation description
language, explain SPI, and present some examples.</P>
<HR>
<A HREF="sprut-2.html">Next</A>
Previous
<A HREF="sprut.html#toc1">Contents</A>
</BODY>
</HTML>