86 std::optional<size_t>
leaf;
121 static std::optional<BUS_SCHEMA>
Parse(
const wxString& aText,
const BUS_ALIASES& aAliases = {} );
134 std::shared_ptr<const BUS_SCHEMA>
schema;
136 std::shared_ptr<const BUS_SCHEMA::NODE>
tree;
163 void Retain(
const std::set<wxString>& aLive );
169 std::shared_ptr<const BUS_SCHEMA::NODE>
FindTree(
const wxString& aText )
const;
182 std::vector<std::pair<size_t, size_t>>
matched;
CACHE_TABLE< wxString, RESULT >::ENTRY ENTRY
CACHE_TABLE< wxString, RESULT > m_cache
std::set< wxString > m_dirty
void Retain(const std::set< wxString > &aLive)
Erase the entries whose text is not in aLive.
bool SetAliases(const BUS_ALIASES &aAliases)
Replace the alias table.
std::shared_ptr< const BUS_SCHEMA::NODE > FindTree(const wxString &aText) const
Current tree without cache writes.
BUS_PARSE_CACHE(CACHE_VERSIONS &aVersions)
const ENTRY & Parse(const wxString &aText)
Return the cached entry, and parse again if the entry is missing or dirty.
One sequence for all cache tables for the lifetime of an engine session.
Value keys and the key session of the schematic connectivity engine.
std::map< wxString, std::vector< wxString > > BUS_ALIASES
Bus alias table, from alias name to member texts.
BUS_ALIGNMENT Align(const BUS_SCHEMA &aLeft, const BUS_SCHEMA &aRight)
Match the leaves of aLeft to the leaves of aRight.
Member correspondence between two bus schemas.
std::vector< size_t > unmappedLeft
Left leaf ordinals without a right partner.
std::vector< std::pair< size_t, size_t > > matched
Pairs of left and right leaf ordinals.
std::shared_ptr< const BUS_SCHEMA > schema
std::set< wxString > aliasesUsed
bool operator==(const RESULT &aOther) const
std::shared_ptr< const BUS_SCHEMA::NODE > tree
Presentation tree.
wxString name
Member name with all group prefixes, such as I2C.SDA.
std::vector< wxString > groupPath
Prefixes of the inner named groups.
wxString localName
Member name without group prefixes, such as SDA.
bool operator==(const LEAF &) const =default
One node of the presentation tree.
wxString text
Container label text.
std::optional< size_t > leaf
Leaf ordinal of a NET node.
bool operator==(const NODE &) const =default
std::vector< NODE > members
The parsed form of one bus text.
std::vector< LEAF > leaves
Member nets in declaration order, with nested buses flattened.
NODE root
Presentation tree. BUS_PARSE_CACHE stores it apart from the schema.
@ GROUP
A list such as I2C{SDA SCL}. Members align by name with another group.
@ VECTOR
A range such as D[0..3]. Members align by ordinal.
wxString prefix
Root prefix, such as D or I2C. It is empty for an unnamed group.
std::set< wxString > aliasesUsed
Every member name that the parser looked up in the alias table.
size_t prefixEnd
End of the root prefix in the escaped input text.
bool operator==(const BUS_SCHEMA &aOther) const
Compare the electrical schema only.
static std::optional< BUS_SCHEMA > Parse(const wxString &aText, const BUS_ALIASES &aAliases={})
Parse a vector or group bus text.