1#!/bin/bash 2 3# check_syntax.sh - a small script to search for interface headers with 4# missing semicolons (they give troubles to Doxygen). 5# Author: Francesco Montorsi 6 7 8rm -f missing_semicolons 9 10# the preprocessor will remove comments and all #preprocessor #stuff; 11# we then remove the empty lines 12for iface in wx/*h; do 13 14 echo "--- $iface ---" >>missing_semicolons 15 16 gcc -E $iface | grep -v '#' | grep -v '^[[:space:]]*$' >temp 17 18 # now remove the lines which ends with a comma or a semicolon; they're ok 19 cat temp | grep -v '.*;$' | grep -v '.*,$' >temp2 20 21 # now search for methods; we know they should always contain at least two () brackets! 22 cat temp2 | grep '(' >>missing_semicolons 23 24 # now remove the lines which shouldn't have final comma or semicolon: 25# cat temp2 | grep -v '^[[:space:]]*wx[A-Z]*[[:space:]]*$' >temp 26# cat temp | grep -v 'class' | grep -v 'enum' | grep -v 'template' | \ 27# grep -v 'struct' | grep -v 'typedef' | \ 28# grep -v 'public:' | grep -v 'protected:' | grep -v 'private:' | \ 29# grep -v '{' | grep -v '}' >>missing_semicolons 30 31done 32 33rm temp temp2 34