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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
|
%%
%% This is file `tdiagram.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% semantic.dtx (with options: `allOptions,Tdiagram')
%%
%% IMPORTANT NOTICE:
%%
%% For the copyright see the source file.
%%
%% Any modified versions of this file must be renamed
%% with new filenames distinct from tdiagram.sty.
%%
%% For distribution of the original source see the terms
%% for copying and modification in the file semantic.dtx.
%%
%% This generated file may be distributed as long as the
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%%
%% semantic.dtx (c)1995--2002 Peter Møller Neergaard and
%% Arne John Glenstrup
%%
\expandafter\ifx\csname sem@nticsLoader\endcsname\relax
\PackageError{semantic}{%
This file should not be loaded directly}
{%
This file is an option of the semantic package. It should not be
loaded directly\MessageBreak
but by using \protect\usepackage{semantic} in your document
preamble.\MessageBreak
No commands are defined.\MessageBreak
Type <return> to proceed.
}%
\else
\TestForConflict{\@getSymbol,\@interpreter,\@parseArg,\@program}
\TestForConflict{\@putSymbol,\@saveBeforeSymbolMacro,\compiler}
\TestForConflict{\interpreter,\machine,\program,\@compiler}
\newif\if@@Left
\newif\if@@Up
\newcount\@@xShift
\newcount\@@yShift
\newtoks\@@symbol
\newtoks\@@tempSymbol
\newcommand{\compiler}[1]{\@compiler#1\end}
\def\@compiler#1,#2,#3\end{%
\if@@Nested %
\if@@Up %
\@@yShift=40 \if@@Left \@@xShift=-50 \else \@@xShift=-30 \fi
\else%
\@@yShift=20 \@@xShift =0 %
\fi%
\else%
\@@yShift=40 \@@xShift=-40%
\fi
\hskip\@@xShift\unitlength\raise \@@yShift\unitlength\hbox{%
\put(0,0){\line(1,0){80}}%
\put(0,-20){\line(1,0){30}}%
\put(50,-20){\line(1,0){30}}%
\put(30,-40){\line(1,0){20}}%
\put(0,0){\line(0,-1){20}}%
\put(80,0){\line(0,-1){20}}%
\put(30,-20){\line(0,-1){20}}%
\put(50,-20){\line(0,-1){20}}%
\put(30,-20){\makebox(20,20){$\rightarrow$}} %
{\@@Uptrue \@@Lefttrue \@parseArg(0,-20)(5,-20)#1\end}%
\if@@Up \else \@@tempSymbol=\expandafter{\the\@@symbol}\fi
{\@@Uptrue \@@Leftfalse \@parseArg(80,-20)(55,-20)#3\end}%
{\@@Upfalse \@@Lefttrue \@parseArg(50,-40)(30,-40)#2\end}%
\if@@Up \@@tempSymbol=\expandafter{\the\@@symbol}\fi
\if@@Nested \global\@@symbol=\expandafter{\the\@@tempSymbol} \fi%
}%
}
\newcommand{\interpreter}[1]{\@interpreter#1\end}
\def\@interpreter#1,#2\end{%
\if@@Nested %
\if@@Up %
\@@yShift=40 \if@@Left \@@xShift=0 \else \@@xShift=20 \fi
\else%
\@@yShift=0 \@@xShift =0 %
\fi%
\else%
\@@yShift=40 \@@xShift=10%
\fi
\hskip\@@xShift\unitlength\raise \@@yShift\unitlength\hbox{%
\put(0,0){\line(-1,0){20}}%
\put(0,-40){\line(-1,0){20}}%
\put(0,0){\line(0,-1){40}}%
\put(-20,0){\line(0,-1){40}}%
{\@@Uptrue \@@Lefttrue \@parseArg(0,0)(-20,-20)#1\end}%
\if@@Up \else \@@tempSymbol=\expandafter{\the\@@symbol}\fi
{\@@Upfalse \@@Lefttrue \@parseArg(0,-40)(-20,-40)#2\end}%
\if@@Up \@@tempSymbol=\expandafter{\the\@@symbol}\fi
\if@@Nested \global\@@symbol=\expandafter{\the\@@tempSymbol} \fi%
}%
}
\newcommand{\program}[1]{\@program#1\end}
\def\@program#1,#2\end{%
\if@@Nested %
\if@@Up %
\@@yShift=0 \if@@Left \@@xShift=0 \else \@@xShift=20 \fi
\else%
\PackageError{semantic}{%
A program cannot be at the bottom}
{%
You have tried to use a \protect\program\space as the
bottom\MessageBreak parameter to \protect\compiler,
\protect\interpreter\space or \protect\program.\MessageBreak
Type <return> to proceed --- Output can be distorted.}%
\fi%
\else%
\@@yShift=0 \@@xShift=10%
\fi
\hskip\@@xShift\unitlength\raise \@@yShift\unitlength\hbox{%
\put(0,0){\line(-1,0){20}}%
\put(0,0){\line(0,1){30}}%
\put(-20,0){\line(0,1){30}}%
\put(-10,30){\oval(20,20)[t]}%
\@putSymbol[#1]{-20,20}%
{\@@Upfalse \@@Lefttrue \@parseArg(0,0)(-20,0)#2\end}%
}%
}
\newcommand{\machine}[1]{%
\if@@Nested %
\if@@Up %
\PackageError{semantic}{%
A machine cannot be at the top}
{%
You have tried to use a \protect\machine\space as a
top\MessageBreak parameter to \protect\compiler or
\protect\interpreter.\MessageBreak
Type <return> to proceed --- Output can be distorted.}%
\else \@@yShift=0 \@@xShift=0
\fi%
\else%
\@@yShift=20 \@@xShift=10%
\fi
\hskip\@@xShift\unitlength\raise \@@yShift\unitlength\hbox{%
\put(0,0){\line(-1,0){20}} \put(-20,0){\line(3,-5){10}}
\put(0,0){\line(-3,-5){10}}%
{\@@Uptrue \@@Lefttrue \@parseArg(0,0)(-20,-15)#1\end}%
}%
}
\def\@parseArg(#1)(#2){%
\@ifNextMacro{\@doSymbolMacro(#1)(#2)}{\@getSymbol(#2)}}
\def\@getSymbol(#1)#2\end{\@putSymbol[#2]{#1}}
\def\@doSymbolMacro(#1)(#2)#3{%
\@ifnextchar[{\@saveBeforeSymbolMacro(#1)(#2)#3}%
{\@symbolMacro(#1)(#2)#3}}
\def\@saveBeforeSymbolMacro(#1)(#2)#3[#4]#5\end{%
\@@tempSymbol={#4}%
\@@Nestedtrue\put(#1){#3#5}%
\@putSymbol[\the\@@tempSymbol]{#2}}
\def\@symbolMacro(#1)(#2)#3\end{%
\@@Nestedtrue\put(#1){#3}%
\@putSymbol{#2}}
\newcommand{\@putSymbol}[2][\the\@@symbol]{%
\global\@@symbol=\expandafter{#1}%
\put(#2){\makebox(20,20){\texttt{\the\@@symbol}}}}
\fi
\endinput
%%
%% End of file `tdiagram.sty'.
|