pub struct ActiveItem {
pub offset: usize,
pub dot: usize,
pub fun: RuntimeCncFun,
pub seq: Vec<Sym>,
pub args: Vec<PArg>,
pub fid: FId,
pub lbl: i32,
}
Expand description
Active item for parsing.
Represents an active parsing item in the chart, with position and components.
Fields§
§offset: usize
Offset.
dot: usize
Dot position.
fun: RuntimeCncFun
Function.
seq: Vec<Sym>
Sequence.
args: Vec<PArg>
Arguments.
fid: FId
FId.
lbl: i32
Label.
Implementations§
Source§impl ActiveItem
impl ActiveItem
Sourcepub fn new(
offset: usize,
dot: usize,
fun: RuntimeCncFun,
seq: Vec<Sym>,
args: Vec<PArg>,
fid: FId,
lbl: i32,
) -> Self
pub fn new( offset: usize, dot: usize, fun: RuntimeCncFun, seq: Vec<Sym>, args: Vec<PArg>, fid: FId, lbl: i32, ) -> Self
Creates a new active item.
§Arguments
offset
- Offset.dot
- Dot position.fun
- Function.seq
- Sequence.args
- Arguments.fid
- FId.lbl
- Label.
§Examples
use gf_core::{ActiveItem, RuntimeCncFun, LinType, PArg, Sym};
let fun = RuntimeCncFun::new("Test".to_string(), LinType::Sym(vec![]));
let item = ActiveItem::new(0, 0, fun, vec![], vec![], 1, 0);
assert_eq!(item.offset, 0);
Sourcepub fn is_equal(&self, other: &ActiveItem) -> bool
pub fn is_equal(&self, other: &ActiveItem) -> bool
Sourcepub fn shift_over_arg(&self, i: usize, fid: FId) -> ActiveItem
pub fn shift_over_arg(&self, i: usize, fid: FId) -> ActiveItem
Sourcepub fn shift_over_token(&self) -> ActiveItem
pub fn shift_over_token(&self) -> ActiveItem
Trait Implementations§
Source§impl Clone for ActiveItem
impl Clone for ActiveItem
Source§fn clone(&self) -> ActiveItem
fn clone(&self) -> ActiveItem
Returns a duplicate 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 Debug for ActiveItem
impl Debug for ActiveItem
Source§impl PartialEq for ActiveItem
impl PartialEq for ActiveItem
impl StructuralPartialEq for ActiveItem
Auto Trait Implementations§
impl Freeze for ActiveItem
impl RefUnwindSafe for ActiveItem
impl Send for ActiveItem
impl Sync for ActiveItem
impl Unpin for ActiveItem
impl UnwindSafe for ActiveItem
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