#!/usr/bin/env python3
#
#  Licensed to the Apache Software Foundation (ASF) under one
#  or more contributor license agreements.  See the NOTICE file
#  distributed with this work for additional information
#  regarding copyright ownership.  The ASF licenses this file
#  to you under the Apache License, Version 2.0 (the
#  "License"); you may not use this file except in compliance
#  with the License.  You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.
"""U4WRH script - Process header_rewrite (HRW) lines and reconstruct hrw4u source."""

from __future__ import annotations

from hrw4u.common import run_main
from u4wrh.hrw_visitor import HRWInverseVisitor
from u4wrh.u4wrhLexer import u4wrhLexer
from u4wrh.u4wrhParser import u4wrhParser


def main() -> None:
    """Main entry point for the u4wrh script."""
    run_main(
        description="Process header_rewrite (HRW) lines and reconstruct hrw4u source.",
        lexer_class=u4wrhLexer,
        parser_class=u4wrhParser,
        visitor_class=HRWInverseVisitor,
        error_prefix="u4wrh",
        output_flag_name="hrw4u",
        output_flag_help="Produce reconstructed hrw4u output (default)")


if __name__ == "__main__":
    main()
