PARC is the C source frontend for the FOL toolchain. It preprocesses and parses one explicitly configured translation unit and produces the checked schema-v2 source contract consumed by later stages.
The package identity is follang-parc version 0.16.0; Rust code imports it as
parc. The minimum supported Rust version (MSRV) is 1.89.
parc::scan::{ScanConfig, scan_headers}is the only public path that creates a source contract from headers.parc::contractcontains immutableTargetSpec,SourcePackage, declaration and type values, canonical codecs, selection, and completion checks.parc::driver,parc::parse,parc::ast, andparc::visitremain available for syntax-level consumers.- AST-to-contract lowering is internal. The old
parc::ir,parc::intake, and direct public extraction routes do not exist.
Patching SourcePackage fields or deserializing its domain model directly is
not supported. Build a checked package through scan_headers, or decode a
canonical artifact with contract::decode_source_package.
Scanning has no host/default constructor. Callers must supply:
- a validated
TargetSpecbuilt from explicit compiler and C data-model facts; - a canonical
PathMappingfrom absolute physical roots to logical roots; PreprocessorMode::Builtinor an absolute external executable whose content fingerprint matchesTargetSpec::compiler();- exactly one absolute entry header.
use parc::scan::{scan_headers, PathMapping, PathMappingRule, PreprocessorMode, ScanConfig};
let mapping = PathMapping::try_new([
PathMappingRule::try_new("/absolute/project", "project")?,
])?;
let config = ScanConfig::new(checked_target, mapping, PreprocessorMode::Builtin)?
.entry_header("/absolute/project/include/api.h");
let report = scan_headers(&config)?;
println!("declarations: {}", report.package().declarations().len());
println!("diagnostics: {}", report.diagnostics().len());The bounded built-in path records original ranges, transitive content-addressed
files, effective macros, include chains, and macro-expansion provenance. It may
produce Completeness::Complete when every construct is modeled. Unsupported
preprocessor behavior, parser recovery, exact-type gaps, and exhausted budgets
produce structured forcing diagnostics instead of guessed data. External
preprocessing remains explicitly Partial with PARC-P0001 because compiler
output alone cannot prove original source and macro provenance.
Multiple entry headers must be scanned independently; they are never
concatenated into one translation unit. Checked packages with identical target
and preprocessing identity can be projected with SourcePackage::retain and
combined with SourcePackage::merge.
PARC owns source declarations, source types, diagnostics, provenance, target identity, and effective source inputs. It does not own measured ABI layout, symbol inspection, link planning, binary validation, or Rust generation.
Use the repository Make targets:
make fmt-check
make lint
make check-features
make test
make test-contract
make test-package
make test-system
make docs-checkmake verify runs the full non-mutating release gate and requires all system
prerequisites. See the book for the contract and parser details.
The three Cargo features are repository test switches, not consumer capability
flags: repo-tests selects repository fixtures, system-tests selects declared
compiler/header prerequisites, and dev-pegviz adds local reference-test
tracing. The packaged archive promises its default library tests and doctests;
repository-only fixtures are deliberately not included.
Registry publication is disabled (publish = false). The project does not
claim that the follang-parc name is owned or available on crates.io. Release
candidates are self-contained Cargo archives made from synchronized Git tags;
downstream siblings pin the exact tag commit in PARC -> LINC -> GERC -> FOL
order. make release-check is a non-mutating eligibility check and never bumps,
tags, pushes, or publishes anything.
The current source artifact is schema follang.parc.source-package version 2,
with ID algorithm version 1. Rust SemVer, schema/ID bump rules, MSRV policy, the
exact H2 baseline, and the clean-upstream release procedure are recorded in
RELEASE.md.
Dual-licensed under Apache 2.0 or MIT.