KiCad PCB EDA Suite
|
Go to the source code of this file.
Macros | |
#define | D(x) |
#define | CTL_OMIT_NL (1<<0) |
#define | CTL_IN_ATTRS (1<<1) |
Typedefs | |
typedef PTREE::const_iterator | CITER |
typedef PTREE::iterator | ITER |
Functions | |
void | scanList (PTREE *aTree, DSNLEXER *aLexer) |
Function scanList reads a sexpr list from the input stream into a new node with key aLexer->CurText(). | |
void | scanAtom (PTREE *aTree, const DSNLEXER *aLexer) |
void | Scan (PTREE *aTree, DSNLEXER *aLexer) |
Fill an empty PTREE with information from a KiCad s-expression stream. | |
bool | isAtom (const CPTREE &aTree) |
bool | isLast (const CPTREE &aTree, CITER it) |
CITER | next (CITER it) |
static void | formatNode (OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const std::string &aKey, const CPTREE &aTree) |
static void | formatList (OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree) |
void | Format (OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree) |
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative. | |
void Format | ( | OUTPUTFORMATTER * | out, |
int | aNestLevel, | ||
int | aCtl, | ||
const CPTREE & | aTree | ||
) |
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition at line 200 of file ptree.cpp.
References formatNode().
Referenced by LIB_ID::GetUniStringLibId(), CADSTAR_ARCHIVE_PARSER::HEADER::Parse(), SYMBOL_EDIT_FRAME::UpdateTitle(), and DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem().
|
static |
Definition at line 137 of file ptree.cpp.
References CTL_IN_ATTRS, CTL_OMIT_NL, formatList(), formatNode(), isAtom(), isLast(), and next().
Referenced by formatList(), and formatNode().
|
static |
Definition at line 166 of file ptree.cpp.
References CTL_OMIT_NL, formatList(), isAtom(), OUTPUTFORMATTER::Print(), and OUTPUTFORMATTER::Quotes().
Referenced by Format(), and formatList().
|
inline |
Definition at line 112 of file ptree.cpp.
Referenced by formatList(), and formatNode().
Definition at line 126 of file ptree.cpp.
Referenced by CVPCB_MAINFRAME::AutomaticFootprintMatching(), BOOST_AUTO_TEST_CASE(), CheckDuplicatePins(), TEARDROP_MANAGER::computeAnchorPoints(), PNS::TOPOLOGY::ConnectedJoints(), CornerListToPolygon(), GENCAD_EXPORTER::CreatePadsShapesSection(), POLYGON_TRIANGULATION::earcutList(), TMATCH::CONNECTION_GRAPH::FindIsomorphism(), formatList(), SHAPE_POLY_SET::GetNeighbourIndexes(), hexParse(), intParse(), isLast(), IsUTF8(), EDA_ITEM::Matches(), SYMBOL_VIEWER_FRAME::OnCharHook(), DIALOG_DIELECTRIC_MATERIAL::onListKeyDown(), parseChar(), parseDouble(), parseHex(), parseInt(), parseQuotedString(), parseUnquotedString(), KICAD_FORMAT::Prettify(), DSNLEXER::readLine(), BOARD::recalcOpposites(), EDA_ITEM::Replace(), DRC_TEST_PROVIDER_SLIVER_CHECKER::Run(), FOOTPRINT_VIEWER_FRAME::selectNext(), POLYGON_TRIANGULATION::simplifyList(), POLYGON_TRIANGULATION::splitPolygon(), STROKE_PARAMS::Stroke(), unfracture(), SHAPE_POLY_SET::unfractureSingle(), KIGFX::ORIGIN_VIEWITEM::ViewDraw(), wordbreakMarkup(), EE_SELECTION_TOOL::ZoomFitCrossProbeBBox(), and PCB_SELECTION_TOOL::ZoomFitCrossProbeBBox().
Fill an empty PTREE with information from a KiCad s-expression stream.
Use a DSNLEXER with an empty keyword table as aLexer. Useful for parsing s-expression files or strings of arbitrary grammars, say from a file or clipboard. The s-expression must be "KiCad compatible". See Documentation/s-expressions.txt for this KiCad compatible definition (it is the non-specctra mode). And also see in tools/property_tree.cpp for example usage.
FILE* fp = fopen( argv[1], "r" );
static const KEYWORD empty_keywords[1] = {};
DSNLEXER lexer( empty_keywords, 0, fp, wxString( From_UTF8( argv[1] ) ) );
try { PTREE doc; Scan( &doc, &lexer ); } catch( const IO_ERROR& ioe ) { fprintf( stderr, "%s\n", TO_UTF8( ioe.errorText ) ); }
Definition at line 86 of file ptree.cpp.
References DSNLEXER::CurTok(), DSN_EOF, DSN_LEFT, DSN_NONE, DSNLEXER::NextTok(), scanAtom(), scanList(), and DSNLEXER::Unexpected().
Referenced by SCH_EDITOR_CONTROL::AssignFootprints(), BACK_ANNOTATE::getPcbModulesFromString(), and scanList().
Function scanList reads a sexpr list from the input stream into a new node with key aLexer->CurText().
Definition at line 55 of file ptree.cpp.
References DSNLEXER::CurText(), DSNLEXER::CurTok(), DSN_EOF, DSN_LEFT, DSN_RIGHT, DSNLEXER::NextTok(), Scan(), and DSNLEXER::Unexpected().
Referenced by Scan().