|
KiCad PCB EDA Suite
|
#include <libeval_compiler.h>
Public Member Functions | |
| CONTEXT () | |
| virtual | ~CONTEXT () |
| CONTEXT (const CONTEXT &)=delete | |
| CONTEXT & | operator= (const CONTEXT &)=delete |
| virtual void | Reset () |
| Release every value allocated by the previous evaluation and rewind the stack so the same CONTEXT can be reused for another Run() without being reconstructed. | |
| VALUE * | AllocValue () |
| VALUE * | StoreValue (VALUE *aValue) |
| void | Push (VALUE *v) |
| VALUE * | Pop () |
| VALUE * | Top () |
| Peek the top of the stack without popping (used by the short-circuit jumps). | |
| int | SP () const |
| void | SetErrorCallback (std::function< void(const wxString &aMessage, int aOffset)> aCallback) |
| bool | HasErrorCallback () |
| void | ReportError (const wxString &aErrorMsg) |
Private Member Functions | |
| VALUE * | inlineValue (std::size_t aIndex) |
Private Attributes | |
| std::vector< VALUE * > | m_ownedValues |
| VALUE * | m_stack [100] |
| int | m_stackPtr |
| unsigned char | m_inlineStorage [INLINE_VALUE_COUNT *sizeof(VALUE)] |
| std::size_t | m_inlineUsed |
| std::function< void(const wxString &aMessage, int aOffset)> | m_errorCallback |
Static Private Attributes | |
| static constexpr std::size_t | INLINE_VALUE_COUNT = 32 |
Definition at line 344 of file libeval_compiler.h.
|
inline |
Definition at line 347 of file libeval_compiler.h.
References m_inlineUsed, m_ownedValues, m_stack, and m_stackPtr.
Referenced by CONTEXT(), and operator=().
|
inlinevirtual |
Definition at line 355 of file libeval_compiler.h.
References Reset().
|
inline |
Definition at line 386 of file libeval_compiler.h.
References INLINE_VALUE_COUNT, inlineValue(), m_inlineUsed, m_ownedValues, and VALUE.
Referenced by enclosedByAreaFunc(), LIBEVAL::UOP::Exec(), existsOnLayerFunc(), fromToFunc(), LIBEVAL::COMPILER::generateUCode(), getFieldFunc(), hasComponentClassFunc(), hasExactNetclassFunc(), hasNetChainFunc(), hasNetclassFunc(), inDiffPairFunc(), inNetChainClassFunc(), inNetChainFunc(), intersectsAreaFunc(), intersectsBackCourtyardFunc(), intersectsCourtyardFunc(), intersectsFrontCourtyardFunc(), isBlindBuriedViaFunc(), isBlindVia(), isBuriedVia(), isCoupledDiffPairFunc(), isMicroVia(), isPlatedFunc(), memberOfFootprintFunc(), memberOfGroupFunc(), memberOfSheetFunc(), memberOfSheetOrChildrenFunc(), Pop(), and Top().
|
inline |
Definition at line 447 of file libeval_compiler.h.
References m_errorCallback.
Referenced by collidesWithArea(), enclosedByAreaFunc(), LIBEVAL::UOP::Exec(), existsOnLayerFunc(), getFieldFunc(), hasComponentClassFunc(), hasExactNetclassFunc(), hasNetclassFunc(), inDiffPairFunc(), inNetChainClassFunc(), inNetChainFunc(), intersectsAreaFunc(), intersectsBackCourtyardFunc(), intersectsCourtyardFunc(), intersectsFrontCourtyardFunc(), memberOfFootprintFunc(), memberOfGroupFunc(), memberOfSheetFunc(), and memberOfSheetOrChildrenFunc().
|
inlineprivate |
Definition at line 454 of file libeval_compiler.h.
References m_inlineStorage.
Referenced by AllocValue(), and Reset().
|
inline |
Definition at line 414 of file libeval_compiler.h.
References _, AllocValue(), m_stack, m_stackPtr, and ReportError().
Referenced by enclosedByAreaFunc(), LIBEVAL::UOP::Exec(), existsOnLayerFunc(), fromToFunc(), LIBEVAL::COMPILER::generateUCode(), getFieldFunc(), hasComponentClassFunc(), hasExactNetclassFunc(), hasNetclassFunc(), inDiffPairFunc(), inNetChainClassFunc(), inNetChainFunc(), intersectsAreaFunc(), intersectsBackCourtyardFunc(), intersectsCourtyardFunc(), intersectsFrontCourtyardFunc(), memberOfFootprintFunc(), memberOfGroupFunc(), memberOfSheetFunc(), memberOfSheetOrChildrenFunc(), and LIBEVAL::UCODE::Run().
|
inline |
Definition at line 409 of file libeval_compiler.h.
References m_stack, and m_stackPtr.
Referenced by enclosedByAreaFunc(), LIBEVAL::UOP::Exec(), existsOnLayerFunc(), fromToFunc(), LIBEVAL::COMPILER::generateUCode(), getFieldFunc(), hasComponentClassFunc(), hasExactNetclassFunc(), hasNetChainFunc(), hasNetclassFunc(), inDiffPairFunc(), inNetChainClassFunc(), inNetChainFunc(), intersectsAreaFunc(), intersectsBackCourtyardFunc(), intersectsCourtyardFunc(), intersectsFrontCourtyardFunc(), isBlindBuriedViaFunc(), isBlindVia(), isBuriedVia(), isCoupledDiffPairFunc(), isMicroVia(), isPlatedFunc(), memberOfFootprintFunc(), memberOfGroupFunc(), memberOfSheetFunc(), and memberOfSheetOrChildrenFunc().
| void LIBEVAL::CONTEXT::ReportError | ( | const wxString & | aErrorMsg | ) |
Definition at line 700 of file libeval_compiler.cpp.
References m_errorCallback.
Referenced by collidesWithArea(), enclosedByAreaFunc(), LIBEVAL::UOP::Exec(), existsOnLayerFunc(), getFieldFunc(), hasComponentClassFunc(), hasExactNetclassFunc(), hasNetclassFunc(), inDiffPairFunc(), inNetChainClassFunc(), inNetChainFunc(), intersectsAreaFunc(), intersectsBackCourtyardFunc(), intersectsCourtyardFunc(), intersectsFrontCourtyardFunc(), memberOfFootprintFunc(), memberOfGroupFunc(), memberOfSheetFunc(), memberOfSheetOrChildrenFunc(), Pop(), and Top().
|
inlinevirtual |
Release every value allocated by the previous evaluation and rewind the stack so the same CONTEXT can be reused for another Run() without being reconstructed.
This keeps the owned- value vector's buffer allocated, so a reused context performs zero heap allocation for the common evaluation. Overrides must chain to this base after rewinding their own per-run state.
Reimplemented in PCBEXPR_CONTEXT.
Definition at line 371 of file libeval_compiler.h.
References inlineValue(), m_errorCallback, m_inlineUsed, m_ownedValues, and m_stackPtr.
Referenced by PCBEXPR_CONTEXT::Reset(), and ~CONTEXT().
|
inline |
Definition at line 442 of file libeval_compiler.h.
References m_errorCallback.
Referenced by DRC_RULE_CONDITION::EvaluateFor(), MULTICHANNEL_TOOL::findComponentsInRuleArea(), MULTICHANNEL_TOOL::findOtherItemsInRuleArea(), MULTICHANNEL_TOOL::findRoutingInRuleArea(), LIBEVAL::COMPILER::generateUCode(), and ITEM_EVAL_EXPECTATION::RunTest().
|
inline |
Definition at line 437 of file libeval_compiler.h.
References m_stackPtr.
Referenced by LIBEVAL::UCODE::Run().
Definition at line 403 of file libeval_compiler.h.
References m_ownedValues.
Referenced by LIBEVAL::UOP::Exec(), and LIBEVAL::UCODE::Run().
|
inline |
Peek the top of the stack without popping (used by the short-circuit jumps).
Definition at line 426 of file libeval_compiler.h.
References _, AllocValue(), m_stack, m_stackPtr, and ReportError().
Referenced by LIBEVAL::UOP::Exec().
|
staticconstexprprivate |
Definition at line 452 of file libeval_compiler.h.
Referenced by AllocValue().
|
private |
Definition at line 466 of file libeval_compiler.h.
Referenced by HasErrorCallback(), ReportError(), Reset(), and SetErrorCallback().
|
private |
Definition at line 463 of file libeval_compiler.h.
Referenced by inlineValue().
|
private |
Definition at line 464 of file libeval_compiler.h.
Referenced by AllocValue(), CONTEXT(), and Reset().
|
private |
Definition at line 459 of file libeval_compiler.h.
Referenced by AllocValue(), CONTEXT(), Reset(), and StoreValue().
|
private |
|
private |