Struct parol::parser::parol_grammar::ParolGrammar
source · pub struct ParolGrammar<'t> {
pub productions: Vec<Production>,
pub title: Option<String>,
pub comment: Option<String>,
pub start_symbol: String,
pub scanner_configurations: Vec<ScannerConfig>,
pub user_type_definitions: BTreeMap<String, UserDefinedTypeName>,
pub grammar_type: GrammarType,
/* private fields */
}
Expand description
Data structure used to build up a parol::GrammarConfig during parsing.
Fields§
§productions: Vec<Production>
The parsed productions
title: Option<String>
The optional title of the grammar
comment: Option<String>
The optional comment of the grammar
start_symbol: String
The mandatory start symbol of the grammar
scanner_configurations: Vec<ScannerConfig>
All parsed scanner configurations
user_type_definitions: BTreeMap<String, UserDefinedTypeName>
User type definitions (aliases)
grammar_type: GrammarType
The grammar type
Implementations§
source§impl ParolGrammar<'_>
impl ParolGrammar<'_>
Trait Implementations§
source§impl<'t> Clone for ParolGrammar<'t>
impl<'t> Clone for ParolGrammar<'t>
source§fn clone(&self) -> ParolGrammar<'t>
fn clone(&self) -> ParolGrammar<'t>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'t> Debug for ParolGrammar<'t>
impl<'t> Debug for ParolGrammar<'t>
source§impl Default for &ParolGrammar<'_>
impl Default for &ParolGrammar<'_>
source§impl<'t> Default for ParolGrammar<'t>
impl<'t> Default for ParolGrammar<'t>
source§fn default() -> ParolGrammar<'t>
fn default() -> ParolGrammar<'t>
Returns the “default value” for a type. Read more
source§impl Display for ParolGrammar<'_>
impl Display for ParolGrammar<'_>
source§impl<'t> ParolGrammarTrait<'t> for ParolGrammar<'t>
impl<'t> ParolGrammarTrait<'t> for ParolGrammar<'t>
source§fn production(&mut self, arg: &Production<'t>) -> Result<()>
fn production(&mut self, arg: &Production<'t>) -> Result<()>
Semantic action for non-terminal ‘Production’
source§fn prolog(&mut self, _arg: &Prolog<'t>) -> Result<()>
fn prolog(&mut self, _arg: &Prolog<'t>) -> Result<()>
Semantic action for non-terminal ‘Prolog’
source§fn start_declaration(&mut self, _arg: &StartDeclaration<'t>) -> Result<()>
fn start_declaration(&mut self, _arg: &StartDeclaration<'t>) -> Result<()>
Semantic action for non-terminal ‘StartDeclaration’
source§fn declaration(&mut self, _arg: &Declaration<'t>) -> Result<()>
fn declaration(&mut self, _arg: &Declaration<'t>) -> Result<()>
Semantic action for non-terminal ‘Declaration’
source§fn scanner_directives(&mut self, _arg: &ScannerDirectives<'t>) -> Result<()>
fn scanner_directives(&mut self, _arg: &ScannerDirectives<'t>) -> Result<()>
Semantic action for non-terminal ‘ScannerDirectives’
source§fn grammar_definition(&mut self, _arg: &GrammarDefinition<'t>) -> Result<()>
fn grammar_definition(&mut self, _arg: &GrammarDefinition<'t>) -> Result<()>
Semantic action for non-terminal ‘GrammarDefinition’
source§fn double_colon(&mut self, _arg: &DoubleColon<'t>) -> Result<()>
fn double_colon(&mut self, _arg: &DoubleColon<'t>) -> Result<()>
Semantic action for non-terminal ‘DoubleColon’
source§fn alternations(&mut self, _arg: &Alternations<'t>) -> Result<()>
fn alternations(&mut self, _arg: &Alternations<'t>) -> Result<()>
Semantic action for non-terminal ‘Alternations’
source§fn alternation(&mut self, _arg: &Alternation<'t>) -> Result<()>
fn alternation(&mut self, _arg: &Alternation<'t>) -> Result<()>
Semantic action for non-terminal ‘Alternation’
source§fn factor(&mut self, _arg: &Factor<'t>) -> Result<()>
fn factor(&mut self, _arg: &Factor<'t>) -> Result<()>
Semantic action for non-terminal ‘Factor’
source§fn symbol(&mut self, _arg: &Symbol<'t>) -> Result<()>
fn symbol(&mut self, _arg: &Symbol<'t>) -> Result<()>
Semantic action for non-terminal ‘Symbol’
source§fn token_literal(&mut self, _arg: &TokenLiteral<'t>) -> Result<()>
fn token_literal(&mut self, _arg: &TokenLiteral<'t>) -> Result<()>
Semantic action for non-terminal ‘TokenLiteral’
source§fn simple_token(&mut self, _arg: &SimpleToken<'t>) -> Result<()>
fn simple_token(&mut self, _arg: &SimpleToken<'t>) -> Result<()>
Semantic action for non-terminal ‘SimpleToken’
source§fn token_with_states(&mut self, _arg: &TokenWithStates<'t>) -> Result<()>
fn token_with_states(&mut self, _arg: &TokenWithStates<'t>) -> Result<()>
Semantic action for non-terminal ‘TokenWithStates’
source§fn string(&mut self, _arg: &String<'t>) -> Result<()>
fn string(&mut self, _arg: &String<'t>) -> Result<()>
Semantic action for non-terminal ‘String’
source§fn raw_string(&mut self, _arg: &RawString<'t>) -> Result<()>
fn raw_string(&mut self, _arg: &RawString<'t>) -> Result<()>
Semantic action for non-terminal ‘RawString’
source§fn optional(&mut self, _arg: &Optional<'t>) -> Result<()>
fn optional(&mut self, _arg: &Optional<'t>) -> Result<()>
Semantic action for non-terminal ‘Optional’
source§fn repeat(&mut self, _arg: &Repeat<'t>) -> Result<()>
fn repeat(&mut self, _arg: &Repeat<'t>) -> Result<()>
Semantic action for non-terminal ‘Repeat’
source§fn non_terminal(&mut self, _arg: &NonTerminal<'t>) -> Result<()>
fn non_terminal(&mut self, _arg: &NonTerminal<'t>) -> Result<()>
Semantic action for non-terminal ‘NonTerminal’
source§fn identifier(&mut self, _arg: &Identifier<'t>) -> Result<()>
fn identifier(&mut self, _arg: &Identifier<'t>) -> Result<()>
Semantic action for non-terminal ‘Identifier’
source§fn scanner_state(&mut self, _arg: &ScannerState<'t>) -> Result<()>
fn scanner_state(&mut self, _arg: &ScannerState<'t>) -> Result<()>
Semantic action for non-terminal ‘ScannerState’
source§fn identifier_list(&mut self, _arg: &IdentifierList<'t>) -> Result<()>
fn identifier_list(&mut self, _arg: &IdentifierList<'t>) -> Result<()>
Semantic action for non-terminal ‘IdentifierList’
source§fn scanner_switch(&mut self, _arg: &ScannerSwitch<'t>) -> Result<()>
fn scanner_switch(&mut self, _arg: &ScannerSwitch<'t>) -> Result<()>
Semantic action for non-terminal ‘ScannerSwitch’
source§fn a_s_t_control(&mut self, _arg: &ASTControl) -> Result<()>
fn a_s_t_control(&mut self, _arg: &ASTControl) -> Result<()>
Semantic action for non-terminal ‘ASTControl’
source§fn cut_operator(&mut self, _arg: &CutOperator) -> Result<()>
fn cut_operator(&mut self, _arg: &CutOperator) -> Result<()>
Semantic action for non-terminal ‘CutOperator’
source§fn user_type_declaration(&mut self, _arg: &UserTypeDeclaration) -> Result<()>
fn user_type_declaration(&mut self, _arg: &UserTypeDeclaration) -> Result<()>
Semantic action for non-terminal ‘UserTypeDeclaration’
source§fn user_type_name(&mut self, _arg: &UserTypeName<'t>) -> Result<()>
fn user_type_name(&mut self, _arg: &UserTypeName<'t>) -> Result<()>
Semantic action for non-terminal ‘UserTypeName’
source§fn on_comment_parsed(&mut self, _token: Token<'t>)
fn on_comment_parsed(&mut self, _token: Token<'t>)
This method provides skipped language comments.
If you need comments please provide your own implementation of this method.
source§impl TryFrom<ParolGrammar<'_>> for GrammarConfig
impl TryFrom<ParolGrammar<'_>> for GrammarConfig
Auto Trait Implementations§
impl<'t> Freeze for ParolGrammar<'t>
impl<'t> RefUnwindSafe for ParolGrammar<'t>
impl<'t> Send for ParolGrammar<'t>
impl<'t> Sync for ParolGrammar<'t>
impl<'t> Unpin for ParolGrammar<'t>
impl<'t> UnwindSafe for ParolGrammar<'t>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)