From: | Holger Krug <hkrug(at)rationalizer(dot)com> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Syntax changes in 7.2 |
Date: | 2002-01-07 07:05:35 |
Message-ID: | 20020107080535.A883@dev12.rationalizer.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Here some hacky code to generate diffs of the grammar rules. Maybe it
appears to be usefull:
#! /bin/sh
# shell script to diff grammars
# usage: $0 grammar-old.y grammar-new.y
TMPDIR="/tmp/diffgrammar.$$"
PWD=`pwd`
AWKCODE='
BEGIN { RULE=""; }
/^rule/ {
if ( RULE != $3 ) { print $3" ->"; RULE = $3 };
match($0,/^rule[\ \t]*[0-9]+[\ \t]*[(at)A-Za-z_0-9]+[\ \t]*->[\ \t]*/);
print "\t\t"substr($0,RLENGTH);
}
'
mkdir -p ${TMPDIR}/old ${TMPDIR}/new
cp $1 ${TMPDIR}/old
cp $2 ${TMPDIR}/new
cd ${TMPDIR}/old
bison -v `basename $1`
awk "${AWKCODE}" *.output > grammar.rules
cd ${TMPDIR}/new
bison -v `basename $2`
awk "${AWKCODE}" *.output > grammar.rules
cd ${TMPDIR}
diff -u old/grammar.rules new/grammar.rules
cd ${PWD}
rm -rf ${TMPDIR}
--
Holger Krug
hkrug(at)rationalizer(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | Holger Krug | 2002-01-07 07:31:58 | Re: ON ERROR triggers |
Previous Message | Hannu Krosing | 2002-01-07 07:01:15 | Re: LWLock contention: I think I understand the problem |