KiCad PCB EDA Suite
|
#include <pcbexpr_evaluator.h>
Public Member Functions | |
PCBEXPR_COMPILER (LIBEVAL::UNIT_RESOLVER *aUnitResolver) | |
void | Clear () |
void | parseError (const char *s) |
void | parseOk () |
int | GetSourcePos () const |
void | setRoot (LIBEVAL::TREE_NODE *root) |
void | freeTree (LIBEVAL::TREE_NODE *tree) |
bool | Compile (const wxString &aString, UCODE *aCode, CONTEXT *aPreflightContext) |
void | SetErrorCallback (std::function< void(const wxString &aMessage, int aOffset)> aCallback) |
bool | IsErrorPending () const |
const ERROR_STATUS & | GetError () const |
void | GcItem (TREE_NODE *aItem) |
void | GcItem (wxString *aItem) |
Protected Types | |
enum | LEXER_STATE { LS_DEFAULT = 0 , LS_STRING = 1 } |
Protected Member Functions | |
bool | generateUCode (UCODE *aCode, CONTEXT *aPreflightContext) |
void | reportError (COMPILATION_STAGE stage, const wxString &aErrorMsg, int aPos=-1) |
void | newString (const wxString &aString) |
T_TOKEN | getToken () |
bool | lexDefault (T_TOKEN &aToken) |
bool | lexString (T_TOKEN &aToken) |
int | resolveUnits () |
Protected Attributes | |
LEXER_STATE | m_lexerState |
void * | m_parser |
TOKENIZER | m_tokenizer |
char | m_localeDecimalSeparator |
std::unique_ptr< UNIT_RESOLVER > | m_unitResolver |
int | m_sourcePos |
bool | m_parseFinished |
ERROR_STATUS | m_errorStatus |
std::function< void(const wxString &aMessage, int aOffset)> | m_errorCallback |
TREE_NODE * | m_tree |
std::vector< TREE_NODE * > | m_gcItems |
std::vector< wxString * > | m_gcStrings |
Definition at line 232 of file pcbexpr_evaluator.h.
|
protectedinherited |
Enumerator | |
---|---|
LS_DEFAULT | |
LS_STRING |
Definition at line 534 of file libeval_compiler.h.
PCBEXPR_COMPILER::PCBEXPR_COMPILER | ( | LIBEVAL::UNIT_RESOLVER * | aUnitResolver | ) |
Definition at line 576 of file pcbexpr_evaluator.cpp.
References LIBEVAL::COMPILER::m_unitResolver.
|
inherited |
Definition at line 284 of file libeval_compiler.cpp.
References LIBEVAL::TOKENIZER::Clear(), LIBEVAL::COMPILER::freeTree(), LIBEVAL::COMPILER::m_gcItems, LIBEVAL::COMPILER::m_gcStrings, LIBEVAL::COMPILER::m_tokenizer, and LIBEVAL::COMPILER::m_tree.
Referenced by LIBEVAL::COMPILER::newString(), and LIBEVAL::COMPILER::~COMPILER().
|
inherited |
Definition at line 320 of file libeval_compiler.cpp.
References LIBEVAL::defaultToken, LIBEVAL::COMPILER::freeTree(), LIBEVAL::COMPILER::GcItem(), LIBEVAL::COMPILER::generateUCode(), LIBEVAL::TOKENIZER::GetPos(), LIBEVAL::COMPILER::getToken(), libeval_dbg, LIBEVAL::COMPILER::m_errorStatus, LIBEVAL::COMPILER::m_parseFinished, LIBEVAL::COMPILER::m_parser, LIBEVAL::COMPILER::m_sourcePos, LIBEVAL::COMPILER::m_tokenizer, LIBEVAL::COMPILER::m_tree, LIBEVAL::COMPILER::newString(), LIBEVAL::ERROR_STATUS::pendingError, LIBEVAL::T_TOKEN_VALUE::str, LIBEVAL::T_TOKEN::token, and LIBEVAL::T_TOKEN::value.
Referenced by DRC_RULE_CONDITION::Compile(), PCBEXPR_EVALUATOR::Evaluate(), MULTICHANNEL_TOOL::findOtherItemsInRuleArea(), MULTICHANNEL_TOOL::findRoutedConnections(), MULTICHANNEL_TOOL::identifyComponentsInRuleArea(), and testEvalExpr().
|
inherited |
Definition at line 708 of file libeval_compiler.cpp.
References LIBEVAL::COMPILER::freeTree(), LIBEVAL::TREE_NODE::leaf, and LIBEVAL::TREE_NODE::uop.
Referenced by LIBEVAL::COMPILER::Clear(), LIBEVAL::COMPILER::Compile(), LIBEVAL::COMPILER::freeTree(), and LIBEVAL::COMPILER::~COMPILER().
|
inlineinherited |
Definition at line 530 of file libeval_compiler.h.
Referenced by LIBEVAL::COMPILER::Compile(), and LIBEVAL::newNode().
|
inlineinherited |
Definition at line 531 of file libeval_compiler.h.
|
protectedinherited |
Definition at line 813 of file libeval_compiler.cpp.
References _, LIBEVAL::UCODE::AddOp(), LIBEVAL::CONTEXT::AllocValue(), LIBEVAL::UCODE::CreateFuncCall(), LIBEVAL::UCODE::CreateVarRef(), LIBEVAL::CST_CODEGEN, EDA_UNIT_UTILS::UI::DoubleValueFromString(), LIBEVAL::UCODE::Dump(), dump(), LIBEVAL::dumpNode(), LIBEVAL::formatNode(), LIBEVAL::T_TOKEN_VALUE::idx, LIBEVAL::TREE_NODE::isTerminal, LIBEVAL::TREE_NODE::isVisited, LIBEVAL::TREE_NODE::leaf, libeval_dbg, LIBEVAL::COMPILER::m_tree, LIBEVAL::COMPILER::m_unitResolver, LIBEVAL::TREE_NODE::op, LIBEVAL::CONTEXT::Pop(), LIBEVAL::prepareTree(), LIBEVAL::CONTEXT::Push(), LIBEVAL::COMPILER::reportError(), LIBEVAL::VALUE::Set(), LIBEVAL::CONTEXT::SetErrorCallback(), LIBEVAL::TREE_NODE::SetUop(), LIBEVAL::squashParamList(), LIBEVAL::TREE_NODE::srcPos, LIBEVAL::T_TOKEN_VALUE::str, LIBEVAL::TR_IDENTIFIER, LIBEVAL::TR_NUMBER, TR_OP_FUNC_CALL, TR_OP_METHOD_CALL, LIBEVAL::TR_STRING, LIBEVAL::TR_STRUCT_REF, LIBEVAL::TR_UNIT, TR_UOP_PUSH_VALUE, TR_UOP_PUSH_VAR, LIBEVAL::TREE_NODE::uop, LIBEVAL::TREE_NODE::value, and LIBEVAL::VT_PARSE_ERROR.
Referenced by LIBEVAL::COMPILER::Compile().
|
inlineinherited |
Definition at line 528 of file libeval_compiler.h.
Referenced by testEvalExpr().
|
inlineinherited |
Definition at line 515 of file libeval_compiler.h.
Referenced by LIBEVAL::newNode().
|
protectedinherited |
Definition at line 381 of file libeval_compiler.cpp.
References LIBEVAL::defaultTokenValue, LIBEVAL::COMPILER::lexDefault(), LIBEVAL::COMPILER::lexString(), LIBEVAL::COMPILER::LS_DEFAULT, LIBEVAL::COMPILER::LS_STRING, LIBEVAL::COMPILER::m_lexerState, and LIBEVAL::T_TOKEN::value.
Referenced by LIBEVAL::COMPILER::Compile().
|
inlineinherited |
Definition at line 527 of file libeval_compiler.h.
|
protectedinherited |
Definition at line 435 of file libeval_compiler.cpp.
References _, LIBEVAL::CST_PARSE, LIBEVAL::TOKENIZER::Done(), LIBEVAL::TOKENIZER::GetChar(), LIBEVAL::TOKENIZER::GetChars(), LIBEVAL::TOKENIZER::GetPos(), LIBEVAL::T_TOKEN_VALUE::idx, libeval_dbg, LIBEVAL::COMPILER::LS_STRING, LIBEVAL::COMPILER::m_lexerState, LIBEVAL::COMPILER::m_localeDecimalSeparator, LIBEVAL::COMPILER::m_tokenizer, LIBEVAL::TOKENIZER::MatchAhead(), LIBEVAL::TOKENIZER::NextChar(), LIBEVAL::T_TOKEN_VALUE::num, LIBEVAL::COMPILER::reportError(), LIBEVAL::COMPILER::resolveUnits(), LIBEVAL::T_TOKEN_VALUE::str, LIBEVAL::T_TOKEN::token, and LIBEVAL::T_TOKEN::value.
Referenced by LIBEVAL::COMPILER::getToken().
|
protectedinherited |
Definition at line 405 of file libeval_compiler.cpp.
References LIBEVAL::TOKENIZER::GetString(), LIBEVAL::COMPILER::LS_DEFAULT, LIBEVAL::COMPILER::m_lexerState, LIBEVAL::COMPILER::m_tokenizer, LIBEVAL::T_TOKEN_VALUE::str, LIBEVAL::T_TOKEN::token, and LIBEVAL::T_TOKEN::value.
Referenced by LIBEVAL::COMPILER::getToken().
|
protectedinherited |
Definition at line 371 of file libeval_compiler.cpp.
References LIBEVAL::COMPILER::Clear(), LIBEVAL::COMPILER::LS_DEFAULT, LIBEVAL::COMPILER::m_lexerState, LIBEVAL::COMPILER::m_parseFinished, LIBEVAL::COMPILER::m_tokenizer, and LIBEVAL::TOKENIZER::Restart().
Referenced by LIBEVAL::COMPILER::Compile().
|
inherited |
Definition at line 308 of file libeval_compiler.cpp.
References LIBEVAL::CST_PARSE, and LIBEVAL::COMPILER::reportError().
|
inherited |
Definition at line 314 of file libeval_compiler.cpp.
References LIBEVAL::COMPILER::m_parseFinished.
|
protectedinherited |
Definition at line 687 of file libeval_compiler.cpp.
References LIBEVAL::COMPILER::m_errorCallback, LIBEVAL::COMPILER::m_errorStatus, LIBEVAL::COMPILER::m_sourcePos, LIBEVAL::ERROR_STATUS::message, LIBEVAL::ERROR_STATUS::pendingError, LIBEVAL::ERROR_STATUS::srcPos, and LIBEVAL::ERROR_STATUS::stage.
Referenced by LIBEVAL::COMPILER::generateUCode(), LIBEVAL::COMPILER::lexDefault(), and LIBEVAL::COMPILER::parseError().
|
protectedinherited |
Definition at line 415 of file libeval_compiler.cpp.
References libeval_dbg, LIBEVAL::COMPILER::m_tokenizer, LIBEVAL::COMPILER::m_unitResolver, LIBEVAL::TOKENIZER::MatchAhead(), and LIBEVAL::TOKENIZER::NextChar().
Referenced by LIBEVAL::COMPILER::lexDefault().
|
inlineinherited |
Definition at line 522 of file libeval_compiler.h.
Referenced by DRC_RULE_CONDITION::Compile(), MULTICHANNEL_TOOL::findOtherItemsInRuleArea(), MULTICHANNEL_TOOL::findRoutedConnections(), MULTICHANNEL_TOOL::identifyComponentsInRuleArea(), and PCBEXPR_EVALUATOR::SetErrorCallback().
|
inherited |
Definition at line 702 of file libeval_compiler.cpp.
References LIBEVAL::COMPILER::m_tree.
|
protectedinherited |
Definition at line 568 of file libeval_compiler.h.
Referenced by LIBEVAL::COMPILER::reportError().
|
protectedinherited |
Definition at line 566 of file libeval_compiler.h.
Referenced by LIBEVAL::COMPILER::Compile(), LIBEVAL::COMPILER::COMPILER(), and LIBEVAL::COMPILER::reportError().
|
protectedinherited |
Definition at line 572 of file libeval_compiler.h.
Referenced by LIBEVAL::COMPILER::Clear().
|
protectedinherited |
Definition at line 573 of file libeval_compiler.h.
Referenced by LIBEVAL::COMPILER::Clear().
|
protectedinherited |
Definition at line 540 of file libeval_compiler.h.
Referenced by LIBEVAL::COMPILER::getToken(), LIBEVAL::COMPILER::lexDefault(), LIBEVAL::COMPILER::lexString(), and LIBEVAL::COMPILER::newString().
|
protectedinherited |
Definition at line 560 of file libeval_compiler.h.
Referenced by LIBEVAL::COMPILER::COMPILER(), and LIBEVAL::COMPILER::lexDefault().
|
protectedinherited |
Definition at line 565 of file libeval_compiler.h.
Referenced by LIBEVAL::COMPILER::Compile(), LIBEVAL::COMPILER::COMPILER(), LIBEVAL::COMPILER::newString(), and LIBEVAL::COMPILER::parseOk().
|
protectedinherited |
Definition at line 558 of file libeval_compiler.h.
Referenced by LIBEVAL::COMPILER::Compile(), LIBEVAL::COMPILER::COMPILER(), and LIBEVAL::COMPILER::~COMPILER().
|
protectedinherited |
Definition at line 564 of file libeval_compiler.h.
Referenced by LIBEVAL::COMPILER::Compile(), LIBEVAL::COMPILER::COMPILER(), and LIBEVAL::COMPILER::reportError().
|
protectedinherited |
Definition at line 559 of file libeval_compiler.h.
Referenced by LIBEVAL::COMPILER::Clear(), LIBEVAL::COMPILER::Compile(), LIBEVAL::COMPILER::lexDefault(), LIBEVAL::COMPILER::lexString(), LIBEVAL::COMPILER::newString(), and LIBEVAL::COMPILER::resolveUnits().
|
protectedinherited |
Definition at line 570 of file libeval_compiler.h.
Referenced by LIBEVAL::COMPILER::Clear(), LIBEVAL::COMPILER::Compile(), LIBEVAL::COMPILER::COMPILER(), LIBEVAL::COMPILER::generateUCode(), LIBEVAL::COMPILER::setRoot(), and LIBEVAL::COMPILER::~COMPILER().
|
protectedinherited |
Definition at line 562 of file libeval_compiler.h.
Referenced by LIBEVAL::COMPILER::COMPILER(), LIBEVAL::COMPILER::generateUCode(), PCBEXPR_COMPILER(), and LIBEVAL::COMPILER::resolveUnits().