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 227 of file pcbexpr_evaluator.h.
|
protectedinherited |
Enumerator | |
---|---|
LS_DEFAULT | |
LS_STRING |
Definition at line 526 of file libeval_compiler.h.
PCBEXPR_COMPILER::PCBEXPR_COMPILER | ( | LIBEVAL::UNIT_RESOLVER * | aUnitResolver | ) |
Definition at line 541 of file pcbexpr_evaluator.cpp.
References LIBEVAL::COMPILER::m_unitResolver.
|
inherited |
Definition at line 281 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 317 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::identifyComponentsInRuleArea(), and testEvalExpr().
|
inherited |
Definition at line 705 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 522 of file libeval_compiler.h.
Referenced by LIBEVAL::COMPILER::Compile(), and LIBEVAL::newNode().
|
inlineinherited |
Definition at line 523 of file libeval_compiler.h.
|
protectedinherited |
Definition at line 810 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 520 of file libeval_compiler.h.
Referenced by testEvalExpr().
|
inlineinherited |
Definition at line 507 of file libeval_compiler.h.
Referenced by LIBEVAL::newNode().
|
protectedinherited |
Definition at line 378 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 519 of file libeval_compiler.h.
|
protectedinherited |
Definition at line 432 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 402 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 368 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 305 of file libeval_compiler.cpp.
References LIBEVAL::CST_PARSE, and LIBEVAL::COMPILER::reportError().
|
inherited |
Definition at line 311 of file libeval_compiler.cpp.
References LIBEVAL::COMPILER::m_parseFinished.
|
protectedinherited |
Definition at line 684 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 412 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 514 of file libeval_compiler.h.
Referenced by DRC_RULE_CONDITION::Compile(), MULTICHANNEL_TOOL::identifyComponentsInRuleArea(), and PCBEXPR_EVALUATOR::SetErrorCallback().
|
inherited |
Definition at line 699 of file libeval_compiler.cpp.
References LIBEVAL::COMPILER::m_tree.
|
protectedinherited |
Definition at line 560 of file libeval_compiler.h.
Referenced by LIBEVAL::COMPILER::reportError().
|
protectedinherited |
Definition at line 558 of file libeval_compiler.h.
Referenced by LIBEVAL::COMPILER::Compile(), LIBEVAL::COMPILER::COMPILER(), and LIBEVAL::COMPILER::reportError().
|
protectedinherited |
Definition at line 564 of file libeval_compiler.h.
Referenced by LIBEVAL::COMPILER::Clear().
|
protectedinherited |
Definition at line 565 of file libeval_compiler.h.
Referenced by LIBEVAL::COMPILER::Clear().
|
protectedinherited |
Definition at line 532 of file libeval_compiler.h.
Referenced by LIBEVAL::COMPILER::getToken(), LIBEVAL::COMPILER::lexDefault(), LIBEVAL::COMPILER::lexString(), and LIBEVAL::COMPILER::newString().
|
protectedinherited |
Definition at line 552 of file libeval_compiler.h.
Referenced by LIBEVAL::COMPILER::COMPILER(), and LIBEVAL::COMPILER::lexDefault().
|
protectedinherited |
Definition at line 557 of file libeval_compiler.h.
Referenced by LIBEVAL::COMPILER::Compile(), LIBEVAL::COMPILER::COMPILER(), LIBEVAL::COMPILER::newString(), and LIBEVAL::COMPILER::parseOk().
|
protectedinherited |
Definition at line 550 of file libeval_compiler.h.
Referenced by LIBEVAL::COMPILER::Compile(), LIBEVAL::COMPILER::COMPILER(), and LIBEVAL::COMPILER::~COMPILER().
|
protectedinherited |
Definition at line 556 of file libeval_compiler.h.
Referenced by LIBEVAL::COMPILER::Compile(), LIBEVAL::COMPILER::COMPILER(), and LIBEVAL::COMPILER::reportError().
|
protectedinherited |
Definition at line 551 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 562 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 554 of file libeval_compiler.h.
Referenced by LIBEVAL::COMPILER::COMPILER(), LIBEVAL::COMPILER::generateUCode(), PCBEXPR_COMPILER(), and LIBEVAL::COMPILER::resolveUnits().