[][src]Struct gll_pg_core::GSSState

pub struct GSSState<L: Ord + Clone + GrammarLabel> {
    pub graph: Graph<GSSNode<L>, SPPFNodeIndex, Directed>,
    pub nodes: BTreeMap<GSSNode<L>, NodeIndex>,
    pub sppf_nodes: Vec<SPPFNode<L>>,
    pub initial_node_index: NodeIndex,
    pub visited: Vec<BTreeSet<(L, NodeIndex, SPPFNodeIndex)>>,
    pub todo: Vec<(L, NodeIndex, usize, SPPFNodeIndex)>,
    pub pop: BTreeSet<(NodeIndex, SPPFNodeIndex)>,
    pub current_position: usize,
    pub current_node_index: NodeIndex,
    pub current_sppf_node: usize,
}

All GSS Parser states. It is used by generated code, don't use it directly.

Fields

graph: Graph<GSSNode<L>, SPPFNodeIndex, Directed>

Direct GSS graph

nodes: BTreeMap<GSSNode<L>, NodeIndex>

Mapping from node to its index

sppf_nodes: Vec<SPPFNode<L>>

All sppf nodes, and nodes reference each other by index

initial_node_index: NodeIndexvisited: Vec<BTreeSet<(L, NodeIndex, SPPFNodeIndex)>>

U_j in original paper

todo: Vec<(L, NodeIndex, usize, SPPFNodeIndex)>

R in original paper

pop: BTreeSet<(NodeIndex, SPPFNodeIndex)>

P in original paper

current_position: usize

C_i in original paper

current_node_index: NodeIndex

C_u in original paper

current_sppf_node: usize

C_n in original paper

Methods

impl<L: Ord + Clone + GrammarLabel> GSSState<L>[src]

pub fn add(&mut self, l: L, u: NodeIndex, i: usize, w: SPPFNodeIndex)[src]

The add function in the paper

pub fn pop(&mut self, u: NodeIndex, i: usize, z: SPPFNodeIndex)[src]

The pop function in the paper

pub fn create(
    &mut self,
    l: L,
    u: NodeIndex,
    j: usize,
    w: SPPFNodeIndex
) -> NodeIndex
[src]

The create function in the paper

pub fn get_node_t(&mut self, x: L::Symbol, i: usize) -> SPPFNodeIndex[src]

The get_node_t function in the paper

pub fn get_node_p(
    &mut self,
    l: L,
    w: SPPFNodeIndex,
    z: SPPFNodeIndex
) -> SPPFNodeIndex
[src]

The get_node_p function in the paper

pub fn collect_symbols(&self, node: SPPFNodeIndex) -> Vec<SPPFNodeIndex>[src]

Collect all symbol leaves of a packed node

Auto Trait Implementations

impl<L> Send for GSSState<L> where
    L: Send,
    <L as GrammarLabel>::Symbol: Send

impl<L> Sync for GSSState<L> where
    L: Sync,
    <L as GrammarLabel>::Symbol: Sync

impl<L> Unpin for GSSState<L> where
    L: Unpin,
    <L as GrammarLabel>::Symbol: Unpin

impl<L> UnwindSafe for GSSState<L> where
    L: RefUnwindSafe + UnwindSafe,
    <L as GrammarLabel>::Symbol: UnwindSafe

impl<L> RefUnwindSafe for GSSState<L> where
    L: RefUnwindSafe,
    <L as GrammarLabel>::Symbol: RefUnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]