SciLex
A header-only C++20 lexer built on REAL
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
scilex::grammar Struct Reference

A parsed grammar: the rules in order, and each rule's name (index = the rule's kind). More...

#include <grammar.hpp>

Public Member Functions

std::string_view name (int kind) const noexcept
 The name of kind, or "?" for a kind no rule of this grammar has (a reserved kind such as error).
 

Public Attributes

std::vector< rule > rules
 The rules, kind i at index i.
 
std::vector< std::string > names
 The name of kind i.
 

Detailed Description

A parsed grammar: the rules in order, and each rule's name (index = the rule's kind).

Member Function Documentation

◆ name()

std::string_view scilex::grammar::name ( int  kind) const
inlinenoexcept

The name of kind, or "?" for a kind no rule of this grammar has (a reserved kind such as error).

Parameters
[in]kindA token kind.
Returns
Its name.

Member Data Documentation

◆ names

std::vector<std::string> scilex::grammar::names

The name of kind i.

◆ rules

std::vector<rule> scilex::grammar::rules

The rules, kind i at index i.


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