Re: Syntax changes in 7.2 - Mailing list pgsql-hackers

From Holger Krug
Subject Re: Syntax changes in 7.2
Date
Msg-id 20020107080535.A883@dev12.rationalizer.com
Whole thread Raw
In response to Re: Syntax changes in 7.2  (Bruce Momjian <pgman@candle.pha.pa.us>)
List 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]*[@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@rationalizer.com


pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: LWLock contention: I think I understand the problem
Next
From: Michael Meskes
Date:
Subject: Re: fork() while connected