Struct cleaver::fe::parser::Rdp
[−]
pub struct Rdp<T> { /* fields omitted */ }
Methods
impl<'input, T: Input<'input>> Rdp<T>
fn new(input: T) -> Rdp<T>
fn comment(&mut self) -> bool
fn any(&mut self) -> bool
fn eoi(&mut self) -> bool
fn alpha(&mut self) -> bool
fn alpha_num(&mut self) -> bool
fn identifier(&mut self) -> bool
fn bool_literal(&mut self) -> bool
fn bool_literal_true(&mut self) -> bool
fn bool_literal_false(&mut self) -> bool
fn int_literal(&mut self) -> bool
fn float_literal(&mut self) -> bool
fn string_literal(&mut self) -> bool
fn type_(&mut self) -> bool
fn type_void(&mut self) -> bool
fn type_bool(&mut self) -> bool
fn type_int(&mut self) -> bool
fn type_float(&mut self) -> bool
fn type_string(&mut self) -> bool
fn variable(&mut self) -> bool
fn declaration(&mut self) -> bool
fn wrap_decl(&mut self) -> bool
fn decl_list(&mut self) -> bool
fn literal(&mut self) -> bool
fn rel_op(&mut self) -> bool
fn rel_op_eq(&mut self) -> bool
fn rel_op_le(&mut self) -> bool
fn rel_op_lt(&mut self) -> bool
fn add_op(&mut self) -> bool
fn add_op_add(&mut self) -> bool
fn add_op_sub(&mut self) -> bool
fn mul_op(&mut self) -> bool
fn mul_op_mul(&mut self) -> bool
fn mul_op_div(&mut self) -> bool
fn un_op(&mut self) -> bool
fn un_op_minus(&mut self) -> bool
fn un_op_not(&mut self) -> bool
fn expression(&mut self) -> bool
fn simple_expression(&mut self) -> bool
fn term(&mut self) -> bool
fn factor(&mut self) -> bool
fn literal_expr(&mut self) -> bool
fn call_expr(&mut self) -> bool
fn expr_list(&mut self) -> bool
fn wrap_expr(&mut self) -> bool
fn variable_expr(&mut self) -> bool
fn parenth_expr(&mut self) -> bool
fn lparenth(&mut self) -> bool
fn rparenth(&mut self) -> bool
fn statement(&mut self) -> bool
fn expr_stmt(&mut self) -> bool
fn decl_stmt(&mut self) -> bool
fn assignment(&mut self) -> bool
fn if_stmt(&mut self) -> bool
fn else_part(&mut self) -> bool
fn while_stmt(&mut self) -> bool
fn return_stmt(&mut self) -> bool
fn compound_stmt(&mut self) -> bool
fn lbrace(&mut self) -> bool
fn rbrace(&mut self) -> bool
fn wrap_stmt(&mut self) -> bool
fn program(&mut self) -> bool
fn function(&mut self) -> bool
fn wrap_fun(&mut self) -> bool
fn whitespace(&mut self) -> bool
fn try<F>(&mut self, revert: bool, rule: F) -> bool where F: FnOnce(&mut Self) -> bool
fn prec_climb<F, G>(&mut self,
pos: usize,
left: usize,
min_prec: u8,
last_op: Option<(Option<Rule>, u8, bool)>,
primary: &mut F,
climb: &mut G)
-> (Option<(Option<Rule>, u8, bool)>, Option<usize>) where F: FnMut(&mut Self) -> bool, G: FnMut(&mut Self) -> Option<(Option<Rule>, u8, bool)>
pos: usize,
left: usize,
min_prec: u8,
last_op: Option<(Option<Rule>, u8, bool)>,
primary: &mut F,
climb: &mut G)
-> (Option<(Option<Rule>, u8, bool)>, Option<usize>) where F: FnMut(&mut Self) -> bool, G: FnMut(&mut Self) -> Option<(Option<Rule>, u8, bool)>
fn parse_variable(&self) -> Variable
fn parse_type(&self) -> Type
fn parse_binary_op(&self) -> BinaryOp
fn parse_unary_op(&self) -> UnaryOp
fn parse_literal(&self) -> Literal
fn parse_expression(&self) -> Node<Expression>
fn parse_expressions(&self) -> LinkedList<Node<Expression>>
fn parse_statement(&self) -> Node<Statement>
fn parse_else_part(&self) -> Option<Box<Node<Statement>>>
fn parse_statements(&self) -> LinkedList<Node<Statement>>
fn parse_function(&self) -> Node<Function>
fn parse_program(&self) -> Functions
fn parse_declaration(&self) -> Rc<Variable>
fn parse_declarations(&self) -> LinkedList<Rc<Variable>>
Trait Implementations
impl<'input, T: Input<'input>> Parser<'input, T> for Rdp<T>
type Rule = Rule
type Token = Token<Rule>
fn input(&self) -> &T
fn input_mut(&mut self) -> &mut T
fn end(&self) -> bool
Returns whether a Parser
has reached its end.
fn eoi_matched(&self) -> bool
Returns whether a Parser
has matched end-of-input.
fn reset(&mut self)
Reset a Parser
.
fn queue(&self) -> &Vec<Token<Rule>>
Returns the queue of all matched Token
s.
fn queue_index(&self) -> usize
Returns the current index within the queue. Used in process!
.
fn inc_queue_index(&self)
Increments the current index within the queue. Used in process!
.
fn set_queue_index(&self, index: usize)
Set the current index within the queue. Used in process!
.
fn queue_mut(&mut self) -> &mut Vec<Token<Rule>>
Returns the mutable queue of all matched Token
s.
fn skip_ws(&mut self)
Skips white-space.
fn skip_com(&mut self)
Skips comments.
fn is_atomic(&self) -> bool
Returns whether a Parser
is currently inside an atomic rule.
fn set_atomic(&mut self, value: bool)
Sets a Parser
to atomic rule mode, barring comment & white-space skipping.
fn track(&mut self, failed: Rule, pos: usize)
Keeps track of rule failures. It gets called when a Rule
fails at pos
.
fn tracked_len(&self) -> usize
Returns the length of the tracked Rule
s.
fn expected(&mut self) -> (Vec<Rule>, usize)
Retuns a Vec
of all expected Rule
s at the deepest position where the parsing last stopped. It only returns leafs from the rule tree. Used for error reporting. Read more