Struct opg::table::OpTable[][src]

pub struct OpTable {
    table: HashMap<(String, String), char>,
    ts: HashSet<String>,
}

A struct of Operation Table.

Fields

table: HashMap<(String, String), char>

The hashmap of relation.

ts: HashSet<String>

The terminal set in the grammar.

Implementations

impl OpTable[src]

pub fn new(ts: HashSet<String>) -> OpTable[src]

Create a new opTable.

pub fn insert(&mut self, ttuple: &(String, String), ch: char)[src]

Insert to table.

Principles

Try to insert the a tuple with ch relation. If it is occupied and not equal to the relation to be inserted, then the grammar is ambiguous and the panic will be fired.

pub fn to_string(&self) -> String[src]

Convert table to string.

Trait Implementations

impl Display for OpTable[src]

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

Define the behavior of outputting an opTable struct.

Auto Trait Implementations

impl RefUnwindSafe for OpTable[src]

impl Send for OpTable[src]

impl Sync for OpTable[src]

impl Unpin for OpTable[src]

impl UnwindSafe for OpTable[src]

Blanket Implementations

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

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

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

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

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

impl<T> ToString for T where
    T: Display + ?Sized
[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.