KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PCB_IO_KICAD_SEXPR_PARSER Class Reference

Read a Pcbnew s-expression formatted LINE_READER object and returns the appropriate BOARD_ITEM object. More...

#include <pcb_io_kicad_sexpr_parser.h>

Inheritance diagram for PCB_IO_KICAD_SEXPR_PARSER:

Classes

struct  CONSTRAINT_INFO
 Deferred constraint, resolved against the parsed items once the whole file is read, mirroring GROUP_INFO (members reference items by KIID). More...
 
struct  GENERATOR_INFO
 
struct  GROUP_INFO
 

Public Types

typedef std::unordered_map< std::string, PCB_LAYER_ID > LAYER_ID_MAP
 
typedef std::unordered_map< std::string, LSET > LSET_MAP
 
typedef std::unordered_map< wxString, KIID > KIID_MAP
 

Public Member Functions

 PCB_IO_KICAD_SEXPR_PARSER (LINE_READER *aReader, BOARD *aBoard, std::function< bool(wxString, int, wxString, wxString)> aQueryUserCallback, PROGRESS_REPORTER *aProgressReporter=nullptr, unsigned aLineCount=0, bool aPreserveDestinationStackup=false, bool aAppendToExisting=false)
 
BOARD_ITEM * Parse ()
 
FOOTPRINT * parseFOOTPRINT (wxArrayString *aInitialComments=nullptr)
 
void ParseFootprintLib (boost::ptr_map< wxString, FP_CACHE_ENTRY, std::less< wxString >, boost::heap_clone_allocator, std::allocator< std::pair< const wxString, void * > > > &aFootprints)
 Parse a footprint library file.
 
bool IsTooRecent ()
 Return whether a version number, if any was parsed, was too recent.
 
wxString GetRequiredVersion ()
 Return a string representing the version of KiCad required to open this file.
 
bool IsValidBoardHeader ()
 Partially parse the input and check if it matches expected header.
 
const std::vector< wxString > & GetParseWarnings () const
 Return any non-fatal parse warnings that occurred during parsing.
 
void SetLayerMappingHandler (LAYER_MAPPING_HANDLER aHandler)
 Handler to remap an appended board's layers onto the destination board, used on mismatch.
 

Private Types

using TIMEOUT = std::chrono::milliseconds
 The type of progress bar timeout.
 
using CLOCK = std::chrono::steady_clock
 The clock used for the timestamp (guaranteed to be monotonic).
 
using TIME_PT = std::chrono::time_point<CLOCK>
 The type of the time stamps.
 

Private Member Functions

int getNetCode (int aNetCode)
 Convert net code using the mapping table if available, otherwise returns unchanged net code if < 0 or if it's out of range.
 
void pushValueIntoMap (int aIndex, int aValue)
 Add aValue value in netcode mapping (m_netCodes) at aIndex.
 
void init ()
 Clear and re-establish m_layerMap with the default layer names.
 
void checkpoint ()
 
void createOldLayerMapping (std::unordered_map< std::string, std::string > &aMap)
 Create a mapping from the (short-lived) bug where layer names were translated.
 
void skipCurrent ()
 Skip the current token level, i.e search for the RIGHT parenthesis which closes the current description.
 
void parseHeader ()
 
void parseGeneralSection ()
 
void parsePAGE_INFO ()
 
void parseTITLE_BLOCK ()
 
void parseLayers ()
 
void remapAppendedLayers (const std::vector< LAYER > &aSourceLayers, const LSET &aDestInitialEnabled, int aDestInitialCopperCount)
 Remap the appended layers onto the destination using m_layerMappingHandler, on mismatch.
 
void parseLayer (LAYER *aLayer)
 
void parseBoardStackup ()
 
void parseSetup ()
 
void parseDrillSymbolProfile ()
 
void parseDefaults (BOARD_DESIGN_SETTINGS &aSettings)
 
void parseDefaultTextDims (BOARD_DESIGN_SETTINGS &aSettings, int aLayer)
 
void parseNETINFO_ITEM ()
 
void parseNETCLASS ()
 
void parseNET_CHAINS_SECTION ()
 
void parseTEARDROP_PARAMETERS (TEARDROP_PARAMETERS *tdParams)
 
void parseTextBoxContent (PCB_TEXTBOX *aTextBox)
 
void bakeTextBoxLib (PCB_TEXTBOX *aTextBox)
 Lift disk-parsed values into PCB_TEXTBOX lib storage for new format files.
 
void parseLineEnding (LINE_ENDING &aEnding)
 Parse a line ending definition from the token stream.
 
PCB_SHAPE * parsePCB_SHAPE (BOARD_ITEM *aParent)
 
PCB_TEXT * parsePCB_TEXT (BOARD_ITEM *aParent, PCB_TEXT *aBaseText=nullptr)
 
bool parsePCB_TEXT_effects (PCB_TEXT *aText, PCB_TEXT *aBaseText=nullptr)
 
PCB_REFERENCE_IMAGE * parsePCB_REFERENCE_IMAGE (BOARD_ITEM *aParent)
 
PCB_TEXTBOX * parsePCB_TEXTBOX (BOARD_ITEM *aParent)
 
PCB_BARCODE * parsePCB_BARCODE (BOARD_ITEM *aParent)
 
PCB_TABLECELL * parsePCB_TABLECELL (BOARD_ITEM *aParent)
 
PCB_TABLE * parsePCB_TABLE (BOARD_ITEM *aParent)
 
bool parseTableBodyToken (PCB_TABLE *aTable, PCB_KEYS_T::T aToken, bool aAllowIdentity)
 aAllowIdentity is false inside a drill chart's table_data, where the enclosing form owns uuid, layer and lock state.
 
void parseTableBody (PCB_TABLE *aTable, bool aAllowIdentity)
 
PCB_GENERATED_TABLE * parseGeneratedTable (std::unique_ptr< PCB_GENERATED_TABLE > aTable)
 The body every generated table shares.
 
bool parseGeneratedTableExtra (PCB_GENERATED_TABLE *aTable, PCB_KEYS_T::T aToken)
 One token only aTable's kind carries.
 
DRILL_SPAN parseDrillSpanBody ()
 
PCB_DRILL_MAP * parsePCB_DRILL_MAP (BOARD_ITEM *aParent)
 
PCB_DIMENSION_BASE * parseDIMENSION (BOARD_ITEM *aParent)
 
FOOTPRINT * parseFOOTPRINT_unchecked (wxArrayString *aInitialComments=nullptr)
 
void parseFootprintStackup (FOOTPRINT &aFootprint)
 
PAD * parsePAD (FOOTPRINT *aParent=nullptr)
 
void parsePAD_primitives (PAD *aPad, PCB_LAYER_ID aLayer)
 
void parsePAD_option (PAD *aPad, PCB_LAYER_ID aLayer)
 
void parsePostMachining (PADSTACK::POST_MACHINING_PROPS &aProps)
 
void parsePadstack (PAD *aPad)
 
PCB_TRACK * parseARC ()
 
PCB_TRACK * parsePCB_TRACK ()
 
PCB_VIA * parsePCB_VIA ()
 
void parseViastack (PCB_VIA *aVia)
 
ZONE * parseZONE (BOARD_ITEM_CONTAINER *aParent)
 
PCB_TARGET * parsePCB_TARGET ()
 
PCB_POINT * parsePCB_POINT ()
 
PCB_GRID_ITEM * parsePCB_GRID_ITEM ()
 
BOARD * parseBOARD ()
 
void parseGROUP_members (GROUP_INFO &aGroupInfo)
 
void parseGROUP (BOARD_ITEM *aParent)
 
void parseCONSTRAINT (BOARD_ITEM *aParent)
 
void parseGENERATOR (BOARD_ITEM *aParent)
 
void parseGENERATOR_templates (GENERATOR_INFO &aGenInfo)
 
BOARD * parseBOARD_unchecked ()
 
PCB_LAYER_ID lookUpLayer (const LAYER_ID_MAP &aMap, bool aAllowUndefined=false)
 Parse the current token for the layer definition of a BOARD_ITEM object.
 
LSET lookUpLayerSet (const LSET_MAP &aMap)
 
PCB_LAYER_ID parseBoardItemLayer ()
 Parse the layer definition of a BOARD_ITEM object.
 
LSET parseBoardItemLayersAsMask ()
 Parse the layers definition of a BOARD_ITEM object.
 
LSET parseLayersForCuItemWithSoldermask ()
 Parse the layers definition of a BOARD_ITEM object that has a single copper layer and optional soldermask layer.
 
VECTOR2I parseXY ()
 Parse a coordinate pair (xy X Y) in board units (mm).
 
void parseXY (int *aX, int *aY)
 
void parseMargins (int &aLeft, int &aTop, int &aRight, int &aBottom)
 
void parseZoneDefaults (std::map< PCB_LAYER_ID, ZONE_LAYER_PROPERTIES > &aProperties)
 
void parseZoneLayerProperty (std::map< PCB_LAYER_ID, ZONE_LAYER_PROPERTIES > &aProperties)
 
std::pair< wxString, wxString > parseBoardProperty ()
 
void parseCustomProperty (EDA_ITEM *aItem)
 
void parseCustomProperty (std::map< wxString, wxString > &aProps)
 
void parseVariants ()
 
void parseFootprintVariant (FOOTPRINT *aFootprint)
 
void parseOutlinePoints (SHAPE_LINE_CHAIN &aPoly)
 Parses possible outline points and stores them into aPoly.
 
void parseEDA_TEXT (EDA_TEXT *aText)
 Parse the common settings for any object derived from EDA_TEXT.
 
void parseRenderCache (EDA_TEXT *aText)
 Parse the render cache for any object derived from EDA_TEXT.
 
FP_3DMODEL * parse3DModel (bool aFileNameAlreadyParsed=false)
 
int parseBoardUnits ()
 Parse the current token as an ASCII numeric string with possible leading whitespace into a double precision floating point number.
 
int parseBoardUnits (const char *aExpected, EDA_DATA_TYPE aDataType)
 
int parseBoardUnits (const PCB_KEYS_T::T aToken, const EDA_DATA_TYPE aDataType=EDA_DATA_TYPE::DISTANCE)
 
int parseInt ()
 
int parseInt (const char *aExpected)
 
long parseHex ()
 
bool parseBool ()
 
std::optional< bool > parseOptBool ()
 
bool parseMaybeAbsentBool (bool aDefaultValue)
 Parses a boolean flag inside a list that existed before boolean normalization.
 
std::pair< std::optional< bool >, std::optional< bool > > parseFrontBackOptBool (bool aAllowLegacyFormat=false)
 
void parseNet (BOARD_CONNECTED_ITEM *aItem)
 
KIID CurStrToKIID ()
 
void resolveGroups (BOARD_ITEM *aParent)
 Called after parsing a footprint definition or board to build the group membership lists.
 
void resolveConstraints (BOARD_ITEM *aParent)
 
void finishItem (BOARD_ITEM *aItem)
 Resolve the fonts, groups and constraints of a fully parsed board or footprint.
 

Private Attributes

BOARD * m_board
 
LAYER_ID_MAP m_layerIndices
 map layer name to it's index
 
LSET_MAP m_layerMasks
 map layer names to their masks
 
std::set< wxString > m_undefinedLayers
 set of layers not defined in layers section
 
std::vector< int > m_netCodes
 net codes mapping for boards being loaded
 
bool m_tooRecent
 true if version parses as later than supported
 
int m_requiredVersion
 set to the KiCad format version this board requires
 
wxString m_generatorVersion
 Set to the generator version this board requires.
 
bool m_appendToExisting
 reading into an existing board; reset UUIDs
 
bool m_preserveDestinationStackup
 append keeps destination stackup
 
LAYER_MAPPING_HANDLER m_layerMappingHandler
 optional remap of appended layers onto dest
 
KIID_MAP m_resetKIIDMap
 if resetting UUIDs, record new ones to update groups with.
 
std::set< KIID > m_linkedZones
 Zones read with a link set or anchor.
 
bool m_showLegacySegmentZoneWarning
 
bool m_showLegacy5ZoneWarning
 
PROGRESS_REPORTER * m_progressReporter
 optional; may be nullptr
 
TIME_PT m_lastProgressTime
 for progress reporting
 
unsigned m_lineCount
 for progress reporting
 
std::vector< GROUP_INFO > m_groupInfos
 
std::vector< GENERATOR_INFO > m_generatorInfos
 
std::vector< CONSTRAINT_INFO > m_constraintInfos
 
std::function< bool(wxString aTitle, int aIcon, wxString aMsg, wxString aAction)> m_queryUserCallback
 
std::vector< wxString > m_parseWarnings
 Non-fatal warnings collected during parsing.
 

Detailed Description

Read a Pcbnew s-expression formatted LINE_READER object and returns the appropriate BOARD_ITEM object.

Definition at line 99 of file pcb_io_kicad_sexpr_parser.h.

Member Typedef Documentation

◆ CLOCK

using PCB_IO_KICAD_SEXPR_PARSER::CLOCK = std::chrono::steady_clock
private

The clock used for the timestamp (guaranteed to be monotonic).

Definition at line 543 of file pcb_io_kicad_sexpr_parser.h.

◆ KIID_MAP

typedef std::unordered_map< wxString, KIID > PCB_IO_KICAD_SEXPR_PARSER::KIID_MAP

Definition at line 105 of file pcb_io_kicad_sexpr_parser.h.

◆ LAYER_ID_MAP

typedef std::unordered_map< std::string, PCB_LAYER_ID > PCB_IO_KICAD_SEXPR_PARSER::LAYER_ID_MAP

Definition at line 103 of file pcb_io_kicad_sexpr_parser.h.

◆ LSET_MAP

typedef std::unordered_map< std::string, LSET > PCB_IO_KICAD_SEXPR_PARSER::LSET_MAP

Definition at line 104 of file pcb_io_kicad_sexpr_parser.h.

◆ TIME_PT

using PCB_IO_KICAD_SEXPR_PARSER::TIME_PT = std::chrono::time_point<CLOCK>
private

The type of the time stamps.

Definition at line 546 of file pcb_io_kicad_sexpr_parser.h.

◆ TIMEOUT

using PCB_IO_KICAD_SEXPR_PARSER::TIMEOUT = std::chrono::milliseconds
private

The type of progress bar timeout.

Definition at line 540 of file pcb_io_kicad_sexpr_parser.h.

Constructor & Destructor Documentation

◆ PCB_IO_KICAD_SEXPR_PARSER()

PCB_IO_KICAD_SEXPR_PARSER::PCB_IO_KICAD_SEXPR_PARSER ( LINE_READER * aReader,
BOARD * aBoard,
std::function< bool(wxString, int, wxString, wxString)> aQueryUserCallback,
PROGRESS_REPORTER * aProgressReporter = nullptr,
unsigned aLineCount = 0,
bool aPreserveDestinationStackup = false,
bool aAppendToExisting = false )
inline

Member Function Documentation

◆ bakeTextBoxLib()

void PCB_IO_KICAD_SEXPR_PARSER::bakeTextBoxLib ( PCB_TEXTBOX * aTextBox)
private

◆ checkpoint()

void PCB_IO_KICAD_SEXPR_PARSER::checkpoint ( )
private

◆ createOldLayerMapping()

void PCB_IO_KICAD_SEXPR_PARSER::createOldLayerMapping ( std::unordered_map< std::string, std::string > & aMap)
private

Create a mapping from the (short-lived) bug where layer names were translated.

Todo
Remove this once we support custom layer names.
Parameters
aMapstring mapping from translated to English layer names.

Definition at line 2506 of file pcb_io_kicad_sexpr_parser.cpp.

Referenced by parseLayers().

◆ CurStrToKIID()

◆ finishItem()

void PCB_IO_KICAD_SEXPR_PARSER::finishItem ( BOARD_ITEM * aItem)
private

Resolve the fonts, groups and constraints of a fully parsed board or footprint.

Definition at line 1138 of file pcb_io_kicad_sexpr_parser.cpp.

References EDA_ITEM::GetEmbeddedFiles(), m_constraintInfos, m_generatorInfos, m_groupInfos, RECURSE, resolveConstraints(), resolveGroups(), BOARD_ITEM::RunOnChildren(), and EMBEDDED_FILES::UpdateFontFiles().

Referenced by Parse(), and ParseFootprintLib().

◆ getNetCode()

int PCB_IO_KICAD_SEXPR_PARSER::getNetCode ( int aNetCode)
inlineprivate

Convert net code using the mapping table if available, otherwise returns unchanged net code if < 0 or if it's out of range.

Definition at line 236 of file pcb_io_kicad_sexpr_parser.h.

References m_netCodes.

Referenced by parseNet(), and parsePAD().

◆ GetParseWarnings()

const std::vector< wxString > & PCB_IO_KICAD_SEXPR_PARSER::GetParseWarnings ( ) const
inline

Return any non-fatal parse warnings that occurred during parsing.

These are errors that were handled gracefully but should be reported to the user.

Definition at line 174 of file pcb_io_kicad_sexpr_parser.h.

References m_parseWarnings.

Referenced by PCB_IO_KICAD_SEXPR::DoLoad(), and FP_CACHE::Load().

◆ GetRequiredVersion()

wxString PCB_IO_KICAD_SEXPR_PARSER::GetRequiredVersion ( )

Return a string representing the version of KiCad required to open this file.

Not particularly meaningful if IsTooRecent() returns false.

Definition at line 351 of file pcb_io_kicad_sexpr_parser.cpp.

References _, m_requiredVersion, and THROW_PARSE_ERROR.

Referenced by PCB_IO_KICAD_SEXPR::DoLoad(), PCB_IO_KICAD_SEXPR::Parse(), parseBOARD(), and parseFOOTPRINT().

◆ init()

void PCB_IO_KICAD_SEXPR_PARSER::init ( )
private

Clear and re-establish m_layerMap with the default layer names.

m_layerMap will have some of its entries overwritten whenever a (new) board is encountered.

Definition at line 104 of file pcb_io_kicad_sexpr_parser.cpp.

References LSET::AllCuMask(), B_Adhes, B_CrtYd, B_Cu, B_Fab, B_Mask, B_Paste, B_SilkS, F_Adhes, F_CrtYd, F_Cu, F_Fab, F_Mask, F_Paste, F_SilkS, In15_Cu, LSET::InternalCuMask(), m_layerIndices, m_layerMasks, m_linkedZones, m_requiredVersion, m_resetKIIDMap, m_showLegacy5ZoneWarning, m_showLegacySegmentZoneWarning, m_tooRecent, LSET::Name(), PCB_LAYER_ID_COUNT, and TO_UTF8.

Referenced by PCB_IO_KICAD_SEXPR_PARSER().

◆ IsTooRecent()

bool PCB_IO_KICAD_SEXPR_PARSER::IsTooRecent ( )
inline

Return whether a version number, if any was parsed, was too recent.

Definition at line 153 of file pcb_io_kicad_sexpr_parser.h.

References m_tooRecent.

Referenced by PCB_IO_KICAD_SEXPR::DoLoad(), and PCB_IO_KICAD_SEXPR::Parse().

◆ IsValidBoardHeader()

bool PCB_IO_KICAD_SEXPR_PARSER::IsValidBoardHeader ( )

Partially parse the input and check if it matches expected header.

Returns
true if expected header matches

Definition at line 1069 of file pcb_io_kicad_sexpr_parser.cpp.

References m_constraintInfos, and m_groupInfos.

Referenced by PCB_IO_KICAD_SEXPR::CanReadBoard().

◆ lookUpLayer()

PCB_LAYER_ID PCB_IO_KICAD_SEXPR_PARSER::lookUpLayer ( const LAYER_ID_MAP & aMap,
bool aAllowUndefined = false )
private

Parse the current token for the layer definition of a BOARD_ITEM object.

Parameters
aMapis the LAYER_{NUM|MSK}_MAP to use for the lookup.
Returns
The result of the parsed BOARD_ITEM layer or set designator.
Exceptions
IO_ERRORif the layer is not valid.
PARSE_ERRORif the layer syntax is incorrect.

Definition at line 2823 of file pcb_io_kicad_sexpr_parser.cpp.

References m_undefinedLayers, Rescue, and UNDEFINED_LAYER.

Referenced by parseBoardItemLayer(), parsePAD(), parsePadstack(), parsePCB_VIA(), and parseViastack().

◆ lookUpLayerSet()

LSET PCB_IO_KICAD_SEXPR_PARSER::lookUpLayerSet ( const LSET_MAP & aMap)
private

Definition at line 2812 of file pcb_io_kicad_sexpr_parser.cpp.

References Rescue.

Referenced by parseBoardItemLayersAsMask().

◆ Parse()

◆ parse3DModel()

◆ parseARC()

◆ parseBOARD()

BOARD * PCB_IO_KICAD_SEXPR_PARSER::parseBOARD ( )
private

Definition at line 1277 of file pcb_io_kicad_sexpr_parser.cpp.

References GetRequiredVersion(), m_tooRecent, and parseBOARD_unchecked().

Referenced by Parse().

◆ parseBOARD_unchecked()

◆ parseBoardItemLayer()

PCB_LAYER_ID PCB_IO_KICAD_SEXPR_PARSER::parseBoardItemLayer ( )
private

◆ parseBoardItemLayersAsMask()

LSET PCB_IO_KICAD_SEXPR_PARSER::parseBoardItemLayersAsMask ( )
private

Parse the layers definition of a BOARD_ITEM object.

Returns
The mask of layers the parsed BOARD_ITEM is on.
Exceptions
IO_ERRORif any of the layers is not valid.
PARSE_ERRORif the layers syntax is incorrect.

Definition at line 2860 of file pcb_io_kicad_sexpr_parser.cpp.

References lookUpLayerSet(), m_layerMasks, and T.

Referenced by parseLayersForCuItemWithSoldermask(), parsePAD(), parsePCB_SHAPE(), and parseZONE().

◆ parseBoardProperty()

std::pair< wxString, wxString > PCB_IO_KICAD_SEXPR_PARSER::parseBoardProperty ( )
private

Definition at line 501 of file pcb_io_kicad_sexpr_parser.cpp.

Referenced by parseBOARD_unchecked().

◆ parseBoardStackup()

◆ parseBoardUnits() [1/3]

◆ parseBoardUnits() [2/3]

int PCB_IO_KICAD_SEXPR_PARSER::parseBoardUnits ( const char * aExpected,
EDA_DATA_TYPE aDataType = EDA_DATA_TYPE::DISTANCE )
private

◆ parseBoardUnits() [3/3]

int PCB_IO_KICAD_SEXPR_PARSER::parseBoardUnits ( const PCB_KEYS_T::T aToken,
const EDA_DATA_TYPE aDataType = EDA_DATA_TYPE::DISTANCE )
inlineprivate

Definition at line 482 of file pcb_io_kicad_sexpr_parser.h.

References DISTANCE, and parseBoardUnits().

◆ parseBool()

◆ parseCONSTRAINT()

◆ parseCustomProperty() [1/2]

◆ parseCustomProperty() [2/2]

void PCB_IO_KICAD_SEXPR_PARSER::parseCustomProperty ( std::map< wxString, wxString > & aProps)
private

Definition at line 527 of file pcb_io_kicad_sexpr_parser.cpp.

◆ parseDefaults()

◆ parseDefaultTextDims()

◆ parseDIMENSION()

◆ parseDrillSpanBody()

DRILL_SPAN PCB_IO_KICAD_SEXPR_PARSER::parseDrillSpanBody ( )
private

Definition at line 5378 of file pcb_io_kicad_sexpr_parser.cpp.

References name, LSET::NameToLayer(), and T.

Referenced by parsePCB_DRILL_MAP().

◆ parseDrillSymbolProfile()

◆ parseEDA_TEXT()

◆ parseFOOTPRINT()

FOOTPRINT * PCB_IO_KICAD_SEXPR_PARSER::parseFOOTPRINT ( wxArrayString * aInitialComments = nullptr)
Parameters
aInitialCommentsmay be a pointer to a heap allocated initial comment block or NULL. If not NULL, then caller has given ownership of a wxArrayString to this function and care must be taken to delete it even on exception.

Definition at line 6237 of file pcb_io_kicad_sexpr_parser.cpp.

References GetRequiredVersion(), m_tooRecent, and parseFOOTPRINT_unchecked().

Referenced by Parse(), parseBOARD_unchecked(), and ParseFootprintLib().

◆ parseFOOTPRINT_unchecked()

FOOTPRINT * PCB_IO_KICAD_SEXPR_PARSER::parseFOOTPRINT_unchecked ( wxArrayString * aInitialComments = nullptr)
private

Definition at line 6253 of file pcb_io_kicad_sexpr_parser.cpp.

References _, KIGFX::COLOR4D::a, JUMPER_GROUP_SET::Add(), ANGLE_0, APPEND, KIGFX::COLOR4D::b, B_Cu, B_Fab, COPPER, CurStrToKIID(), DEGREES_T, DESCRIPTION, DSN_EOF, DSN_LEFT, DSN_RIGHT, DSN_STRING, Edge_Cuts, F_Cu, F_Fab, FIRST_FP_AFFINE_TRANSFORM, FOOTPRINT, FP_BOARD_ONLY, FP_DNP, FP_EXCLUDE_FROM_BOM, FP_EXCLUDE_FROM_POS_FILES, FP_EXCLUDE_FROM_SIM, FP_SMD, FP_THROUGH_HOLE, From_UTF8(), KIGFX::COLOR4D::g, ZONE::GetNumCorners(), PCB_POINT::GetPosition(), group, ZONE::HatchBorder(), image, info, TRANSFORM_TRS::InverseApply(), SHAPE_POLY_SET::IterateWithHoles(), LEGACY_NET_TIES, m_board, EXTRUDED_3D_BODY::m_color, m_generatorVersion, EXTRUDED_3D_BODY::m_height, EXTRUDED_3D_BODY::m_layer, m_layerIndices, EXTRUDED_3D_BODY::m_material, EXTRUDED_3D_BODY::m_offset, m_parseWarnings, m_requiredVersion, EXTRUDED_3D_BODY::m_rotation, EXTRUDED_3D_BODY::m_scale, EXTRUDED_3D_BODY::m_show, EXTRUDED_3D_BODY::m_standoff, m_tooRecent, JUMPER_GROUP::Make(), Margin, MATTE, METAL, model, PCB_3D_BODY::MutableExtruded(), name, LSET::NameToLayer(), ZONE::Outline(), pad, LIB_ID::Parse(), parse3DModel(), parseBoardItemLayer(), parseBoardUnits(), parseBool(), parseCONSTRAINT(), parseCustomProperty(), parseDIMENSION(), parseDouble(), EMBEDDED_FILES_PARSER::ParseEmbedded(), parseFootprintStackup(), parseFootprintVariant(), parseGROUP(), parseHex(), parseInt(), parseMaybeAbsentBool(), parsePAD(), parsePCB_BARCODE(), parsePCB_POINT(), parsePCB_REFERENCE_IMAGE(), parsePCB_SHAPE(), parsePCB_TABLE(), parsePCB_TEXT(), parsePCB_TEXT_effects(), parsePCB_TEXTBOX(), parseZONE(), PLASTIC, KIGFX::COLOR4D::r, REFERENCE, BASE_SET::set(), BOARD_ITEM::SetLayer(), PCB_POINT::SetPosition(), EDA_TEXT::SetText(), BOARD_ITEM::SetUuidDirect(), SHAPE_POLY_SET::SetVertex(), EDA_TEXT::SetVisible(), SEXPR_FOOTPRINT_LIB_FILE_VERSION, skipCurrent(), PCB_TEXT::StyleFromSettings(), T, table, text, THROW_IO_ERRORF, UNDEFINED_LAYER, UNSELECTED_LAYER, KIGFX::COLOR4D::UNSPECIFIED, USER, VALUE, IO_ERROR::What(), VECTOR2< T >::x, VECTOR3< T >::x, VECTOR2< T >::y, VECTOR3< T >::y, and VECTOR3< T >::z.

Referenced by parseFOOTPRINT().

◆ ParseFootprintLib()

void PCB_IO_KICAD_SEXPR_PARSER::ParseFootprintLib ( boost::ptr_map< wxString, FP_CACHE_ENTRY, std::less< wxString >, boost::heap_clone_allocator, std::allocator< std::pair< const wxString, void * > > > & aFootprints)

Parse a footprint library file.

This parses a .kicad_mod file containing one or more footprints and populates aFootprints.

Note
This parses both packed and unpacked file formats. Starting with file version 20261028, all *.kicad_mod files contain a header like all other KiCad s-expression file formats.
Parameters
[out]aFootprintsMap to store parsed footprints (footprint name -> cache entry).

Definition at line 1160 of file pcb_io_kicad_sexpr_parser.cpp.

References finishItem(), m_generatorVersion, m_requiredVersion, m_tooRecent, parseFOOTPRINT(), parseInt(), SEXPR_FOOTPRINT_LIB_FILE_VERSION, and T.

Referenced by PCB_IO_KICAD_SEXPR::ImportFootprint(), and FP_CACHE::Load().

◆ parseFootprintStackup()

void PCB_IO_KICAD_SEXPR_PARSER::parseFootprintStackup ( FOOTPRINT & aFootprint)
private

◆ parseFootprintVariant()

◆ parseFrontBackOptBool()

std::pair< std::optional< bool >, std::optional< bool > > PCB_IO_KICAD_SEXPR_PARSER::parseFrontBackOptBool ( bool aAllowLegacyFormat = false)
private

Definition at line 9467 of file pcb_io_kicad_sexpr_parser.cpp.

References parseOptBool(), result, and T.

Referenced by parsePAD(), parsePadstack(), parsePCB_VIA(), and parseSetup().

◆ parseGeneralSection()

void PCB_IO_KICAD_SEXPR_PARSER::parseGeneralSection ( )
private

Definition at line 1969 of file pcb_io_kicad_sexpr_parser.cpp.

References m_board, parseBoardUnits(), parseMaybeAbsentBool(), and T.

Referenced by parseBOARD_unchecked().

◆ parseGeneratedTable()

◆ parseGeneratedTableExtra()

◆ parseGENERATOR()

◆ parseGENERATOR_templates()

void PCB_IO_KICAD_SEXPR_PARSER::parseGENERATOR_templates ( GENERATOR_INFO & aGenInfo)
private

◆ parseGROUP()

◆ parseGROUP_members()

void PCB_IO_KICAD_SEXPR_PARSER::parseGROUP_members ( GROUP_INFO & aGroupInfo)
private

◆ parseHeader()

void PCB_IO_KICAD_SEXPR_PARSER::parseHeader ( )
private

◆ parseHex()

long PCB_IO_KICAD_SEXPR_PARSER::parseHex ( )
inlineprivate

◆ parseInt() [1/2]

◆ parseInt() [2/2]

int PCB_IO_KICAD_SEXPR_PARSER::parseInt ( const char * aExpected)
inlineprivate

Definition at line 492 of file pcb_io_kicad_sexpr_parser.h.

References parseInt().

◆ parseLayer()

void PCB_IO_KICAD_SEXPR_PARSER::parseLayer ( LAYER * aLayer)
private

◆ parseLayers()

◆ parseLayersForCuItemWithSoldermask()

LSET PCB_IO_KICAD_SEXPR_PARSER::parseLayersForCuItemWithSoldermask ( )
private

Parse the layers definition of a BOARD_ITEM object that has a single copper layer and optional soldermask layer.

Returns
The mask of layers the parsed BOARD_ITEM is on.
Exceptions
IO_ERRORif any of the layers is not valid.
PARSE_ERRORif the layers syntax is incorrect.

Definition at line 2876 of file pcb_io_kicad_sexpr_parser.cpp.

References LSET::AllCuMask(), any::any(), B_Cu, B_Mask, F_Cu, F_Mask, LSET::InternalCuMask(), and parseBoardItemLayersAsMask().

Referenced by parseARC(), and parsePCB_TRACK().

◆ parseLineEnding()

void PCB_IO_KICAD_SEXPR_PARSER::parseLineEnding ( LINE_ENDING & aEnding)
private

Parse a line ending definition from the token stream.

Parameters
aEndingA reference to the LINE_ENDING structure to write to.

Definition at line 3889 of file pcb_io_kicad_sexpr_parser.cpp.

References ARROW, ARROW_OPEN, CIRCLE, NONE, parseBoardUnits(), STROKE_PARAMS_PARSER::ParseStroke(), pcbIUScale, LINE_ENDING::SetLength(), LINE_ENDING::SetStroke(), LINE_ENDING::SetStyle(), LINE_ENDING::SetWidth(), SQUARE, and T.

Referenced by parsePCB_SHAPE().

◆ parseMargins()

void PCB_IO_KICAD_SEXPR_PARSER::parseMargins ( int & aLeft,
int & aTop,
int & aRight,
int & aBottom )
private

Definition at line 492 of file pcb_io_kicad_sexpr_parser.cpp.

References parseBoardUnits().

Referenced by parseTextBoxContent().

◆ parseMaybeAbsentBool()

bool PCB_IO_KICAD_SEXPR_PARSER::parseMaybeAbsentBool ( bool aDefaultValue)
private

Parses a boolean flag inside a list that existed before boolean normalization.

For example, this will handle both (legacy_teardrops) and (legacy_teardrops yes). Call this after parsing the T_legacy_teardrops, and aDefaultValue will be returned for the first case, or true will be returned for the second case.

Parameters
aDefaultValuewill be returned if the end of the list is encountered as the next token
Returns
the parsed boolean

Definition at line 271 of file pcb_io_kicad_sexpr_parser.cpp.

References DSN_RIGHT, and T.

Referenced by parse3DModel(), parseARC(), parseDIMENSION(), parseEDA_TEXT(), parseFOOTPRINT_unchecked(), parseFootprintVariant(), parseGeneralSection(), parsePAD(), parsePCB_BARCODE(), parsePCB_SHAPE(), parsePCB_TEXT_effects(), parsePCB_TRACK(), parsePCB_VIA(), parseTEARDROP_PARAMETERS(), parseTextBoxContent(), and parseZONE().

◆ parseNet()

◆ parseNET_CHAINS_SECTION()

void PCB_IO_KICAD_SEXPR_PARSER::parseNET_CHAINS_SECTION ( )
private

Definition at line 3651 of file pcb_io_kicad_sexpr_parser.cpp.

References m_board, m_netCodes, name, pad, skipCurrent(), and T.

Referenced by parseBOARD_unchecked().

◆ parseNETCLASS()

void PCB_IO_KICAD_SEXPR_PARSER::parseNETCLASS ( )
private

◆ parseNETINFO_ITEM()

void PCB_IO_KICAD_SEXPR_PARSER::parseNETINFO_ITEM ( )
private

◆ parseOptBool()

std::optional< bool > PCB_IO_KICAD_SEXPR_PARSER::parseOptBool ( )
private

Definition at line 251 of file pcb_io_kicad_sexpr_parser.cpp.

References T.

Referenced by parseFrontBackOptBool(), and parsePCB_VIA().

◆ parseOutlinePoints()

void PCB_IO_KICAD_SEXPR_PARSER::parseOutlinePoints ( SHAPE_LINE_CHAIN & aPoly)
private

Parses possible outline points and stores them into aPoly.

This accepts points for DRAWSEGMENT polygons, EDGEMODULE polygons and ZONE_CONTAINER polygons. Points and arcs are added to the most recent outline

Parameters
aPolypolygon container to add points and arcs

Definition at line 395 of file pcb_io_kicad_sexpr_parser.cpp.

References SHAPE_LINE_CHAIN::Append(), parseBoardUnits(), T, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by parseGENERATOR(), parsePCB_SHAPE(), parseRenderCache(), parseTextBoxContent(), and parseZONE().

◆ parsePAD()

◆ parsePAD_option()

void PCB_IO_KICAD_SEXPR_PARSER::parsePAD_option ( PAD * aPad,
PCB_LAYER_ID aLayer )
private

◆ parsePAD_primitives()

void PCB_IO_KICAD_SEXPR_PARSER::parsePAD_primitives ( PAD * aPad,
PCB_LAYER_ID aLayer )
private

◆ parsePadstack()

◆ parsePAGE_INFO()

◆ parsePCB_BARCODE()

◆ parsePCB_DRILL_MAP()

◆ parsePCB_GRID_ITEM()

◆ parsePCB_POINT()

PCB_POINT * PCB_IO_KICAD_SEXPR_PARSER::parsePCB_POINT ( )
private

◆ parsePCB_REFERENCE_IMAGE()

◆ parsePCB_SHAPE()

◆ parsePCB_TABLE()

PCB_TABLE * PCB_IO_KICAD_SEXPR_PARSER::parsePCB_TABLE ( BOARD_ITEM * aParent)
private

Definition at line 5756 of file pcb_io_kicad_sexpr_parser.cpp.

References parseTableBody(), and table.

Referenced by parseBOARD_unchecked(), and parseFOOTPRINT_unchecked().

◆ parsePCB_TABLECELL()

PCB_TABLECELL * PCB_IO_KICAD_SEXPR_PARSER::parsePCB_TABLECELL ( BOARD_ITEM * aParent)
private

Definition at line 5006 of file pcb_io_kicad_sexpr_parser.cpp.

References bakeTextBoxLib(), and parseTextBoxContent().

Referenced by parseTableBodyToken().

◆ parsePCB_TARGET()

PCB_TARGET * PCB_IO_KICAD_SEXPR_PARSER::parsePCB_TARGET ( )
private

◆ parsePCB_TEXT()

PCB_TEXT * PCB_IO_KICAD_SEXPR_PARSER::parsePCB_TEXT ( BOARD_ITEM * aParent,
PCB_TEXT * aBaseText = nullptr )
private

◆ parsePCB_TEXT_effects()

◆ parsePCB_TEXTBOX()

PCB_TEXTBOX * PCB_IO_KICAD_SEXPR_PARSER::parsePCB_TEXTBOX ( BOARD_ITEM * aParent)
private

◆ parsePCB_TRACK()

◆ parsePCB_VIA()

◆ parsePostMachining()

◆ parseRenderCache()

void PCB_IO_KICAD_SEXPR_PARSER::parseRenderCache ( EDA_TEXT * aText)
private

Parse the render cache for any object derived from EDA_TEXT.

Parameters
aTextA pointer to the EDA_TEXT object to save the parsed settings into.
Exceptions
PARSE_ERRORif the text syntax is not valid.

Definition at line 904 of file pcb_io_kicad_sexpr_parser.cpp.

References SHAPE_POLY_SET::AddHole(), SHAPE_POLY_SET::AddOutline(), DEGREES_T, From_UTF8(), SHAPE_POLY_SET::OutlineCount(), parseDouble(), parseOutlinePoints(), SHAPE_LINE_CHAIN::SetClosed(), T, and text.

Referenced by parsePCB_TEXT_effects(), and parseTextBoxContent().

◆ parseSetup()

void PCB_IO_KICAD_SEXPR_PARSER::parseSetup ( )
private

Definition at line 3036 of file pcb_io_kicad_sexpr_parser.cpp.

References BOARD_STACKUP::BuildDefaultStackupList(), alg::contains(), GAL_SET::DefaultVisible(), NET_SETTINGS::GetDefaultNetclass(), BOARD_DESIGN_SETTINGS::GetDefaultZoneSettings(), PCB_PLOT_PARAMS::GetLegacyPlotViaOnMaskLayer(), BOARD_DESIGN_SETTINGS::GetStackupDescriptor(), LAYER_CLASS_COPPER, LAYER_CLASS_EDGES, LAYER_CLASS_SILK, BOARD_DESIGN_SETTINGS::m_AllowSoldermaskBridgesInFPs, m_appendToExisting, m_board, BOARD_DESIGN_SETTINGS::m_CapVias, BOARD_DESIGN_SETTINGS::m_CoverViasBack, BOARD_DESIGN_SETTINGS::m_CoverViasFront, BOARD_DESIGN_SETTINGS::m_DiffPairDimensionsList, BOARD_DESIGN_SETTINGS::m_FillVias, BOARD_DESIGN_SETTINGS::m_HasStackup, BOARD_DESIGN_SETTINGS::m_HoleToHoleMin, BOARD_DESIGN_SETTINGS::m_LineThickness, BOARD_DESIGN_SETTINGS::m_MaxError, BOARD_DESIGN_SETTINGS::m_MicroViasMinDrill, BOARD_DESIGN_SETTINGS::m_MicroViasMinSize, BOARD_DESIGN_SETTINGS::m_MinClearance, BOARD_DESIGN_SETTINGS::m_MinThroughDrill, BOARD_DESIGN_SETTINGS::m_NetSettings, BOARD_DESIGN_SETTINGS::m_PlugViasBack, BOARD_DESIGN_SETTINGS::m_PlugViasFront, m_preserveDestinationStackup, m_requiredVersion, BOARD_DESIGN_SETTINGS::m_SolderMaskExpansion, BOARD_DESIGN_SETTINGS::m_SolderMaskMinWidth, BOARD_DESIGN_SETTINGS::m_SolderPasteMargin, BOARD_DESIGN_SETTINGS::m_SolderPasteMarginRatio, BOARD_DESIGN_SETTINGS::m_TentViasBack, BOARD_DESIGN_SETTINGS::m_TentViasFront, BOARD_DESIGN_SETTINGS::m_TextSize, BOARD_DESIGN_SETTINGS::m_TextThickness, BOARD_DESIGN_SETTINGS::m_TrackMinWidth, BOARD_DESIGN_SETTINGS::m_TrackWidthList, BOARD_DESIGN_SETTINGS::m_ViasDimensionsList, BOARD_DESIGN_SETTINGS::m_ViasMinAnnularWidth, BOARD_DESIGN_SETTINGS::m_ViasMinSize, ZONE_SETTINGS::m_ZoneClearance, BOARD_DESIGN_SETTINGS::m_ZoneLayerProperties, MIN_VISIBILITY_MASK, PCB_PLOT_PARAMS::Parse(), parseBoardStackup(), parseBoardUnits(), parseBool(), parseDefaults(), parseDouble(), parseDrillSymbolProfile(), parseFrontBackOptBool(), parseHex(), parseZoneDefaults(), BOARD_STACKUP::RemoveAll(), BOARD_DESIGN_SETTINGS::SetAuxOrigin(), BOARD_DESIGN_SETTINGS::SetGridOrigin(), skipCurrent(), T, via, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by parseBOARD_unchecked().

◆ parseTableBody()

void PCB_IO_KICAD_SEXPR_PARSER::parseTableBody ( PCB_TABLE * aTable,
bool aAllowIdentity )
private

Definition at line 5363 of file pcb_io_kicad_sexpr_parser.cpp.

References parseTableBodyToken(), and T.

Referenced by parsePCB_TABLE().

◆ parseTableBodyToken()

bool PCB_IO_KICAD_SEXPR_PARSER::parseTableBodyToken ( PCB_TABLE * aTable,
PCB_KEYS_T::T aToken,
bool aAllowIdentity )
private

aAllowIdentity is false inside a drill chart's table_data, where the enclosing form owns uuid, layer and lock state.

A nested copy would silently win. One token of a table's geometry and cells. False when the token is none of them, so a drill chart can offer its own tokens first and share everything a table already reads.

Definition at line 5194 of file pcb_io_kicad_sexpr_parser.cpp.

References CurStrToKIID(), parseBoardItemLayer(), parseBoardUnits(), parseBool(), parseCustomProperty(), parseInt(), parsePCB_TABLECELL(), STROKE_PARAMS_PARSER::ParseStroke(), pcbIUScale, SOLID, T, and table.

Referenced by parseGeneratedTable(), and parseTableBody().

◆ parseTEARDROP_PARAMETERS()

◆ parseTextBoxContent()

◆ parseTITLE_BLOCK()

void PCB_IO_KICAD_SEXPR_PARSER::parseTITLE_BLOCK ( )
private

◆ parseVariants()

void PCB_IO_KICAD_SEXPR_PARSER::parseVariants ( )
private

Definition at line 538 of file pcb_io_kicad_sexpr_parser.cpp.

References m_board, and T.

Referenced by parseBOARD_unchecked().

◆ parseViastack()

◆ parseXY() [1/2]

VECTOR2I PCB_IO_KICAD_SEXPR_PARSER::parseXY ( )
private

Parse a coordinate pair (xy X Y) in board units (mm).

The parser checks if the previous token was T_LEFT and parses the remainder of the token syntax. This is used when parsing a list of coordinate points. This way the parser can be used in either case.

Returns
A wxPoint object containing the coordinate pair.
Exceptions
PARSE_ERRORif the coordinate pair syntax is incorrect.

Definition at line 375 of file pcb_io_kicad_sexpr_parser.cpp.

References parseBoardUnits(), T, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by parseDIMENSION(), parsePCB_SHAPE(), parseXY(), parseZONE(), and parseZoneLayerProperty().

◆ parseXY() [2/2]

void PCB_IO_KICAD_SEXPR_PARSER::parseXY ( int * aX,
int * aY )
private

Definition at line 480 of file pcb_io_kicad_sexpr_parser.cpp.

References parseXY(), VECTOR2< T >::x, and VECTOR2< T >::y.

◆ parseZONE()

ZONE * PCB_IO_KICAD_SEXPR_PARSER::parseZONE ( BOARD_ITEM_CONTAINER * aParent)
private

Definition at line 9613 of file pcb_io_kicad_sexpr_parser.cpp.

References _, SEG::A, ALWAYS, ARC_HIGH_DEF, SEG::B, SHAPE_POLY_SET::BooleanAdd(), chain, ZONE_SETTINGS::CHAMFER, COMPONENT_CLASS, COPPER_THIEVING, CurStrToKIID(), DEGREES_T, DIAGONAL_EDGE, DIAGONAL_FULL, DOTS, THIEVING_SETTINGS::element_size, ERROR_OUTSIDE, ZONE_SETTINGS::FILLET, FULL, THIEVING_SETTINGS::gap, ZONE::GetDefaultHatchPitch(), NETINFO_ITEM::GetNetCode(), GROUP_PLACEMENT, HATCH, HATCH_PATTERN, ignore_unused(), INSERT, SHAPE_POLY_SET::IsEmpty(), THIEVING_SETTINGS::line_width, REPEAT_LAYOUT_OPTIONS::m_anchor, m_board, REPEAT_LAYOUT_OPTIONS::m_connectedRoutingOnly, REPEAT_LAYOUT_OPTIONS::m_copyOtherItems, REPEAT_LAYOUT_OPTIONS::m_copyPlacement, REPEAT_LAYOUT_OPTIONS::m_copyRouting, REPEAT_LAYOUT_OPTIONS::m_groupItems, REPEAT_LAYOUT_OPTIONS::m_includeLockedItems, m_linkedZones, m_parseWarnings, m_requiredVersion, m_showLegacy5ZoneWarning, m_showLegacySegmentZoneWarning, SHAPE_POLY_SET::NewOutline(), niluuid, NO_HATCH, ZONE_SETTINGS::NO_SMOOTHING, NONE, orientation(), THIEVING_SETTINGS::orientation, SHAPE_POLY_SET::Outline(), parseBoardItemLayer(), parseBoardItemLayersAsMask(), parseBoardUnits(), parseBool(), parseCustomProperty(), parseDouble(), parseInt(), parseMaybeAbsentBool(), parseNet(), parseOutlinePoints(), parseXY(), parseZoneLayerProperty(), THIEVING_SETTINGS::pattern, pcbIUScale, SHAPE_LINE_CHAIN::PointCount(), POLYGONS, pushValueIntoMap(), ROUND_ALL_CORNERS, SHAPE_LINE_CHAIN::SetClosed(), SHEETNAME, SQUARES, THIEVING_SETTINGS::stagger, T, TD_TRACKEND, TD_VIAPAD, THERMAL, THT_THERMAL, TransformOvalToPolygon(), and NETINFO_LIST::UNCONNECTED.

Referenced by parseBOARD_unchecked(), and parseFOOTPRINT_unchecked().

◆ parseZoneDefaults()

void PCB_IO_KICAD_SEXPR_PARSER::parseZoneDefaults ( std::map< PCB_LAYER_ID, ZONE_LAYER_PROPERTIES > & aProperties)
private

Definition at line 3453 of file pcb_io_kicad_sexpr_parser.cpp.

References parseZoneLayerProperty(), and T.

Referenced by parseSetup().

◆ parseZoneLayerProperty()

void PCB_IO_KICAD_SEXPR_PARSER::parseZoneLayerProperty ( std::map< PCB_LAYER_ID, ZONE_LAYER_PROPERTIES > & aProperties)
private

◆ pushValueIntoMap()

void PCB_IO_KICAD_SEXPR_PARSER::pushValueIntoMap ( int aIndex,
int aValue )
private

Add aValue value in netcode mapping (m_netCodes) at aIndex.

Ensure there is room in m_netCodes for that, and add room if needed.

Parameters
aIndexis the index ( expected >=0 )of the location to use in m_netCodes.
aValueis the netcode value to map.

Definition at line 194 of file pcb_io_kicad_sexpr_parser.cpp.

References m_netCodes.

Referenced by parseNETINFO_ITEM(), and parseZONE().

◆ remapAppendedLayers()

void PCB_IO_KICAD_SEXPR_PARSER::remapAppendedLayers ( const std::vector< LAYER > & aSourceLayers,
const LSET & aDestInitialEnabled,
int aDestInitialCopperCount )
private

◆ resolveConstraints()

◆ resolveGroups()

◆ SetLayerMappingHandler()

void PCB_IO_KICAD_SEXPR_PARSER::SetLayerMappingHandler ( LAYER_MAPPING_HANDLER aHandler)
inline

Handler to remap an appended board's layers onto the destination board, used on mismatch.

Definition at line 177 of file pcb_io_kicad_sexpr_parser.h.

References m_layerMappingHandler.

Referenced by PCB_IO_KICAD_SEXPR::DoLoad().

◆ skipCurrent()

void PCB_IO_KICAD_SEXPR_PARSER::skipCurrent ( )
private

Skip the current token level, i.e search for the RIGHT parenthesis which closes the current description.

Definition at line 173 of file pcb_io_kicad_sexpr_parser.cpp.

References T.

Referenced by parseBoardStackup(), parseDrillSymbolProfile(), parseFOOTPRINT_unchecked(), parseGeneratedTable(), parseGeneratedTableExtra(), parseNET_CHAINS_SECTION(), parsePCB_DRILL_MAP(), and parseSetup().

Member Data Documentation

◆ m_appendToExisting

bool PCB_IO_KICAD_SEXPR_PARSER::m_appendToExisting
private

reading into an existing board; reset UUIDs

Definition at line 556 of file pcb_io_kicad_sexpr_parser.h.

Referenced by CurStrToKIID(), parseBOARD_unchecked(), parseLayers(), parseSetup(), PCB_IO_KICAD_SEXPR_PARSER(), resolveConstraints(), and resolveGroups().

◆ m_board

◆ m_constraintInfos

std::vector<CONSTRAINT_INFO> PCB_IO_KICAD_SEXPR_PARSER::m_constraintInfos
private

◆ m_generatorInfos

std::vector<GENERATOR_INFO> PCB_IO_KICAD_SEXPR_PARSER::m_generatorInfos
private

Definition at line 572 of file pcb_io_kicad_sexpr_parser.h.

Referenced by finishItem(), parseGENERATOR(), and resolveGroups().

◆ m_generatorVersion

wxString PCB_IO_KICAD_SEXPR_PARSER::m_generatorVersion
private

Set to the generator version this board requires.

Definition at line 555 of file pcb_io_kicad_sexpr_parser.h.

Referenced by parseBOARD_unchecked(), parseFOOTPRINT_unchecked(), and ParseFootprintLib().

◆ m_groupInfos

std::vector<GROUP_INFO> PCB_IO_KICAD_SEXPR_PARSER::m_groupInfos
private

◆ m_lastProgressTime

TIME_PT PCB_IO_KICAD_SEXPR_PARSER::m_lastProgressTime
private

for progress reporting

Definition at line 568 of file pcb_io_kicad_sexpr_parser.h.

Referenced by checkpoint(), and PCB_IO_KICAD_SEXPR_PARSER().

◆ m_layerIndices

LAYER_ID_MAP PCB_IO_KICAD_SEXPR_PARSER::m_layerIndices
private

◆ m_layerMappingHandler

LAYER_MAPPING_HANDLER PCB_IO_KICAD_SEXPR_PARSER::m_layerMappingHandler
private

optional remap of appended layers onto dest

Definition at line 558 of file pcb_io_kicad_sexpr_parser.h.

Referenced by parseLayers(), remapAppendedLayers(), and SetLayerMappingHandler().

◆ m_layerMasks

LSET_MAP PCB_IO_KICAD_SEXPR_PARSER::m_layerMasks
private

map layer names to their masks

Definition at line 550 of file pcb_io_kicad_sexpr_parser.h.

Referenced by init(), parseBoardItemLayersAsMask(), parseLayers(), and remapAppendedLayers().

◆ m_lineCount

unsigned PCB_IO_KICAD_SEXPR_PARSER::m_lineCount
private

for progress reporting

Definition at line 569 of file pcb_io_kicad_sexpr_parser.h.

Referenced by checkpoint(), and PCB_IO_KICAD_SEXPR_PARSER().

◆ m_linkedZones

std::set<KIID> PCB_IO_KICAD_SEXPR_PARSER::m_linkedZones
private

Zones read with a link set or anchor.

Definition at line 562 of file pcb_io_kicad_sexpr_parser.h.

Referenced by init(), parseBOARD_unchecked(), and parseZONE().

◆ m_netCodes

std::vector<int> PCB_IO_KICAD_SEXPR_PARSER::m_netCodes
private

net codes mapping for boards being loaded

Definition at line 552 of file pcb_io_kicad_sexpr_parser.h.

Referenced by getNetCode(), parseNET_CHAINS_SECTION(), and pushValueIntoMap().

◆ m_parseWarnings

std::vector<wxString> PCB_IO_KICAD_SEXPR_PARSER::m_parseWarnings
private

Non-fatal warnings collected during parsing.

Definition at line 577 of file pcb_io_kicad_sexpr_parser.h.

Referenced by GetParseWarnings(), parseBOARD_unchecked(), parseFOOTPRINT_unchecked(), parsePAD(), and parseZONE().

◆ m_preserveDestinationStackup

bool PCB_IO_KICAD_SEXPR_PARSER::m_preserveDestinationStackup
private

append keeps destination stackup

Definition at line 557 of file pcb_io_kicad_sexpr_parser.h.

Referenced by parseLayers(), parseSetup(), and PCB_IO_KICAD_SEXPR_PARSER().

◆ m_progressReporter

PROGRESS_REPORTER* PCB_IO_KICAD_SEXPR_PARSER::m_progressReporter
private

optional; may be nullptr

Definition at line 567 of file pcb_io_kicad_sexpr_parser.h.

Referenced by checkpoint(), PCB_IO_KICAD_SEXPR_PARSER(), and remapAppendedLayers().

◆ m_queryUserCallback

std::function<bool( wxString aTitle, int aIcon, wxString aMsg, wxString aAction )> PCB_IO_KICAD_SEXPR_PARSER::m_queryUserCallback
private

Definition at line 575 of file pcb_io_kicad_sexpr_parser.h.

Referenced by parseBOARD_unchecked(), and PCB_IO_KICAD_SEXPR_PARSER().

◆ m_requiredVersion

◆ m_resetKIIDMap

KIID_MAP PCB_IO_KICAD_SEXPR_PARSER::m_resetKIIDMap
private

if resetting UUIDs, record new ones to update groups with.

Definition at line 561 of file pcb_io_kicad_sexpr_parser.h.

Referenced by CurStrToKIID(), init(), parseBOARD_unchecked(), resolveConstraints(), and resolveGroups().

◆ m_showLegacy5ZoneWarning

bool PCB_IO_KICAD_SEXPR_PARSER::m_showLegacy5ZoneWarning
private

Definition at line 565 of file pcb_io_kicad_sexpr_parser.h.

Referenced by init(), and parseZONE().

◆ m_showLegacySegmentZoneWarning

bool PCB_IO_KICAD_SEXPR_PARSER::m_showLegacySegmentZoneWarning
private

Definition at line 564 of file pcb_io_kicad_sexpr_parser.h.

Referenced by init(), and parseZONE().

◆ m_tooRecent

bool PCB_IO_KICAD_SEXPR_PARSER::m_tooRecent
private

true if version parses as later than supported

Definition at line 553 of file pcb_io_kicad_sexpr_parser.h.

Referenced by init(), IsTooRecent(), parseBOARD(), parseFOOTPRINT(), parseFOOTPRINT_unchecked(), ParseFootprintLib(), and parseHeader().

◆ m_undefinedLayers

std::set<wxString> PCB_IO_KICAD_SEXPR_PARSER::m_undefinedLayers
private

set of layers not defined in layers section

Definition at line 551 of file pcb_io_kicad_sexpr_parser.h.

Referenced by lookUpLayer(), and parseBOARD_unchecked().


The documentation for this class was generated from the following files: