|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
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 |
|
inlineexplicit |
|
inline |
Definition at line 113 of file Lexer.cpp.
Referenced by handleLineStart(), and lexToken().
|
inline |
Measure one line's indentation and emit INDENT/DEDENT.
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().
|
inline |
Definition at line 259 of file Lexer.cpp.
References a, fsw::script::Assign, b, fsw::script::BadNumber, ch(), col, fsw::script::Colon, fsw::script::Comma, fsw::script::Eof, fsw::script::EqEq, fail(), fsw::script::Ge, fsw::script::Gt, i, fsw::script::anonymous_namespace{Lexer.cpp}::identChar(), fsw::script::anonymous_namespace{Lexer.cpp}::identStart(), fsw::script::anonymous_namespace{Lexer.cpp}::keywordOf(), fsw::script::Le, line, fsw::script::LParen, fsw::script::Lt, fsw::script::Minus, fsw::script::Ne, fsw::script::Number, peek(), fsw::script::Plus, push(), fsw::script::RParen, fsw::script::Slash, src, fsw::script::Star, start(), and fsw::script::UnexpectedChar.
Referenced by run().
|
inline |
|
inline |
Definition at line 120 of file Lexer.cpp.
Referenced by handleLineStart(), lexToken(), and run().
|
inline |
Definition at line 136 of file Lexer.cpp.
References col, fsw::script::Dedent, fsw::script::Eof, failed, handleLineStart(), i, indents, lexToken(), line, fsw::script::Newline, out, peek(), push(), and src.
| 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().
| 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().
| 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().
| 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().
| 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().
| LexResult fsw::script::anonymous_namespace{Lexer.cpp}::Lexer::out |
Definition at line 100 of file Lexer.cpp.
Referenced by fail(), run(), test_injector_layout.TestOldFlatDesigns::test_calls_out_the_thin_lox_web(), test_injector_layout.TestChannels::test_channel_flow_area_is_reported_against_the_orifices(), test_injector_layout.TestOldFlatDesigns::test_crams_every_element_onto_a_circle_narrower_than_the_throat(), test_injector_layout.TestChannels::test_drawn_passages_start_on_the_flank_and_end_on_the_floor(), test_injector_layout.TestChannels::test_flat_floor_leaves_an_acute_inlet_lip_and_no_short_wall_rule(), test_injector_layout.TestChannels::test_lands_between_are_what_is_left(), test_injector_layout.TestOldFlatDesigns::test_leaves_no_room_at_the_axis(), test_injector_layout.TestChannels::test_numbers_as_drawn(), test_injector_layout.TestChannels::test_passage_runs_its_L_over_d_to_the_channel_floor(), test_injector_layout.TestEnvelope::test_sleeve_from_the_requirements(), test_injector_layout.TestOldFlatDesigns::test_sp8089_included_angle(), and test_injector_layout.TestChannels::test_the_section_dimensions_each_channel_and_its_hole_axis_meets_it().
| 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().
| 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().