Metadata-Version: 2.4
Name: fhy_lang
Version: 0.1.1
Summary: Cross-domain-language frontend for the FhY compiler framework.
Author-email: Christopher Priebe <cpriebe@ucsd.edu>
Maintainer-email: Christopher Priebe <cpriebe@ucsd.edu>
License: Copyright (c) 2026 FhY Developers
        Christopher Priebe <cpriebe@ucsd.edu>
        Hadi S Esmaeilzadeh <hadi@ucsd.edu>
        All Rights Reserved.
        
        Redistribution and use in source and binary forms, with or without modification, are
        permitted provided that the following conditions are met:
        
        1. Redistributions of source code must retain the above copyright notice, this list of
        conditions and the following disclaimer.
        
        2. Redistributions in binary form must reproduce the above copyright notice, this list
        of conditions and the following disclaimer in the documentation and/or other materials
        provided with the distribution.
        
        3. Neither the name of the copyright holder nor the names of its contributors may be
        used to endorse or promote products derived from this software without specific prior
        written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY
        EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
        OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
        SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
        INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
        TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
        BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
        CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
        WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
        DAMAGE.
        
Keywords: Compiler,Cross-Domain Language,Cross-Domain Compiler,Multi-Target Compiler
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: BSD License
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: antlr4-python3-runtime==4.13.0
Requires-Dist: antlr4-tools==0.2.0
Requires-Dist: fhy-core>=0.1.1
Requires-Dist: frozendict
Requires-Dist: networkx>=3.2.1
Requires-Dist: typer>=0.24.1
Provides-Extra: dev
Requires-Dist: fhy_lang[lint,pre-commit,test,type]; extra == "dev"
Requires-Dist: tox; extra == "dev"
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: coverage; extra == "test"
Requires-Dist: pytest-xdist; extra == "test"
Provides-Extra: pre-commit
Requires-Dist: pre-commit>3.0.0; extra == "pre-commit"
Provides-Extra: lint
Requires-Dist: ruff; extra == "lint"
Requires-Dist: pylint; extra == "lint"
Provides-Extra: type
Requires-Dist: mypy; extra == "type"
Requires-Dist: types-networkx; extra == "type"
Dynamic: license-file

# FhY Language and Frontend

[![PyPI version](https://img.shields.io/pypi/v/fhy_lang.svg)](https://pypi.org/project/fhy_lang/)
[![Python versions](https://img.shields.io/pypi/pyversions/fhy_lang.svg)](https://pypi.org/project/fhy_lang/)
[![CI](https://github.com/actlab-fhy/FhY-lang/actions/workflows/python-package.yml/badge.svg)](https://github.com/actlab-fhy/FhY-lang/actions/workflows/python-package.yml)

*A Language for Modeling Physical Things*

*FhY* is a cross-domain language with mathematical foundations that moves beyond the
current paradigm of domain-specific languages to enable cross-domain multi-acceleration.

This package provides the user-facing surface of the compiler: the FhY source language, its grammar and parser (built on ANTLR), the AST definitions, and the driver that turns a FhY source program into a fully-constructed AST module and symbol table ready to be consumed by downstream compilation stages.

## Features

- FhY grammar and ANTLR-generated parser
- Abstract syntax tree (AST) definitions and pretty-printing utilities
- Parse-tree-to-AST conversion
- Symbol table construction
- Compilation driver with configurable options (verbose logging, optimization)
- AST serialization to JSON or human-readable pretty-printed formats

## Command Line Interface

Installing the package exposes the `compile-fhy-lang` command:

```bash
compile-fhy-lang --help
compile-fhy-lang --version
```

### Compile and serialize a FhY source program

```bash
compile-fhy-lang serialize path/to/main.fhy [OPTIONS]
```

Common options:

- `--format, -f {json,pretty,prettyid}` - serialization format for the resulting AST
- `--indent, -i N` - indentation width for human-readable output
- `--verbose` - enable debug-level logging
- `--optimize` - enable frontend optimizations
- `--log-file PATH` - write logs to the given file

If no `--format` is provided, the program is compiled but no serialized output is emitted.
