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<'_>

source

pub fn new() -> Self

Constructs a new item

Trait Implementations§

source§

impl<'t> Clone for ParolGrammar<'t>

source§

fn clone(&self) -> ParolGrammar<'t>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'t> Debug for ParolGrammar<'t>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for &ParolGrammar<'_>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'t> Default for ParolGrammar<'t>

source§

fn default() -> ParolGrammar<'t>

Returns the “default value” for a type. Read more
source§

impl Display for ParolGrammar<'_>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<'t> ParolGrammarTrait<'t> for ParolGrammar<'t>

source§

fn production(&mut self, arg: &Production<'t>) -> Result<()>

Semantic action for non-terminal ‘Production’

source§

fn parol(&mut self, parol: &Parol<'t>) -> Result<()>

Semantic action for non-terminal ‘Parol’

source§

fn prolog(&mut self, _arg: &Prolog<'t>) -> Result<()>

Semantic action for non-terminal ‘Prolog’
source§

fn start_declaration(&mut self, _arg: &StartDeclaration<'t>) -> Result<()>

Semantic action for non-terminal ‘StartDeclaration’
source§

fn declaration(&mut self, _arg: &Declaration<'t>) -> Result<()>

Semantic action for non-terminal ‘Declaration’
source§

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<()>

Semantic action for non-terminal ‘GrammarDefinition’
source§

fn double_colon(&mut self, _arg: &DoubleColon<'t>) -> Result<()>

Semantic action for non-terminal ‘DoubleColon’
source§

fn alternations(&mut self, _arg: &Alternations<'t>) -> Result<()>

Semantic action for non-terminal ‘Alternations’
source§

fn alternation(&mut self, _arg: &Alternation<'t>) -> Result<()>

Semantic action for non-terminal ‘Alternation’
source§

fn factor(&mut self, _arg: &Factor<'t>) -> Result<()>

Semantic action for non-terminal ‘Factor’
source§

fn symbol(&mut self, _arg: &Symbol<'t>) -> Result<()>

Semantic action for non-terminal ‘Symbol’
source§

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<()>

Semantic action for non-terminal ‘SimpleToken’
source§

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<()>

Semantic action for non-terminal ‘String’
source§

fn raw_string(&mut self, _arg: &RawString<'t>) -> Result<()>

Semantic action for non-terminal ‘RawString’
source§

fn regex(&mut self, _arg: &Regex<'t>) -> Result<()>

Semantic action for non-terminal ‘Regex’
source§

fn group(&mut self, _arg: &Group<'t>) -> Result<()>

Semantic action for non-terminal ‘Group’
source§

fn optional(&mut self, _arg: &Optional<'t>) -> Result<()>

Semantic action for non-terminal ‘Optional’
source§

fn repeat(&mut self, _arg: &Repeat<'t>) -> Result<()>

Semantic action for non-terminal ‘Repeat’
source§

fn non_terminal(&mut self, _arg: &NonTerminal<'t>) -> Result<()>

Semantic action for non-terminal ‘NonTerminal’
source§

fn identifier(&mut self, _arg: &Identifier<'t>) -> Result<()>

Semantic action for non-terminal ‘Identifier’
source§

fn scanner_state(&mut self, _arg: &ScannerState<'t>) -> Result<()>

Semantic action for non-terminal ‘ScannerState’
source§

fn state_list(&mut self, _arg: &StateList<'t>) -> Result<()>

Semantic action for non-terminal ‘StateList’
source§

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<()>

Semantic action for non-terminal ‘ASTControl’
source§

fn cut_operator(&mut self, _arg: &CutOperator) -> Result<()>

Semantic action for non-terminal ‘CutOperator’
source§

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<()>

Semantic action for non-terminal ‘UserTypeName’
source§

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

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(grammar: ParolGrammar<'_>) -> Result<Self>

Performs the conversion.

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V