1 #ifndef NETLIST_READER_H 2 #define NETLIST_READER_H 33 #include <boost/ptr_container/ptr_vector.hpp> 38 #include <netlist_lexer.h> 131 wxASSERT( aLineReader !=
nullptr );
164 const wxString& aNetlistFileName,
165 const wxString& aCompFootprintFileName = wxEmptyString );
246 CMP_READER* aFootprintLinkReader =
nullptr ) :
296 return NETLIST_LEXER::TokenName( aTok );
366 CMP_READER* aFootprintLinkReader =
nullptr ) :
384 #endif // NETLIST_READER_H An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
static NETLIST_FILE_T GuessNetlistFileType(LINE_READER *aLineReader)
Look at aFileHeaderLine to see if it matches any of the netlist file types it knows about.
Read the new s-expression based KiCad netlist format.
void SetNetlist(NETLIST *aNetlist)
LINE_READER * m_lineReader
The line reader to read.
NETLIST * m_netlist
The netlist to parse into. Not owned.
static NETLIST_READER * GetNetlistReader(NETLIST *aNetlist, const wxString &aNetlistFileName, const wxString &aCompFootprintFileName=wxEmptyString)
Attempt to determine the net list file type of aNetlistFileName and return the appropriate NETLIST_RE...
NETLIST * m_netlist
The net list to read the file(s) into.
void parseComponent()
Parse a component description: (comp (ref P1) (value DB25FEMELLE) (footprint DB25FC) (libsource (lib ...
CMP_READER(LINE_READER *aLineReader)
void skipCurrent()
Skip the current token level, i.e search for the RIGHT parenthesis which closes the current descripti...
NETLIST_READER(LINE_READER *aLineReader, NETLIST *aNetlist, CMP_READER *aFootprintLinkReader=nullptr)
LEGACY_NETLIST_READER(LINE_READER *aLineReader, NETLIST *aNetlist, CMP_READER *aFootprintLinkReader=nullptr)
This file contains miscellaneous commonly used macros and functions.
The parser for reading the KiCad s-expression netlist format.
virtual ~KICAD_NETLIST_READER()
bool Load(NETLIST *aNetlist)
Read the *.cmp file format contains the component footprint assignments created by CvPcb into aNetlis...
virtual void LoadNetlist() override
Load the contents of the netlist file into aNetlist.
KICAD_NETLIST_PARSER(LINE_READER *aReader, NETLIST *aNetlist)
virtual void LoadNetlist()=0
Load the contents of the netlist file into aNetlist.
void parseLibPartList()
Read the section "libparts" in the netlist: (libparts (libpart (lib device) (part C) (description "Co...
Store information read from a netlist along with the flags used to update the NETLIST in the BOARD.
LINE_READER * m_lineReader
The line reader used to parse the netlist. Not owned.
virtual ~NETLIST_READER()
A pure virtual class to derive a specific type of netlist reader from.
KICAD_NETLIST_PARSER * m_parser
The s-expression format parser.
void loadNet(char *aText, COMPONENT *aComponent)
Function loadNet read a component net description from aText.
Read the KiCad legacy and the old Orcad netlist formats.
KICAD_NETLIST_READER(LINE_READER *aLineReader, NETLIST *aNetlist, CMP_READER *aFootprintLinkReader=nullptr)
Store all of the related footprint information found in a netlist.
void Parse()
Function Parse parse the full netlist.
bool m_loadFootprintFilters
Load the component footprint filters section if true.
virtual void LoadNetlist() override
Read the netlist file in the legacy format into aNetlist.
const char * getTokenName(NL_T::T aTok)
Read a component footprint link file (*.cmp) format.
bool m_loadNets
Load the nets section of the netlist file if true.
void parseNet()
Parse a net section (net (code 20) (name /PC-A0) (node (ref BUS1) (pin 62)) (node (ref U3) (pin 3)) (...
void loadFootprintFilters()
Load the footprint filter section of netlist file.
LINE_READER * m_lineReader
The line reader of the netlist.
void SetLineReader(LINE_READER *aLineReader)
LINE_READER * GetLineReader()
COMPONENT * loadComponent(char *aText)
Read the aLine containing the description of a component from a legacy format netlist and add it to t...
CMP_READER * m_footprintReader
The reader used to load the footprint links. If NULL, footprint links are not read.