STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
fsw::script::anonymous_namespace{Lexer.cpp}::Lexer Struct Reference
Collaboration diagram for fsw::script::anonymous_namespace{Lexer.cpp}::Lexer:
[legend]

Public Member Functions

 Lexer (const std::string &s)
void fail (Diag code, uint32_t l, uint32_t c, std::string msg)
void push (Tok k, uint32_t l, uint32_t c, uint32_t len, std::string text={}, double num=0.0)
char peek (size_t off=0) const
void run ()
bool handleLineStart (bool &at_line_start)
 Measure one line's indentation and emit INDENT/DEDENT.
bool lexToken ()

Public Attributes

const std::string & src
LexResult out
size_t i = 0
uint32_t line = 1
uint32_t col = 1
std::vector< uint32_t > indents {0}
 Column stack for open blocks; [0] is always 0.
uint32_t unit = 0
 Set by the first indented line; every later indent must be a multiple of it.
bool failed = false

Detailed Description

Definition at line 98 of file Lexer.cpp.

Constructor & Destructor Documentation

◆ Lexer()

fsw::script::anonymous_namespace{Lexer.cpp}::Lexer::Lexer ( const std::string & s)
inlineexplicit

Definition at line 110 of file Lexer.cpp.

References src.

Member Function Documentation

◆ fail()

void fsw::script::anonymous_namespace{Lexer.cpp}::Lexer::fail ( Diag code,
uint32_t l,
uint32_t c,
std::string msg )
inline

Definition at line 113 of file Lexer.cpp.

References failed, and out.

Referenced by handleLineStart(), and lexToken().

◆ handleLineStart()

bool fsw::script::anonymous_namespace{Lexer.cpp}::Lexer::handleLineStart ( bool & at_line_start)
inline

Measure one line's indentation and emit INDENT/DEDENT.

Returns
false on a hard error. Sets at_line_start=false when real content follows.

Definition at line 186 of file Lexer.cpp.

References fsw::script::BadDedent, fsw::script::BadIndentUnit, col, fsw::script::Dedent, fail(), i, fsw::script::Indent, indents, fsw::script::kMaxIndentUnit, line, push(), src, fsw::script::TabIndent, and unit.

Referenced by run().

◆ lexToken()

◆ peek()

char fsw::script::anonymous_namespace{Lexer.cpp}::Lexer::peek ( size_t off = 0) const
inline

Definition at line 132 of file Lexer.cpp.

References i, and src.

Referenced by lexToken(), and run().

◆ push()

void fsw::script::anonymous_namespace{Lexer.cpp}::Lexer::push ( Tok k,
uint32_t l,
uint32_t c,
uint32_t len,
std::string text = {},
double num = 0.0 )
inline

Definition at line 120 of file Lexer.cpp.

Referenced by handleLineStart(), lexToken(), and run().

◆ run()

void fsw::script::anonymous_namespace{Lexer.cpp}::Lexer::run ( )
inline

Member Data Documentation

◆ col

uint32_t fsw::script::anonymous_namespace{Lexer.cpp}::Lexer::col = 1

Definition at line 103 of file Lexer.cpp.

Referenced by handleLineStart(), lexToken(), and run().

◆ failed

bool fsw::script::anonymous_namespace{Lexer.cpp}::Lexer::failed = false

Definition at line 108 of file Lexer.cpp.

Referenced by test_ota_flash.Results::check(), fail(), and run().

◆ i

size_t fsw::script::anonymous_namespace{Lexer.cpp}::Lexer::i = 0

Definition at line 101 of file Lexer.cpp.

Referenced by handleLineStart(), lexToken(), peek(), and run().

◆ indents

std::vector<uint32_t> fsw::script::anonymous_namespace{Lexer.cpp}::Lexer::indents {0}

Column stack for open blocks; [0] is always 0.

Definition at line 105 of file Lexer.cpp.

Referenced by handleLineStart(), and run().

◆ line

uint32_t fsw::script::anonymous_namespace{Lexer.cpp}::Lexer::line = 1

Definition at line 102 of file Lexer.cpp.

Referenced by handleLineStart(), lexToken(), and run().

◆ out

◆ src

const std::string& fsw::script::anonymous_namespace{Lexer.cpp}::Lexer::src

Definition at line 99 of file Lexer.cpp.

Referenced by handleLineStart(), Lexer(), lexToken(), peek(), and run().

◆ unit

uint32_t fsw::script::anonymous_namespace{Lexer.cpp}::Lexer::unit = 0

Set by the first indented line; every later indent must be a multiple of it.

0 = unset.

Definition at line 107 of file Lexer.cpp.

Referenced by handleLineStart().


The documentation for this struct was generated from the following file:
  • daq-server/diablo_server/lib/src/script/Lexer.cpp