| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | # This scripts checks that the new grammar of Coq as defined in syntax-v8.tex |
| 3 | # is consistent in the sense that all invoked non-terminals are defined |
| 4 | |
| 5 | defined_ntscip-shell shell shell-project 0.0.0 defined_nt().() { |
| 6 | grepscip-shell system . . grep. "\\DEFNT{.*}" syntax-v8.tex | sedscip-shell system . . sed. -e "s|.*DEFNT{\([^}]*\)}.*|\1|"|\ |
| 7 | sort | sortscip-shell system . . sort. -u |
| 8 | } |
| 9 | |
| 10 | used_ntscip-shell shell shell-project 0.0.0 used_nt().() { |
| 11 | catscip-shell system . . cat. syntax-v8.tex | trscip-shell system . . tr. \\\\ \\n | grepscip-shell system . . grep. "^NT{.*}" |\ |
| 12 | sed -e "s|^NT{\([^}]*\)}.*|\1|" | egrepscip-shell system . . egrep. -v ^\#1\|non-terminal | sortscip-shell system . . sort. -u |
| 13 | } |
| 14 | |
| 15 | used_termscip-shell shell shell-project 0.0.0 used_term().() { |
| 16 | catscip-shell system . . cat. syntax-v8.tex | trscip-shell system . . tr. \\\\ \\n | grepscip-shell system . . grep. "^TERM{.*}" |\ |
| 17 | sed -e "s|^TERM{\([^}]*\)}.*|\1|" -e "s|\\$||g" | egrepscip-shell system . . egrep. -v ^\#1\|terminal | sortscip-shell system . . sort. -u |
| 18 | } |
| 19 | |
| 20 | used_kwdscip-shell shell shell-project 0.0.0 used_kwd().() { |
| 21 | catscip-shell system . . cat. syntax-v8.tex | trscip-shell system . . tr. \\\\ \\n | grepscip-shell system . . grep. "^KWD{.*}" |\ |
| 22 | sed -e "s|^KWD{\([^}]*\)}.*|\1|" -e "s|\\$||g" | egrepscip-shell system . . egrep. -v ^\#1 | sortscip-shell system . . sort. -u |
| 23 | } |
| 24 | |
| 25 | defined_ntscip-shell shell shell-project 0.0.0 defined_nt(). > def |
| 26 | used_ntscip-shell shell shell-project 0.0.0 used_nt(). > use |
| 27 | used_termscip-shell shell shell-project 0.0.0 used_term(). > use-t |
| 28 | used_kwdscip-shell shell shell-project 0.0.0 used_kwd(). > use-k |
| 29 | diffscip-shell system . . diff. def use > df |
| 30 | |
| 31 | ############################### |
| 32 | echoscip-shell system . . echo. |
| 33 | if grepscip-shell system . . grep. ^\> df > /dev/nullscip-shell filesystem . . `/dev/null`. 2>&1 ; then |
| 34 | echoscip-shell system . . echo. Undefined non-terminals: |
| 35 | echoscip-shell system . . echo. ======================== |
| 36 | echoscip-shell system . . echo. |
| 37 | grepscip-shell system . . grep. ^\> df | sedscip-shell system . . sed. -e "s|^> ||" |
| 38 | echoscip-shell system . . echo. |
| 39 | fi |
| 40 | if grepscip-shell system . . grep. ^\< df > /dev/nullscip-shell filesystem . . `/dev/null`. 2>&1 ; then |
| 41 | echoscip-shell system . . echo. Unused non-terminals: |
| 42 | echoscip-shell system . . echo. ===================== |
| 43 | echoscip-shell system . . echo. |
| 44 | grepscip-shell system . . grep. ^\< df | sedscip-shell system . . sed. -e "s|^< ||" |
| 45 | echoscip-shell system . . echo. |
| 46 | fi |
| 47 | #echo Used terminals: |
| 48 | #echo =============== |
| 49 | #echo |
| 50 | #cat use-t |