KiCad PCB EDA Suite
numEval Namespace Reference

Namespaces

 KIGFX
 
 numEval
 
 std
 

Template specialization to enable wxStrings for certain containers (e.g. unordered_map)


 

Classes

class  FILE_LINE_READER
 Class FILE_LINE_READER is a LINE_READER that reads from an open file. More...
 
class  FILE_OUTPUTFORMATTER
 Class FILE_OUTPUTFORMATTER may be used for text file output. More...
 
struct  FUTURE_FORMAT_ERROR
 Struct FUTURE_FORMAT_ERROR variant of PARSE_ERROR indicating that a syntax or related error was likely caused by a file generated by a newer version of KiCad than this. More...
 
class  INPUTSTREAM_LINE_READER
 Class INPUTSTREAM_LINE_READER is a LINE_READER that reads from a wxInputStream object. More...
 
class  IO_ERROR
 Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions containing meaningful error messages. More...
 
class  KI_PARAM_ERROR
 class KI_PARAM_ERROR is a class used to hold a translatable error message and may be used when throwing exceptions containing a translated error message. More...
 
class  LINE_READER
 Class LINE_READER is an abstract class from which implementation specific LINE_READERs may be derived to read single lines of text and manage a line number counter. More...
 
class  LOCALE_IO
 Instantiate the current locale within a scope in which you are expecting exceptions to be thrown. More...
 
class  NUMERIC_EVALUATOR
 
class  OUTPUTFORMATTER
 Class OUTPUTFORMATTER is an important interface (abstract class) used to output 8 bit text in a convenient way. More...
 
struct  PARSE_ERROR
 Struct PARSE_ERROR contains a filename or source description, a problem input line, a line number, a byte offset, and an error message which contains the the caller's report and his call site information: CPP source file, function, and line number. More...
 
class  STREAM_OUTPUTFORMATTER
 Class STREAM_OUTPUTFORMATTER implements OUTPUTFORMATTER to a wxWidgets wxOutputStream. More...
 
class  STRING_FORMATTER
 Class STRING_FORMATTER implements OUTPUTFORMATTER to a memory buffer. More...
 
class  STRING_LINE_READER
 Class STRING_LINE_READER is a LINE_READER that reads from a multiline 8 bit wide std::string. More...
 
struct  StructColors
 
struct  TokenType
 
class  UTF8
 Class UTF8 is an 8 bit string that is assuredly encoded in UTF8, and supplies special conversion support to and from wxString, to and from std::string, and has non-mutating iteration over unicode characters. More...
 
class  VECTOR2
 Class VECTOR2 defines a general 2D-vector/point. More...
 
struct  VECTOR2_TRAITS
 Class VECTOR2_TRAITS traits class for VECTOR2. More...
 
struct  VECTOR2_TRAITS< int >
 
class  WX_FILENAME
 A wrapper around a wxFileName which is much more performant with a subset of the API. More...
 
union  YYMINORTYPE
 
struct  yyParser
 
struct  yyStackEntry
 

Typedefs

typedef VECTOR2< double > VECTOR2D
 
typedef VECTOR2< int > VECTOR2I
 
typedef VECTOR2< unsigned int > VECTOR2U
 
typedef VECTOR2< double > DPOINT
 
typedef DPOINT DSIZE
 
typedef long timestamp_t
 timestamp_t is our type to represent unique IDs for all kinds of elements; historically simply the timestamp when they were created. More...
 
typedef uint32_t EDA_KEY
 
typedef struct yyStackEntry yyStackEntry
 
typedef struct yyParser yyParser
 

Enumerations

enum  EDA_COLOR_T {
  UNSPECIFIED_COLOR = -1, BLACK = 0, DARKDARKGRAY, DARKGRAY,
  LIGHTGRAY, WHITE, LIGHTYELLOW, DARKBLUE,
  DARKGREEN, DARKCYAN, DARKRED, DARKMAGENTA,
  DARKBROWN, BLUE, GREEN, CYAN,
  RED, MAGENTA, BROWN, LIGHTBLUE,
  LIGHTGREEN, LIGHTCYAN, LIGHTRED, LIGHTMAGENTA,
  YELLOW, PUREBLUE, PUREGREEN, PURECYAN,
  PURERED, PUREMAGENTA, PUREYELLOW, NBCOLORS,
  HIGHLIGHT_FLAG = ( 1<<19 ), MASKCOLOR = 31
}
 The color enumeration. More...
 
enum  pseudokeys {
  EDA_PANNING_UP_KEY = 1, EDA_PANNING_DOWN_KEY, EDA_PANNING_LEFT_KEY, EDA_PANNING_RIGHT_KEY,
  EDA_ZOOM_IN_FROM_MOUSE, EDA_ZOOM_OUT_FROM_MOUSE, EDA_ZOOM_CENTER_FROM_MOUSE
}
 Pseudo key codes for command panning. More...
 
enum  EDA_UNITS_T { INCHES = 0, MILLIMETRES = 1, UNSCALED_UNITS = 2, DEGREES = 3 }
 

Functions

template<typename T >
rescale (T aNumerator, T aValue, T aDenominator)
 Function rescale() More...
 
template<typename T >
int sign (T val)
 
template<>
int rescale (int aNumerator, int aValue, int aDenominator)
 
template<>
int64_t rescale (int64_t aNumerator, int64_t aValue, int64_t aDenominator)
 
static int round_nearest (double v)
 
template<class T >
std::ostream & operator<< (std::ostream &aStream, const VECTOR2< T > &aVector)
 
template<class T >
VECTOR2< T > operator* (const T &aFactor, const VECTOR2< T > &aVector)
 
template<class T >
const VECTOR2< T > LexicographicalMax (const VECTOR2< T > &aA, const VECTOR2< T > &aB)
 
template<class T >
const VECTOR2< T > LexicographicalMin (const VECTOR2< T > &aA, const VECTOR2< T > &aB)
 
template<class T >
const int LexicographicalCompare (const VECTOR2< T > &aA, const VECTOR2< T > &aB)
 
bool IsUTF8 (const char *aString)
 Function IsUTF8 tests a c-string to see if it is UTF8 encoded. More...
 
int StrPrintf (std::string *aResult, const char *aFormat,...)
 Function StrPrintf is like sprintf() but the output is appended to a std::string instead of to a character array. More...
 
std::string StrPrintf (const char *format,...)
 Function StrPrintf is like sprintf() but the output is returned in a std::string instead of to a character array. More...
 
EDA_COLOR_T ColorFromInt (int aColor)
 Checked cast. Use only when necessary (usually I/O) More...
 
EDA_COLOR_T NextColor (EDA_COLOR_T &aColor)
 
EDA_COLOR_T ColorGetBase (EDA_COLOR_T aColor)
 Return only the plain color part. More...
 
EDA_COLOR_T ColorMix (EDA_COLOR_T aColor1, EDA_COLOR_T aColor2)
 Mix two colors in some way (hopefully like a logical OR) More...
 
void ColorTurnToDarkDarkGray (EDA_COLOR_T *aColor)
 Force the color part of a color to darkdarkgray. More...
 
void ColorChangeHighlightFlag (EDA_COLOR_T *aColor, bool flag)
 
void SetAlpha (EDA_COLOR_T *aColor, unsigned char aBlend)
 Function SetAlpha ORs in the alpha blend parameter in to a color index. More...
 
unsigned char GetAlpha (EDA_COLOR_T aColor)
 Function GetAlpha returns the alpha blend parameter from a color index. More...
 
void ColorApplyHighlightFlag (EDA_COLOR_T *aColor)
 Step a color to the highlighted version if the highlight flag is set. More...
 
EDA_COLOR_T ColorByName (const wxString &aName)
 Find a color by name. More...
 
EDA_COLOR_T ColorFindNearest (const wxColour &aColor)
 Find the nearest color match. More...
 
EDA_COLOR_T ColorFindNearest (int aR, int aG, int aB)
 Find the nearest color match. More...
 
bool ColorIsLight (EDA_COLOR_T aColor)
 Check if a color is light i.e. More...
 
const wxChar * ColorGetName (EDA_COLOR_T aColor)
 
void ColorSetBrush (wxBrush *aBrush, EDA_COLOR_T aColor)
 
wxColour MakeColour (EDA_COLOR_T aColor)
 Function MakeColour returns a wxWidgets wxColor from a KiCad color index with alpha value. More...
 
static int KiROUND (double v)
 Round a floating point number to an integer using "round halfway cases away from zero". More...
 
wxSize GetTextSize (const wxString &aSingleLine, wxWindow *aWindow)
 Return the size of aSingleLine of text when it is rendered in aWindow using whatever font is currently set in that window. More...
 
bool EnsureTextCtrlWidth (wxTextCtrl *aCtrl, const wxString *aString=NULL)
 Set the minimum pixel width on a text control in order to make a text string be fully visible within it. More...
 
void SelectReferenceNumber (wxTextEntry *aTextEntry)
 Select the number (or "?") in a reference for ease of editing. More...
 
int ProcessExecute (const wxString &aCommandLine, int aFlags=wxEXEC_ASYNC, wxProcess *callback=NULL)
 Run a command in a child process. More...
 
timestamp_t GetNewTimeStamp ()
 
int GetCommandOptions (const int argc, const char **argv, const char *stringtst, const char **optarg, int *optind)
 
double RoundTo0 (double x, double precision)
 Round to the nearest precision. More...
 
void wxStringSplit (const wxString &aText, wxArrayString &aStrings, wxChar aSplitter)
 Split aString to a string list separated at aSplitter. More...
 
wxString SearchHelpFileFullPath (const SEARCH_STACK &aSearchStack, const wxString &aBaseName)
 Return the help file's full path. More...
 
bool EnsureFileDirectoryExists (wxFileName *aTargetFullFileName, const wxString &aBaseFilename, REPORTER *aReporter=NULL)
 Make aTargetFullFileName absolute and create the path of this file if it doesn't yet exist. More...
 
const wxString PrePendPath (const wxString &aEnvVar, const wxString &aPriorityPath)
 Put aPriorityPath in front of all paths in the value of aEnvVar. More...
 
std::unique_ptr< wxConfigBase > GetNewConfig (const wxString &aProgName)
 Create a new wxConfig so we can put configuration files in a more proper place for each platform. More...
 
wxString GetKicadConfigPath ()
 Return the user configuration path used to store KiCad's configuration files. More...
 
const wxString ExpandEnvVarSubstitutions (const wxString &aString)
 Replace any environment variable references with their values. More...
 
const wxString ResolveUriByEnvVars (const wxString &aUri)
 Replace any environment variables in file-path uris (leaving network-path URIs alone). More...
 
long long TimestampDir (const wxString &aDirPath, const wxString &aFilespec)
 A copy of ConvertFileTimeToWx() because wxWidgets left it as a static function private to src/common/filename.cpp. More...
 
int Mm2mils (double x)
 Convert mm to mils. More...
 
int Mils2mm (double x)
 Convert mils to mm. More...
 
std::string Double2Str (double aValue)
 Helper function Double2Str to print a float number without using scientific notation and no trailing 0 We want to avoid scientific notation in S-expr files (not easy to read) for floating numbers. More...
 
void StripTrailingZeros (wxString &aStringValue, unsigned aTrailingZeroAllowed=1)
 Function StripTrailingZeros Remove trailing 0 from a string containing a converted float number. More...
 
double To_User_Unit (EDA_UNITS_T aUnit, double aValue, bool aUseMils=false)
 Function To_User_Unit convert aValue in internal units to the appropriate user units defined by aUnit. More...
 
wxString AngleToStringDegrees (double aAngle)
 Function AngleToStringDegrees is a helper to convert the double aAngle (in internal unit) to a string in degrees. More...
 
wxString MessageTextFromValue (EDA_UNITS_T aUnits, double aValue, bool aUseMils=false)
 Function MessageTextFromValue is a helper to convert the double length aValue to a string in inches, millimeters, or unscaled units. More...
 
wxString MessageTextFromValue (EDA_UNITS_T aUnits, int aValue, bool aUseMils=false)
 
wxString StringFromValue (EDA_UNITS_T aUnit, int aValue, bool aAddUnitSymbol=false, bool aUseMils=false)
 Function StringFromValue returns the string from aValue according to units (inch, mm ...) for display, and the initial unit for value. More...
 
double From_User_Unit (EDA_UNITS_T aUnit, double aValue, bool aUseMils=false)
 Return in internal units the value "val" given in a real unit such as "in", "mm" or "deg". More...
 
double DoubleValueFromString (EDA_UNITS_T aUnits, const wxString &aTextValue, bool aUseMils=false)
 Function DoubleValueFromString converts aTextValue to a double. More...
 
int ValueFromString (EDA_UNITS_T aUnits, const wxString &aTextValue, bool aUseMils=false)
 Function ValueFromString converts aTextValue in aUnits to internal units used by the application. More...
 
void FetchUnitsFromString (const wxString &aTextValue, EDA_UNITS_T &aUnits, bool &aUseMils)
 Function FetchUnitsFromString writes any unit info found in the string to aUnits and aUseMils. More...
 
wxString GetAbbreviatedUnitsLabel (EDA_UNITS_T aUnit, bool aUseMils=false)
 Get the units string for a given units type. More...
 
std::string FormatInternalUnits (int aValue)
 Function FormatInternalUnits converts aValue from internal units to a string appropriate for writing to file. More...
 
std::string FormatAngle (double aAngle)
 Function FormatAngle converts aAngle from board units to a string appropriate for writing to file. More...
 
std::string FormatInternalUnits (const wxPoint &aPoint)
 
std::string FormatInternalUnits (const wxSize &aSize)
 
std::string FormatInternalUnits (const VECTOR2I &aPoint)
 
void ParseTrace (FILE *TraceFILE, char *zTracePrompt)
 
void * ParseAlloc (void *(*mallocProc)(size_t))
 
static void yy_destructor (yyParser *yypParser, YYCODETYPE yymajor, YYMINORTYPE *yypminor)
 
static int yy_pop_parser_stack (yyParser *pParser)
 
void ParseFree (void *p, void(*freeProc)(void *))
 
static int yy_find_shift_action (yyParser *pParser, YYCODETYPE iLookAhead)
 
static int yy_find_reduce_action (int stateno, YYCODETYPE iLookAhead)
 
static void yyStackOverflow (yyParser *yypParser, YYMINORTYPE *yypMinor)
 
static void yy_shift (yyParser *yypParser, int yyNewState, int yyMajor, YYMINORTYPE *yypMinor)
 
static void yy_accept (yyParser *)
 
static void yy_reduce (yyParser *yypParser, int yyruleno)
 
static void yy_parse_failed (yyParser *yypParser)
 
static void yy_syntax_error (yyParser *yypParser, int yymajor, YYMINORTYPE yyminor)
 
void Parse (void *yyp, int yymajor, ParseTOKENTYPE yyminorParseARG_PDECL)
 

Variables

const StructColors g_ColorRefs [NBCOLORS]
 list of existing Colors More...
 
KIGFX::COLOR4D g_GhostColor
 Draw color for moving objects. More...
 
static const YYMINORTYPE yyzerominor = { 0 }
 
static const YYACTIONTYPE yy_action []
 
static const YYCODETYPE yy_lookahead []
 
static const signed char yy_shift_ofst []
 
static const signed char yy_reduce_ofst []
 
static const YYACTIONTYPE yy_default []
 
static FILE * yyTraceFILE = 0
 
static char * yyTracePrompt = 0
 
static const char *const yyTokenName []
 
static const char *const yyRuleName []
 
struct {
   YYCODETYPE   numEval::lhs
 
   unsigned char   numEval::nrhs
 
yyRuleInfo []
 

Typedef Documentation

typedef VECTOR2<double> numEval::DPOINT

Definition at line 592 of file numeric_evaluator.cpp.

Definition at line 593 of file numeric_evaluator.cpp.

typedef uint32_t numEval::EDA_KEY

Definition at line 74 of file numeric_evaluator.cpp.

typedef long numEval::timestamp_t

timestamp_t is our type to represent unique IDs for all kinds of elements; historically simply the timestamp when they were created.

Long term, this type might be renamed to something like unique_id_t (and then rename all the methods from {Get,Set}TimeStamp() to {Get,Set}Id()) ?

The type should be at least 32 bit and simple to map via swig; swig does have issues with types such as 'int32_t', so we choose 'long'.

Definition at line 53 of file numeric_evaluator.cpp.

typedef VECTOR2<double> numEval::VECTOR2D

Definition at line 586 of file numeric_evaluator.cpp.

typedef VECTOR2<int> numEval::VECTOR2I

Definition at line 587 of file numeric_evaluator.cpp.

typedef VECTOR2<unsigned int> numEval::VECTOR2U

Definition at line 588 of file numeric_evaluator.cpp.

typedef struct yyParser numEval::yyParser

Definition at line 236 of file numeric_evaluator.cpp.

Definition at line 218 of file numeric_evaluator.cpp.

Enumeration Type Documentation

The color enumeration.

Also contains a flag and the alpha value in the upper bits

Enumerator
UNSPECIFIED_COLOR 
BLACK 
DARKDARKGRAY 
DARKGRAY 
LIGHTGRAY 
WHITE 
LIGHTYELLOW 
DARKBLUE 
DARKGREEN 
DARKCYAN 
DARKRED 
DARKMAGENTA 
DARKBROWN 
BLUE 
GREEN 
CYAN 
RED 
MAGENTA 
BROWN 
LIGHTBLUE 
LIGHTGREEN 
LIGHTCYAN 
LIGHTRED 
LIGHTMAGENTA 
YELLOW 
PUREBLUE 
PUREGREEN 
PURECYAN 
PURERED 
PUREMAGENTA 
PUREYELLOW 
NBCOLORS 

Number of colors.

HIGHLIGHT_FLAG 
MASKCOLOR 

mask for color index into g_ColorRefs[]

Definition at line 43 of file numeric_evaluator.cpp.

47 {
48  struct lconv* lc = localeconv();
49  m_localeDecimalSeparator = *lc->decimal_point;
50 
51  m_parseError = false;
52  m_parseFinished = false;
53 
54  m_parser = numEval::ParseAlloc( malloc );
55 
56  switch( aUnits )
57  {
58  case INCHES:
59  if( aUseMils )
60  m_defaultUnits = Unit::Mil;
61  else
62  m_defaultUnits = Unit::Inch;
63  break;
64  case MILLIMETRES:m_defaultUnits = Unit::Metric;
65  break;
66  default:m_defaultUnits = Unit::Metric;
67  break;
68  }
69 }
70 
71 
73 {
75 
76  // Allow explicit call to destructor
77  m_parser = nullptr;
78 
79  Clear();
void ParseFree(void *p, void(*freeProc)(void *))
Definition: common.h:161
void * ParseAlloc(void *(*mallocProc)(size_t))
Enumerator
INCHES 
MILLIMETRES 
UNSCALED_UNITS 
DEGREES 

Definition at line 160 of file numeric_evaluator.cpp.

166 {

Pseudo key codes for command panning.

Enumerator
EDA_PANNING_UP_KEY 
EDA_PANNING_DOWN_KEY 
EDA_PANNING_LEFT_KEY 
EDA_PANNING_RIGHT_KEY 
EDA_ZOOM_IN_FROM_MOUSE 
EDA_ZOOM_OUT_FROM_MOUSE 
EDA_ZOOM_CENTER_FROM_MOUSE 

Definition at line 92 of file numeric_evaluator.cpp.

94 {
95  m_parseError = true;
96 }
97 
98 
100 {

Function Documentation

wxString numEval::AngleToStringDegrees ( double  aAngle)

Function AngleToStringDegrees is a helper to convert the double aAngle (in internal unit) to a string in degrees.

Definition at line 421 of file base_units.cpp.

422 {
423  wxString text;
424 
425  text.Printf( wxT( "%.3f" ), aAngle/10.0 );
426  StripTrailingZeros( text, 1 );
427 
428  return text;
429 }
void StripTrailingZeros(wxString &aStringValue, unsigned aTrailingZeroAllowed)
Function StripTrailingZeros Remove trailing 0 from a string containing a converted float number...
Definition: base_units.cpp:178
void numEval::ColorApplyHighlightFlag ( EDA_COLOR_T aColor)
inline

Step a color to the highlighted version if the highlight flag is set.

Definition at line 158 of file numeric_evaluator.cpp.

EDA_COLOR_T numEval::ColorByName ( const wxString &  aName)

Find a color by name.

Definition at line 72 of file colors.cpp.

73 {
74  // look for a match in the palette itself
75  for( EDA_COLOR_T trying = BLACK; trying < NBCOLORS; trying = NextColor(trying) )
76  {
77  if( 0 == aName.CmpNoCase( ColorGetName( trying ) ) )
78  return trying;
79  }
80 
81  // Not found, no idea...
82  return UNSPECIFIED_COLOR;
83 }
EDA_COLOR_T
NOTE: EDA_COLOR_T is deprecated and is kept around for compatibility with legacy canvas.
Definition: colors.h:42
const wxChar * ColorGetName(EDA_COLOR_T aColor)
Definition: colors.h:185
Definition: colors.h:45
Number of colors.
Definition: colors.h:75
EDA_COLOR_T NextColor(EDA_COLOR_T &aColor)
Definition: colors.h:87
void numEval::ColorChangeHighlightFlag ( EDA_COLOR_T aColor,
bool  flag 
)
inline

Definition at line 112 of file numeric_evaluator.cpp.

112 {
113  return m_originalText;
114 }
115 
116 
117 bool NUMERIC_EVALUATOR::Process( const wxString& aString )
118 {
bool Process(const wxString &aString)
EDA_COLOR_T numEval::ColorFindNearest ( const wxColour &  aColor)

Find the nearest color match.

Definition at line 96 of file colors.cpp.

97 {
98  return ColorFindNearest( aColor.Red(), aColor.Green(), aColor.Blue() );
99 }
EDA_COLOR_T ColorFindNearest(const wxColour &aColor)
Find the nearest color match.
Definition: colors.cpp:96
EDA_COLOR_T numEval::ColorFindNearest ( int  aR,
int  aG,
int  aB 
)

Find the nearest color match.

Parameters
aRis the red component of the color to be matched (in range 0-255)
aGis the green component of the color to be matched (in range 0-255)
aBis the blue component of the color to be matched (in range 0-255)

Definition at line 102 of file colors.cpp.

103 {
104  EDA_COLOR_T candidate = BLACK;
105 
106  /* Find the 'nearest' color in the palette. This is fun. There is
107  a gazilion of metrics for the color space and no one of the
108  useful one is in the RGB color space. Who cares, this is a CAD,
109  not a photosomething...
110 
111  I hereby declare that the distance is the sum of the square of the
112  component difference. Think about the RGB color cube. Now get the
113  euclidean distance, but without the square root... for ordering
114  purposes it's the same, obviously. Also each component can't be
115  less of the target one, since I found this currently work better...
116  */
117  int nearest_distance = 255 * 255 * 3 + 1; // Can't beat this
118 
119  for( EDA_COLOR_T trying = BLACK; trying < NBCOLORS; trying = NextColor(trying) )
120  {
121  const StructColors &c = g_ColorRefs[trying];
122  int distance = (aR - c.m_Red) * (aR - c.m_Red) +
123  (aG - c.m_Green) * (aG - c.m_Green) +
124  (aB - c.m_Blue) * (aB - c.m_Blue);
125 
126  if( distance < nearest_distance && c.m_Red >= aR &&
127  c.m_Green >= aG && c.m_Blue >= aB )
128  {
129  nearest_distance = distance;
130  candidate = trying;
131  }
132  }
133 
134  return candidate;
135 }
EDA_COLOR_T
NOTE: EDA_COLOR_T is deprecated and is kept around for compatibility with legacy canvas.
Definition: colors.h:42
unsigned char m_Red
Definition: colors.h:146
unsigned char m_Green
Definition: colors.h:145
unsigned char m_Blue
Definition: colors.h:144
const StructColors g_ColorRefs[NBCOLORS]
The predefined colors used in KiCad.
Definition: colors.cpp:37
Definition: colors.h:45
Number of colors.
Definition: colors.h:75
EDA_COLOR_T NextColor(EDA_COLOR_T &aColor)
Definition: colors.h:87
EDA_COLOR_T numEval::ColorFromInt ( int  aColor)
inline

Checked cast. Use only when necessary (usually I/O)

Definition at line 82 of file numeric_evaluator.cpp.

84 {
85  free( m_token.token );
86  m_token.token = nullptr;
EDA_COLOR_T numEval::ColorGetBase ( EDA_COLOR_T  aColor)
inline

Return only the plain color part.

Definition at line 97 of file numeric_evaluator.cpp.

100 {
101  m_parseFinished = true;
const wxChar* numEval::ColorGetName ( EDA_COLOR_T  aColor)
inline

Definition at line 186 of file numeric_evaluator.cpp.

187  {
188  bool haveSeparator = false;
189  idx = 0;
190  auto ch = m_token.input[ m_token.pos ];
191 
bool numEval::ColorIsLight ( EDA_COLOR_T  aColor)

Check if a color is light i.e.

if black would be more readable than white on it

EDA_COLOR_T numEval::ColorMix ( EDA_COLOR_T  aColor1,
EDA_COLOR_T  aColor2 
)

Mix two colors in some way (hopefully like a logical OR)

void numEval::ColorSetBrush ( wxBrush *  aBrush,
EDA_COLOR_T  aColor 
)
inline

Definition at line 193 of file numeric_evaluator.cpp.

193  {
194  if( isDecimalSeparator( ch ) && haveSeparator )
195  break;
196 
197  m_token.token[ idx++ ] = ch;
198 
199  if( isDecimalSeparator( ch ))
void numEval::ColorTurnToDarkDarkGray ( EDA_COLOR_T aColor)
inline

Force the color part of a color to darkdarkgray.

Definition at line 107 of file numeric_evaluator.cpp.

std::string numEval::Double2Str ( double  aValue)

Helper function Double2Str to print a float number without using scientific notation and no trailing 0 We want to avoid scientific notation in S-expr files (not easy to read) for floating numbers.

So we cannot always just use the g or the f format to print a fp number this helper function uses the f format when needed, or g when f is not well working and then removes trailing 0

Definition at line 63 of file base_units.cpp.

64 {
65  char buf[50];
66  int len;
67 
68  if( aValue != 0.0 && fabs( aValue ) <= 0.0001 )
69  {
70  // For these small values, %f works fine,
71  // and %g gives an exponent
72  len = sprintf( buf, "%.16f", aValue );
73 
74  while( --len > 0 && buf[len] == '0' )
75  buf[len] = '\0';
76 
77  if( buf[len] == '.' )
78  buf[len] = '\0';
79  else
80  ++len;
81  }
82  else
83  {
84  // For these values, %g works fine, and sometimes %f
85  // gives a bad value (try aValue = 1.222222222222, with %.16f format!)
86  len = sprintf( buf, "%.16g", aValue );
87  }
88 
89  return std::string( buf, len );
90 }
double numEval::DoubleValueFromString ( EDA_UNITS_T  aUnits,
const wxString &  aTextValue,
bool  aUseMils = false 
)

Function DoubleValueFromString converts aTextValue to a double.

Parameters
aUnitsThe units of aTextValue.
aTextValueA reference to a wxString object containing the string to convert.
aUseMilsIndicates mils should be used for imperial units (inches).
Returns
A double representing that value in internal units
bool numEval::EnsureFileDirectoryExists ( wxFileName *  aTargetFullFileName,
const wxString &  aBaseFilename,
REPORTER aReporter = NULL 
)

Make aTargetFullFileName absolute and create the path of this file if it doesn't yet exist.

Parameters
aTargetFullFileNamethe wxFileName containing the full path and file name to modify. The path may be absolute or relative to aBaseFilename .
aBaseFilenamea full filename. Only its path is used to set the aTargetFullFileName path.
aReportera point to a REPORTER object use to show messages (can be NULL)
Returns
true if aOutputDir already exists or was successfully created.

Definition at line 468 of file common.cpp.

471 {
472  wxString msg;
473  wxString baseFilePath = wxFileName( aBaseFilename ).GetPath();
474 
475  // make aTargetFullFileName path, which is relative to aBaseFilename path (if it is not
476  // already an absolute path) absolute:
477  if( !aTargetFullFileName->MakeAbsolute( baseFilePath ) )
478  {
479  if( aReporter )
480  {
481  msg.Printf( _( "Cannot make path \"%s\" absolute with respect to \"%s\"." ),
482  GetChars( aTargetFullFileName->GetPath() ),
483  GetChars( baseFilePath ) );
484  aReporter->Report( msg, REPORTER::RPT_ERROR );
485  }
486 
487  return false;
488  }
489 
490  // Ensure the path of aTargetFullFileName exists, and create it if needed:
491  wxString outputPath( aTargetFullFileName->GetPath() );
492 
493  if( !wxFileName::DirExists( outputPath ) )
494  {
495  if( wxMkdir( outputPath ) )
496  {
497  if( aReporter )
498  {
499  msg.Printf( _( "Output directory \"%s\" created.\n" ), GetChars( outputPath ) );
500  aReporter->Report( msg, REPORTER::RPT_INFO );
501  return true;
502  }
503  }
504  else
505  {
506  if( aReporter )
507  {
508  msg.Printf( _( "Cannot create output directory \"%s\".\n" ),
509  GetChars( outputPath ) );
510  aReporter->Report( msg, REPORTER::RPT_ERROR );
511  }
512 
513  return false;
514  }
515  }
516 
517  return true;
518 }
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_UNDEFINED)=0
Function Report is a pure virtual function to override in the derived object.
bool numEval::EnsureTextCtrlWidth ( wxTextCtrl *  aCtrl,
const wxString *  aString = NULL 
)

Set the minimum pixel width on a text control in order to make a text string be fully visible within it.

The current font within the text control is considered. The text can come either from the control or be given as an argument. If the text control is larger than needed, then nothing is done.

Parameters
aCtrlthe text control to potentially make wider.
aStringthe text that is used in sizing the control's pixel width. If NULL, then the text already within the control is used.
Returns
bool - true if the aCtrl had its size changed, else false.

Definition at line 126 of file common.cpp.

127 {
128  wxWindow* window = aCtrl->GetParent();
129 
130  if( !window )
131  window = aCtrl;
132 
133  wxString ctrlText;
134 
135  if( !aString )
136  {
137  ctrlText = aCtrl->GetValue();
138  aString = &ctrlText;
139  }
140 
141  wxSize textz = GetTextSize( *aString, window );
142  wxSize ctrlz = aCtrl->GetSize();
143 
144  if( ctrlz.GetWidth() < textz.GetWidth() + 10 )
145  {
146  ctrlz.SetWidth( textz.GetWidth() + 10 );
147  aCtrl->SetSizeHints( ctrlz );
148  return true;
149  }
150 
151  return false;
152 }
wxSize GetTextSize(const wxString &aSingleLine, wxWindow *aWindow)
Return the size of aSingleLine of text when it is rendered in aWindow using whatever font is currentl...
Definition: common.cpp:111
const wxString numEval::ExpandEnvVarSubstitutions ( const wxString &  aString)

Replace any environment variable references with their values.

Parameters
aString= a string containing (perhaps) references to env var
Returns
a string where env var are replaced by their value

Definition at line 441 of file common.cpp.

442 {
443  // wxGetenv( wchar_t* ) is not re-entrant on linux.
444  // Put a lock on multithreaded use of wxGetenv( wchar_t* ), called from wxEpandEnvVars(),
445  static MUTEX getenv_mutex;
446 
447  MUTLOCK lock( getenv_mutex );
448 
449  // We reserve the right to do this another way, by providing our own member
450  // function.
451  return KIwxExpandEnvVars( aString );
452 }
wxString KIwxExpandEnvVars(const wxString &str)
Definition: common.cpp:320
boost::interprocess::interprocess_mutex MUTEX
Establish KiCad MUTEX choices here in this file: typedef MUTEX and typedef MUTLOCK.
Definition: ki_mutex.h:42
boost::interprocess::scoped_lock< MUTEX > MUTLOCK
Definition: ki_mutex.h:43
void numEval::FetchUnitsFromString ( const wxString &  aTextValue,
EDA_UNITS_T aUnits,
bool &  aUseMils 
)

Function FetchUnitsFromString writes any unit info found in the string to aUnits and aUseMils.

std::string numEval::FormatAngle ( double  aAngle)

Function FormatAngle converts aAngle from board units to a string appropriate for writing to file.

Note
Internal angles for board items can be either degrees or tenths of degree on how KiCad is built.
Parameters
aAngleA angle value to convert.
Returns
A std::string object containing the converted angle.

Definition at line 490 of file base_units.cpp.

491 {
492  char temp[50];
493  int len;
494 
495  len = snprintf( temp, sizeof(temp), "%.10g", aAngle / 10.0 );
496 
497  return std::string( temp, len );
498 }
std::string numEval::FormatInternalUnits ( int  aValue)

Function FormatInternalUnits converts aValue from internal units to a string appropriate for writing to file.

Note
Internal units for board items can be either deci-mils or nanometers depending on how KiCad is built.
Parameters
aValueA coordinate value to convert.
Returns
A std::string object containing the converted value.

Definition at line 457 of file base_units.cpp.

458 {
459  char buf[50];
460  double engUnits = aValue;
461  int len;
462 
463 #ifndef EESCHEMA
464  engUnits /= IU_PER_MM;
465 #endif
466 
467  if( engUnits != 0.0 && fabs( engUnits ) <= 0.0001 )
468  {
469  len = snprintf( buf, sizeof(buf), "%.10f", engUnits );
470 
471  while( --len > 0 && buf[len] == '0' )
472  buf[len] = '\0';
473 
474 #ifndef EESCHEMA
475  if( buf[len] == '.' )
476  buf[len] = '\0';
477  else
478 #endif
479  ++len;
480  }
481  else
482  {
483  len = snprintf( buf, sizeof(buf), "%.10g", engUnits );
484  }
485 
486  return std::string( buf, len );
487 }
std::string numEval::FormatInternalUnits ( const wxPoint &  aPoint)

Definition at line 501 of file base_units.cpp.

502 {
503  return FormatInternalUnits( aPoint.x ) + " " + FormatInternalUnits( aPoint.y );
504 }
std::string FormatInternalUnits(int aValue)
Function FormatInternalUnits converts aValue from internal units to a string appropriate for writing ...
Definition: base_units.cpp:457
std::string numEval::FormatInternalUnits ( const wxSize &  aSize)

Definition at line 513 of file base_units.cpp.

514 {
515  return FormatInternalUnits( aSize.GetWidth() ) + " " + FormatInternalUnits( aSize.GetHeight() );
516 }
std::string FormatInternalUnits(int aValue)
Function FormatInternalUnits converts aValue from internal units to a string appropriate for writing ...
Definition: base_units.cpp:457
std::string numEval::FormatInternalUnits ( const VECTOR2I aPoint)
double numEval::From_User_Unit ( EDA_UNITS_T  aUnit,
double  aValue,
bool  aUseMils = false 
)

Return in internal units the value "val" given in a real unit such as "in", "mm" or "deg".

wxString numEval::GetAbbreviatedUnitsLabel ( EDA_UNITS_T  aUnit,
bool  aUseMils = false 
)

Get the units string for a given units type.

Parameters
aUnits- The units requested.
Returns
The human readable units string.
unsigned char numEval::GetAlpha ( EDA_COLOR_T  aColor)
inline

Function GetAlpha returns the alpha blend parameter from a color index.

Definition at line 136 of file numeric_evaluator.cpp.

138  {
139  // Reset parser by passing zero as token ID, value is ignored.
140  numEval::Parse( m_parser, 0, tok.value, this );
void Parse(void *yyp, int yymajor, ParseTOKENTYPE yyminorParseARG_PDECL)
int numEval::GetCommandOptions ( const int  argc,
const char **  argv,
const char *  stringtst,
const char **  optarg,
int *  optind 
)
wxString numEval::GetKicadConfigPath ( )

Return the user configuration path used to store KiCad's configuration files.

The configuration path order of precedence is determined by the following criteria:

  • The value of the KICAD_CONFIG_HOME environment variable
  • The value of the XDG_CONFIG_HOME environment variable.
  • The result of the call to wxStandardPaths::GetUserConfigDir() with ".config" appended as required on Linux builds.
Returns
A wxString containing the config path for Kicad

Definition at line 262 of file common.cpp.

263 {
264  wxFileName cfgpath;
265 
266  // http://docs.wxwidgets.org/3.0/classwx_standard_paths.html#a7c7cf595d94d29147360d031647476b0
267  cfgpath.AssignDir( wxStandardPaths::Get().GetUserConfigDir() );
268 
269  // GetUserConfigDir() does not default to ~/.config which is the current standard
270  // configuration file location on Linux. This has been fixed in later versions of wxWidgets.
271 #if !defined( __WXMSW__ ) && !defined( __WXMAC__ )
272  wxArrayString dirs = cfgpath.GetDirs();
273 
274  if( dirs.Last() != ".config" )
275  cfgpath.AppendDir( ".config" );
276 #endif
277 
278  wxString envstr;
279 
280  // This shouldn't cause any issues on Windows or MacOS.
281  if( wxGetEnv( wxT( "XDG_CONFIG_HOME" ), &envstr ) && !envstr.IsEmpty() )
282  {
283  // Override the assignment above with XDG_CONFIG_HOME
284  cfgpath.AssignDir( envstr );
285  }
286 
287  cfgpath.AppendDir( wxT( "kicad" ) );
288 
289  // Use KICAD_CONFIG_HOME to allow the user to force a specific configuration path.
290  if( wxGetEnv( wxT( "KICAD_CONFIG_HOME" ), &envstr ) && !envstr.IsEmpty() )
291  {
292  // Override the assignment above with KICAD_CONFIG_HOME
293  cfgpath.AssignDir( envstr );
294  }
295 
296  if( !cfgpath.DirExists() )
297  {
298  cfgpath.Mkdir( wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL );
299  }
300 
301  return cfgpath.GetPath();
302 }
std::unique_ptr<wxConfigBase> numEval::GetNewConfig ( const wxString &  aProgName)

Create a new wxConfig so we can put configuration files in a more proper place for each platform.

This is generally $HOME/.config/kicad/ in Linux according to the FreeDesktop specification at http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html The config object created here should be destroyed by the caller.

Parameters
aProgNameis the name of the program calling this function - can be obtained by calling Pgm().App().GetAppName(). This will be the actual file name of the config file.
Returns
A pointer to a new wxConfigBase derived object is returned. The caller is in charge of deleting it.

Definition at line 251 of file common.cpp.

252 {
253  wxFileName configname;
254  configname.AssignDir( GetKicadConfigPath() );
255  configname.SetFullName( aProgName );
256 
257  // explicitly use wxFileConfig to prevent storing any settings in the system registry on Windows
258  return std::make_unique<wxFileConfig>( wxT( "" ), wxT( "" ), configname.GetFullPath() );
259 }
wxString GetKicadConfigPath()
Return the user configuration path used to store KiCad&#39;s configuration files.
Definition: common.cpp:262
timestamp_t numEval::GetNewTimeStamp ( )
Returns
an unique time stamp that changes after each call

Definition at line 212 of file common.cpp.

213 {
214  static timestamp_t oldTimeStamp;
215  timestamp_t newTimeStamp;
216 
217  newTimeStamp = time( NULL );
218 
219  if( newTimeStamp <= oldTimeStamp )
220  newTimeStamp = oldTimeStamp + 1;
221 
222  oldTimeStamp = newTimeStamp;
223 
224  return newTimeStamp;
225 }
long timestamp_t
timestamp_t is our type to represent unique IDs for all kinds of elements; historically simply the ti...
Definition: common.h:53
wxSize numEval::GetTextSize ( const wxString &  aSingleLine,
wxWindow *  aWindow 
)

Return the size of aSingleLine of text when it is rendered in aWindow using whatever font is currently set in that window.

Definition at line 111 of file common.cpp.

112 {
113  wxCoord width;
114  wxCoord height;
115 
116  {
117  wxClientDC dc( aWindow );
118  dc.SetFont( aWindow->GetFont() );
119  dc.GetTextExtent( aSingleLine, &width, &height );
120  }
121 
122  return wxSize( width, height );
123 }
bool numEval::IsUTF8 ( const char *  aString)

Function IsUTF8 tests a c-string to see if it is UTF8 encoded.

BTW an ASCII string is a valid UTF8 string.

Definition at line 173 of file utf8.cpp.

174 {
175  int len = strlen( aString );
176 
177  if( len )
178  {
179  const unsigned char* next = (unsigned char*) aString;
180  const unsigned char* end = next + len;
181 
182  try
183  {
184  while( next < end )
185  {
186  next += UTF8::uni_forward( next, NULL );
187  }
188 
189  // uni_forward() should find the exact end if it is truly UTF8
190  if( next > end )
191  return false;
192  }
193  catch( const IO_ERROR& )
194  {
195  return false;
196  }
197  }
198 
199  return true;
200 }
CITER next(CITER it)
Definition: ptree.cpp:130
static int uni_forward(const unsigned char *aSequence, unsigned *aResult=NULL)
Function uni_forward advances over a single UTF8 encoded multibyte character, capturing the unicode c...
Definition: utf8.cpp:73
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:76
static int numEval::KiROUND ( double  v)
inlinestatic

Round a floating point number to an integer using "round halfway cases away from zero".

In Debug build an assert fires if will not fit into an int.KiROUND: a function so v is not evaluated twice. Unfortunately, compiler is unable to pre-compute constants using this.

Definition at line 121 of file numeric_evaluator.cpp.

127  {
template<class T >
const int numEval::LexicographicalCompare ( const VECTOR2< T > &  aA,
const VECTOR2< T > &  aB 
)

Definition at line 559 of file numeric_evaluator.cpp.

template<class T >
const VECTOR2<T> numEval::LexicographicalMax ( const VECTOR2< T > &  aA,
const VECTOR2< T > &  aB 
)

Definition at line 535 of file numeric_evaluator.cpp.

template<class T >
const VECTOR2<T> numEval::LexicographicalMin ( const VECTOR2< T > &  aA,
const VECTOR2< T > &  aB 
)

Definition at line 547 of file numeric_evaluator.cpp.

wxColour numEval::MakeColour ( EDA_COLOR_T  aColor)
inline

Function MakeColour returns a wxWidgets wxColor from a KiCad color index with alpha value.

Note that alpha support is not available on every wxWidgets platform. On such platform the behavior is the same as for wxALPHA_OPAQUE and that means the alpha value has no effect and will be ignored.

Returns
wxColour - given a KiCad color index with alpha value

Definition at line 209 of file numeric_evaluator.cpp.

215  {
216  char ch = m_token.input[ m_token.pos ];
217 
218  if( ch == '"' )
219  {
220  m_token.pos++;
221  return Unit::Inch;
wxString numEval::MessageTextFromValue ( EDA_UNITS_T  aUnits,
double  aValue,
bool  aUseMils = false 
)

Function MessageTextFromValue is a helper to convert the double length aValue to a string in inches, millimeters, or unscaled units.

Should be used only to display a coordinate in status, but not in dialogs, files, etc., because the mantissa of the number displayed has 4 digits max for readability. The actual internal value could need up to 8 digits to be printed.

Use StringFromValue() instead where precision matters.

Parameters
aUnitsThe units to show the value in. The unit string is added to the message text.
aValueThe double value to convert.
aUseMilsConvert inch values to mils if true.
Returns
The converted string for display in user interface elements.
wxString numEval::MessageTextFromValue ( EDA_UNITS_T  aUnits,
int  aValue,
bool  aUseMils = false 
)
int numEval::Mils2mm ( double  x)
inline

Convert mils to mm.

Definition at line 54 of file numeric_evaluator.cpp.

57 {
int numEval::Mm2mils ( double  x)
inline

Convert mm to mils.

Definition at line 51 of file numeric_evaluator.cpp.

EDA_COLOR_T numEval::NextColor ( EDA_COLOR_T aColor)
inline

Definition at line 88 of file numeric_evaluator.cpp.

94 {
template<class T >
VECTOR2<T> numEval::operator* ( const T &  aFactor,
const VECTOR2< T > &  aVector 
)

Definition at line 469 of file numeric_evaluator.cpp.

template<class T >
std::ostream & numEval::operator<< ( std::ostream &  aStream,
const VECTOR2< T > &  aVector 
)

Definition at line 578 of file numeric_evaluator.cpp.

void numEval::Parse ( void *  yyp,
int  yymajor,
ParseTOKENTYPE yyminor  ParseARG_PDECL 
)
void* numEval::ParseAlloc ( void *(*)(size_t)  mallocProc)

Definition at line 342 of file numeric_evaluator.cpp.

344  {
345  case '+' :retval.token = PLUS; break;
346  case '-' :retval.token = MINUS; break;
347  case '*' :retval.token = MULT; break;
348  case '/' :retval.token = DIVIDE; break;
349  case '(' :retval.token = PARENL; break;
350  case ')' :retval.token = PARENR; break;
351  case '=' :retval.token = ASSIGN; break;
352  case ';' :retval.token = SEMCOL; break;
353  default :m_parseError = true; break; /* invalid character */
354  }
355  m_token.pos++;
356  }
357 
#define ASSIGN
#define PARENR
#define MINUS
#define SEMCOL
#define PARENL
#define MULT
#define DIVIDE
#define PLUS
void numEval::ParseFree ( void *  p,
void(*)(void *)  freeProc 
)

Definition at line 423 of file numeric_evaluator.cpp.

void numEval::ParseTrace ( FILE *  TraceFILE,
char *  zTracePrompt 
)

Definition at line 262 of file numeric_evaluator.cpp.

271  {
const wxString numEval::PrePendPath ( const wxString &  aEnvVar,
const wxString &  aPriorityPath 
)

Put aPriorityPath in front of all paths in the value of aEnvVar.

Definition at line 32 of file prependpath.cpp.

33 {
34  wxPathList paths;
35 
36  paths.AddEnvList( aEnvVar );
37  paths.Insert( aPriorityPath, 0 );
38 
39  return wxJoin( paths, wxPATH_SEP[0] );
40 }
int numEval::ProcessExecute ( const wxString &  aCommandLine,
int  aFlags = wxEXEC_ASYNC,
wxProcess *  callback = NULL 
)

Run a command in a child process.

Parameters
aCommandLineThe process and any arguments to it all in a single string.
aFlagsThe same args as allowed for wxExecute()
callbackwxProcess implementing OnTerminate to be run when the child process finishes
Returns
int - pid of process, 0 in case of error (like return values of wxExecute())

Definition at line 206 of file common.cpp.

207 {
208  return wxExecute( aCommandLine, aFlags, callback );
209 }
template<>
int numEval::rescale ( int  aNumerator,
int  aValue,
int  aDenominator 
)

Definition at line 32 of file math_util.cpp.

33 {
34  return (int) ( (int64_t) aNumerator * (int64_t) aValue / (int64_t) aDenominator );
35 }
template<>
int64_t numEval::rescale ( int64_t  aNumerator,
int64_t  aValue,
int64_t  aDenominator 
)

Definition at line 39 of file math_util.cpp.

40 {
41 #ifdef __x86_64__
42  return ( (__int128_t) aNumerator * (__int128_t) aValue ) / aDenominator;
43 #else
44  int64_t r = 0;
45  int64_t sign = ( ( aNumerator < 0 ) ? -1 : 1 ) * ( aDenominator < 0 ? -1 : 1 ) *
46  ( aValue < 0 ? -1 : 1 );
47 
48  int64_t a = std::abs( aNumerator );
49  int64_t b = std::abs( aValue );
50  int64_t c = std::abs( aDenominator );
51 
52  r = c / 2;
53 
54  if( b <= INT_MAX && c <= INT_MAX )
55  {
56  if( a <= INT_MAX )
57  return sign * ( ( a * b + r ) / c );
58  else
59  return sign * ( a / c * b + ( a % c * b + r ) / c);
60  }
61  else
62  {
63  uint64_t a0 = a & 0xFFFFFFFF;
64  uint64_t a1 = a >> 32;
65  uint64_t b0 = b & 0xFFFFFFFF;
66  uint64_t b1 = b >> 32;
67  uint64_t t1 = a0 * b1 + a1 * b0;
68  uint64_t t1a = t1 << 32;
69  int i;
70 
71  a0 = a0 * b0 + t1a;
72  a1 = a1 * b1 + ( t1 >> 32 ) + ( a0 < t1a );
73  a0 += r;
74  a1 += a0 < (uint64_t)r;
75 
76  for( i = 63; i >= 0; i-- )
77  {
78  a1 += a1 + ( ( a0 >> i ) & 1 );
79  t1 += t1;
80 
81  if( (uint64_t) c <= a1 )
82  {
83  a1 -= c;
84  t1++;
85  }
86  }
87 
88  return t1 * sign;
89  }
90 #endif
91 }
#define abs(a)
Definition: auxiliary.h:84
size_t i
Definition: json11.cpp:597
int sign(T val)
Definition: math_util.h:44
const wxString numEval::ResolveUriByEnvVars ( const wxString &  aUri)

Replace any environment variables in file-path uris (leaving network-path URIs alone).

Definition at line 455 of file common.cpp.

456 {
457  // URL-like URI: return as is.
458  wxURL url( aUri );
459  if( url.GetError() == wxURL_NOERR )
460  return aUri;
461 
462  // Otherwise, the path points to a local file. Resolve environment
463  // variables if any.
464  return ExpandEnvVarSubstitutions( aUri );
465 }
const wxString ExpandEnvVarSubstitutions(const wxString &aString)
Replace any environment variable references with their values.
Definition: common.cpp:441
static int numEval::round_nearest ( double  v)
inlinestatic

Definition at line 57 of file numeric_evaluator.cpp.

57  {
58  case INCHES:
59  if( aUseMils )
60  m_defaultUnits = Unit::Mil;
Definition: common.h:161
double numEval::RoundTo0 ( double  x,
double  precision 
)

Round to the nearest precision.

Try to approximate a coordinate using a given precision to prevent rounding errors when converting from inches to mm.

ie round the unit value to 0 if unit is 1 or 2, or 8 or 9

Definition at line 228 of file common.cpp.

229 {
230  assert( precision != 0 );
231 
232  long long ix = KiROUND( x * precision );
233 
234  if ( x < 0.0 )
235  ix = -ix;
236 
237  int remainder = ix % 10; // remainder is in precision mm
238 
239  if( remainder <= 2 )
240  ix -= remainder; // truncate to the near number
241  else if( remainder >= 8 )
242  ix += 10 - remainder; // round to near number
243 
244  if ( x < 0 )
245  ix = -ix;
246 
247  return (double) ix / precision;
248 }
static int KiROUND(double v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: common.h:121
wxString numEval::SearchHelpFileFullPath ( const SEARCH_STACK aSearchStack,
const wxString &  aBaseName 
)

Return the help file's full path.

Return the KiCad help file with path and extension. Help files can be html (.html ext) or pdf (.pdf ext) files. A <BaseName>.html file is searched and if not found, <BaseName>.pdf file is searched in the same path. If the help file for the current locale is not found, an attempt to find the English version of the help file is made. Help file is searched in directories in this order: help/<canonical name> like help/en_GB help/<short name> like help/en help/en

Parameters
aSearchStackcontains some possible base dirs that may be above the the one actually holding aBaseName. These are starting points for nested searches.
aBaseNameis the name of the help file to search for,

without extension

.

Returns
wxEmptyString is returned if aBaseName is not found, else the full path & filename.

Definition at line 67 of file searchhelpfilefullpath.cpp.

Referenced by EDA_BASE_FRAME::GetKicadHelp().

68 {
69  wxArrayString subdirs;
70  wxArrayString altsubdirs;
71  SEARCH_STACK ss = aSStack;
72 
73  // It might already be in aSStack, but why depend on other code
74  // far away when it's so easy to add it again (to our copy) as the first place to look.
75 
76  // This is CMAKE_INSTALL_PREFIX unless DEFAULT_INSTALL_PATH was defined during
77  // build configuration:
78  ss.AddPaths( wxT( DEFAULT_INSTALL_PATH ), 0 );
79 
80 #if defined(__WXMAC__)
81  ss.AddPaths( GetOSXKicadMachineDataDir() );
82  ss.AddPaths( Pgm().GetExecutablePath(), 0 );
83 
84  // OS X packages can have the help files in
85  // /Library/Application\ Support/kicad/help,
86  // and in Contents/SharedSupport/help inside the
87  // bundle.
88  // Below we account for an international subdirectory.
89  subdirs.Add( "help" );
90  altsubdirs.Add( "Contents" );
91  altsubdirs.Add( "SharedSupport" );
92  altsubdirs.Add( "help" );
93 #endif
94 
95 #if ! defined(__WXMAC__) // && defined(__linux__)
96  // This is the executable path minus the trailing bin directory used on Windows and Linux.
97  wxFileName tmp( Pgm().GetExecutablePath(), wxEmptyString );
98  wxArrayString binDirs = tmp.GetDirs();
99 
100  if( !binDirs.IsEmpty() && binDirs[ binDirs.GetCount() - 1 ].CmpNoCase( wxT( "bin" ) ) == 0 )
101  tmp.RemoveLastDir();
102 
103  ss.AddPaths( tmp.GetPath(), 0 );
104 
105  // Based on kicad-doc.bzr/CMakeLists.txt, line 20, the help files are
106  // installed into "<CMAKE_INSTALL_PREFIX>/share/doc/kicad/help" for linux.
107  // This is ${KICAD_HELP} var in that CMakeLists.txt file.
108  // Below we account for an international subdirectory.
109  subdirs.Add( "share" );
110  subdirs.Add( "doc" );
111  subdirs.Add( "kicad" );
112  subdirs.Add( "help" );
113 
114  // Based on kicad-doc.bzr/CMakeLists.txt, line 35, the help files are
115  // installed into "<CMAKE_INSTALL_PREFIX>/doc/help" for Windows.
116  // This is ${KICAD_HELP} var in that CMakeLists.txt file.
117  // Below we account for an international subdirectory.
118  altsubdirs.Add( "doc" );
119  altsubdirs.Add( "help" );
120 #endif
121 
122  // If there's a KICAD environment variable set, always use that guy's path first.
123  if( !Pgm().GetKicadEnvVariable().IsEmpty() )
124  ss.AddPaths( Pgm().GetKicadEnvVariable(), 0 );
125 
126  /* Search for a help file.
127  * we *must* find a help file.
128  * so help is searched in directories in this order:
129  * help/<canonical name> like help/en_GB
130  * help/<short name> like help/en
131  * help/en
132  */
133 
134  wxLocale* i18n = Pgm().GetLocale();
135 
136  // We try to find help file in help/<canonical name>
137  // If fails, try to find help file in help/<short canonical name>
138  // If fails, try to find help file in help/en
139  wxArrayString locale_name_dirs;
140  locale_name_dirs.Add( i18n->GetCanonicalName() ); // canonical name like fr_FR
141 
142  // wxLocale::GetName() does not return always the short name
143  locale_name_dirs.Add( i18n->GetName().BeforeLast( '_' ) ); // short canonical name like fr
144  locale_name_dirs.Add( "en" ); // default (en)
145 
146 #if defined(DEBUG) && 1
147  ss.Show( wxString( __func__ ) );
148  wxLogTrace( tracePathsAndFiles, "%s: m_help_file:'%s'", __func__, aBaseName );
149 #endif
150 
151  wxLogTrace( tracePathsAndFiles, "Checking SEARCH_STACK for file %s", aBaseName );
152 
153  // Help files can be html (.html ext) or pdf (.pdf ext) files.
154  // Therefore, <BaseName>.html file is searched and if not found,
155  // <BaseName>.pdf file is searched in the same paths
156  wxString fn;
157 
158  for( unsigned ii = 0; ii < locale_name_dirs.GetCount(); ii++ )
159  {
160  subdirs.Add( locale_name_dirs[ii] );
161  altsubdirs.Add( locale_name_dirs[ii] );
162 
163  fn = FindFileInSearchPaths( ss, aBaseName + wxT( ".html" ), &altsubdirs );
164 
165  if( !fn.IsEmpty() )
166  {
167  // Prepend URI protocol since we will open in a browser
168  fn = wxT( "file://" ) + fn;
169  break;
170  }
171 
172  fn = FindFileInSearchPaths( ss, aBaseName + wxT( ".pdf" ), &altsubdirs );
173 
174  if( !fn.IsEmpty() )
175  break;
176 
177  fn = FindFileInSearchPaths( ss, aBaseName + wxT( ".html" ), &subdirs );
178 
179  if( !fn.IsEmpty() )
180  {
181  // Prepend URI protocol since we will open in a browser
182  fn = wxT( "file://" ) + fn;
183  break;
184  }
185 
186  fn = FindFileInSearchPaths( ss, aBaseName + wxT( ".pdf" ), &subdirs );
187 
188  if( !fn.IsEmpty() )
189  break;
190 
191  subdirs.RemoveAt( subdirs.GetCount() - 1 );
192  altsubdirs.RemoveAt( altsubdirs.GetCount() - 1 );
193  }
194 
195  return fn;
196 }
const wxChar *const tracePathsAndFiles
Flag to enable path and file name debug output.
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:66
Class SEARCH_STACK looks for files in a number of places.
Definition: search_stack.h:41
VTBL_ENTRY wxLocale * GetLocale()
Definition: pgm_base.h:219
wxString FindFileInSearchPaths(const SEARCH_STACK &aStack, const wxString &aFilename, const wxArrayString *aSubdirs)
Function FindFileInSearchPaths looks in "this" for aFilename, but first modifies every search path by...
void AddPaths(const wxString &aPaths, int aIndex=-1)
Function AddPaths insert or append path(s)
void numEval::SelectReferenceNumber ( wxTextEntry *  aTextEntry)

Select the number (or "?") in a reference for ease of editing.

Definition at line 155 of file common.cpp.

156 {
157  wxString ref = aTextEntry->GetValue();
158 
159  if( ref.find_first_of( '?' ) != ref.npos )
160  {
161  aTextEntry->SetSelection( ref.find_first_of( '?' ), ref.find_last_of( '?' ) + 1 );
162  }
163  else
164  {
165  wxString num = ref;
166 
167  while( !num.IsEmpty() && ( !isdigit( num.Last() ) || !isdigit( num.GetChar( 0 ) ) ) )
168  {
169  if( !isdigit( num.Last() ) )
170  num.RemoveLast();
171  if( !isdigit( num.GetChar ( 0 ) ) )
172  num = num.Right( num.Length() - 1);
173  }
174 
175  aTextEntry->SetSelection( ref.Find( num ), ref.Find( num ) + num.Length() );
176 
177  if( num.IsEmpty() )
178  aTextEntry->SetSelection( -1, -1 );
179  }
180 }
void numEval::SetAlpha ( EDA_COLOR_T aColor,
unsigned char  aBlend 
)
inline

Function SetAlpha ORs in the alpha blend parameter in to a color index.

Definition at line 124 of file numeric_evaluator.cpp.

127  {
128  m_parseFinished = true;
129  return true;
130  }
template<typename T >
int numEval::sign ( val)

Definition at line 45 of file numeric_evaluator.cpp.

47 {
48  struct lconv* lc = localeconv();
wxString numEval::StringFromValue ( EDA_UNITS_T  aUnit,
int  aValue,
bool  aAddUnitSymbol = false,
bool  aUseMils = false 
)

Function StringFromValue returns the string from aValue according to units (inch, mm ...) for display, and the initial unit for value.

For readability, the mantissa has 3 or more digits (max 8 digits), the trailing 0 are removed if the mantissa has more than 3 digits and some trailing 0 This function should be used to display values in dialogs because a value entered in mm (for instance 2.0 mm) could need up to 8 digits mantissa if displayed in inch to avoid truncation or rounding made just by the printf function. otherwise the actual value is rounded when read from dialog and converted in internal units, and therefore modified.

Parameters
aUnit= display units (INCHES, MILLIMETRE ..)
aValue= value in Internal_Unit
aAddUnitSymbol= true to add symbol unit to the string value
aUseMilsIndicates mils should be used for imperial units (inches).
Returns
A wxString object containing value and optionally the symbol unit (like 2.000 mm)
void numEval::StripTrailingZeros ( wxString &  aStringValue,
unsigned  aTrailingZeroAllowed = 1 
)

Function StripTrailingZeros Remove trailing 0 from a string containing a converted float number.

The trailing 0 are removed if the mantissa has more than aTrailingZeroAllowed digits and some trailing 0

Definition at line 178 of file base_units.cpp.

179 {
180  struct lconv * lc = localeconv();
181  char sep = lc->decimal_point[0];
182  unsigned sep_pos = aStringValue.Find( sep );
183 
184  if( sep_pos > 0 )
185  {
186  // We want to keep at least aTrailingZeroAllowed digits after the separator
187  unsigned min_len = sep_pos + aTrailingZeroAllowed + 1;
188 
189  while( aStringValue.Len() > min_len )
190  {
191  if( aStringValue.Last() == '0' )
192  aStringValue.RemoveLast();
193  else
194  break;
195  }
196  }
197 }
int numEval::StrPrintf ( std::string *  aResult,
const char *  aFormat,
  ... 
)

Function StrPrintf is like sprintf() but the output is appended to a std::string instead of to a character array.

Parameters
aResultis the string to append to, previous text is not clear()ed.
aFormatis a printf() style format string.
Returns
int - the count of bytes appended to the result string, no terminating nul is included.

Definition at line 74 of file richio.cpp.

Referenced by checkConnectedTo(), fmt_mask(), GITHUB_PLUGIN::FootprintDelete(), GITHUB_PLUGIN::FootprintSave(), PCB_IO::format(), FormatProbeItem(), GenCADLayerName(), GenCADLayerNameFlipped(), PCB_PARSER::init(), GENDRILL_WRITER_BASE::layerName(), SCH_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::OpenProjectFiles(), GITHUB_GETLIBLIST::remoteGetJSON(), GITHUB_PLUGIN::remoteGetZip(), ReplaceIllegalFileNameChars(), SCH_EDIT_FRAME::SendCrossProbeNetName(), PCB_EDIT_FRAME::SendCrossProbeNetName(), and CVPCB_MAINFRAME::SendMessageToEESCHEMA().

75 {
76  va_list args;
77 
78  va_start( args, format );
79  int ret = vprint( result, format, args );
80  va_end( args );
81 
82  return ret;
83 }
static int vprint(std::string *result, const char *format, va_list ap)
Definition: richio.cpp:38
std::string numEval::StrPrintf ( const char *  format,
  ... 
)

Function StrPrintf is like sprintf() but the output is returned in a std::string instead of to a character array.

Parameters
formatis a printf() style format string.
Returns
std::string - the result of the sprintf().

Definition at line 86 of file richio.cpp.

87 {
88  std::string ret;
89  va_list args;
90 
91  va_start( args, format );
92  int ignore = vprint( &ret, format, args );
93  (void) ignore;
94  va_end( args );
95 
96  return ret;
97 }
static int vprint(std::string *result, const char *format, va_list ap)
Definition: richio.cpp:38
long long numEval::TimestampDir ( const wxString &  aDirPath,
const wxString &  aFilespec 
)

A copy of ConvertFileTimeToWx() because wxWidgets left it as a static function private to src/common/filename.cpp.

TimestampDir

This routine offers SIGNIFICANT performance benefits over using wxWidgets to gather timestamps from matching files in a directory.

Parameters
aDirPaththe directory to search
aFilespeca (wildcarded) file spec to match against
Returns
a hash of the last-mod-dates of all matching files in the directory

Definition at line 803 of file common.cpp.

804 {
805  long long timestamp = 0;
806 
807 #if defined(__WIN32__)
808  // Win32 version.
809  // Save time by not searching for each path twice: once in wxDir.GetNext() and once in
810  // wxFileName.GetModificationTime(). Also cuts out wxWidgets' string-matching and case
811  // conversion by staying on the MSW side of things.
812  std::wstring filespec( aDirPath.t_str() );
813  filespec += '\\';
814  filespec += aFilespec.t_str();
815 
816  WIN32_FIND_DATA findData;
817  wxDateTime lastModDate;
818 
819  HANDLE fileHandle = ::FindFirstFile( filespec.data(), &findData );
820 
821  if( fileHandle != INVALID_HANDLE_VALUE )
822  {
823  do
824  {
825  ConvertFileTimeToWx( &lastModDate, findData.ftLastWriteTime );
826  timestamp += lastModDate.GetValue().GetValue();
827  }
828  while ( FindNextFile( fileHandle, &findData ) != 0);
829  }
830 
831  FindClose( fileHandle );
832 #else
833  // POSIX version.
834  // Save time by not converting between encodings -- do everything on the file-system side.
835  std::string filespec( aFilespec.fn_str() );
836  std::string dir_path( aDirPath.fn_str() );
837 
838  DIR* dir = opendir( dir_path.c_str() );
839 
840  if( dir )
841  {
842  for( dirent* dir_entry = readdir( dir ); dir_entry; dir_entry = readdir( dir ) )
843  {
844  if( !matchWild( filespec.c_str(), dir_entry->d_name, true ) )
845  continue;
846 
847  std::string entry_path = dir_path + '/' + dir_entry->d_name;
848  struct stat entry_stat;
849 
850  wxCRT_Lstat( entry_path.c_str(), &entry_stat );
851 
852  // Timestamp the source file, not the symlink
853  if( S_ISLNK( entry_stat.st_mode ) ) // wxFILE_EXISTS_SYMLINK
854  {
855  char buffer[ PATH_MAX + 1 ];
856  ssize_t pathLen = readlink( entry_path.c_str(), buffer, PATH_MAX );
857 
858  if( pathLen > 0 )
859  {
860  buffer[ pathLen ] = '\0';
861  entry_path = dir_path + buffer;
862 
863  wxCRT_Lstat( entry_path.c_str(), &entry_stat );
864  }
865  }
866 
867  if( S_ISREG( entry_stat.st_mode ) ) // wxFileExists()
868  timestamp += entry_stat.st_mtime * 1000;
869  }
870 
871  closedir( dir );
872  }
873 #endif
874 
875  return timestamp;
876 }
bool matchWild(const char *pat, const char *text, bool dot_special)
A copy of wxMatchWild(), which wxWidgets attributes to Douglas A.
Definition: common.cpp:667
double numEval::To_User_Unit ( EDA_UNITS_T  aUnit,
double  aValue,
bool  aUseMils = false 
)

Function To_User_Unit convert aValue in internal units to the appropriate user units defined by aUnit.

Returns
The converted value, in double
Parameters
aUnitThe units to convert aValue to.
aValueThe value in internal units to convert.
aUseMilsIndicates mils should be used for imperial units (inches).
int numEval::ValueFromString ( EDA_UNITS_T  aUnits,
const wxString &  aTextValue,
bool  aUseMils = false 
)

Function ValueFromString converts aTextValue in aUnits to internal units used by the application.

Parameters
aUnitsThe units of aTextValue.
aTextValueA reference to a wxString object containing the string to convert.
aUseMilsIndicates mils should be used for imperial units (inches).
Returns
The string from Value, according to units (inch, mm ...) for display,
void numEval::wxStringSplit ( const wxString &  aText,
wxArrayString &  aStrings,
wxChar  aSplitter 
)

Split aString to a string list separated at aSplitter.

Parameters
aTextis the text to split
aStringswill contain the splitted lines
aSplitteris the 'split' character

Definition at line 183 of file common.cpp.

184 {
185  wxString tmp;
186 
187  for( unsigned ii = 0; ii < aText.Length(); ii++ )
188  {
189  if( aText[ii] == aSplitter )
190  {
191  aStrings.Add( tmp );
192  tmp.Clear();
193  }
194 
195  else
196  tmp << aText[ii];
197  }
198 
199  if( !tmp.IsEmpty() )
200  {
201  aStrings.Add( tmp );
202  }
203 }
static void numEval::yy_accept ( yyParser yypParser)
static

Definition at line 832 of file numeric_evaluator.cpp.

static void numEval::yy_destructor ( yyParser yypParser,
YYCODETYPE  yymajor,
YYMINORTYPE yypminor 
)
static

Definition at line 364 of file numeric_evaluator.cpp.

367 {
368  if( m_varMap[ aString ] )
369  return m_varMap[ aString ];
370  else
371  return 0.0;
372 }
373 
static int numEval::yy_find_reduce_action ( int  stateno,
YYCODETYPE  iLookAhead 
)
static

Definition at line 519 of file numeric_evaluator.cpp.

static int numEval::yy_find_shift_action ( yyParser pParser,
YYCODETYPE  iLookAhead 
)
static

Definition at line 454 of file numeric_evaluator.cpp.

static void numEval::yy_parse_failed ( yyParser yypParser)
static

Definition at line 796 of file numeric_evaluator.cpp.

static int numEval::yy_pop_parser_stack ( yyParser pParser)
static

Definition at line 393 of file numeric_evaluator.cpp.

static void numEval::yy_reduce ( yyParser yypParser,
int  yyruleno 
)
static

Definition at line 641 of file numeric_evaluator.cpp.

static void numEval::yy_shift ( yyParser yypParser,
int  yyNewState,
int  yyMajor,
YYMINORTYPE yypMinor 
)
static

Definition at line 566 of file numeric_evaluator.cpp.

static void numEval::yy_syntax_error ( yyParser yypParser,
int  yymajor,
YYMINORTYPE  yyminor 
)
static

Definition at line 815 of file numeric_evaluator.cpp.

static void numEval::yyStackOverflow ( yyParser yypParser,
YYMINORTYPE yypMinor 
)
static

Definition at line 549 of file numeric_evaluator.cpp.

Variable Documentation

const StructColors numEval::g_ColorRefs[NBCOLORS]

list of existing Colors

list of existing Colors

Please: if you change a value, remember these values are carefully chosen to have good results in Pcbnew, that uses the ORed value of basic colors when displaying superimposed objects This list must have exactly NBCOLORS items

Definition at line 37 of file colors.cpp.

KIGFX::COLOR4D numEval::g_GhostColor

Draw color for moving objects.

Draw color for moving objects.

TODO: All of these variables should be moved into the class were they are defined and used. Most of them probably belong in the application class.

Definition at line 57 of file common.cpp.

unsigned char numEval::nrhs

Definition at line 614 of file numeric_evaluator.cpp.

const YYACTIONTYPE numEval::yy_action[]
static
Initial value:
= {
24, 9, 8, 23, 6, 7, 25, 28, 17, 16,
17, 4, 5, 4, 5, 3, 26, 22, 2, 22,
2, 9, 8, 23, 6, 7, 47, 17, 15, 19,
4, 5, 21, 20, 47, 26, 22, 2, 27, 10,
9, 8, 23, 6, 7, 46, 1, 18, 10, 23,
6, 7, 47, 47, 14, 13, 12, 11,
}

Definition at line 147 of file numeric_evaluator.cpp.

const YYACTIONTYPE numEval::yy_default[]
static
Initial value:
= {
45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
45, 45, 39, 37, 36, 41, 40, 38, 29, 44,
43, 42, 34, 35, 33, 32, 31, 30,
}

Definition at line 178 of file numeric_evaluator.cpp.

const YYCODETYPE numEval::yy_lookahead[]
static
Initial value:
= {
3, 4, 5, 6, 7, 8, 9, 0, 1, 17,
1, 4, 5, 4, 5, 2, 9, 10, 11, 10,
11, 4, 5, 6, 7, 8, 18, 1, 17, 12,
4, 5, 17, 17, 18, 9, 10, 11, 16, 17,
4, 5, 6, 7, 8, 14, 15, 16, 17, 6,
7, 8, 18, 18, 17, 17, 17, 17,
}

Definition at line 155 of file numeric_evaluator.cpp.

const signed char numEval::yy_reduce_ofst[]
static
Initial value:
= {
31, 22, 40, 39, 38, 37, 16, 15, 11, -8,
}

Definition at line 175 of file numeric_evaluator.cpp.

const signed char numEval::yy_shift_ofst[]
static
Initial value:
= {
26, 7, 9, 9, 9, 9, 9, 9, 9, 9,
-3, 17, 36, 43, 43, 43, 43, 13,
}

Definition at line 167 of file numeric_evaluator.cpp.

const { ... } numEval::yyRuleInfo[]
Initial value:
= {
{ 14, 1 },
{ 15, 1 },
{ 15, 2 },
{ 16, 1 },
{ 16, 2 },
{ 16, 2 },
{ 17, 1 },
{ 17, 2 },
{ 17, 2 },
{ 17, 2 },
{ 17, 1 },
{ 17, 3 },
{ 17, 3 },
{ 17, 3 },
{ 17, 3 },
{ 17, 3 },
{ 17, 3 },
}
const char* const numEval::yyRuleName[]
static
Initial value:
= {
"main ::= in",
"in ::= stmt",
"in ::= in stmt",
"stmt ::= ENDS",
"stmt ::= expr ENDS",
"stmt ::= expr SEMCOL",
"expr ::= VALUE",
"expr ::= expr UNIT",
"expr ::= MINUS expr",
"expr ::= PLUS expr",
"expr ::= VAR",
"expr ::= VAR ASSIGN expr",
"expr ::= expr PLUS expr",
"expr ::= expr MINUS expr",
"expr ::= expr MULT expr",
"expr ::= expr DIVIDE expr",
"expr ::= PARENL expr PARENR",
}

Definition at line 285 of file numeric_evaluator.cpp.

const char* const numEval::yyTokenName[]
static
Initial value:
= {
"$", "VAR", "ASSIGN", "SEMCOL",
"PLUS", "MINUS", "UNIT", "DIVIDE",
"MULT", "ENDS", "VALUE", "PARENL",
"PARENR", "error", "main", "in",
"stmt", "expr",
}

Definition at line 273 of file numeric_evaluator.cpp.

FILE* numEval::yyTraceFILE = 0
static

Definition at line 240 of file numeric_evaluator.cpp.

char* numEval::yyTracePrompt = 0
static

Definition at line 241 of file numeric_evaluator.cpp.

const YYMINORTYPE numEval::yyzerominor = { 0 }
static

Definition at line 84 of file numeric_evaluator.cpp.