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 236 of file pcbexpr_evaluator.h.
|
protectedinherited |
Enumerator | |
---|---|
LS_DEFAULT | |
LS_STRING |
Definition at line 567 of file libeval_compiler.h.
PCBEXPR_COMPILER::PCBEXPR_COMPILER | ( | LIBEVAL::UNIT_RESOLVER * | aUnitResolver | ) |
Definition at line 741 of file pcbexpr_evaluator.cpp.
References LIBEVAL::COMPILER::m_unitResolver.
|
inherited |
Definition at line 290 of file libeval_compiler.cpp.
References freeTree(), m_gcItems, m_gcStrings, m_tokenizer, and m_tree.
Referenced by newString(), operator=(), and ~COMPILER().
|
inherited |
Definition at line 326 of file libeval_compiler.cpp.
References LIBEVAL::defaultToken, freeTree(), GcItem(), generateUCode(), getToken(), libeval_dbg, m_errorStatus, m_parseFinished, m_parser, m_sourcePos, m_tokenizer, m_tree, newString(), LIBEVAL::T_TOKEN_VALUE::str, LIBEVAL::T_TOKEN::token, and LIBEVAL::T_TOKEN::value.
Referenced by DRC_RULE_CONDITION::Compile(), MULTICHANNEL_TOOL::findComponentsInRuleArea(), MULTICHANNEL_TOOL::findOtherItemsInRuleArea(), MULTICHANNEL_TOOL::findRoutingInRuleArea(), testEvalExpr(), and testEvalExpr().
|
inherited |
Definition at line 720 of file libeval_compiler.cpp.
References freeTree(), LIBEVAL::TREE_NODE::leaf, and LIBEVAL::TREE_NODE::uop.
Referenced by Clear(), Compile(), freeTree(), and ~COMPILER().
|
inlineinherited |
Definition at line 563 of file libeval_compiler.h.
References m_gcItems.
Referenced by Compile(), and LIBEVAL::newNode().
|
inlineinherited |
Definition at line 564 of file libeval_compiler.h.
References m_gcStrings.
|
protectedinherited |
Definition at line 823 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, m_tree, m_unitResolver, LIBEVAL::TREE_NODE::op, LIBEVAL::CONTEXT::Pop(), LIBEVAL::prepareTree(), LIBEVAL::CONTEXT::Push(), 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, UNSCALED, LIBEVAL::TREE_NODE::uop, LIBEVAL::TREE_NODE::value, and LIBEVAL::VT_PARSE_ERROR.
Referenced by Compile().
|
inlineinherited |
Definition at line 561 of file libeval_compiler.h.
References m_errorStatus.
Referenced by testEvalExpr().
|
inlineinherited |
Definition at line 548 of file libeval_compiler.h.
References m_sourcePos.
Referenced by LIBEVAL::newNode().
|
protectedinherited |
Definition at line 387 of file libeval_compiler.cpp.
References LIBEVAL::defaultTokenValue, lexDefault(), lexString(), LS_DEFAULT, LS_STRING, m_lexerState, and LIBEVAL::T_TOKEN::value.
Referenced by Compile().
|
inlineinherited |
Definition at line 560 of file libeval_compiler.h.
References m_errorStatus.
|
protectedinherited |
Definition at line 446 of file libeval_compiler.cpp.
References _, LIBEVAL::CST_PARSE, LIBEVAL::T_TOKEN_VALUE::idx, libeval_dbg, LS_STRING, m_lexerState, m_localeDecimalSeparator, m_sourcePos, m_tokenizer, LIBEVAL::T_TOKEN_VALUE::num, reportError(), resolveUnits(), LIBEVAL::T_TOKEN_VALUE::str, LIBEVAL::T_TOKEN::token, and LIBEVAL::T_TOKEN::value.
Referenced by getToken().
|
protectedinherited |
Definition at line 412 of file libeval_compiler.cpp.
References LS_DEFAULT, m_lexerState, m_tokenizer, LIBEVAL::T_TOKEN_VALUE::str, LIBEVAL::T_TOKEN::token, and LIBEVAL::T_TOKEN::value.
Referenced by getToken().
|
protectedinherited |
Definition at line 377 of file libeval_compiler.cpp.
References Clear(), LS_DEFAULT, m_lexerState, m_parseFinished, and m_tokenizer.
Referenced by Compile().
|
inherited |
Definition at line 314 of file libeval_compiler.cpp.
References LIBEVAL::CST_PARSE, and reportError().
Referenced by operator=().
|
inherited |
Definition at line 320 of file libeval_compiler.cpp.
References m_parseFinished.
Referenced by operator=().
|
protectedinherited |
Definition at line 699 of file libeval_compiler.cpp.
References m_errorCallback, m_errorStatus, and m_sourcePos.
Referenced by generateUCode(), lexDefault(), and parseError().
|
protectedinherited |
Definition at line 422 of file libeval_compiler.cpp.
References libeval_dbg, m_tokenizer, and m_unitResolver.
Referenced by lexDefault().
|
inlineinherited |
Definition at line 555 of file libeval_compiler.h.
References m_errorCallback.
Referenced by DRC_RULE_CONDITION::Compile(), MULTICHANNEL_TOOL::findComponentsInRuleArea(), MULTICHANNEL_TOOL::findOtherItemsInRuleArea(), and MULTICHANNEL_TOOL::findRoutingInRuleArea().
|
inherited |
Definition at line 714 of file libeval_compiler.cpp.
References m_tree.
|
protectedinherited |
Definition at line 601 of file libeval_compiler.h.
Referenced by reportError(), and SetErrorCallback().
|
protectedinherited |
Definition at line 599 of file libeval_compiler.h.
Referenced by Compile(), COMPILER(), GetError(), IsErrorPending(), and reportError().
|
protectedinherited |
Definition at line 605 of file libeval_compiler.h.
|
protectedinherited |
Definition at line 606 of file libeval_compiler.h.
|
protectedinherited |
Definition at line 573 of file libeval_compiler.h.
Referenced by COMPILER(), getToken(), lexDefault(), lexString(), and newString().
|
protectedinherited |
Definition at line 593 of file libeval_compiler.h.
Referenced by COMPILER(), and lexDefault().
|
protectedinherited |
Definition at line 598 of file libeval_compiler.h.
Referenced by Compile(), COMPILER(), newString(), and parseOk().
|
protectedinherited |
Definition at line 591 of file libeval_compiler.h.
Referenced by Compile(), COMPILER(), and ~COMPILER().
|
protectedinherited |
Definition at line 597 of file libeval_compiler.h.
Referenced by Compile(), COMPILER(), GetSourcePos(), lexDefault(), and reportError().
|
protectedinherited |
Definition at line 592 of file libeval_compiler.h.
Referenced by Clear(), Compile(), lexDefault(), lexString(), newString(), and resolveUnits().
|
protectedinherited |
Definition at line 603 of file libeval_compiler.h.
Referenced by Clear(), Compile(), COMPILER(), generateUCode(), setRoot(), and ~COMPILER().
|
protectedinherited |
Definition at line 595 of file libeval_compiler.h.
Referenced by COMPILER(), generateUCode(), PCBEXPR_COMPILER::PCBEXPR_COMPILER(), and resolveUnits().