Created
February 11, 2019 11:16
-
-
Save nulldatamap/ec79c91954c40756d0416dd8d282f6b6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\usepackage{tikz} | |
\usetikzlibrary{calc} | |
% ... | |
\newcommand{\Compiler}[4]{ | |
\draw (#1) -- ++(3, 0) -- ++(0, -1) -- ++(-1, 0) | |
-- ++(0, -1) -- ++(-1, 0) -- ++(0, 1) | |
-- ++(-1, 0) -- ++(0, 1); | |
\node at ($(#1)+(0.5, -0.5)$) {\Large #2}; | |
\node at ($(#1)+(2.5, -0.5)$) {\Large #4}; | |
\node at ($(#1)+(1.5, -1.5)$) {\Large #3}; | |
} | |
\newcommand{\Machine}[2]{ | |
\draw (#1) -- ++(1, 0) -- ++(-0.5, -1) -- ++(-0.5, 1); | |
\node at ($(#1)+(0.5, -0.3)$) {#2}; | |
} | |
\newcommand{\Program}[2]{ | |
\draw (#1) -- ++(0, -1) -- ++(1, 0) -- ++(0, 1); | |
\draw (#1) [out=150,in=180] to ($(#1)+(0.5,1)$)x | |
[in=25, out=0] to ($(#1)+(1,0)$); | |
\node at ($(#1)+(0.5,-0.5)$) {\Large #2}; | |
} | |
% ... | |
\begin{tikzpicture} | |
\Compiler{1,1}{C}{C}{C} | |
\Compiler{4,0}{C}{x86}{x86} | |
\Machine{4,1}{x86} | |
\Program{5,5}{C} | |
\end{tikzpicture} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Syntax error at the end of line #22:
x
should be;
instead.