Struct parol::generators::grammar_config::GrammarConfig [−][src]
pub struct GrammarConfig {
pub cfg: Cfg,
pub title: Option<String>,
pub comment: Option<String>,
pub scanner_configurations: Vec<ScannerConfig>,
pub lookahead_size: usize,
}
Expand description
Configuration information for a context free grammar. Currently containing comment tokens and maximum lookahead size. Can later be amended with further information and even pragmas that control the generation of lexers and parsers. Examples for amendments: * Ignore case, generate a case-insensitive lexer * Parse whitespace instead of skipping them by default * Prologue and epilogue for generated parser output
Newly added feature is to optionally switch automatic handling off newlines off.
Fields
cfg: Cfg
The actual context free grammar. It should be checked and left-factored here. For this task use the ´generators::grammar_trans::check_and_transform_grammar` function to prepare the grammar.
title: Option<String>
Title of the grammar
comment: Option<String>
Optional comment
scanner_configurations: Vec<ScannerConfig>
At least one scanner configurations
lookahead_size: usize
The maximum lookahead size, used for lexer generation
Implementations
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for GrammarConfig
impl Send for GrammarConfig
impl Sync for GrammarConfig
impl Unpin for GrammarConfig
impl UnwindSafe for GrammarConfig
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.