daily pastebin goal
16%
SHARE
TWEET

To accompany http://i.imgur.com/p00oC5z.png?1

a guest May 27th, 2015 23 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #! /bin/bash
  2.  
  3. #  I, the copyright holder of this work, hereby release it into the public
  4. #  domain.  This applies worldwide.
  5.  
  6. set -e
  7.  
  8. cat<<EOF > right-recursive-parse-of-a-double-subtraction.mp
  9. prologues:=2;
  10. verbatimtex
  11. \documentclass{article}
  12. \begin{document}
  13. etex
  14. ;
  15.  
  16. def connect(expr u, v)=
  17.   pair toward;
  18.   toward := unitvector (v - u);
  19.   toward := toward * 8 / abs(ypart toward);
  20.   draw (u+toward)--(v-toward);
  21. enddef;
  22.  
  23. beginfig(0)
  24.   pickup pencircle;
  25.   xs := 60;
  26.   ys := 30;
  27.   pair a[];
  28.   a0 := (0, 0) xscaled xs yscaled ys;
  29.   a1 := (-1, -1) xscaled xs yscaled ys;
  30.   a2 := (1, -1) xscaled xs yscaled ys;
  31.   a3 := (-1, -2) xscaled xs yscaled ys;
  32.   a4 := (0, -2) xscaled xs yscaled ys;
  33.   a5 := (1, -2) xscaled xs yscaled ys;
  34.   a6 := (3, -2) xscaled xs yscaled ys;
  35.   a7 := (-1, -3) xscaled xs yscaled ys;
  36.   a8 := (1, -3) xscaled xs yscaled ys;
  37.   a9 := (2, -3) xscaled xs yscaled ys;
  38.   a10 := (3, -3) xscaled xs yscaled ys;
  39.   a11 := (4, -3) xscaled xs yscaled ys;
  40.   a12 := (1, -4) xscaled xs yscaled ys;
  41.   a13 := (3, -4) xscaled xs yscaled ys;
  42.   a14 := (4, -4) xscaled xs yscaled ys;
  43.   a15 := (3, -5) xscaled xs yscaled ys;
  44.   label(btex \(\mathit{Expression}\) etex, a0);
  45.   label(btex \(\mathit{Term}\) etex, a1);
  46.   label(btex \(\mathit{Expression}'\) etex, a2);
  47.  label(btex \(\mathit{Factor}\) etex, a3);
  48.  label(btex \(-\) etex, a4);
  49.  label(btex \(\mathit{Term}\) etex, a5);
  50.  label(btex \(\mathit{Expression}'\) etex, a6);
  51.   label(btex \(\mathit{Integer}\) etex, a7);
  52.   label(btex \(\mathit{Factor}\) etex, a8);
  53.   label(btex \(-\) etex, a9);
  54.   label(btex \(\mathit{Term}\) etex, a10);
  55.   label(btex \(\mathit{Expression}'\) etex, a11);
  56.  label(btex \(\mathit{Integer}\) etex, a12);
  57.  label(btex \(\mathit{Factor}\) etex, a13);
  58.  label(btex \(\epsilon\) etex, a14);
  59.  label(btex \(\mathit{Integer}\) etex, a15);
  60.  connect(a0, a1);
  61.  connect(a0, a2);
  62.  connect(a1, a3);
  63.  connect(a2, a4);
  64.  connect(a2, a5);
  65.  connect(a2, a6);
  66.  connect(a3, a7);
  67.  connect(a5, a8);
  68.  connect(a6, a9);
  69.  connect(a6, a10);
  70.  connect(a6, a11);
  71.  connect(a8, a12);
  72.  connect(a10, a13);
  73.  connect(a11, a14);
  74.  connect(a13, a15);
  75. endfig;
  76.  
  77. bye;
  78. EOF
  79.  
  80. cat<<EOF > right-recursive-parse-of-a-double-subtraction.tex
  81. \documentclass{article}
  82. \usepackage[paperwidth=26cm,paperheight=13cm,text={26cm,13cm}]{geometry}
  83. \usepackage{graphicx}
  84. \pagestyle{empty}
  85. \begin{document}
  86. \hbox{}
  87. \centerline{\convertMPtoPDF{\jobname.0}{2}{2}}
  88. \end{document}
  89. EOF
  90.  
  91. mpost right-recursive-parse-of-a-double-subtraction
  92. pdflatex right-recursive-parse-of-a-double-subtraction
  93. convert right-recursive-parse-of-a-double-subtraction.pdf right-recursive-parse-of-a-double-subtraction.png
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top