#!/bin/bash

    # process the file generated by flex.

IFS="
"
    # read all lines until yy_buffer_state is encountered

while read line ; do
    echo "$line"

    echo $line | grep yy_buffer_state > /dev/null 2>&1
    if [ $? -eq 0 ] ; then
        break
    fi
done

    # following the yy_buffer_state line add a final #endif

echo "#endif"

