2 %% This is file `tdiagram.sty',
3 %% generated with the docstrip utility.
5 %% The original source files were:
7 %% semantic.dtx (with options: `allOptions,Tdiagram')
11 %% For the copyright see the source file.
13 %% Any modified versions of this file must be renamed
14 %% with new filenames distinct from tdiagram.sty.
16 %% For distribution of the original source see the terms
17 %% for copying and modification in the file semantic.dtx.
19 %% This generated file may be distributed as long as the
20 %% original source files, as listed above, are part of the
21 %% same distribution. (The sources need not necessarily be
22 %% in the same archive or directory.)
24 %% semantic.dtx (c)1995--2002 Peter M^^f8ller Neergaard and
25 %% Arne John Glenstrup
27 \expandafter\ifx\csname sem@nticsLoader\endcsname\relax
28 \PackageError{semantic}{%
29 This file should not be loaded directly}
31 This file is an option of the semantic package. It should not be
32 loaded directly\MessageBreak
33 but by using \protect\usepackage{semantic} in your document
34 preamble.\MessageBreak
35 No commands are defined.\MessageBreak
36 Type <return> to proceed.
39 \TestForConflict{\@getSymbol,\@interpreter,\@parseArg,\@program}
40 \TestForConflict{\@putSymbol,\@saveBeforeSymbolMacro,\compiler}
41 \TestForConflict{\interpreter,\machine,\program,\@compiler}
48 \newcommand{\compiler}[1]{\@compiler#1\end}
49 \def\@compiler#1,#2,#3\end{%
52 \@@yShift=40 \if@@Left \@@xShift=-50 \else \@@xShift=-30 \fi
54 \@@yShift=20 \@@xShift =0 %
57 \@@yShift=40 \@@xShift=-40%
59 \hskip\@@xShift\unitlength\raise \@@yShift\unitlength\hbox{%
60 \put(0,0){\line(1,0){80}}%
61 \put(0,-20){\line(1,0){30}}%
62 \put(50,-20){\line(1,0){30}}%
63 \put(30,-40){\line(1,0){20}}%
64 \put(0,0){\line(0,-1){20}}%
65 \put(80,0){\line(0,-1){20}}%
66 \put(30,-20){\line(0,-1){20}}%
67 \put(50,-20){\line(0,-1){20}}%
68 \put(30,-20){\makebox(20,20){$\rightarrow$}} %
69 {\@@Uptrue \@@Lefttrue \@parseArg(0,-20)(5,-20)#1\end}%
70 \if@@Up \else \@@tempSymbol=\expandafter{\the\@@symbol}\fi
71 {\@@Uptrue \@@Leftfalse \@parseArg(80,-20)(55,-20)#3\end}%
72 {\@@Upfalse \@@Lefttrue \@parseArg(50,-40)(30,-40)#2\end}%
73 \if@@Up \@@tempSymbol=\expandafter{\the\@@symbol}\fi
74 \if@@Nested \global\@@symbol=\expandafter{\the\@@tempSymbol} \fi%
77 \newcommand{\interpreter}[1]{\@interpreter#1\end}
78 \def\@interpreter#1,#2\end{%
81 \@@yShift=40 \if@@Left \@@xShift=0 \else \@@xShift=20 \fi
83 \@@yShift=0 \@@xShift =0 %
86 \@@yShift=40 \@@xShift=10%
88 \hskip\@@xShift\unitlength\raise \@@yShift\unitlength\hbox{%
89 \put(0,0){\line(-1,0){20}}%
90 \put(0,-40){\line(-1,0){20}}%
91 \put(0,0){\line(0,-1){40}}%
92 \put(-20,0){\line(0,-1){40}}%
93 {\@@Uptrue \@@Lefttrue \@parseArg(0,0)(-20,-20)#1\end}%
94 \if@@Up \else \@@tempSymbol=\expandafter{\the\@@symbol}\fi
95 {\@@Upfalse \@@Lefttrue \@parseArg(0,-40)(-20,-40)#2\end}%
96 \if@@Up \@@tempSymbol=\expandafter{\the\@@symbol}\fi
97 \if@@Nested \global\@@symbol=\expandafter{\the\@@tempSymbol} \fi%
100 \newcommand{\program}[1]{\@program#1\end}
101 \def\@program#1,#2\end{%
104 \@@yShift=0 \if@@Left \@@xShift=0 \else \@@xShift=20 \fi
106 \PackageError{semantic}{%
107 A program cannot be at the bottom}
109 You have tried to use a \protect\program\space as the
110 bottom\MessageBreak parameter to \protect\compiler,
111 \protect\interpreter\space or \protect\program.\MessageBreak
112 Type <return> to proceed --- Output can be distorted.}%
115 \@@yShift=0 \@@xShift=10%
117 \hskip\@@xShift\unitlength\raise \@@yShift\unitlength\hbox{%
118 \put(0,0){\line(-1,0){20}}%
119 \put(0,0){\line(0,1){30}}%
120 \put(-20,0){\line(0,1){30}}%
121 \put(-10,30){\oval(20,20)[t]}%
122 \@putSymbol[#1]{-20,20}%
123 {\@@Upfalse \@@Lefttrue \@parseArg(0,0)(-20,0)#2\end}%
126 \newcommand{\machine}[1]{%
129 \PackageError{semantic}{%
130 A machine cannot be at the top}
132 You have tried to use a \protect\machine\space as a
133 top\MessageBreak parameter to \protect\compiler or
134 \protect\interpreter.\MessageBreak
135 Type <return> to proceed --- Output can be distorted.}%
136 \else \@@yShift=0 \@@xShift=0
139 \@@yShift=20 \@@xShift=10%
141 \hskip\@@xShift\unitlength\raise \@@yShift\unitlength\hbox{%
142 \put(0,0){\line(-1,0){20}} \put(-20,0){\line(3,-5){10}}
143 \put(0,0){\line(-3,-5){10}}%
144 {\@@Uptrue \@@Lefttrue \@parseArg(0,0)(-20,-15)#1\end}%
147 \def\@parseArg(#1)(#2){%
148 \@ifNextMacro{\@doSymbolMacro(#1)(#2)}{\@getSymbol(#2)}}
149 \def\@getSymbol(#1)#2\end{\@putSymbol[#2]{#1}}
150 \def\@doSymbolMacro(#1)(#2)#3{%
151 \@ifnextchar[{\@saveBeforeSymbolMacro(#1)(#2)#3}%
152 {\@symbolMacro(#1)(#2)#3}}
153 \def\@saveBeforeSymbolMacro(#1)(#2)#3[#4]#5\end{%
155 \@@Nestedtrue\put(#1){#3#5}%
156 \@putSymbol[\the\@@tempSymbol]{#2}}
157 \def\@symbolMacro(#1)(#2)#3\end{%
158 \@@Nestedtrue\put(#1){#3}%
160 \newcommand{\@putSymbol}[2][\the\@@symbol]{%
161 \global\@@symbol=\expandafter{#1}%
162 \put(#2){\makebox(20,20){\texttt{\the\@@symbol}}}}
166 %% End of file `tdiagram.sty'.