KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PCBEXPR_COMPILER Class Reference

#include <pcbexpr_evaluator.h>

Inheritance diagram for PCBEXPR_COMPILER:
LIBEVAL::COMPILER

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
 

Detailed Description

Definition at line 214 of file pcbexpr_evaluator.h.

Member Enumeration Documentation

◆ LEXER_STATE

enum LIBEVAL::COMPILER::LEXER_STATE
protectedinherited
Enumerator
LS_DEFAULT 
LS_STRING 

Definition at line 525 of file libeval_compiler.h.

Constructor & Destructor Documentation

◆ PCBEXPR_COMPILER()

PCBEXPR_COMPILER::PCBEXPR_COMPILER ( LIBEVAL::UNIT_RESOLVER aUnitResolver)

Definition at line 459 of file pcbexpr_evaluator.cpp.

References LIBEVAL::COMPILER::m_unitResolver.

Member Function Documentation

◆ Clear()

◆ Compile()

◆ freeTree()

◆ GcItem() [1/2]

void LIBEVAL::COMPILER::GcItem ( TREE_NODE aItem)
inlineinherited

Definition at line 521 of file libeval_compiler.h.

References LIBEVAL::COMPILER::m_gcItems.

Referenced by LIBEVAL::COMPILER::Compile(), and LIBEVAL::newNode().

◆ GcItem() [2/2]

void LIBEVAL::COMPILER::GcItem ( wxString *  aItem)
inlineinherited

Definition at line 522 of file libeval_compiler.h.

References LIBEVAL::COMPILER::m_gcStrings.

◆ generateUCode()

◆ GetError()

const ERROR_STATUS & LIBEVAL::COMPILER::GetError ( ) const
inlineinherited

Definition at line 519 of file libeval_compiler.h.

References LIBEVAL::COMPILER::m_errorStatus.

Referenced by testEvalExpr().

◆ GetSourcePos()

int LIBEVAL::COMPILER::GetSourcePos ( ) const
inlineinherited

Definition at line 506 of file libeval_compiler.h.

References LIBEVAL::COMPILER::m_sourcePos.

Referenced by LIBEVAL::newNode().

◆ getToken()

◆ IsErrorPending()

bool LIBEVAL::COMPILER::IsErrorPending ( ) const
inlineinherited

◆ lexDefault()

◆ lexString()

◆ newString()

void LIBEVAL::COMPILER::newString ( const wxString &  aString)
protectedinherited

◆ parseError()

void LIBEVAL::COMPILER::parseError ( const char *  s)
inherited

Definition at line 305 of file libeval_compiler.cpp.

References LIBEVAL::CST_PARSE, and LIBEVAL::COMPILER::reportError().

◆ parseOk()

void LIBEVAL::COMPILER::parseOk ( )
inherited

Definition at line 311 of file libeval_compiler.cpp.

References LIBEVAL::COMPILER::m_parseFinished.

◆ reportError()

◆ resolveUnits()

int LIBEVAL::COMPILER::resolveUnits ( )
protectedinherited

◆ SetErrorCallback()

void LIBEVAL::COMPILER::SetErrorCallback ( std::function< void(const wxString &aMessage, int aOffset)>  aCallback)
inlineinherited

◆ setRoot()

void LIBEVAL::COMPILER::setRoot ( LIBEVAL::TREE_NODE root)
inherited

Definition at line 699 of file libeval_compiler.cpp.

References LIBEVAL::COMPILER::m_tree.

Member Data Documentation

◆ m_errorCallback

std::function<void( const wxString& aMessage, int aOffset )> LIBEVAL::COMPILER::m_errorCallback
protectedinherited

◆ m_errorStatus

ERROR_STATUS LIBEVAL::COMPILER::m_errorStatus
protectedinherited

◆ m_gcItems

std::vector<TREE_NODE*> LIBEVAL::COMPILER::m_gcItems
protectedinherited

Definition at line 563 of file libeval_compiler.h.

Referenced by LIBEVAL::COMPILER::Clear(), and LIBEVAL::COMPILER::GcItem().

◆ m_gcStrings

std::vector<wxString*> LIBEVAL::COMPILER::m_gcStrings
protectedinherited

Definition at line 564 of file libeval_compiler.h.

Referenced by LIBEVAL::COMPILER::Clear(), and LIBEVAL::COMPILER::GcItem().

◆ m_lexerState

LEXER_STATE LIBEVAL::COMPILER::m_lexerState
protectedinherited

◆ m_localeDecimalSeparator

char LIBEVAL::COMPILER::m_localeDecimalSeparator
protectedinherited

◆ m_parseFinished

bool LIBEVAL::COMPILER::m_parseFinished
protectedinherited

◆ m_parser

void* LIBEVAL::COMPILER::m_parser
protectedinherited

◆ m_sourcePos

int LIBEVAL::COMPILER::m_sourcePos
protectedinherited

◆ m_tokenizer

◆ m_tree

◆ m_unitResolver

std::unique_ptr<UNIT_RESOLVER> LIBEVAL::COMPILER::m_unitResolver
protectedinherited

The documentation for this class was generated from the following files: