How verihogg/verihogg-format works
verihogg-format is a SystemVerilog source formatter. Users provide source through stdin or file paths and receive formatted text on stdout or, with --inplace, updated files. The CLI binds run options; source is lexed, normalized, unwrapped into logical lines, annotated, assigned layout policies, joined/aligned, and printed. The README documents indentation and tabular alignment; line wrapping is described as not yet implemented, although a wrap-search stage is present in the source pipeline. Runner internals were not sampled, so file-processing links reflect the documented workflow rather than inspected implementation details.
Main entry points: formatter.cpp Format orchestrator · main.cpp CLI entry · runner.cpp File runner · lex_context.cpp Source lexer
Components 19
CLI and input
- CLI entry
formatter/src/main.cpp - Argument binding
formatter/src/pipeline/format_args.cpp - Source files or stdin
Lexical preparation
- Source lexer
formatter/src/data/lex_context.cpp - slang lexer
- Token normalizer
formatter/src/pipeline/token_normalizer.cpp
Formatting pipeline
- Format orchestrator
formatter/src/formatter.cpp - Tree unwrapper
formatter/src/pipeline/tree_unwrapper.cpp - Token annotator
formatter/src/pipeline/token_annotator.cpp - Policy assignment
formatter/src/pipeline/policy_assigner.cpp - Line joiner
formatter/src/pipeline/line_joiner.cpp - Tabular aligner
formatter/src/pipeline/tabular_aligner.cpp - Wrap search
formatter/src/pipeline/line_wrap_searcher.cpp - Text printer
formatter/src/pipeline/printer.cpp
Output delivery
- File runner
formatter/src/pipeline/runner.cpp - Formatted output
Other components
- Formatter user
- File system
- Console
Connections 20
- Formatter user → CLI entry: invokes
- Source files or stdin → CLI entry: provides source
- CLI entry → Argument binding: binds options
- CLI entry → Source lexer: lexes stdin
- Source lexer → slang lexer: uses lexer
- CLI entry → Format orchestrator: formats stdin
- CLI entry → File runner: dispatches files
- File runner → Format orchestrator: formats files
- File runner → File system: reads or overwrites
- Format orchestrator → Token normalizer: normalizes tokens
- Format orchestrator → Tree unwrapper: unwraps tokens
- Format orchestrator → Token annotator: annotates lines
- Format orchestrator → Policy assignment: assigns policies
- Format orchestrator → Line joiner: joins lines
- Format orchestrator → Tabular aligner: aligns columns
- Format orchestrator → Wrap search: searches wraps
- Format orchestrator → Text printer: prints lines
- Format orchestrator → Formatted output: produces text
- File runner → Console: writes output
- CLI entry → Console: writes stdin output