Architecture Overview
This project implements a multi-vendor network-config parser in Python with the following functions:
- Chunk a large CLI config into top-level blocks
- Dispatch each block to a specialized parser
- Highlight which tokens are “modeled” versus “unmodeled”
- Report per-parser coverage statistics
- Emit both an expanded view for the nested BGP sections
1. Chunking & Dispatch
- Config Tree & Flattening
- Build an indentation-based tree (
ConfigLine) from the raw file. -
Flatten into top-level chunks (e.g.
interface,vlan,ip route,vrf definition,router bgp, etc.). -
Classification
- Each chunk’s first line is matched against known prefixes.
-
Unknown types fall back to
StubParser. -
Parser Interface
```python class BaseChunkParser(ABC): @abstractmethod def analyze(self, lines: List[str]) -> List[ParsedLine]: ...