vkdb
A time series database engine in C++.
Loading...
Searching...
No Matches
vkdb::Parser Class Reference

Parser for vq. More...

#include <parser.h>

Public Types

using size_type = uint64_t
 
using error_callback = std::function<void(const Token&, const std::string&)>
 

Public Member Functions

 Parser ()=delete
 Deleted default constructor.
 
 Parser (const std::vector< Token > &tokens, error_callback callback=[](const Token &, const std::string &) {}) noexcept
 Construct a Parser with a list of tokens and an optional error callback.
 
std::optional< Expr > parse () noexcept
 Parses the tokens into an expression.
 

Detailed Description

Parser for vq.

Definition at line 22 of file parser.h.

Member Typedef Documentation

◆ error_callback

using vkdb::Parser::error_callback = std::function<void(const Token&, const std::string&)>

Definition at line 25 of file parser.h.

◆ size_type

using vkdb::Parser::size_type = uint64_t

Definition at line 24 of file parser.h.

Constructor & Destructor Documentation

◆ Parser()

vkdb::Parser::Parser ( const std::vector< Token > & tokens,
error_callback callback = [](const Token&, const std::string&) {} )
noexcept

Construct a Parser with a list of tokens and an optional error callback.

Defaults the error callback to an empty lambda.

Parameters
tokensThe list of tokens to parse.
callbackThe error callback function.

Definition at line 5 of file parser.cpp.

Member Function Documentation

◆ parse()

std::optional< Expr > vkdb::Parser::parse ( )
nodiscardnoexcept

Parses the tokens into an expression.

Returns
An optional expression if parsing is successful.

Definition at line 11 of file parser.cpp.


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