Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::CSVStateMachine Class Reference
Collaboration diagram for duckdb::CSVStateMachine:

Public Member Functions

 CSVStateMachine (CSVReaderOptions &options_p, const CSVStateMachineOptions &state_machine_options, CSVStateMachineCache &csv_state_machine_cache_p)
 CSVStateMachine (const StateMachine &transition_array, const CSVReaderOptions &options)
void Transition (CSVStates &states, char current_char) const
 Transition all states to next state, that depends on the current char.
void Print () const

Public Attributes

const StateMachine & transition_array
const CSVStateMachineOptions state_machine_options
 Options of this state machine.
const CSVReaderOptions & options
 CSV Reader Options.
DialectOptions dialect_options
 Dialect options resulting from sniffing.

Detailed Description

The CSV State Machine comprises a state transition array (STA). The STA indicates the current state of parsing based on both the current and preceding characters. This reveals whether we are dealing with a Field, a New Line, a Delimiter, and so forth. The STA's creation depends on the provided quote, character, and delimiter options for that state machine. The motivation behind implementing an STA is to remove branching in regular CSV parsing by predicting and detecting the states. Note: The State Machine is currently utilized solely in the CSV Sniffer.

Constructor & Destructor Documentation

◆ CSVStateMachine() [1/2]

duckdb::CSVStateMachine::CSVStateMachine ( CSVReaderOptions & options_p,
const CSVStateMachineOptions & state_machine_options,
CSVStateMachineCache & csv_state_machine_cache_p )
explicit
174029 : transition_array(csv_state_machine_cache.Get(state_machine_options_p)),
174030 state_machine_options(state_machine_options_p), options(options_p) {
174031 dialect_options.state_machine_options = state_machine_options;
174032}
const CSVReaderOptions & options
CSV Reader Options.
Definition duckdb.cpp:166027
const StateMachine & transition_array
Definition duckdb.cpp:166023
const CSVStateMachineOptions state_machine_options
Options of this state machine.
Definition duckdb.cpp:166025
DialectOptions dialect_options
Dialect options resulting from sniffing.
Definition duckdb.cpp:166029

◆ CSVStateMachine() [2/2]

duckdb::CSVStateMachine::CSVStateMachine ( const StateMachine & transition_array,
const CSVReaderOptions & options )
explicit
174035 : transition_array(transition_array_p), state_machine_options(options_p.dialect_options.state_machine_options),
174036 options(options_p), dialect_options(options.dialect_options) {
174037 dialect_options.state_machine_options = state_machine_options;
174038}

Member Function Documentation

◆ Transition()

void duckdb::CSVStateMachine::Transition ( CSVStates & states,
char current_char ) const
inline

Transition all states to next state, that depends on the current char.

166008 {
166009 states.states[0] = states.states[1];
166010 states.states[1] = transition_array[static_cast<uint8_t>(current_char)][static_cast<uint8_t>(states.states[1])];
166011 }
::uint8_t uint8_t

◆ Print()

void duckdb::CSVStateMachine::Print ( ) const
inline
166013 {
166014 Printer::Print(OutputStream::STREAM_STDOUT, string("State Machine Options"));
166015 Printer::Print(OutputStream::STREAM_STDOUT, string("Delim: ") + state_machine_options.delimiter.FormatValue());
166016 Printer::Print(OutputStream::STREAM_STDOUT, string("Quote: ") + state_machine_options.quote.FormatValue());
166017 Printer::Print(OutputStream::STREAM_STDOUT, string("Escape: ") + state_machine_options.escape.FormatValue());
166018 Printer::Print(OutputStream::STREAM_STDOUT, string("Comment: ") + state_machine_options.comment.FormatValue());
166019 Printer::Print(OutputStream::STREAM_STDOUT, string("---------------------"));
166020 }
static DUCKDB_API void Print(OutputStream stream, const string &str)
Print the object to the stream.
Definition duckdb.cpp:92556

Member Data Documentation

◆ transition_array

const StateMachine& duckdb::CSVStateMachine::transition_array

The Transition Array is a Finite State Machine It holds the transitions of all states, on all 256 possible different characters


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