KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dsnlexer.cpp File Reference
#include <charconv>
#include <cstdarg>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <dsnlexer.h>
#include <wx/translation.h>

Go to the source code of this file.

Macros

#define FMT_CLIPBOARD   _( "clipboard" )
 

Functions

static bool isSpace (char cc)
 Test for whitespace.
 
bool isDigit (char cc)
 
bool isSep (char cc)
 
static bool isNumber (const char *cp, const char *limit)
 Return true if the next sequence of text is a number: either an integer, fixed point, or float with exponent.
 

Variables

static const KEYWORD empty_keywords [1] = {}
 

Macro Definition Documentation

◆ FMT_CLIPBOARD

#define FMT_CLIPBOARD   _( "clipboard" )

Definition at line 34 of file dsnlexer.cpp.

Function Documentation

◆ isDigit()

bool isDigit ( char  cc)
inline
Returns
true if cc is an s-expression separator character.

Definition at line 458 of file dsnlexer.cpp.

Referenced by isNumber(), and NET_SETTINGS::ParseBusVector().

◆ isNumber()

static bool isNumber ( const char *  cp,
const char *  limit 
)
static

Return true if the next sequence of text is a number: either an integer, fixed point, or float with exponent.

Stops scanning at the first non-number character, even if it is not whitespace.

Parameters
cpis the start of the current token.
limitis the end of the current token.
Returns
true if input token is a number, else false.

Definition at line 480 of file dsnlexer.cpp.

References isDigit().

Referenced by DSNLEXER::NextTok().

◆ isSep()

bool isSep ( char  cc)
inline

Definition at line 465 of file dsnlexer.cpp.

References isSpace().

Referenced by DSNLEXER::NextTok().

◆ isSpace()

static bool isSpace ( char  cc)
static

Test for whitespace.

Our whitespace, by our definition, is a subset of ASCII, i.e. no bytes with MSB on can be considered whitespace, since they are likely part of a multibyte UTF8 character.

Definition at line 437 of file dsnlexer.cpp.

Referenced by isSep(), PCB_IO_KICAD_LEGACY::loadPAD(), and DSNLEXER::NextTok().

Variable Documentation

◆ empty_keywords

const KEYWORD empty_keywords[1] = {}
static

Definition at line 109 of file dsnlexer.cpp.