Last change
on this file since 3282 was
3282,
checked in by regisgia, 7 years ago

 WP5 slides for the final review.

File size:
1.1 KB

Line  

1  

2  open Mlpost 

3  

4  

5  (* Helpers *) 

6  

7  let tex = Box.tex ~dx:(Num.cm 0.1) ~dy:(Num.cm 0.1) 

8  

9  

10  (* Boxes *) 

11  

12  let source = tex "\\begin{tabular}{c}Source\\end{tabular}" 

13  

14  let labelled_source = 

15  tex "\\begin{tabular}{c}Labelled\\\\source\\end{tabular}" 

16  

17  let labelled_asm = 

18  tex "\\begin{tabular}{c}Labelled\\\\assembly\\end{tabular}" 

19  

20  let concrete_costs = 

21  tex ("\\begin{tabular}{c}\\textbf{Concrete}\\\\" ^ 

22  "\\textbf{costs}\\end{tabular}") 

23  

24  let boxes = 

25  let l1 = 

26  Box.hbox_list ~padding:(Num.cm 2.2) 

27  [source ; labelled_source ; labelled_asm] in 

28  let l2 = 

29  Box.hbox_list ~padding:(Num.cm 1.) [List.nth l1 2 ; concrete_costs] in 

30  Box.group (l1 @ [List.nth l2 1]) 

31  

32  

33  (* Arrows *) 

34  

35  let nth i = Box.nth i boxes 

36  

37  let arrow tex i j = 

38  let p1 = Box.east (nth i) in 

39  let p2 = Box.west (nth j) in 

40  Arrow.draw ~tex ~anchor:`Top (Path.pathp ~style:Path.jLine [p1 ; p2]) 

41  

42  let arrows = 

43  List.map Box.pic [arrow "Labelling" 0 1 ; arrow "Compilation" 1 2 ; 

44  arrow "" 2 3] 

45  

46  

47  (* Symbolic *) 

48  

49  let symbolic = Box.group (boxes :: arrows) 

50  

51  

52  (* Output pictures *) 

53  

54  let result = Box.draw symbolic 

55  

56  let _ = Metapost.emit "symbolic" result 

Note: See
TracBrowser
for help on using the repository browser.