]> matita.cs.unibo.it Git - helm.git/blob - helm/ocaml/cic_notation/doc/tdiagram.sty
ocaml 3.09 transition
[helm.git] / helm / ocaml / cic_notation / doc / tdiagram.sty
1 %%
2 %% This is file `tdiagram.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% semantic.dtx  (with options: `allOptions,Tdiagram')
8 %% 
9 %% IMPORTANT NOTICE:
10 %% 
11 %% For the copyright see the source file.
12 %% 
13 %% Any modified versions of this file must be renamed
14 %% with new filenames distinct from tdiagram.sty.
15 %% 
16 %% For distribution of the original source see the terms
17 %% for copying and modification in the file semantic.dtx.
18 %% 
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.)
23 %%
24 %% semantic.dtx  (c)1995--2002 Peter M^^f8ller Neergaard and
25 %%                             Arne John Glenstrup
26 %%
27 \expandafter\ifx\csname sem@nticsLoader\endcsname\relax
28   \PackageError{semantic}{%
29     This file should not be loaded directly}
30     {%
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.
37     }%
38 \else
39 \TestForConflict{\@getSymbol,\@interpreter,\@parseArg,\@program}
40 \TestForConflict{\@putSymbol,\@saveBeforeSymbolMacro,\compiler}
41 \TestForConflict{\interpreter,\machine,\program,\@compiler}
42 \newif\if@@Left
43 \newif\if@@Up
44 \newcount\@@xShift
45 \newcount\@@yShift
46 \newtoks\@@symbol
47 \newtoks\@@tempSymbol
48 \newcommand{\compiler}[1]{\@compiler#1\end}
49 \def\@compiler#1,#2,#3\end{%
50   \if@@Nested %
51     \if@@Up %
52     \@@yShift=40 \if@@Left \@@xShift=-50 \else \@@xShift=-30 \fi
53     \else%
54       \@@yShift=20 \@@xShift =0 %
55     \fi%
56   \else%
57     \@@yShift=40 \@@xShift=-40%
58     \fi
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%
75   }%
76 }
77 \newcommand{\interpreter}[1]{\@interpreter#1\end}
78 \def\@interpreter#1,#2\end{%
79   \if@@Nested %
80     \if@@Up %
81     \@@yShift=40 \if@@Left \@@xShift=0 \else \@@xShift=20 \fi
82     \else%
83       \@@yShift=0 \@@xShift =0 %
84     \fi%
85   \else%
86     \@@yShift=40 \@@xShift=10%
87     \fi
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%
98   }%
99 }
100 \newcommand{\program}[1]{\@program#1\end}
101 \def\@program#1,#2\end{%
102   \if@@Nested %
103     \if@@Up %
104     \@@yShift=0 \if@@Left \@@xShift=0 \else \@@xShift=20 \fi
105     \else%
106       \PackageError{semantic}{%
107         A program cannot be at the bottom}
108         {%
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.}%
113     \fi%
114   \else%
115     \@@yShift=0 \@@xShift=10%
116     \fi
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}%
124   }%
125 }
126 \newcommand{\machine}[1]{%
127   \if@@Nested %
128     \if@@Up %
129       \PackageError{semantic}{%
130         A machine cannot be at the top}
131         {%
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
137     \fi%
138   \else%
139     \@@yShift=20 \@@xShift=10%
140     \fi
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}%
145   }%
146 }
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{%
154   \@@tempSymbol={#4}%
155   \@@Nestedtrue\put(#1){#3#5}%
156   \@putSymbol[\the\@@tempSymbol]{#2}}
157 \def\@symbolMacro(#1)(#2)#3\end{%
158   \@@Nestedtrue\put(#1){#3}%
159   \@putSymbol{#2}}
160 \newcommand{\@putSymbol}[2][\the\@@symbol]{%
161   \global\@@symbol=\expandafter{#1}%
162   \put(#2){\makebox(20,20){\texttt{\the\@@symbol}}}}
163 \fi
164 \endinput
165 %%
166 %% End of file `tdiagram.sty'.