-- PSL - Printer -- Copyright (C) 2002-2016 Tristan Gingold -- -- GHDL is free software; you can redistribute it and/or modify it under -- the terms of the GNU General Public License as published by the Free -- Software Foundation; either version 2, or (at your option) any later -- version. -- -- GHDL is distributed in the hope that it will be useful, but WITHOUT ANY -- WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- -- You should have received a copy of the GNU General Public License -- along with GHDL; see the file COPYING. If not, write to the Free -- Software Foundation, 59 Temple Place - Suite 330, Boston, MA -- 02111-1307, USA. with Types; use Types; with PSL.Errors; use PSL.Errors; with PSL.Prints; with Ada.Text_IO; use Ada.Text_IO; with Name_Table; use Name_Table; package body PSL.Tprint is procedure Disp_Expr (N : Node) is begin case Get_Kind (N) is when N_Number => declare Str : constant String := Uns32'Image (Get_Value (N)); begin Put (Str (2 .. Str'Last)); end; when others => Error_Kind ("disp_expr", N); end case; end Disp_Expr; procedure Disp_Count (N : Node) is B : Node; begin B := Get_Low_Bound (N); if B = Null_Node then return; end if; Disp_Expr (B); B := Get_High_Bound (N); if B = Null_Node then return; end if; Put (":"); Disp_Expr (B); end Disp_Count; procedure Put_Node (Prefix : String; Name : String) is begin Put (Prefix); Put ("-+ "); Put (Name); end Put_Node; procedure Put_Node_Line (Prefix : String; Name : String) is begin Put_Node (Prefix, Name); New_Line; end Put_Node_Line; function Down (Str : String) return String is L : constant Natural := Str'Last; begin if Str (L) = '\' then return Str (Str'First .. L - 1) & " \"; elsif Str (L) = '/' then return Str (Str'First .. L - 1) & "| \"; else raise Program_Error; end if; end Down; function Up (Str : String) return String is L : constant Natural := Str'Last; begin if Str (L) = '/' then return Str (Str'First .. L - 1) & " /"; elsif Str (L) = '\' then return Str (Str'First .. L - 1) & "| /"; else raise Program_Error; end if; end Up; procedure Disp_Repeat_Sequence (Prefix : String; Name : String; N : Node) is S : Node; begin Put_Node (Prefix, Name); Disp_Count (N); Put_Line ("]"); S := Get_Sequence (N); if S /= Null_Node then Disp_Property (Down (Prefix), S); end if; end Disp_Repeat_Sequence; procedure Disp_Binary_Sequence (Prefix : String; Name : String; N : Node) is begin Disp_Property (Up (Prefix), Get_Left (N)); Put_Node_Line (Prefix, Name); Disp_Property (Down (Prefix), Get_Right (N)); end Disp_Binary_Sequence; procedure Disp_Range_Property (Prefix : String; Name : String; N : Node) is begin Put_Node (Prefix, Name); Put ("["); Disp_Count (N); Put_Line ("]"); Disp_Property (Down (Prefix), Get_Property (N)); end Disp_Range_Property; procedure Disp_Boolean_Range_Property (Prefix : String; Name : String; N : Node) is begin Disp_Property (Up (Prefix), Get_Boolean (N)); Put_Node (Prefix, Name); Put ("["); Disp_Count (N); Put_Line ("]"); Disp_Property (Down (Prefix), Get_Property (N)); end Disp_Boolean_Range_Property; procedure Disp_Property (Prefix : String; Prop : Node) is begin case Get_Kind (Prop) is when N_Never => Put_Node_Line (Prefix, "never"); Disp_Property (Down (Prefix), Get_Property (Prop)); when N_Always => Put_Node_Line (Prefix, "always"); Disp_Property (Down (Prefix), Get_Property (Prop)); when N_Eventually => Put_Node_Line (Prefix, "eventually!"); Disp_Property (Down (Prefix), Get_Property (Prop)); when N_Next => Put_Node_Line (Prefix, "next"); -- if Get_Strong_Flag (Prop) then -- Put ('!'); -- end if; Disp_Property (Down (Prefix), Get_Property (Prop)); when N_Next_A => Disp_Range_Property (Prefix, "next_a", Prop); when N_Next_E
#!/bin/bash
fast_mode=false
set -- $(getopt fu "$@")
while [ $# -gt 0 ]; do
case "$1" in
-f)
fast_mode=true
;;
--)
shift
break
;;
-*)
echo "$0: error - unrecognized option $1" 1>&2
exit 1
;;
*)
break
esac
shift
done
PDFTEX_OPT="-shell-escape -halt-on-error"
set -ex
if ! $fast_mode; then
! md5sum *.aux *.snm *.nav *.toc > autoloop.old
make -C PRESENTATION_Intro
make -C PRESENTATION_ExSyn
make -C PRESENTATION_ExAdv
make -C PRESENTATION_ExOth
make -C PRESENTATION_Prog
fi
set -ex
pdflatex $PDFTEX_OPT presentation.tex
if ! $fast_mode; then
while
md5sum *.aux *.snm *.nav *.toc > autoloop.new
! cmp autoloop.old autoloop.new
do
cp autoloop.new autoloop.old
pdflatex $PDFTEX_OPT presentation.tex
done
rm -f autoloop.old
rm -f autoloop.new
fi