A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
Loading...
Searching...
No Matches
pattern.h File Reference
#include <cstddef>
#include <optional>
#include <string>
#include <string_view>
#include <vector>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  a11::flow::pattern::Hole
 One capture position in a pattern. More...
 
struct  a11::flow::pattern::Pattern
 A compiled pattern: literals and holes, in the order they were written. More...
 
struct  a11::flow::pattern::Pattern::Piece
 
struct  a11::flow::pattern::Compiled
 A pattern, or what is wrong with the text it was written as. More...
 
struct  a11::flow::pattern::Capture
 What one hole took: a view into the subject that was matched. More...
 

Namespaces

namespace  a11
 
namespace  a11::flow
 
namespace  a11::flow::pattern
 

Enumerations

enum class  a11::flow::pattern::HoleType {
  a11::flow::pattern::kString , a11::flow::pattern::kInt , a11::flow::pattern::kNumber , a11::flow::pattern::kBool ,
  a11::flow::pattern::kWord , a11::flow::pattern::kLine , a11::flow::pattern::kRest , a11::flow::pattern::kDuration ,
  a11::flow::pattern::kTime , a11::flow::pattern::kJson
}
 The pattern language match reads: literal text and named holes. More...
 

Functions

std::string_view a11::flow::pattern::HoleTypeName (HoleType type)
 
std::optional< HoleType > a11::flow::pattern::HoleTypeFromName (std::string_view name)
 The type that name spells, or nothing where it is not one of them.
 
Compiled a11::flow::pattern::Compile (std::string_view text)
 Compile a pattern, saying what is wrong rather than throwing.
 
std::optional< std::vector< Capture > > a11::flow::pattern::Match (const Pattern &pattern, std::string_view subject)
 Match pattern anywhere in subject, taking the earliest fit.