#!/bin/sh

hxtoh()
{
    flag=1
    while read -r str; do
        case $str in
            HXCOMM*)
            ;;
            STEXI*|ETEXI*|SRST*|ERST*) flag=$(($flag^1))
            ;;
            *)
            test $flag -eq 1 && printf "%s\n" "$str"
            ;;
        esac
    done
}

print_texi_heading()
{
    if test "$*" != ""; then
        title="$*"
        printf "@subsection %s\n" "${title%:}"
    fi
}

hxtotexi()
{
    flag=0
    rstflag=0
    line=1
    while read -r str; do
        case "$str" in
            HXCOMM*)
            ;;
            STEXI*)
            if test $rstflag -eq 1 ; then
                printf "line %d: syntax error: expected ERST, found '%s'\n" "$line" "$str" >&2
                exit 1
            fi
            if test $flag -eq 1 ; then
                printf "line %d: syntax error: expected ETEXI, found '%s'\n" "$line" "$str" >&2
                exit 1
            fi
            flag=1
            ;;
            ETEXI*)
            if test $rstflag -eq 1 ; then
                printf "line %d: syntax error: expected ERST, found '%s'\n" "$line" "$str" >&2
                exit 1
            fi
            if test $flag -ne 1 ; then
                printf "line %d: syntax error: expected STEXI, found '%s'\n" "$line" "$str" >&2
                exit 1
            fi
            flag=0
            ;;
            SRST*)
            if test $rstflag -eq 1 ; then
                printf "line %d: syntax error: expected ERST, found '%s'\n" "$line" "$str" >&2
                exit 1
            fi
            if test $flag -eq 1 ; then
                printf "line %d: syntax error: expected ETEXI, found '%s'\n" "$line" "$str" >&2
                exit 1
            fi
            rstflag=1
            ;;
            ERST*)
            if test $flag -eq 1 ; then
                printf "line %d: syntax error: expected ETEXI, found '%s'\n" "$line" "$str" >&2
                exit 1
            fi
            if test $rstflag -ne 1 ; then
                printf "line %d: syntax error: expected SRST, found '%s'\n" "$line" "$str" >&2
                exit 1
            fi
            rstflag=0
            ;;
            DEFHEADING*)
            print_texi_heading "$(expr "$str" : "DEFHEADING(\(.*\))")"
            ;;
            ARCHHEADING*)
            print_texi_heading "$(expr "$str" : "ARCHHEADING(\(.*\),.*)")"
            ;;
            *)
            test $flag -eq 1 && printf '%s\n' "$str"
            ;;
        esac
        line=$((line+1))
    done
}

case "$1" in
"-h") hxtoh ;;
"-t") hxtotexi ;;
*) exit 1 ;;
esac

exit 0
