use crate::parser::args::GrammarArgs;
use crate::parser::args::IdentOrLiteral;
use crate::parser::args::PatternArgs;
use crate::parser::args::PrecDPrecArgs;
use crate::parser::args::RecoveredError;
use crate::parser::args::RuleDefArgs;
use crate::parser::args::RuleLineArgs;
use crate::parser::lexer::Lexed;
use crate::parser::location::Located;
use crate::parser::location::Location;
use crate::terminalset::TerminalSet;
use crate::terminalset::TerminalSetItem;
use proc_macro2::Group;
use proc_macro2::TokenStream;
use quote::ToTokens;
use rusty_lr_core::rule::ReduceType;
use std::boxed::Box;
#[allow(non_camel_case_types, dead_code)]
pub type GrammarContext =
::rusty_lr_core::parser::deterministic::Context<GrammarParser, GrammarDataStack, u8>;
#[allow(non_camel_case_types, dead_code)]
pub type GrammarRule =
::rusty_lr_core::rule::ProductionRule<GrammarTerminalClasses, GrammarNonTerminals>;
#[allow(non_camel_case_types, dead_code)]
pub type GrammarTables = ::rusty_lr_core::parser::table::SparseFlatTables<
GrammarTerminalClasses,
GrammarNonTerminals,
u8,
u8,
>;
#[allow(non_camel_case_types, dead_code)]
pub type GrammarParseError = ::rusty_lr_core::parser::deterministic::ParseError<
Lexed,
Location,
::rusty_lr_core::DefaultReduceActionError,
>;
#[allow(non_camel_case_types, dead_code)]
#[derive(
Clone,
Copy,
std::hash::Hash,
std::cmp::PartialEq,
std::cmp::Eq,
std::cmp::PartialOrd,
std::cmp::Ord,
)]
#[repr(usize)]
pub enum GrammarTerminalClasses {
ident,
TermClass1,
colon,
pipe,
percent,
equal,
caret,
dot,
dollar,
comma,
int_literal,
byte_literal,
byte_str_literal,
char_literal,
str_literal,
parengroup,
bracegroup,
lparen,
rparen,
lbracket,
rbracket,
left,
right,
token,
start,
tokentype,
userdata,
errortype,
moduleprefix,
lalr,
glr,
prec,
precedence,
nooptim,
dprec,
location,
semicolon,
plus,
star,
question,
exclamation,
minus,
error,
eof,
}
impl GrammarTerminalClasses {
#[inline]
pub fn from_usize(value: usize) -> Self {
debug_assert!(
value < 44usize,
"Terminal class index {} is out of bounds (max {})",
value,
44usize
);
unsafe { ::std::mem::transmute(value) }
}
}
impl ::rusty_lr_core::parser::terminalclass::TerminalClass for GrammarTerminalClasses {
type Term = Lexed;
const ERROR: Self = Self::error;
const EOF: Self = Self::eof;
fn as_str(&self) -> &'static str {
match self {
GrammarTerminalClasses::ident => "ident",
GrammarTerminalClasses::TermClass1 => "[other_literal, <Others>]",
GrammarTerminalClasses::colon => "colon",
GrammarTerminalClasses::pipe => "pipe",
GrammarTerminalClasses::percent => "percent",
GrammarTerminalClasses::equal => "equal",
GrammarTerminalClasses::caret => "caret",
GrammarTerminalClasses::dot => "dot",
GrammarTerminalClasses::dollar => "dollar",
GrammarTerminalClasses::comma => "comma",
GrammarTerminalClasses::int_literal => "int_literal",
GrammarTerminalClasses::byte_literal => "byte_literal",
GrammarTerminalClasses::byte_str_literal => "byte_str_literal",
GrammarTerminalClasses::char_literal => "char_literal",
GrammarTerminalClasses::str_literal => "str_literal",
GrammarTerminalClasses::parengroup => "parengroup",
GrammarTerminalClasses::bracegroup => "bracegroup",
GrammarTerminalClasses::lparen => "lparen",
GrammarTerminalClasses::rparen => "rparen",
GrammarTerminalClasses::lbracket => "lbracket",
GrammarTerminalClasses::rbracket => "rbracket",
GrammarTerminalClasses::left => "left",
GrammarTerminalClasses::right => "right",
GrammarTerminalClasses::token => "token",
GrammarTerminalClasses::start => "start",
GrammarTerminalClasses::tokentype => "tokentype",
GrammarTerminalClasses::userdata => "userdata",
GrammarTerminalClasses::errortype => "errortype",
GrammarTerminalClasses::moduleprefix => "moduleprefix",
GrammarTerminalClasses::lalr => "lalr",
GrammarTerminalClasses::glr => "glr",
GrammarTerminalClasses::prec => "prec",
GrammarTerminalClasses::precedence => "precedence",
GrammarTerminalClasses::nooptim => "nooptim",
GrammarTerminalClasses::dprec => "dprec",
GrammarTerminalClasses::location => "location",
GrammarTerminalClasses::semicolon => "semicolon",
GrammarTerminalClasses::plus => "plus",
GrammarTerminalClasses::star => "star",
GrammarTerminalClasses::question => "question",
GrammarTerminalClasses::exclamation => "exclamation",
GrammarTerminalClasses::minus => "minus",
GrammarTerminalClasses::error => "error",
GrammarTerminalClasses::eof => "eof",
}
}
fn to_usize(&self) -> usize {
*self as usize
}
fn precedence(&self) -> ::rusty_lr_core::parser::Precedence {
match self {
GrammarTerminalClasses::minus => ::rusty_lr_core::parser::Precedence::new(0),
GrammarTerminalClasses::plus
| GrammarTerminalClasses::star
| GrammarTerminalClasses::question
| GrammarTerminalClasses::exclamation => ::rusty_lr_core::parser::Precedence::new(1),
GrammarTerminalClasses::eof => {
unreachable!("eof token cannot be used in precedence levels")
}
_ => ::rusty_lr_core::parser::Precedence::none(),
}
}
fn from_term(terminal: &Self::Term) -> Self {
#[allow(unreachable_patterns, unused_variables)]
match terminal {
Lexed::Ident(ident) => GrammarTerminalClasses::ident,
Lexed::Colon(_) => GrammarTerminalClasses::colon,
Lexed::Pipe(_) => GrammarTerminalClasses::pipe,
Lexed::Percent(_) => GrammarTerminalClasses::percent,
Lexed::Equal(_) => GrammarTerminalClasses::equal,
Lexed::Caret(_) => GrammarTerminalClasses::caret,
Lexed::Dot(_) => GrammarTerminalClasses::dot,
Lexed::Dollar(_) => GrammarTerminalClasses::dollar,
Lexed::Comma(_) => GrammarTerminalClasses::comma,
Lexed::IntLiteral(_) => GrammarTerminalClasses::int_literal,
Lexed::ByteLiteral(_) => GrammarTerminalClasses::byte_literal,
Lexed::ByteStrLiteral(_) => GrammarTerminalClasses::byte_str_literal,
Lexed::CharLiteral(_) => GrammarTerminalClasses::char_literal,
Lexed::StrLiteral(_) => GrammarTerminalClasses::str_literal,
Lexed::ParenGroup(parengroup) => GrammarTerminalClasses::parengroup,
Lexed::BraceGroup(bracegroup) => GrammarTerminalClasses::bracegroup,
Lexed::LParen => GrammarTerminalClasses::lparen,
Lexed::RParen => GrammarTerminalClasses::rparen,
Lexed::LBracket => GrammarTerminalClasses::lbracket,
Lexed::RBracket => GrammarTerminalClasses::rbracket,
Lexed::Left(_) => GrammarTerminalClasses::left,
Lexed::Right(_) => GrammarTerminalClasses::right,
Lexed::Token(_) => GrammarTerminalClasses::token,
Lexed::Start(_) => GrammarTerminalClasses::start,
Lexed::TokenType(_) => GrammarTerminalClasses::tokentype,
Lexed::UserData(_) => GrammarTerminalClasses::userdata,
Lexed::ErrorType(_) => GrammarTerminalClasses::errortype,
Lexed::ModulePrefix(_) => GrammarTerminalClasses::moduleprefix,
Lexed::Lalr(_) => GrammarTerminalClasses::lalr,
Lexed::Glr(_) => GrammarTerminalClasses::glr,
Lexed::Prec(_) => GrammarTerminalClasses::prec,
Lexed::Precedence(_) => GrammarTerminalClasses::precedence,
Lexed::NoOptim(_) => GrammarTerminalClasses::nooptim,
Lexed::DPrec(_) => GrammarTerminalClasses::dprec,
Lexed::Location(_) => GrammarTerminalClasses::location,
Lexed::Semicolon(_) => GrammarTerminalClasses::semicolon,
Lexed::Plus(_) => GrammarTerminalClasses::plus,
Lexed::Star(_) => GrammarTerminalClasses::star,
Lexed::Question(_) => GrammarTerminalClasses::question,
Lexed::Exclamation(_) => GrammarTerminalClasses::exclamation,
Lexed::Minus(_) => GrammarTerminalClasses::minus,
_ => GrammarTerminalClasses::TermClass1,
}
}
}
impl std::fmt::Display for GrammarTerminalClasses {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
use ::rusty_lr_core::parser::terminalclass::TerminalClass;
write!(f, "{}", self.as_str())
}
}
impl std::fmt::Debug for GrammarTerminalClasses {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
use ::rusty_lr_core::parser::terminalclass::TerminalClass;
write!(f, "{}", self.as_str())
}
}
#[allow(non_camel_case_types, dead_code)]
#[derive(
Clone,
Copy,
std::hash::Hash,
std::cmp::PartialEq,
std::cmp::Eq,
std::cmp::PartialOrd,
std::cmp::Ord,
)]
#[repr(usize)]
pub enum GrammarNonTerminals {
Rule,
RuleType,
RuleLines,
RuleLine,
PrecDef,
TokenMapped,
TerminalSetItem,
TerminalSet,
Pattern,
Action,
IdentOrLiteral,
Directive,
GrammarLine,
Grammar,
_TokenMappedPlus15,
_TokenMappedStar16,
_PrecDefPlus17,
_PrecDefStar18,
_caretQuestion19,
_TerminalSetItemPlus20,
_TerminalSetItemStar21,
_PatternPlus22,
_PatternStar23,
__PatternStar23SepPlus24,
_commaQuestion25,
_TermSet26,
__TermSet26Plus27,
_IdentOrLiteralPlus28,
_GrammarLinePlus29,
Augmented,
}
impl GrammarNonTerminals {
#[inline]
pub fn from_usize(value: usize) -> Self {
debug_assert!(
value < 30usize,
"Non-terminal index {} is out of bounds (max {})",
value,
30usize
);
unsafe { ::std::mem::transmute(value) }
}
}
impl std::fmt::Display for GrammarNonTerminals {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
use ::rusty_lr_core::parser::nonterminal::NonTerminal;
write!(f, "{}", self.as_str())
}
}
impl std::fmt::Debug for GrammarNonTerminals {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
use ::rusty_lr_core::parser::nonterminal::NonTerminal;
write!(f, "{}", self.as_str())
}
}
impl ::rusty_lr_core::parser::nonterminal::NonTerminal for GrammarNonTerminals {
fn as_str(&self) -> &'static str {
match self {
GrammarNonTerminals::Rule => "Rule",
GrammarNonTerminals::RuleType => "RuleType",
GrammarNonTerminals::RuleLines => "RuleLines",
GrammarNonTerminals::RuleLine => "RuleLine",
GrammarNonTerminals::PrecDef => "PrecDef",
GrammarNonTerminals::TokenMapped => "TokenMapped",
GrammarNonTerminals::TerminalSetItem => "TerminalSetItem",
GrammarNonTerminals::TerminalSet => "TerminalSet",
GrammarNonTerminals::Pattern => "Pattern",
GrammarNonTerminals::Action => "Action",
GrammarNonTerminals::IdentOrLiteral => "IdentOrLiteral",
GrammarNonTerminals::Directive => "Directive",
GrammarNonTerminals::GrammarLine => "GrammarLine",
GrammarNonTerminals::Grammar => "Grammar",
GrammarNonTerminals::_TokenMappedPlus15 => "TokenMapped+",
GrammarNonTerminals::_TokenMappedStar16 => "TokenMapped*",
GrammarNonTerminals::_PrecDefPlus17 => "PrecDef+",
GrammarNonTerminals::_PrecDefStar18 => "PrecDef*",
GrammarNonTerminals::_caretQuestion19 => "caret?",
GrammarNonTerminals::_TerminalSetItemPlus20 => "TerminalSetItem+",
GrammarNonTerminals::_TerminalSetItemStar21 => "TerminalSetItem*",
GrammarNonTerminals::_PatternPlus22 => "Pattern+",
GrammarNonTerminals::_PatternStar23 => "Pattern*",
GrammarNonTerminals::__PatternStar23SepPlus24 => "$sep(Pattern*, pipe, +)",
GrammarNonTerminals::_commaQuestion25 => "comma?",
GrammarNonTerminals::_TermSet26 => "[^semicolon]",
GrammarNonTerminals::__TermSet26Plus27 => "[^semicolon]+",
GrammarNonTerminals::_IdentOrLiteralPlus28 => "IdentOrLiteral+",
GrammarNonTerminals::_GrammarLinePlus29 => "GrammarLine+",
GrammarNonTerminals::Augmented => "Augmented",
}
}
fn nonterm_type(&self) -> Option<::rusty_lr_core::parser::nonterminal::NonTerminalType> {
match self {
GrammarNonTerminals::Rule => None,
GrammarNonTerminals::RuleType => None,
GrammarNonTerminals::RuleLines => None,
GrammarNonTerminals::RuleLine => None,
GrammarNonTerminals::PrecDef => None,
GrammarNonTerminals::TokenMapped => None,
GrammarNonTerminals::TerminalSetItem => None,
GrammarNonTerminals::TerminalSet => None,
GrammarNonTerminals::Pattern => None,
GrammarNonTerminals::Action => None,
GrammarNonTerminals::IdentOrLiteral => None,
GrammarNonTerminals::Directive => None,
GrammarNonTerminals::GrammarLine => None,
GrammarNonTerminals::Grammar => None,
GrammarNonTerminals::_TokenMappedPlus15 => {
Some(::rusty_lr_core::parser::nonterminal::NonTerminalType::PlusLeft)
}
GrammarNonTerminals::_TokenMappedStar16 => {
Some(::rusty_lr_core::parser::nonterminal::NonTerminalType::Star)
}
GrammarNonTerminals::_PrecDefPlus17 => {
Some(::rusty_lr_core::parser::nonterminal::NonTerminalType::PlusLeft)
}
GrammarNonTerminals::_PrecDefStar18 => {
Some(::rusty_lr_core::parser::nonterminal::NonTerminalType::Star)
}
GrammarNonTerminals::_caretQuestion19 => {
Some(::rusty_lr_core::parser::nonterminal::NonTerminalType::Optional)
}
GrammarNonTerminals::_TerminalSetItemPlus20 => {
Some(::rusty_lr_core::parser::nonterminal::NonTerminalType::PlusLeft)
}
GrammarNonTerminals::_TerminalSetItemStar21 => {
Some(::rusty_lr_core::parser::nonterminal::NonTerminalType::Star)
}
GrammarNonTerminals::_PatternPlus22 => {
Some(::rusty_lr_core::parser::nonterminal::NonTerminalType::PlusLeft)
}
GrammarNonTerminals::_PatternStar23 => {
Some(::rusty_lr_core::parser::nonterminal::NonTerminalType::Star)
}
GrammarNonTerminals::__PatternStar23SepPlus24 => {
Some(::rusty_lr_core::parser::nonterminal::NonTerminalType::PlusLeft)
}
GrammarNonTerminals::_commaQuestion25 => {
Some(::rusty_lr_core::parser::nonterminal::NonTerminalType::Optional)
}
GrammarNonTerminals::_TermSet26 => {
Some(::rusty_lr_core::parser::nonterminal::NonTerminalType::TerminalSet)
}
GrammarNonTerminals::__TermSet26Plus27 => {
Some(::rusty_lr_core::parser::nonterminal::NonTerminalType::PlusLeft)
}
GrammarNonTerminals::_IdentOrLiteralPlus28 => {
Some(::rusty_lr_core::parser::nonterminal::NonTerminalType::PlusLeft)
}
GrammarNonTerminals::_GrammarLinePlus29 => {
Some(::rusty_lr_core::parser::nonterminal::NonTerminalType::PlusRight)
}
GrammarNonTerminals::Augmented => {
Some(::rusty_lr_core::parser::nonterminal::NonTerminalType::Augmented)
}
}
}
fn to_usize(&self) -> usize {
*self as usize
}
}
#[rustfmt::skip]
#[allow(unused_braces, unused_parens, non_snake_case, non_camel_case_types)]
pub enum GrammarData {
__terminals(Lexed),
__variant1(::std::boxed::Box<RuleDefArgs>),
__variant2(Option<Group>),
__variant3(Vec<RuleLineArgs>),
__variant4(::std::boxed::Box<RuleLineArgs>),
__variant5(::std::boxed::Box<PrecDPrecArgs>),
__variant6(::std::boxed::Box<(Option<Located<String>>, PatternArgs)>),
__variant7(TerminalSetItem),
__variant8(TerminalSet),
__variant9(PatternArgs),
__variant10(IdentOrLiteral),
__variant11(Vec<(Option<Located<String>>, PatternArgs)>),
__variant12(Vec<PrecDPrecArgs>),
__variant13(Option<Lexed>),
__variant14(Vec<TerminalSetItem>),
__variant15(Vec<PatternArgs>),
__variant16(Vec<Vec<PatternArgs>>),
__variant17(Vec<Lexed>),
__variant18(Vec<IdentOrLiteral>),
Empty,
}
#[rustfmt::skip]
#[allow(unused_braces, unused_parens, non_snake_case, non_camel_case_types)]
pub struct GrammarDataStack {
pub __stack: Vec<GrammarData>,
}
impl Default for GrammarDataStack {
fn default() -> Self {
Self {
__stack: Vec::new(),
}
}
}
#[rustfmt::skip]
#[allow(
unused_braces,
unused_parens,
unused_variables,
non_snake_case,
unused_mut,
dead_code
)]
impl GrammarDataStack {
fn custom_reduce_action_0(
mut t: Vec<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<TokenStream, ::rusty_lr_core::DefaultReduceActionError> {
Ok({
let mut tokens = TokenStream::new();
for token in t.into_iter() {
token.append_to_stream(&mut tokens);
}
tokens
})
}
#[inline]
fn reduce_Rule_0(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__variant3(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
3usize), Some(& GrammarData::__variant2(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
4usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.truncate(__location_stack.len() - 2);
let mut __rustylr_location_colon = __location_stack.pop().unwrap();
__location_stack.pop();
let mut __rustylr_location_ident = __location_stack.pop().unwrap();
__data_stack.__stack.pop();
let mut RuleLines = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant3(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.pop();
let mut RuleType = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant2(val) => val,
_ => unreachable!(),
};
let mut ident = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
let __res = {
let Lexed::Ident(ident) = ident else {
unreachable!("Rule-Ident");
};
if let Some(fisrt) = RuleLines.first_mut() {
fisrt.separator_location = __rustylr_location_colon;
}
RuleDefArgs {
name: Located::new(ident.to_string(), __rustylr_location_ident),
typename: RuleType.map(|t| t.stream()),
rule_lines: RuleLines,
}
};
if __push_data {
__data_stack
.__stack
.push(GrammarData::__variant1(::std::boxed::Box::new(__res)));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_RuleType_0(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.pop();
let mut parengroup = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
let __res = {
let Lexed::ParenGroup(parengroup) = parengroup else {
unreachable!("RuleType - Group");
};
Some(parengroup)
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant2(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_RuleType_1(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)] {}
let __res = { None };
if __push_data {
__data_stack.__stack.push(GrammarData::__variant2(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_RuleLines_0(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__variant4(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__variant3(_)))
);
}
__location_stack.pop();
let mut __rustylr_location_pipe = __location_stack.pop().unwrap();
__location_stack.pop();
let mut RuleLine = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant4(val) => *val,
_ => unreachable!(),
};
__data_stack.__stack.pop();
let mut RuleLines = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant3(val) => val,
_ => unreachable!(),
};
let __res = {
RuleLine.separator_location = __rustylr_location_pipe;
RuleLines.push(RuleLine);
RuleLines
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant3(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_RuleLines_1(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__variant4(_)))
);
}
__location_stack.pop();
let mut RuleLine = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant4(val) => *val,
_ => unreachable!(),
};
let __res = { vec![RuleLine] };
if __push_data {
__data_stack.__stack.push(GrammarData::__variant3(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_RuleLine_0(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__variant2(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__variant12(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__variant11(_)))
);
}
__location_stack.truncate(__location_stack.len() - 3);
let mut Action = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant2(val) => val,
_ => unreachable!(),
};
let mut PrecDef = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant12(val) => val,
_ => unreachable!(),
};
let mut TokenMapped = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant11(val) => val,
_ => unreachable!(),
};
let __res = {
RuleLineArgs {
tokens: TokenMapped,
reduce_action: Action.map(|action| action.to_token_stream()),
separator_location: Location::default(),
precs: PrecDef,
}
};
if __push_data {
__data_stack
.__stack
.push(GrammarData::__variant4(::std::boxed::Box::new(__res)));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_PrecDef_0(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__variant10(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.truncate(__location_stack.len() - 3);
let mut IdentOrLiteral = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant10(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.truncate(__data_stack.__stack.len() - 2);
let __res = { PrecDPrecArgs::Prec(IdentOrLiteral) };
if __push_data {
__data_stack
.__stack
.push(GrammarData::__variant5(::std::boxed::Box::new(__res)));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_PrecDef_1(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
}
let mut __rustylr_location_error = __location_stack.pop().unwrap();
__location_stack.truncate(__location_stack.len() - 2);
__data_stack.__stack.truncate(__data_stack.__stack.len() - 3);
let __res = {
data.error_recovered
.push(RecoveredError {
message: "Expected <ident> to token or <literal>".to_string(),
link: "https://github.com/ehwan/RustyLR/blob/main/SYNTAX.md#operator-precedence"
.to_string(),
location: __rustylr_location_error,
});
PrecDPrecArgs::None
};
if __push_data {
__data_stack
.__stack
.push(GrammarData::__variant5(::std::boxed::Box::new(__res)));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_PrecDef_2(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
}
let mut __rustylr_location_int_literal = __location_stack.pop().unwrap();
__location_stack.truncate(__location_stack.len() - 2);
let mut int_literal = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.truncate(__data_stack.__stack.len() - 2);
let __res = {
let Lexed::IntLiteral(i) = int_literal else {
unreachable!("PrecDPrecArgs-DPrec");
};
PrecDPrecArgs::DPrec(Located::new(i, __rustylr_location_int_literal))
};
if __push_data {
__data_stack
.__stack
.push(GrammarData::__variant5(::std::boxed::Box::new(__res)));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_PrecDef_3(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
}
let mut __rustylr_location_error = __location_stack.pop().unwrap();
__location_stack.truncate(__location_stack.len() - 2);
__data_stack.__stack.truncate(__data_stack.__stack.len() - 3);
let __res = {
data.error_recovered
.push(RecoveredError {
message: "Expected integer literal".to_string(),
link: "https://github.com/ehwan/RustyLR/blob/main/SYNTAX.md#rule-priority"
.to_string(),
location: __rustylr_location_error,
});
PrecDPrecArgs::None
};
if __push_data {
__data_stack
.__stack
.push(GrammarData::__variant5(::std::boxed::Box::new(__res)));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_PrecDef_4(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__terminals(_)))
);
}
let mut __rustylr_location_error = __location_stack.pop().unwrap();
__location_stack.pop();
__data_stack.__stack.truncate(__data_stack.__stack.len() - 2);
let __res = {
data.error_recovered
.push(RecoveredError {
message: "Expected %prec or %dprec".to_string(),
link: "https://github.com/ehwan/RustyLR/blob/main/SYNTAX.md#operator-precedence"
.to_string(),
location: __rustylr_location_error,
});
PrecDPrecArgs::None
};
if __push_data {
__data_stack
.__stack
.push(GrammarData::__variant5(::std::boxed::Box::new(__res)));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_TokenMapped_0(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__variant9(_)))
);
}
__location_stack.pop();
let mut Pattern = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant9(val) => val,
_ => unreachable!(),
};
let __res = { (None, Pattern) };
if __push_data {
__data_stack
.__stack
.push(GrammarData::__variant6(::std::boxed::Box::new(__res)));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_TokenMapped_1(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__variant9(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.truncate(__location_stack.len() - 2);
let mut __rustylr_location_ident = __location_stack.pop().unwrap();
let mut Pattern = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant9(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.pop();
let mut ident = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
let __res = {
let Lexed::Ident(ident) = ident else {
unreachable!("Token-Ident");
};
(Some(Located::new(ident.to_string(), __rustylr_location_ident)), Pattern)
};
if __push_data {
__data_stack
.__stack
.push(GrammarData::__variant6(::std::boxed::Box::new(__res)));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_TerminalSetItem_0(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__terminals(_)))
);
}
let mut __rustylr_location_ident = __location_stack.pop().unwrap();
let mut ident = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
let __res = {
let Lexed::Ident(ident) = ident else {
unreachable!("TerminalSetItem-Range1");
};
TerminalSetItem::Terminal(
Located::new(ident.to_string(), __rustylr_location_ident),
)
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant7(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_TerminalSetItem_1(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
}
let mut __rustylr_location_last = __location_stack.pop().unwrap();
__location_stack.pop();
let mut __rustylr_location_first = __location_stack.pop().unwrap();
let mut last = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.pop();
let mut first = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
let __res = {
let Lexed::Ident(first) = first else {
unreachable!("TerminalSetItem-Range1");
};
let Lexed::Ident(last) = last else {
unreachable!("TerminalSetItem-Range3");
};
TerminalSetItem::Range(
Located::new(first.to_string(), __rustylr_location_first),
Located::new(last.to_string(), __rustylr_location_last),
)
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant7(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_TerminalSetItem_2(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
}
let mut __rustylr_location_error = __location_stack.pop().unwrap();
__location_stack.truncate(__location_stack.len() - 2);
__data_stack.__stack.truncate(__data_stack.__stack.len() - 3);
let __res = {
data.error_recovered
.push(RecoveredError {
message: "Expected ident for terminal set".to_string(),
link: "https://github.com/ehwan/RustyLR/blob/main/SYNTAX.md#patterns"
.to_string(),
location: __rustylr_location_error,
});
TerminalSetItem::Terminal(Default::default())
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant7(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_TerminalSetItem_3(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__terminals(_)))
);
}
let mut __rustylr_location_char_literal = __location_stack.pop().unwrap();
let mut char_literal = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
let __res = {
let Lexed::CharLiteral(ch) = char_literal else {
unreachable!("TerminalSetItem-CharLiteral1");
};
TerminalSetItem::Char(
Located::new(ch.value(), __rustylr_location_char_literal),
)
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant7(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_TerminalSetItem_4(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
}
let mut __rustylr_location_last = __location_stack.pop().unwrap();
__location_stack.pop();
let mut __rustylr_location_first = __location_stack.pop().unwrap();
let mut last = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.pop();
let mut first = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
let __res = {
let Lexed::CharLiteral(first) = first else {
unreachable!("TerminalSetItem-CharLiteral2");
};
let Lexed::CharLiteral(last) = last else {
unreachable!("TerminalSetItem-CharLiteral3");
};
TerminalSetItem::CharRange(
Located::new(first.value(), __rustylr_location_first),
Located::new(last.value(), __rustylr_location_last),
)
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant7(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_TerminalSetItem_5(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
}
let mut __rustylr_location_error = __location_stack.pop().unwrap();
__location_stack.truncate(__location_stack.len() - 2);
__data_stack.__stack.truncate(__data_stack.__stack.len() - 3);
let __res = {
data.error_recovered
.push(RecoveredError {
message: "Expected char literal for terminal set".to_string(),
link: "https://github.com/ehwan/RustyLR/blob/main/SYNTAX.md#patterns"
.to_string(),
location: __rustylr_location_error,
});
TerminalSetItem::Terminal(Default::default())
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant7(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_TerminalSetItem_6(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__terminals(_)))
);
}
let mut __rustylr_location_byte_literal = __location_stack.pop().unwrap();
let mut byte_literal = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
let __res = {
let Lexed::ByteLiteral(b) = byte_literal else {
unreachable!("TerminalSetItem-ByteLiteral1");
};
TerminalSetItem::Byte(
Located::new(b.value(), __rustylr_location_byte_literal),
)
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant7(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_TerminalSetItem_7(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
}
let mut __rustylr_location_last = __location_stack.pop().unwrap();
__location_stack.pop();
let mut __rustylr_location_first = __location_stack.pop().unwrap();
let mut last = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.pop();
let mut first = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
let __res = {
let Lexed::ByteLiteral(first) = first else {
unreachable!("TerminalSetItem-ByteLiteral2");
};
let Lexed::ByteLiteral(last) = last else {
unreachable!("TerminalSetItem-ByteLiteral3");
};
TerminalSetItem::ByteRange(
Located::new(first.value(), __rustylr_location_first),
Located::new(last.value(), __rustylr_location_last),
)
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant7(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_TerminalSetItem_8(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
}
let mut __rustylr_location_error = __location_stack.pop().unwrap();
__location_stack.truncate(__location_stack.len() - 2);
__data_stack.__stack.truncate(__data_stack.__stack.len() - 3);
let __res = {
data.error_recovered
.push(RecoveredError {
message: "Expected byte literal for terminal set".to_string(),
link: "https://github.com/ehwan/RustyLR/blob/main/SYNTAX.md#patterns"
.to_string(),
location: __rustylr_location_error,
});
TerminalSetItem::Terminal(Default::default())
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant7(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_TerminalSet_0(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__variant14(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__variant13(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
3usize), Some(& GrammarData::__terminals(_)))
);
}
let mut __rustylr_location_rbracket = __location_stack.pop().unwrap();
__location_stack.truncate(__location_stack.len() - 2);
let mut __rustylr_location_lbracket = __location_stack.pop().unwrap();
__data_stack.__stack.pop();
let mut TerminalSetItem = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant14(val) => val,
_ => unreachable!(),
};
let mut caret = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant13(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.pop();
let __res = {
TerminalSet {
negate: caret.is_some(),
items: TerminalSetItem,
open_location: __rustylr_location_lbracket,
close_location: __rustylr_location_rbracket,
}
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant8(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_TerminalSet_1(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__terminals(_)))
);
}
let mut __rustylr_location_dot = __location_stack.pop().unwrap();
__data_stack.__stack.pop();
let __res = {
let span = __rustylr_location_dot;
TerminalSet {
negate: true,
items: vec![],
open_location: span.clone(),
close_location: span,
}
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant8(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_Pattern_0(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__terminals(_)))
);
}
let mut __rustylr_location_ident = __location_stack.pop().unwrap();
let mut ident = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
let __res = {
let Lexed::Ident(ident) = ident else {
unreachable!("Pattern-Ident");
};
PatternArgs::Ident(Located::new(ident.to_string(), __rustylr_location_ident))
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant9(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_Pattern_1(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__variant9(_)))
);
}
let mut __rustylr_location_plus = __location_stack.pop().unwrap();
__location_stack.pop();
let mut plus = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
let mut Pattern = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant9(val) => val,
_ => unreachable!(),
};
let __res = {
let Lexed::Plus(plus) = plus else {
unreachable!("Pattern-Plus");
};
PatternArgs::Plus {
base: Box::new(Pattern),
op_location: __rustylr_location_plus,
}
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant9(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_Pattern_2(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__variant9(_)))
);
}
let mut __rustylr_location_star = __location_stack.pop().unwrap();
__location_stack.pop();
__data_stack.__stack.pop();
let mut Pattern = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant9(val) => val,
_ => unreachable!(),
};
let __res = {
PatternArgs::Star {
base: Box::new(Pattern),
op_location: __rustylr_location_star,
}
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant9(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_Pattern_3(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__variant9(_)))
);
}
let mut __rustylr_location_question = __location_stack.pop().unwrap();
__location_stack.pop();
__data_stack.__stack.pop();
let mut Pattern = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant9(val) => val,
_ => unreachable!(),
};
let __res = {
PatternArgs::Question {
base: Box::new(Pattern),
op_location: __rustylr_location_question,
}
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant9(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_Pattern_4(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__variant9(_)))
);
}
let mut __rustylr_location_exclamation = __location_stack.pop().unwrap();
__location_stack.pop();
__data_stack.__stack.pop();
let mut Pattern = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant9(val) => val,
_ => unreachable!(),
};
let __res = {
PatternArgs::Exclamation {
base: Box::new(Pattern),
op_location: __rustylr_location_exclamation,
}
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant9(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_Pattern_5(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__variant8(_)))
);
}
__location_stack.pop();
let mut TerminalSet = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant8(val) => val,
_ => unreachable!(),
};
let __res = { PatternArgs::TerminalSet(TerminalSet) };
if __push_data {
__data_stack.__stack.push(GrammarData::__variant9(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_Pattern_6(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__variant16(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
}
let mut __rustylr_location_rparen = __location_stack.pop().unwrap();
__location_stack.pop();
let mut __rustylr_location_lparen = __location_stack.pop().unwrap();
__data_stack.__stack.pop();
let mut Pattern = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant16(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.pop();
let __res = {
PatternArgs::Group {
alternatives: Pattern,
open_location: __rustylr_location_lparen,
close_location: __rustylr_location_rparen,
}
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant9(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_Pattern_7(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.pop();
let mut __rustylr_location_error = __location_stack.pop().unwrap();
__location_stack.pop();
__data_stack.__stack.truncate(__data_stack.__stack.len() - 3);
let __res = {
data.error_recovered
.push(RecoveredError {
message: "syntax error when parsing GROUP".to_string(),
link: "https://github.com/ehwan/RustyLR/blob/main/SYNTAX.md#patterns"
.to_string(),
location: __rustylr_location_error,
});
PatternArgs::Ident(Default::default())
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant9(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_Pattern_8(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__terminals(_)))
);
}
let mut __rustylr_location_byte_literal = __location_stack.pop().unwrap();
let mut byte_literal = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
let __res = {
let Lexed::ByteLiteral(b) = byte_literal else {
unreachable!("Pattern-ByteLiteral");
};
PatternArgs::Byte(Located::new(b.value(), __rustylr_location_byte_literal))
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant9(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_Pattern_9(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__terminals(_)))
);
}
let mut __rustylr_location_byte_str_literal = __location_stack.pop().unwrap();
let mut byte_str_literal = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
let __res = {
let Lexed::ByteStrLiteral(b) = byte_str_literal else {
unreachable!("Pattern-ByteStringLiteral");
};
PatternArgs::ByteString(
Located::new(b.value(), __rustylr_location_byte_str_literal),
)
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant9(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_Pattern_10(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__terminals(_)))
);
}
let mut __rustylr_location_char_literal = __location_stack.pop().unwrap();
let mut char_literal = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
let __res = {
let Lexed::CharLiteral(c) = char_literal else {
unreachable!("Pattern-CharLiteral");
};
PatternArgs::Char(Located::new(c.value(), __rustylr_location_char_literal))
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant9(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_Pattern_11(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__terminals(_)))
);
}
let mut __rustylr_location_str_literal = __location_stack.pop().unwrap();
let mut str_literal = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
let __res = {
let Lexed::StrLiteral(s) = str_literal else {
unreachable!("Pattern-StringLiteral");
};
PatternArgs::String(Located::new(s.value(), __rustylr_location_str_literal))
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant9(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_Pattern_12(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__variant9(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__variant9(_)))
);
}
__location_stack.truncate(__location_stack.len() - 3);
let mut p2 = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant9(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.pop();
let mut p1 = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant9(val) => val,
_ => unreachable!(),
};
let __res = {
PatternArgs::Minus {
base: Box::new(p1),
exclude: Box::new(p2),
}
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant9(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_Pattern_13(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__variant9(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
3usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
4usize), Some(& GrammarData::__variant9(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
5usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
6usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
7usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.truncate(__location_stack.len() - 6);
let mut __rustylr_location_ident = __location_stack.pop().unwrap();
__location_stack.pop();
__data_stack.__stack.truncate(__data_stack.__stack.len() - 2);
let mut del = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant9(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.pop();
let mut base = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant9(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.pop();
let mut ident = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.pop();
let __res = {
let Lexed::Ident(ident) = ident else {
unreachable!("Pattern-Sep-Ident");
};
if ident != "sep" {
data.error_recovered
.push(RecoveredError {
message: "Expected $sep".to_string(),
link: "https://github.com/ehwan/RustyLR/blob/main/SYNTAX.md#patterns"
.to_string(),
location: __rustylr_location_ident,
});
}
PatternArgs::Sep {
base: Box::new(base),
delimiter: Box::new(del),
at_least_one: false,
location: *__rustylr_location0,
}
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant9(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_Pattern_14(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
3usize), Some(& GrammarData::__variant9(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
4usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
5usize), Some(& GrammarData::__variant9(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
6usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
7usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
8usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.truncate(__location_stack.len() - 7);
let mut __rustylr_location_ident = __location_stack.pop().unwrap();
__location_stack.pop();
__data_stack.__stack.truncate(__data_stack.__stack.len() - 3);
let mut del = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant9(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.pop();
let mut base = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant9(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.pop();
let mut ident = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.pop();
let __res = {
let Lexed::Ident(ident) = ident else {
unreachable!("Pattern-Sep-Ident");
};
if ident != "sep" {
data.error_recovered
.push(RecoveredError {
message: "Expected $sep".to_string(),
link: "https://github.com/ehwan/RustyLR/blob/main/SYNTAX.md#patterns"
.to_string(),
location: __rustylr_location_ident,
});
}
PatternArgs::Sep {
base: Box::new(base),
delimiter: Box::new(del),
at_least_one: true,
location: *__rustylr_location0,
}
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant9(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_Pattern_15(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
3usize), Some(& GrammarData::__variant9(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
4usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
5usize), Some(& GrammarData::__variant9(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
6usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
7usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
8usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.truncate(__location_stack.len() - 7);
let mut __rustylr_location_ident = __location_stack.pop().unwrap();
__location_stack.pop();
__data_stack.__stack.truncate(__data_stack.__stack.len() - 3);
let mut del = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant9(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.pop();
let mut base = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant9(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.pop();
let mut ident = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.pop();
let __res = {
let Lexed::Ident(ident) = ident else {
unreachable!("Pattern-Sep-Ident");
};
if ident != "sep" {
data.error_recovered
.push(RecoveredError {
message: "Expected $sep".to_string(),
link: "https://github.com/ehwan/RustyLR/blob/main/SYNTAX.md#patterns"
.to_string(),
location: __rustylr_location_ident,
});
}
PatternArgs::Sep {
base: Box::new(base),
delimiter: Box::new(del),
at_least_one: false,
location: *__rustylr_location0,
}
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant9(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_Pattern_16(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__variant9(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
3usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
4usize), Some(& GrammarData::__variant9(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
5usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
6usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
7usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.pop();
let mut __rustylr_location_error = __location_stack.pop().unwrap();
__location_stack.truncate(__location_stack.len() - 4);
let mut __rustylr_location_ident = __location_stack.pop().unwrap();
__location_stack.pop();
__data_stack.__stack.truncate(__data_stack.__stack.len() - 2);
let mut del = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant9(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.pop();
let mut base = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant9(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.pop();
let mut ident = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.pop();
let __res = {
let Lexed::Ident(ident) = ident else {
unreachable!("Pattern-Sep-Ident");
};
if ident != "sep" {
data.error_recovered
.push(RecoveredError {
message: "Expected $sep".to_string(),
link: "https://github.com/ehwan/RustyLR/blob/main/SYNTAX.md#patterns"
.to_string(),
location: __rustylr_location_ident,
});
}
data.error_recovered
.push(RecoveredError {
message: "Unexpected $sep arguments".to_string(),
link: "https://github.com/ehwan/RustyLR/blob/main/SYNTAX.md#patterns"
.to_string(),
location: __rustylr_location_error,
});
PatternArgs::Sep {
base: Box::new(base),
delimiter: Box::new(del),
at_least_one: false,
location: *__rustylr_location0,
}
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant9(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_Pattern_17(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
3usize), Some(& GrammarData::__variant9(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
4usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
5usize), Some(& GrammarData::__variant9(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
6usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
7usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
8usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.pop();
let mut __rustylr_location_error = __location_stack.pop().unwrap();
__location_stack.truncate(__location_stack.len() - 5);
let mut __rustylr_location_ident = __location_stack.pop().unwrap();
__location_stack.pop();
__data_stack.__stack.truncate(__data_stack.__stack.len() - 3);
let mut del = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant9(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.pop();
let mut base = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant9(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.pop();
let mut ident = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.pop();
let __res = {
let Lexed::Ident(ident) = ident else {
unreachable!("Pattern-Sep-Ident");
};
if ident != "sep" {
data.error_recovered
.push(RecoveredError {
message: "Expected $sep".to_string(),
link: "https://github.com/ehwan/RustyLR/blob/main/SYNTAX.md#patterns"
.to_string(),
location: __rustylr_location_ident,
});
}
data.error_recovered
.push(RecoveredError {
message: "Expected '+' or '*' repetition".to_string(),
link: "https://github.com/ehwan/RustyLR/blob/main/SYNTAX.md#patterns"
.to_string(),
location: __rustylr_location_error,
});
PatternArgs::Sep {
base: Box::new(base),
delimiter: Box::new(del),
at_least_one: false,
location: *__rustylr_location0,
}
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant9(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_Action_0(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.pop();
let mut bracegroup = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
let __res = {
let Lexed::BraceGroup(bracegroup) = bracegroup else {
unreachable!("Action0");
};
Some(bracegroup)
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant2(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_Action_1(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)] {}
let __res = { None };
if __push_data {
__data_stack.__stack.push(GrammarData::__variant2(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_IdentOrLiteral_0(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__terminals(_)))
);
}
let mut __rustylr_location_ident = __location_stack.pop().unwrap();
let mut ident = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
let __res = {
let Lexed::Ident(ident) = ident else {
unreachable!("IdentOrLiteral-Ident");
};
IdentOrLiteral::Ident(
Located::new(ident.to_string(), __rustylr_location_ident),
)
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant10(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_IdentOrLiteral_1(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__terminals(_)))
);
}
let mut __rustylr_location_byte_literal = __location_stack.pop().unwrap();
let mut byte_literal = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
let __res = {
let Lexed::ByteLiteral(b) = byte_literal else {
unreachable!("IdentOrLiteral-ByteLiteral");
};
IdentOrLiteral::Byte(
Located::new(b.value(), __rustylr_location_byte_literal),
)
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant10(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_IdentOrLiteral_2(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__terminals(_)))
);
}
let mut __rustylr_location_char_literal = __location_stack.pop().unwrap();
let mut char_literal = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
let __res = {
let Lexed::CharLiteral(c) = char_literal else {
unreachable!("IdentOrLiteral-CharLiteral");
};
IdentOrLiteral::Char(
Located::new(c.value(), __rustylr_location_char_literal),
)
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant10(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_Directive_0(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__variant17(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
3usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
4usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.truncate(__location_stack.len() - 2);
let mut __rustylr_location_ident = __location_stack.pop().unwrap();
__location_stack.truncate(__location_stack.len() - 2);
__data_stack.__stack.pop();
let mut __rustylr_data_3 = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant17(val) => val,
_ => unreachable!(),
};
let mut ident = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.truncate(__data_stack.__stack.len() - 2);
let __rustylr_data_3 = Self::custom_reduce_action_0(
__rustylr_data_3,
data,
__rustylr_location0,
)?;
let mut RustCode = __rustylr_data_3;
{
let Lexed::Ident(ident) = ident else {
unreachable!("TokenDef-Ident");
};
data.terminals
.push((
Located::new(ident.to_string(), __rustylr_location_ident),
RustCode,
));
};
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
#[inline]
fn reduce_Directive_1(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
3usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.pop();
let mut __rustylr_location_ident = __location_stack.pop().unwrap();
__location_stack.truncate(__location_stack.len() - 2);
__data_stack.__stack.truncate(__data_stack.__stack.len() - 4);
{
data.error_recovered
.push(RecoveredError {
message: "Expected token definition".to_string(),
link: "https://github.com/ehwan/RustyLR/blob/main/SYNTAX.md#token-definition-must-defined"
.to_string(),
location: __rustylr_location_ident,
});
};
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
#[inline]
fn reduce_Directive_2(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
3usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.pop();
let mut __rustylr_location_error = __location_stack.pop().unwrap();
__location_stack.truncate(__location_stack.len() - 2);
__data_stack.__stack.truncate(__data_stack.__stack.len() - 4);
{
data.error_recovered
.push(RecoveredError {
message: "Expected token name".to_string(),
link: "https://github.com/ehwan/RustyLR/blob/main/SYNTAX.md#token-definition-must-defined"
.to_string(),
location: __rustylr_location_error,
});
};
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
#[inline]
fn reduce_Directive_3(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
3usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.pop();
let mut __rustylr_location_ident = __location_stack.pop().unwrap();
__location_stack.truncate(__location_stack.len() - 2);
__data_stack.__stack.pop();
let mut ident = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.truncate(__data_stack.__stack.len() - 2);
{
let Lexed::Ident(ident) = ident else {
unreachable!("StartDef-Ident");
};
data.start_rule_name
.push(Located::new(ident.to_string(), __rustylr_location_ident));
};
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
#[inline]
fn reduce_Directive_4(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
3usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.pop();
let mut __rustylr_location_error = __location_stack.pop().unwrap();
__location_stack.truncate(__location_stack.len() - 2);
__data_stack.__stack.truncate(__data_stack.__stack.len() - 4);
{
data.error_recovered
.push(RecoveredError {
message: "Expected start rule name".to_string(),
link: "https://github.com/ehwan/RustyLR/blob/main/SYNTAX.md#start-symbol-must-defined"
.to_string(),
location: __rustylr_location_error,
});
};
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
#[inline]
fn reduce_Directive_5(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__variant17(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
3usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.truncate(__location_stack.len() - 2);
let mut __rustylr_location_tokentype = __location_stack.pop().unwrap();
__location_stack.pop();
__data_stack.__stack.pop();
let mut __rustylr_data_2 = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant17(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.truncate(__data_stack.__stack.len() - 2);
let __rustylr_data_2 = Self::custom_reduce_action_0(
__rustylr_data_2,
data,
__rustylr_location0,
)?;
let mut RustCode = __rustylr_data_2;
{
data.token_typename.push((__rustylr_location_tokentype, RustCode));
};
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
#[inline]
fn reduce_Directive_6(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.pop();
let mut __rustylr_location_tokentype = __location_stack.pop().unwrap();
__location_stack.pop();
__data_stack.__stack.truncate(__data_stack.__stack.len() - 3);
{
data.error_recovered
.push(RecoveredError {
message: "Expected token type definition".to_string(),
link: "https://github.com/ehwan/RustyLR/blob/main/SYNTAX.md#token-type-must-defined"
.to_string(),
location: __rustylr_location_tokentype,
});
};
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
#[inline]
fn reduce_Directive_7(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__variant17(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
3usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.truncate(__location_stack.len() - 2);
let mut __rustylr_location_userdata = __location_stack.pop().unwrap();
__location_stack.pop();
__data_stack.__stack.pop();
let mut __rustylr_data_2 = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant17(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.truncate(__data_stack.__stack.len() - 2);
let __rustylr_data_2 = Self::custom_reduce_action_0(
__rustylr_data_2,
data,
__rustylr_location0,
)?;
let mut RustCode = __rustylr_data_2;
{
data.userdata_typename.push((__rustylr_location_userdata, RustCode));
};
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
#[inline]
fn reduce_Directive_8(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.pop();
let mut __rustylr_location_userdata = __location_stack.pop().unwrap();
__location_stack.pop();
__data_stack.__stack.truncate(__data_stack.__stack.len() - 3);
{
data.error_recovered
.push(RecoveredError {
message: "Expected userdata definition".to_string(),
link: "https://github.com/ehwan/RustyLR/blob/main/SYNTAX.md#userdata-type-optional"
.to_string(),
location: __rustylr_location_userdata,
});
};
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
#[inline]
fn reduce_Directive_9(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__variant18(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
3usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.truncate(__location_stack.len() - 2);
let mut __rustylr_location_left = __location_stack.pop().unwrap();
__location_stack.pop();
__data_stack.__stack.pop();
let mut IdentOrLiteral = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant18(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.truncate(__data_stack.__stack.len() - 2);
{
data.precedences
.push((__rustylr_location_left, Some(ReduceType::Left), IdentOrLiteral));
};
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
#[inline]
fn reduce_Directive_10(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
3usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.pop();
let mut __rustylr_location_error = __location_stack.pop().unwrap();
__location_stack.truncate(__location_stack.len() - 2);
__data_stack.__stack.truncate(__data_stack.__stack.len() - 4);
{
data.error_recovered
.push(RecoveredError {
message: "Expected <ident> to token or <literal>".to_string(),
link: "https://github.com/ehwan/RustyLR/blob/main/SYNTAX.md#operator-precedence"
.to_string(),
location: __rustylr_location_error,
});
};
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
#[inline]
fn reduce_Directive_11(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__variant18(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
3usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.truncate(__location_stack.len() - 2);
let mut __rustylr_location_right = __location_stack.pop().unwrap();
__location_stack.pop();
__data_stack.__stack.pop();
let mut IdentOrLiteral = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant18(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.truncate(__data_stack.__stack.len() - 2);
{
data.precedences
.push((
__rustylr_location_right,
Some(ReduceType::Right),
IdentOrLiteral,
));
};
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
#[inline]
fn reduce_Directive_12(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
3usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.pop();
let mut __rustylr_location_error = __location_stack.pop().unwrap();
__location_stack.truncate(__location_stack.len() - 2);
__data_stack.__stack.truncate(__data_stack.__stack.len() - 4);
{
data.error_recovered
.push(RecoveredError {
message: "Expected <ident> to token or <literal>".to_string(),
link: "https://github.com/ehwan/RustyLR/blob/main/SYNTAX.md#operator-precedence"
.to_string(),
location: __rustylr_location_error,
});
};
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
#[inline]
fn reduce_Directive_13(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__variant18(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
3usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.truncate(__location_stack.len() - 2);
let mut __rustylr_location_precedence = __location_stack.pop().unwrap();
__location_stack.pop();
__data_stack.__stack.pop();
let mut IdentOrLiteral = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant18(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.truncate(__data_stack.__stack.len() - 2);
{
data.precedences.push((__rustylr_location_precedence, None, IdentOrLiteral));
};
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
#[inline]
fn reduce_Directive_14(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
3usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.pop();
let mut __rustylr_location_error = __location_stack.pop().unwrap();
__location_stack.truncate(__location_stack.len() - 2);
__data_stack.__stack.truncate(__data_stack.__stack.len() - 4);
{
data.error_recovered
.push(RecoveredError {
message: "Expected <ident> to token or <literal>".to_string(),
link: "https://github.com/ehwan/RustyLR/blob/main/SYNTAX.md#operator-precedence"
.to_string(),
location: __rustylr_location_error,
});
};
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
#[inline]
fn reduce_Directive_15(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__variant17(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
3usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.truncate(__location_stack.len() - 2);
let mut __rustylr_location_errortype = __location_stack.pop().unwrap();
__location_stack.pop();
__data_stack.__stack.pop();
let mut __rustylr_data_2 = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant17(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.truncate(__data_stack.__stack.len() - 2);
let __rustylr_data_2 = Self::custom_reduce_action_0(
__rustylr_data_2,
data,
__rustylr_location0,
)?;
let mut RustCode = __rustylr_data_2;
{
data.error_typename.push((__rustylr_location_errortype, RustCode));
};
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
#[inline]
fn reduce_Directive_16(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.pop();
let mut __rustylr_location_errortype = __location_stack.pop().unwrap();
__location_stack.pop();
__data_stack.__stack.truncate(__data_stack.__stack.len() - 3);
{
data.error_recovered
.push(RecoveredError {
message: "Expected error type definition".to_string(),
link: "https://github.com/ehwan/RustyLR/blob/main/SYNTAX.md#error-type-optional"
.to_string(),
location: __rustylr_location_errortype,
});
};
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
#[inline]
fn reduce_Directive_17(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__variant17(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
3usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.truncate(__location_stack.len() - 2);
let mut __rustylr_location_moduleprefix = __location_stack.pop().unwrap();
__location_stack.pop();
__data_stack.__stack.pop();
let mut __rustylr_data_2 = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant17(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.truncate(__data_stack.__stack.len() - 2);
let __rustylr_data_2 = Self::custom_reduce_action_0(
__rustylr_data_2,
data,
__rustylr_location0,
)?;
let mut RustCode = __rustylr_data_2;
{
data.module_prefix.push((__rustylr_location_moduleprefix, RustCode));
};
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
#[inline]
fn reduce_Directive_18(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.pop();
let mut __rustylr_location_moduleprefix = __location_stack.pop().unwrap();
__location_stack.pop();
__data_stack.__stack.truncate(__data_stack.__stack.len() - 3);
{
data.error_recovered
.push(RecoveredError {
message: "Expected moduleprefix definition".to_string(),
link: "This is hidden directive, user must not use this explicitly"
.to_string(),
location: __rustylr_location_moduleprefix,
});
};
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
#[inline]
fn reduce_Directive_19(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.truncate(__location_stack.len() - 3);
__data_stack.__stack.pop();
let mut glr = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.pop();
{
data.glr = true;
};
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
#[inline]
fn reduce_Directive_20(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
3usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.pop();
let mut __rustylr_location_error = __location_stack.pop().unwrap();
__location_stack.truncate(__location_stack.len() - 2);
__data_stack.__stack.truncate(__data_stack.__stack.len() - 4);
{
data.error_recovered
.push(RecoveredError {
message: "Expected semicolon".to_string(),
link: "https://github.com/ehwan/RustyLR/blob/main/SYNTAX.md#glr-parser-generation"
.to_string(),
location: __rustylr_location_error,
});
};
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
#[inline]
fn reduce_Directive_21(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.truncate(__location_stack.len() - 3);
__data_stack.__stack.pop();
let mut lalr = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.pop();
{
data.lalr = true;
};
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
#[inline]
fn reduce_Directive_22(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
3usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.pop();
let mut __rustylr_location_error = __location_stack.pop().unwrap();
__location_stack.truncate(__location_stack.len() - 2);
__data_stack.__stack.truncate(__data_stack.__stack.len() - 4);
{
data.error_recovered
.push(RecoveredError {
message: "Expected semicolon".to_string(),
link: "https://github.com/ehwan/RustyLR/blob/main/SYNTAX.md#lalr-parser-generation"
.to_string(),
location: __rustylr_location_error,
});
};
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
#[inline]
fn reduce_Directive_23(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.truncate(__location_stack.len() - 3);
__data_stack.__stack.truncate(__data_stack.__stack.len() - 3);
{
data.no_optim = true;
};
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
#[inline]
fn reduce_Directive_24(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
3usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.pop();
let mut __rustylr_location_error = __location_stack.pop().unwrap();
__location_stack.truncate(__location_stack.len() - 2);
__data_stack.__stack.truncate(__data_stack.__stack.len() - 4);
{
data.error_recovered
.push(RecoveredError {
message: "Expected semicolon".to_string(),
link: "https://github.com/ehwan/RustyLR/blob/main/SYNTAX.md#no-optimization"
.to_string(),
location: __rustylr_location_error,
});
};
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
#[inline]
fn reduce_Directive_25(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__variant17(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
3usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.truncate(__location_stack.len() - 2);
let mut __rustylr_location_location = __location_stack.pop().unwrap();
__location_stack.pop();
__data_stack.__stack.pop();
let mut __rustylr_data_2 = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant17(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.truncate(__data_stack.__stack.len() - 2);
let __rustylr_data_2 = Self::custom_reduce_action_0(
__rustylr_data_2,
data,
__rustylr_location0,
)?;
let mut RustCode = __rustylr_data_2;
{
data.location_typename.push((__rustylr_location_location, RustCode));
};
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
#[inline]
fn reduce_Directive_26(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.pop();
let mut __rustylr_location_location = __location_stack.pop().unwrap();
__location_stack.pop();
__data_stack.__stack.pop();
let mut location = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.pop();
{
data.error_recovered
.push(RecoveredError {
message: "Expected location type definition".to_string(),
link: "https://github.com/ehwan/RustyLR/blob/main/SYNTAX.md#location-tracking"
.to_string(),
location: __rustylr_location_location,
});
};
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
#[inline]
fn reduce_Directive_27(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.pop();
let mut __rustylr_location_error = __location_stack.pop().unwrap();
__location_stack.pop();
__data_stack.__stack.truncate(__data_stack.__stack.len() - 3);
{
data.error_recovered
.push(RecoveredError {
message: "Expected directive, e.g. %token, %start, ...".to_string(),
link: "https://github.com/ehwan/RustyLR/blob/main/SYNTAX.md#syntax"
.to_string(),
location: __rustylr_location_error,
});
};
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
#[inline]
fn reduce_GrammarLine_0(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__variant1(_)))
);
}
__location_stack.pop();
let mut Rule = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant1(val) => *val,
_ => unreachable!(),
};
{
data.rules.push(Rule);
};
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
#[inline]
fn reduce__TokenMappedPlus15_0(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__variant6(_)))
);
}
__location_stack.pop();
let mut A = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant6(val) => *val,
_ => unreachable!(),
};
let __res = { vec![A] };
if __push_data {
__data_stack.__stack.push(GrammarData::__variant11(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce__TokenMappedPlus15_1(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__variant6(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__variant11(_)))
);
}
__location_stack.truncate(__location_stack.len() - 2);
let mut A = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant6(val) => *val,
_ => unreachable!(),
};
let mut Ap = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant11(val) => val,
_ => unreachable!(),
};
let __res = {
Ap.push(A);
Ap
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant11(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce__TokenMappedStar16_0(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__variant11(_)))
);
}
__location_stack.pop();
let mut __token0 = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant11(val) => val,
_ => unreachable!(),
};
let __res = __token0;
if __push_data {
__data_stack.__stack.push(GrammarData::__variant11(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce__TokenMappedStar16_1(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)] {}
let __res = { vec![] };
if __push_data {
__data_stack.__stack.push(GrammarData::__variant11(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce__PrecDefPlus17_0(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__variant5(_)))
);
}
__location_stack.pop();
let mut A = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant5(val) => *val,
_ => unreachable!(),
};
let __res = { vec![A] };
if __push_data {
__data_stack.__stack.push(GrammarData::__variant12(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce__PrecDefPlus17_1(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__variant5(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__variant12(_)))
);
}
__location_stack.truncate(__location_stack.len() - 2);
let mut A = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant5(val) => *val,
_ => unreachable!(),
};
let mut Ap = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant12(val) => val,
_ => unreachable!(),
};
let __res = {
Ap.push(A);
Ap
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant12(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce__PrecDefStar18_0(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__variant12(_)))
);
}
__location_stack.pop();
let mut __token0 = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant12(val) => val,
_ => unreachable!(),
};
let __res = __token0;
if __push_data {
__data_stack.__stack.push(GrammarData::__variant12(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce__PrecDefStar18_1(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)] {}
let __res = { vec![] };
if __push_data {
__data_stack.__stack.push(GrammarData::__variant12(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce__caretQuestion19_0(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.pop();
let mut A = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
let __res = Some(A);
if __push_data {
__data_stack.__stack.push(GrammarData::__variant13(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce__caretQuestion19_1(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)] {}
let __res = { None };
if __push_data {
__data_stack.__stack.push(GrammarData::__variant13(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce__TerminalSetItemPlus20_0(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__variant7(_)))
);
}
__location_stack.pop();
let mut A = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant7(val) => val,
_ => unreachable!(),
};
let __res = { vec![A] };
if __push_data {
__data_stack.__stack.push(GrammarData::__variant14(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce__TerminalSetItemPlus20_1(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__variant7(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__variant14(_)))
);
}
__location_stack.truncate(__location_stack.len() - 2);
let mut A = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant7(val) => val,
_ => unreachable!(),
};
let mut Ap = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant14(val) => val,
_ => unreachable!(),
};
let __res = {
Ap.push(A);
Ap
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant14(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce__TerminalSetItemStar21_0(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__variant14(_)))
);
}
__location_stack.pop();
let mut __token0 = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant14(val) => val,
_ => unreachable!(),
};
let __res = __token0;
if __push_data {
__data_stack.__stack.push(GrammarData::__variant14(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce__TerminalSetItemStar21_1(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)] {}
let __res = { vec![] };
if __push_data {
__data_stack.__stack.push(GrammarData::__variant14(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce__PatternPlus22_0(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__variant9(_)))
);
}
__location_stack.pop();
let mut A = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant9(val) => val,
_ => unreachable!(),
};
let __res = { vec![A] };
if __push_data {
__data_stack.__stack.push(GrammarData::__variant15(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce__PatternPlus22_1(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__variant9(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__variant15(_)))
);
}
__location_stack.truncate(__location_stack.len() - 2);
let mut A = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant9(val) => val,
_ => unreachable!(),
};
let mut Ap = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant15(val) => val,
_ => unreachable!(),
};
let __res = {
Ap.push(A);
Ap
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant15(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce__PatternStar23_0(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__variant15(_)))
);
}
__location_stack.pop();
let mut __token0 = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant15(val) => val,
_ => unreachable!(),
};
let __res = __token0;
if __push_data {
__data_stack.__stack.push(GrammarData::__variant15(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce__PatternStar23_1(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)] {}
let __res = { vec![] };
if __push_data {
__data_stack.__stack.push(GrammarData::__variant15(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce___PatternStar23SepPlus24_0(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__variant15(_)))
);
}
__location_stack.pop();
let mut __token0 = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant15(val) => val,
_ => unreachable!(),
};
let __res = { vec![__token0] };
if __push_data {
__data_stack.__stack.push(GrammarData::__variant16(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce___PatternStar23SepPlus24_1(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__variant15(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__variant16(_)))
);
}
__location_stack.truncate(__location_stack.len() - 3);
let mut __token1 = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant15(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.pop();
let mut __token0 = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant16(val) => val,
_ => unreachable!(),
};
let __res = {
__token0.push(__token1);
__token0
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant16(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce__commaQuestion25_0(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.pop();
__data_stack.__stack.pop();
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
#[inline]
fn reduce__commaQuestion25_1(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)] {}
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
#[inline]
fn reduce___TermSet26Plus27_0(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.pop();
let mut A = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
let __res = { vec![A] };
if __push_data {
__data_stack.__stack.push(GrammarData::__variant17(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce___TermSet26Plus27_1(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__variant17(_)))
);
}
__location_stack.truncate(__location_stack.len() - 2);
let mut A = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
let mut Ap = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant17(val) => val,
_ => unreachable!(),
};
let __res = {
Ap.push(A);
Ap
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant17(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce__IdentOrLiteralPlus28_0(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__variant10(_)))
);
}
__location_stack.pop();
let mut A = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant10(val) => val,
_ => unreachable!(),
};
let __res = { vec![A] };
if __push_data {
__data_stack.__stack.push(GrammarData::__variant18(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce__IdentOrLiteralPlus28_1(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::__variant10(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__variant18(_)))
);
}
__location_stack.truncate(__location_stack.len() - 2);
let mut A = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant10(val) => val,
_ => unreachable!(),
};
let mut Ap = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant18(val) => val,
_ => unreachable!(),
};
let __res = {
Ap.push(A);
Ap
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant18(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce__GrammarLinePlus29_0(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
}
__location_stack.pop();
__data_stack.__stack.pop();
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
#[inline]
fn reduce__GrammarLinePlus29_1(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::Empty))
);
}
__location_stack.truncate(__location_stack.len() - 2);
__data_stack.__stack.truncate(__data_stack.__stack.len() - 2);
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
}
#[rustfmt::skip]
#[allow(
unused_braces,
unused_parens,
non_snake_case,
non_camel_case_types,
unused_variables
)]
impl ::rusty_lr_core::parser::data_stack::DataStack for GrammarDataStack {
type Term = Lexed;
type NonTerm = GrammarNonTerminals;
type ReduceActionError = ::rusty_lr_core::DefaultReduceActionError;
type UserData = GrammarArgs;
type StartType = ();
type Location = Location;
fn pop_start(&mut self) -> Option<Self::StartType> {
self.__stack.pop();
match self.__stack.pop() {
Some(GrammarData::Empty) => Some(()),
_ => None,
}
}
fn pop(&mut self) {
self.__stack.pop();
}
fn push_terminal(&mut self, term: Self::Term) {
self.__stack.push(GrammarData::__terminals(term));
}
fn push_empty(&mut self) {
self.__stack.push(GrammarData::Empty);
}
fn clear(&mut self) {
self.__stack.clear();
}
fn reserve(&mut self, additional: usize) {
self.__stack.reserve(additional);
}
fn split_off(&mut self, at: usize) -> Self {
Self {
__stack: self.__stack.split_off(at),
}
}
fn truncate(&mut self, at: usize) {
self.__stack.truncate(at);
}
fn append(&mut self, other: &mut Self) {
self.__stack.append(&mut other.__stack);
}
fn reduce_action(
data_stack: &mut Self,
location_stack: &mut Vec<Location>,
push_data: bool,
rule_index: usize,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Self::Term>,
user_data: &mut Self::UserData,
location0: &mut Self::Location,
) -> Result<(), Self::ReduceActionError> {
match rule_index {
0usize => {
Self::reduce_Rule_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
1usize => {
Self::reduce_RuleType_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
2usize => {
Self::reduce_RuleType_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
3usize => {
Self::reduce_RuleLines_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
4usize => {
Self::reduce_RuleLines_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
5usize => {
Self::reduce_RuleLine_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
6usize => {
Self::reduce_PrecDef_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
7usize => {
Self::reduce_PrecDef_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
8usize => {
Self::reduce_PrecDef_2(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
9usize => {
Self::reduce_PrecDef_3(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
10usize => {
Self::reduce_PrecDef_4(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
11usize => {
Self::reduce_TokenMapped_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
12usize => {
Self::reduce_TokenMapped_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
13usize => {
Self::reduce_TerminalSetItem_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
14usize => {
Self::reduce_TerminalSetItem_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
15usize => {
Self::reduce_TerminalSetItem_2(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
16usize => {
Self::reduce_TerminalSetItem_3(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
17usize => {
Self::reduce_TerminalSetItem_4(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
18usize => {
Self::reduce_TerminalSetItem_5(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
19usize => {
Self::reduce_TerminalSetItem_6(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
20usize => {
Self::reduce_TerminalSetItem_7(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
21usize => {
Self::reduce_TerminalSetItem_8(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
22usize => {
Self::reduce_TerminalSet_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
23usize => {
Self::reduce_TerminalSet_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
24usize => {
Self::reduce_Pattern_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
25usize => {
Self::reduce_Pattern_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
26usize => {
Self::reduce_Pattern_2(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
27usize => {
Self::reduce_Pattern_3(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
28usize => {
Self::reduce_Pattern_4(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
29usize => {
Self::reduce_Pattern_5(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
30usize => {
Self::reduce_Pattern_6(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
31usize => {
Self::reduce_Pattern_7(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
32usize => {
Self::reduce_Pattern_8(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
33usize => {
Self::reduce_Pattern_9(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
34usize => {
Self::reduce_Pattern_10(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
35usize => {
Self::reduce_Pattern_11(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
36usize => {
Self::reduce_Pattern_12(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
37usize => {
Self::reduce_Pattern_13(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
38usize => {
Self::reduce_Pattern_14(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
39usize => {
Self::reduce_Pattern_15(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
40usize => {
Self::reduce_Pattern_16(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
41usize => {
Self::reduce_Pattern_17(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
42usize => {
Self::reduce_Action_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
43usize => {
Self::reduce_Action_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
44usize => {
Self::reduce_IdentOrLiteral_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
45usize => {
Self::reduce_IdentOrLiteral_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
46usize => {
Self::reduce_IdentOrLiteral_2(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
47usize => {
Self::reduce_Directive_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
48usize => {
Self::reduce_Directive_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
49usize => {
Self::reduce_Directive_2(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
50usize => {
Self::reduce_Directive_3(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
51usize => {
Self::reduce_Directive_4(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
52usize => {
Self::reduce_Directive_5(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
53usize => {
Self::reduce_Directive_6(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
54usize => {
Self::reduce_Directive_7(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
55usize => {
Self::reduce_Directive_8(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
56usize => {
Self::reduce_Directive_9(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
57usize => {
Self::reduce_Directive_10(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
58usize => {
Self::reduce_Directive_11(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
59usize => {
Self::reduce_Directive_12(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
60usize => {
Self::reduce_Directive_13(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
61usize => {
Self::reduce_Directive_14(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
62usize => {
Self::reduce_Directive_15(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
63usize => {
Self::reduce_Directive_16(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
64usize => {
Self::reduce_Directive_17(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
65usize => {
Self::reduce_Directive_18(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
66usize => {
Self::reduce_Directive_19(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
67usize => {
Self::reduce_Directive_20(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
68usize => {
Self::reduce_Directive_21(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
69usize => {
Self::reduce_Directive_22(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
70usize => {
Self::reduce_Directive_23(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
71usize => {
Self::reduce_Directive_24(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
72usize => {
Self::reduce_Directive_25(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
73usize => {
Self::reduce_Directive_26(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
74usize => {
Self::reduce_Directive_27(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
75usize => {
Self::reduce_GrammarLine_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
78usize => {
Self::reduce__TokenMappedPlus15_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
79usize => {
Self::reduce__TokenMappedPlus15_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
80usize => {
Self::reduce__TokenMappedStar16_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
81usize => {
Self::reduce__TokenMappedStar16_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
82usize => {
Self::reduce__PrecDefPlus17_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
83usize => {
Self::reduce__PrecDefPlus17_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
84usize => {
Self::reduce__PrecDefStar18_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
85usize => {
Self::reduce__PrecDefStar18_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
86usize => {
Self::reduce__caretQuestion19_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
87usize => {
Self::reduce__caretQuestion19_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
88usize => {
Self::reduce__TerminalSetItemPlus20_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
89usize => {
Self::reduce__TerminalSetItemPlus20_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
90usize => {
Self::reduce__TerminalSetItemStar21_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
91usize => {
Self::reduce__TerminalSetItemStar21_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
92usize => {
Self::reduce__PatternPlus22_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
93usize => {
Self::reduce__PatternPlus22_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
94usize => {
Self::reduce__PatternStar23_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
95usize => {
Self::reduce__PatternStar23_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
96usize => {
Self::reduce___PatternStar23SepPlus24_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
97usize => {
Self::reduce___PatternStar23SepPlus24_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
98usize => {
Self::reduce__commaQuestion25_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
99usize => {
Self::reduce__commaQuestion25_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
141usize => {
Self::reduce___TermSet26Plus27_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
142usize => {
Self::reduce___TermSet26Plus27_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
143usize => {
Self::reduce__IdentOrLiteralPlus28_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
144usize => {
Self::reduce__IdentOrLiteralPlus28_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
145usize => {
Self::reduce__GrammarLinePlus29_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
146usize => {
Self::reduce__GrammarLinePlus29_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
_ => {
unreachable!("Invalid Rule: {}", rule_index);
}
}
}
}
#[allow(
unused_braces,
unused_parens,
unused_variables,
non_snake_case,
unused_mut
)]
#[derive(Clone, Copy)]
pub struct GrammarParser;
unsafe impl ::std::marker::Send for GrammarParser {}
unsafe impl ::std::marker::Sync for GrammarParser {}
#[rustfmt::skip]
impl ::rusty_lr_core::parser::Parser for GrammarParser {
type Term = Lexed;
type TermClass = GrammarTerminalClasses;
type NonTerm = GrammarNonTerminals;
type StateIndex = u8;
type ReduceRules = u8;
type Tables = GrammarTables;
const ERROR_USED: bool = true;
fn precedence_types(level: u8) -> Option<::rusty_lr_core::rule::ReduceType> {
#[allow(unreachable_patterns)]
match level {
0..=1 => Some(::rusty_lr_core::rule::ReduceType::Left),
_ => None,
}
}
fn get_tables() -> &'static GrammarTables {
static TABLES: std::sync::OnceLock<GrammarTables> = std::sync::OnceLock::new();
TABLES
.get_or_init(|| {
static RULE_NAMES: &[u32] = &[
0, 1, 1, 2, 2, 3, 4, 4, 4, 4, 4, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7,
7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 10,
10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 13, 14,
14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
23, 23, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 27, 27, 28, 28,
29,
];
static RULE_PRECEDENCES: &[u32] = &[
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0,
0, 0, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 1, 0, 5, 5, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
];
static RULE_LENGTHS: &[u32] = &[
5, 1, 0, 3, 1, 3, 3, 3, 3, 3, 2, 1, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 4,
1, 1, 2, 2, 2, 2, 1, 3, 3, 1, 1, 1, 1, 3, 8, 9, 9, 8, 9, 1, 0, 1, 1,
1, 5, 4, 4, 4, 4, 4, 3, 4, 3, 4, 4, 4, 4, 4, 4, 4, 3, 4, 3, 3, 4, 3,
4, 3, 4, 4, 3, 3, 1, 1, 1, 1, 2, 1, 0, 1, 2, 1, 0, 1, 0, 1, 2, 1, 0,
1, 2, 1, 0, 1, 3, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 2, 1, 2, 1, 2, 2,
];
static SHIFT_TERM_DATA: &[u32] = &[
2147516416, 2150629380, 2147549199, 2147614722, 2147647488,
2147745799, 2147778568, 2147876875, 2147909644, 2147942413,
2147975182, 2148007953, 2148040723, 2147680261, 2147713024,
2147745799, 2147778568, 2147876875, 2147909644, 2147942413,
2147975182, 2148007953, 2148040723, 2147811328, 2147844113,
2147713024, 2147745799, 2147778568, 2147876875, 2147909644,
2147942413, 2147975182, 2148007953, 2148040723, 2147713024,
2147745799, 2147778568, 2147876875, 2147909644, 2147942413,
2147975182, 2148007953, 2148040723, 2148794410, 2148073478,
2148139008, 2148270091, 2148401165, 2148171817, 2148204544,
2148237354, 2148302889, 2148335627, 2148368426, 2148433961,
2148466701, 2148499498, 2148139008, 2148270091, 2148401165,
2148663316, 2148761609, 2148892709, 2148925478, 2148958247,
2148991016, 2149023785, 2147713024, 2147745799, 2147778568,
2147876875, 2147909644, 2147942413, 2147975182, 2148007953,
2148040723, 2148827154, 2148892709, 2148925478, 2148958247,
2148991016, 2149023785, 2147713024, 2147745799, 2147778568,
2147876875, 2147909644, 2147942413, 2147975182, 2148007953,
2148040723, 2148892709, 2148925478, 2148958247, 2148991016,
2147713024, 2147745799, 2147778568, 2147876875, 2147909644,
2147942413, 2147975182, 2148007953, 2148040723, 2148892709,
2148925478, 2148958247, 2148991016, 2149023785, 2149220355,
2149285906, 2147713024, 2147745799, 2147778568, 2147876875,
2147909644, 2147942413, 2147975182, 2148007953, 2148040723,
2149351433, 2148892709, 2148925478, 2148958247, 2148991016,
2149023785, 2149580842, 2149384229, 2149449766, 2149515306,
2149416978, 2149482514, 2149548050, 2149613586, 2149679122,
2148892709, 2148925478, 2148958247, 2148991016, 2149023785,
2149777411, 3080228, 2147647488, 2147745799, 2147778568, 2147876875,
2147909644, 2147942413, 2147975182, 2148007953, 2148040723,
2148892709, 2148925478, 2148958247, 2148991016, 2149023785,
2147647488, 2147745799, 2147778568, 2147876875, 2147909644,
2147942413, 2147975182, 2148007953, 2148040723, 2150006788,
2150039583, 2150236194, 2150334506, 2150072320, 2150105099,
2150137869, 2150170666, 2150268938, 2150301738, 2150006788,
2150498320, 2150662165, 2150891542, 2151055383, 2151350296,
2151514137, 2151645210, 2151776283, 2151907356, 2152038429,
2152169502, 2152300576, 2152464417, 2152595491, 2152726570,
2150072320, 2150105099, 2150137869, 2150694954, 3244068, 2150072320,
2150105099, 2150137869, 3342372, 2150072320, 2150105099, 2150137869,
2150924330, 3473444, 2150072320, 2150105099, 2150137869, 3538980,
2151088128, 2151284778, 2151153664, 2151153665, 2151153666,
2151153667, 2151153668, 2151153669, 2151153670, 2151153671,
2151153672, 2151153673, 2151153674, 2151153675, 2151153676,
2151153677, 2151153678, 2151153679, 2151153680, 2151153681,
2151153682, 2151153683, 2151153684, 2151153685, 2151153686,
2151153687, 2151153688, 2151153689, 2151153690, 2151153691,
2151153692, 2151153693, 2151153694, 2151153695, 2151153696,
2151153697, 2151153698, 2151153699, 3637284, 2151153701, 2151153702,
2151153703, 2151153704, 2151153705, 2151251968, 2151251969,
2151251970, 2151251971, 2151251972, 2151251973, 2151251974,
2151251975, 2151251976, 2151251977, 2151251978, 2151251979,
2151251980, 2151251981, 2151251982, 2151251983, 2151251984,
2151251985, 2151251986, 2151251987, 2151251988, 2151251989,
2151251990, 2151251991, 2151251992, 2151251993, 2151251994,
2151251995, 2151251996, 2151251997, 2151251998, 2151251999,
2151252000, 2151252001, 2151252002, 2151252003, 3735588, 2151252005,
2151252006, 2151252007, 2151252008, 2151252009, 3833892, 2151383040,
2151448618, 3932196, 3997732, 2151153664, 2151153665, 2151153666,
2151153667, 2151153668, 2151153669, 2151153670, 2151153671,
2151153672, 2151153673, 2151153674, 2151153675, 2151153676,
2151153677, 2151153678, 2151153679, 2151153680, 2151153681,
2151153682, 2151153683, 2151153684, 2151153685, 2151153686,
2151153687, 2151153688, 2151153689, 2151153690, 2151153691,
2151153692, 2151153693, 2151153694, 2151153695, 2151153696,
2151153697, 2151153698, 2151153699, 4063268, 2151153701, 2151153702,
2151153703, 2151153704, 2151153705, 2151251968, 2151251969,
2151251970, 2151251971, 2151251972, 2151251973, 2151251974,
2151251975, 2151251976, 2151251977, 2151251978, 2151251979,
2151251980, 2151251981, 2151251982, 2151251983, 2151251984,
2151251985, 2151251986, 2151251987, 2151251988, 2151251989,
2151251990, 2151251991, 2151251992, 2151251993, 2151251994,
2151251995, 2151251996, 2151251997, 2151251998, 2151251999,
2151252000, 2151252001, 2151252002, 2151252003, 4128804, 2151252005,
2151252006, 2151252007, 2151252008, 2151252009, 2151153664,
2151153665, 2151153666, 2151153667, 2151153668, 2151153669,
2151153670, 2151153671, 2151153672, 2151153673, 2151153674,
2151153675, 2151153676, 2151153677, 2151153678, 2151153679,
2151153680, 2151153681, 2151153682, 2151153683, 2151153684,
2151153685, 2151153686, 2151153687, 2151153688, 2151153689,
2151153690, 2151153691, 2151153692, 2151153693, 2151153694,
2151153695, 2151153696, 2151153697, 2151153698, 2151153699, 4194340,
2151153701, 2151153702, 2151153703, 2151153704, 2151153705,
2151251968, 2151251969, 2151251970, 2151251971, 2151251972,
2151251973, 2151251974, 2151251975, 2151251976, 2151251977,
2151251978, 2151251979, 2151251980, 2151251981, 2151251982,
2151251983, 2151251984, 2151251985, 2151251986, 2151251987,
2151251988, 2151251989, 2151251990, 2151251991, 2151251992,
2151251993, 2151251994, 2151251995, 2151251996, 2151251997,
2151251998, 2151251999, 2151252000, 2151252001, 2151252002,
2151252003, 4259876, 2151252005, 2151252006, 2151252007, 2151252008,
2151252009, 2151153664, 2151153665, 2151153666, 2151153667,
2151153668, 2151153669, 2151153670, 2151153671, 2151153672,
2151153673, 2151153674, 2151153675, 2151153676, 2151153677,
2151153678, 2151153679, 2151153680, 2151153681, 2151153682,
2151153683, 2151153684, 2151153685, 2151153686, 2151153687,
2151153688, 2151153689, 2151153690, 2151153691, 2151153692,
2151153693, 2151153694, 2151153695, 2151153696, 2151153697,
2151153698, 2151153699, 4325412, 2151153701, 2151153702, 2151153703,
2151153704, 2151153705, 2151251968, 2151251969, 2151251970,
2151251971, 2151251972, 2151251973, 2151251974, 2151251975,
2151251976, 2151251977, 2151251978, 2151251979, 2151251980,
2151251981, 2151251982, 2151251983, 2151251984, 2151251985,
2151251986, 2151251987, 2151251988, 2151251989, 2151251990,
2151251991, 2151251992, 2151251993, 2151251994, 2151251995,
2151251996, 2151251997, 2151251998, 2151251999, 2151252000,
2151252001, 2151252002, 2151252003, 4390948, 2151252005, 2151252006,
2151252007, 2151252008, 2151252009, 2151153664, 2151153665,
2151153666, 2151153667, 2151153668, 2151153669, 2151153670,
2151153671, 2151153672, 2151153673, 2151153674, 2151153675,
2151153676, 2151153677, 2151153678, 2151153679, 2151153680,
2151153681, 2151153682, 2151153683, 2151153684, 2151153685,
2151153686, 2151153687, 2151153688, 2151153689, 2151153690,
2151153691, 2151153692, 2151153693, 2151153694, 2151153695,
2151153696, 2151153697, 2151153698, 2151153699, 4456484, 2151153701,
2151153702, 2151153703, 2151153704, 2151153705, 2151251968,
2151251969, 2151251970, 2151251971, 2151251972, 2151251973,
2151251974, 2151251975, 2151251976, 2151251977, 2151251978,
2151251979, 2151251980, 2151251981, 2151251982, 2151251983,
2151251984, 2151251985, 2151251986, 2151251987, 2151251988,
2151251989, 2151251990, 2151251991, 2151251992, 2151251993,
2151251994, 2151251995, 2151251996, 2151251997, 2151251998,
2151251999, 2151252000, 2151252001, 2151252002, 2151252003, 4522020,
2151252005, 2151252006, 2151252007, 2151252008, 2151252009, 4587556,
2152103978, 4653092, 4718628, 2152235050, 4784164, 2150072320,
2150105099, 2150137869, 2152333354, 4882468, 2150072320, 2150105099,
2150137869, 4948004, 5013540, 2152529962, 5079076, 2151153664,
2151153665, 2151153666, 2151153667, 2151153668, 2151153669,
2151153670, 2151153671, 2151153672, 2151153673, 2151153674,
2151153675, 2151153676, 2151153677, 2151153678, 2151153679,
2151153680, 2151153681, 2151153682, 2151153683, 2151153684,
2151153685, 2151153686, 2151153687, 2151153688, 2151153689,
2151153690, 2151153691, 2151153692, 2151153693, 2151153694,
2151153695, 2151153696, 2151153697, 2151153698, 2151153699, 5144612,
2151153701, 2151153702, 2151153703, 2151153704, 2151153705,
2151251968, 2151251969, 2151251970, 2151251971, 2151251972,
2151251973, 2151251974, 2151251975, 2151251976, 2151251977,
2151251978, 2151251979, 2151251980, 2151251981, 2151251982,
2151251983, 2151251984, 2151251985, 2151251986, 2151251987,
2151251988, 2151251989, 2151251990, 2151251991, 2151251992,
2151251993, 2151251994, 2151251995, 2151251996, 2151251997,
2151251998, 2151251999, 2151252000, 2151252001, 2151252002,
2151252003, 5210148, 2151252005, 2151252006, 2151252007, 2151252008,
2151252009, 5275684, 2147516416, 2150629380, 2152923179,
];
static SHIFT_TERM_OFFSETS: &[u32] = &[
0, 2, 3, 3, 4, 13, 14, 23, 23, 23, 24, 25, 34, 34, 34, 34, 34, 44,
45, 45, 48, 49, 51, 51, 51, 52, 54, 54, 54, 55, 57, 57, 57, 57, 60,
60, 61, 61, 61, 67, 76, 77, 77, 82, 82, 82, 82, 82, 91, 95, 104, 109,
109, 111, 120, 120, 120, 127, 130, 131, 131, 132, 132, 133, 133, 134,
134, 135, 135, 140, 142, 151, 151, 151, 156, 165, 165, 166, 169, 173,
173, 173, 173, 173, 173, 175, 175, 175, 175, 175, 176, 176, 177, 177,
177, 177, 177, 191, 195, 196, 196, 196, 200, 200, 200, 204, 205, 205,
209, 209, 211, 253, 253, 253, 295, 295, 295, 296, 296, 298, 299, 299,
300, 300, 342, 342, 384, 384, 426, 426, 468, 468, 510, 510, 552, 552,
594, 594, 636, 636, 638, 638, 639, 639, 641, 641, 642, 642, 646, 647,
647, 651, 651, 653, 653, 654, 654, 696, 696, 738, 738, 739, 739, 739,
741, 741, 742, 742,
];
static SHIFT_NONTERM_DATA: &[u32] = &[
2152792064, 5341195, 2152824844, 2152890381, 5406748, 2147581953,
2149744642, 2150596611, 2149842949, 2148696071, 2149875720,
2149908494, 2149974031, 2148696071, 2149711880, 2148696071,
2148728840, 2148696071, 2148859912, 2149089301, 2149154838,
2149187607, 2148106258, 2148532230, 2148565011, 2148630548,
2148597766, 2148696071, 2149318664, 2148696071, 2149056520,
2148696071, 2149122056, 2148696071, 2148859912, 2149089301,
2149253142, 2149646360, 2149810179, 2149842949, 2148696071,
2149875720, 2149908494, 2149974031, 2149941253, 2148696071,
2149875720, 2150367236, 2150400016, 2150465553, 2150203402,
2150432772, 2150531081, 2150760458, 2150793243, 2150858762,
2150760458, 2150989851, 2150858762, 2151153689, 2151186458,
2151251993, 2151153689, 2151579674, 2151251993, 2151153689,
2151710746, 2151251993, 2151153689, 2151841818, 2151251993,
2151153689, 2151972890, 2151251993, 2150760458, 2152398875,
2150858762, 2151153689, 2152661018, 2151251993, 2152792064, 5341195,
2152824844, 2152857628,
];
static SHIFT_NONTERM_OFFSETS: &[u32] = &[
0, 5, 6, 6, 6, 13, 13, 15, 15, 15, 15, 15, 17, 17, 17, 17, 17, 22,
23, 23, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27,
27, 27, 27, 27, 27, 29, 29, 29, 29, 29, 29, 29, 29, 31, 31, 33, 33,
33, 33, 37, 37, 37, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 44, 44, 44, 44, 47, 47, 50, 50, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 52, 52, 53, 53, 53, 53, 53, 53, 55, 55, 55, 55, 56,
56, 56, 58, 58, 58, 59, 59, 59, 61, 61, 61, 62, 62, 62, 62, 62, 62,
62, 62, 62, 62, 64, 64, 65, 65, 67, 67, 68, 68, 70, 70, 71, 71, 73,
73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 76, 76, 76, 77, 77, 77,
77, 77, 77, 79, 79, 80, 80, 80, 80, 80, 84, 84, 84, 84,
];
static REDUCE_DATA: &[u32] = &[
2, 1, 2, 2, 1, 1, 3, 1, 81, 4, 1, 81, 16, 1, 81, 36, 1, 81, 0, 1, 24,
3, 1, 24, 4, 1, 24, 7, 1, 24, 8, 1, 24, 11, 1, 24, 12, 1, 24, 13, 1,
24, 14, 1, 24, 16, 1, 24, 17, 1, 24, 19, 1, 24, 36, 1, 24, 37, 1, 24,
38, 1, 24, 39, 1, 24, 40, 1, 24, 41, 1, 24, 0, 1, 24, 3, 1, 24, 4, 1,
24, 7, 1, 24, 8, 1, 24, 9, 1, 24, 11, 1, 24, 12, 1, 24, 13, 1, 24,
14, 1, 24, 16, 1, 24, 17, 1, 24, 18, 1, 24, 19, 1, 24, 36, 1, 24, 37,
1, 24, 38, 1, 24, 39, 1, 24, 40, 1, 24, 41, 1, 24, 42, 1, 24, 0, 1,
23, 3, 1, 23, 4, 1, 23, 7, 1, 23, 8, 1, 23, 9, 1, 23, 11, 1, 23, 12,
1, 23, 13, 1, 23, 14, 1, 23, 16, 1, 23, 17, 1, 23, 18, 1, 23, 19, 1,
23, 36, 1, 23, 37, 1, 23, 38, 1, 23, 39, 1, 23, 40, 1, 23, 41, 1, 23,
42, 1, 23, 0, 1, 32, 3, 1, 32, 4, 1, 32, 7, 1, 32, 8, 1, 32, 9, 1,
32, 11, 1, 32, 12, 1, 32, 13, 1, 32, 14, 1, 32, 16, 1, 32, 17, 1, 32,
18, 1, 32, 19, 1, 32, 36, 1, 32, 37, 1, 32, 38, 1, 32, 39, 1, 32, 40,
1, 32, 41, 1, 32, 42, 1, 32, 0, 1, 33, 3, 1, 33, 4, 1, 33, 7, 1, 33,
8, 1, 33, 9, 1, 33, 11, 1, 33, 12, 1, 33, 13, 1, 33, 14, 1, 33, 16,
1, 33, 17, 1, 33, 18, 1, 33, 19, 1, 33, 36, 1, 33, 37, 1, 33, 38, 1,
33, 39, 1, 33, 40, 1, 33, 41, 1, 33, 42, 1, 33, 0, 1, 34, 3, 1, 34,
4, 1, 34, 7, 1, 34, 8, 1, 34, 9, 1, 34, 11, 1, 34, 12, 1, 34, 13, 1,
34, 14, 1, 34, 16, 1, 34, 17, 1, 34, 18, 1, 34, 19, 1, 34, 36, 1, 34,
37, 1, 34, 38, 1, 34, 39, 1, 34, 40, 1, 34, 41, 1, 34, 42, 1, 34, 0,
1, 35, 3, 1, 35, 4, 1, 35, 7, 1, 35, 8, 1, 35, 9, 1, 35, 11, 1, 35,
12, 1, 35, 13, 1, 35, 14, 1, 35, 16, 1, 35, 17, 1, 35, 18, 1, 35, 19,
1, 35, 36, 1, 35, 37, 1, 35, 38, 1, 35, 39, 1, 35, 40, 1, 35, 41, 1,
35, 42, 1, 35, 3, 1, 95, 18, 1, 95, 0, 1, 87, 11, 1, 87, 13, 1, 87,
20, 1, 87, 0, 1, 86, 11, 1, 86, 13, 1, 86, 20, 1, 86, 20, 1, 91, 0,
1, 13, 11, 1, 13, 13, 1, 13, 20, 1, 13, 0, 1, 14, 11, 1, 14, 13, 1,
14, 20, 1, 14, 0, 1, 15, 11, 1, 15, 13, 1, 15, 20, 1, 15, 0, 1, 19,
11, 1, 19, 13, 1, 19, 20, 1, 19, 0, 1, 20, 11, 1, 20, 13, 1, 20, 20,
1, 20, 0, 1, 21, 11, 1, 21, 13, 1, 21, 20, 1, 21, 0, 1, 16, 11, 1,
16, 13, 1, 16, 20, 1, 16, 0, 1, 17, 11, 1, 17, 13, 1, 17, 20, 1, 17,
0, 1, 18, 11, 1, 18, 13, 1, 18, 20, 1, 18, 0, 1, 88, 11, 1, 88, 13,
1, 88, 20, 1, 88, 20, 1, 90, 0, 1, 89, 11, 1, 89, 13, 1, 89, 20, 1,
89, 0, 1, 22, 3, 1, 22, 4, 1, 22, 7, 1, 22, 8, 1, 22, 9, 1, 22, 11,
1, 22, 12, 1, 22, 13, 1, 22, 14, 1, 22, 16, 1, 22, 17, 1, 22, 18, 1,
22, 19, 1, 22, 36, 1, 22, 37, 1, 22, 38, 1, 22, 39, 1, 22, 40, 1, 22,
41, 1, 22, 42, 1, 22, 0, 1, 29, 3, 1, 29, 4, 1, 29, 7, 1, 29, 8, 1,
29, 9, 1, 29, 11, 1, 29, 12, 1, 29, 13, 1, 29, 14, 1, 29, 16, 1, 29,
17, 1, 29, 18, 1, 29, 19, 1, 29, 36, 1, 29, 37, 1, 29, 38, 1, 29, 39,
1, 29, 40, 1, 29, 41, 1, 29, 42, 1, 29, 0, 1, 31, 3, 1, 31, 4, 1, 31,
7, 1, 31, 8, 1, 31, 9, 1, 31, 11, 1, 31, 12, 1, 31, 13, 1, 31, 14, 1,
31, 16, 1, 31, 17, 1, 31, 18, 1, 31, 19, 1, 31, 36, 1, 31, 37, 1, 31,
38, 1, 31, 39, 1, 31, 40, 1, 31, 41, 1, 31, 42, 1, 31, 0, 1, 92, 3,
1, 92, 7, 1, 92, 8, 1, 92, 11, 1, 92, 12, 1, 92, 13, 1, 92, 14, 1,
92, 17, 1, 92, 18, 1, 92, 19, 1, 92, 0, 1, 25, 3, 1, 25, 4, 1, 25, 7,
1, 25, 8, 1, 25, 9, 1, 25, 11, 1, 25, 12, 1, 25, 13, 1, 25, 14, 1,
25, 16, 1, 25, 17, 1, 25, 18, 1, 25, 19, 1, 25, 36, 1, 25, 37, 1, 25,
38, 1, 25, 39, 1, 25, 40, 1, 25, 41, 1, 25, 42, 1, 25, 0, 1, 26, 3,
1, 26, 4, 1, 26, 7, 1, 26, 8, 1, 26, 9, 1, 26, 11, 1, 26, 12, 1, 26,
13, 1, 26, 14, 1, 26, 16, 1, 26, 17, 1, 26, 18, 1, 26, 19, 1, 26, 36,
1, 26, 37, 1, 26, 38, 1, 26, 39, 1, 26, 40, 1, 26, 41, 1, 26, 42, 1,
26, 0, 1, 27, 3, 1, 27, 4, 1, 27, 7, 1, 27, 8, 1, 27, 9, 1, 27, 11,
1, 27, 12, 1, 27, 13, 1, 27, 14, 1, 27, 16, 1, 27, 17, 1, 27, 18, 1,
27, 19, 1, 27, 36, 1, 27, 37, 1, 27, 38, 1, 27, 39, 1, 27, 40, 1, 27,
41, 1, 27, 42, 1, 27, 0, 1, 28, 3, 1, 28, 4, 1, 28, 7, 1, 28, 8, 1,
28, 9, 1, 28, 11, 1, 28, 12, 1, 28, 13, 1, 28, 14, 1, 28, 16, 1, 28,
17, 1, 28, 18, 1, 28, 19, 1, 28, 36, 1, 28, 37, 1, 28, 38, 1, 28, 39,
1, 28, 40, 1, 28, 41, 1, 28, 42, 1, 28, 0, 1, 36, 3, 1, 36, 4, 1, 36,
7, 1, 36, 8, 1, 36, 9, 1, 36, 11, 1, 36, 12, 1, 36, 13, 1, 36, 14, 1,
36, 16, 1, 36, 17, 1, 36, 18, 1, 36, 19, 1, 36, 36, 1, 36, 41, 1, 36,
42, 1, 36, 3, 1, 94, 18, 1, 94, 0, 1, 93, 3, 1, 93, 7, 1, 93, 8, 1,
93, 11, 1, 93, 12, 1, 93, 13, 1, 93, 14, 1, 93, 17, 1, 93, 18, 1, 93,
19, 1, 93, 3, 1, 96, 18, 1, 96, 3, 1, 95, 18, 1, 95, 3, 1, 97, 18, 1,
97, 0, 1, 30, 3, 1, 30, 4, 1, 30, 7, 1, 30, 8, 1, 30, 9, 1, 30, 11,
1, 30, 12, 1, 30, 13, 1, 30, 14, 1, 30, 16, 1, 30, 17, 1, 30, 18, 1,
30, 19, 1, 30, 36, 1, 30, 37, 1, 30, 38, 1, 30, 39, 1, 30, 40, 1, 30,
41, 1, 30, 42, 1, 30, 18, 1, 99, 18, 1, 98, 0, 1, 38, 3, 1, 38, 4, 1,
38, 7, 1, 38, 8, 1, 38, 9, 1, 38, 11, 1, 38, 12, 1, 38, 13, 1, 38,
14, 1, 38, 16, 1, 38, 17, 1, 38, 18, 1, 38, 19, 1, 38, 36, 1, 38, 37,
1, 38, 38, 1, 38, 39, 1, 38, 40, 1, 38, 41, 1, 38, 42, 1, 38, 0, 1,
39, 3, 1, 39, 4, 1, 39, 7, 1, 39, 8, 1, 39, 9, 1, 39, 11, 1, 39, 12,
1, 39, 13, 1, 39, 14, 1, 39, 16, 1, 39, 17, 1, 39, 18, 1, 39, 19, 1,
39, 36, 1, 39, 37, 1, 39, 38, 1, 39, 39, 1, 39, 40, 1, 39, 41, 1, 39,
42, 1, 39, 0, 1, 41, 3, 1, 41, 4, 1, 41, 7, 1, 41, 8, 1, 41, 9, 1,
41, 11, 1, 41, 12, 1, 41, 13, 1, 41, 14, 1, 41, 16, 1, 41, 17, 1, 41,
18, 1, 41, 19, 1, 41, 36, 1, 41, 37, 1, 41, 38, 1, 41, 39, 1, 41, 40,
1, 41, 41, 1, 41, 42, 1, 41, 0, 1, 40, 3, 1, 40, 4, 1, 40, 7, 1, 40,
8, 1, 40, 9, 1, 40, 11, 1, 40, 12, 1, 40, 13, 1, 40, 14, 1, 40, 16,
1, 40, 17, 1, 40, 18, 1, 40, 19, 1, 40, 36, 1, 40, 37, 1, 40, 38, 1,
40, 39, 1, 40, 40, 1, 40, 41, 1, 40, 42, 1, 40, 0, 1, 37, 3, 1, 37,
4, 1, 37, 7, 1, 37, 8, 1, 37, 9, 1, 37, 11, 1, 37, 12, 1, 37, 13, 1,
37, 14, 1, 37, 16, 1, 37, 17, 1, 37, 18, 1, 37, 19, 1, 37, 36, 1, 37,
37, 1, 37, 38, 1, 37, 39, 1, 37, 40, 1, 37, 41, 1, 37, 42, 1, 37, 0,
1, 12, 3, 1, 12, 4, 1, 12, 7, 1, 12, 8, 1, 12, 11, 1, 12, 12, 1, 12,
13, 1, 12, 14, 1, 12, 16, 1, 12, 17, 1, 12, 19, 1, 12, 36, 1, 12, 3,
1, 81, 4, 1, 81, 16, 1, 81, 36, 1, 81, 3, 1, 3, 36, 1, 3, 0, 1, 78,
3, 1, 78, 4, 1, 78, 7, 1, 78, 8, 1, 78, 11, 1, 78, 12, 1, 78, 13, 1,
78, 14, 1, 78, 16, 1, 78, 17, 1, 78, 19, 1, 78, 36, 1, 78, 0, 1, 11,
3, 1, 11, 4, 1, 11, 7, 1, 11, 8, 1, 11, 11, 1, 11, 12, 1, 11, 13, 1,
11, 14, 1, 11, 16, 1, 11, 17, 1, 11, 19, 1, 11, 36, 1, 11, 3, 1, 80,
4, 1, 80, 16, 1, 80, 36, 1, 80, 0, 1, 79, 3, 1, 79, 4, 1, 79, 7, 1,
79, 8, 1, 79, 11, 1, 79, 12, 1, 79, 13, 1, 79, 14, 1, 79, 16, 1, 79,
17, 1, 79, 19, 1, 79, 36, 1, 79, 3, 1, 85, 16, 1, 85, 36, 1, 85, 0,
1, 44, 3, 1, 44, 4, 1, 44, 11, 1, 44, 13, 1, 44, 16, 1, 44, 36, 1,
44, 0, 1, 45, 3, 1, 45, 4, 1, 45, 11, 1, 45, 13, 1, 45, 16, 1, 45,
36, 1, 45, 0, 1, 46, 3, 1, 46, 4, 1, 46, 11, 1, 46, 13, 1, 46, 16, 1,
46, 36, 1, 46, 3, 1, 7, 4, 1, 7, 16, 1, 7, 36, 1, 7, 3, 1, 6, 4, 1,
6, 16, 1, 6, 36, 1, 6, 3, 1, 8, 4, 1, 8, 16, 1, 8, 36, 1, 8, 3, 1, 9,
4, 1, 9, 16, 1, 9, 36, 1, 9, 3, 1, 10, 4, 1, 10, 16, 1, 10, 36, 1,
10, 3, 1, 82, 4, 1, 82, 16, 1, 82, 36, 1, 82, 3, 1, 84, 16, 1, 84,
36, 1, 84, 3, 1, 83, 4, 1, 83, 16, 1, 83, 36, 1, 83, 3, 1, 43, 36, 1,
43, 3, 1, 42, 36, 1, 42, 3, 1, 5, 36, 1, 5, 0, 1, 0, 4, 1, 0, 43, 1,
0, 3, 1, 4, 36, 1, 4, 0, 1, 57, 4, 1, 57, 43, 1, 57, 0, 1, 143, 11,
1, 143, 13, 1, 143, 36, 1, 143, 0, 1, 56, 4, 1, 56, 43, 1, 56, 0, 1,
144, 11, 1, 144, 13, 1, 144, 36, 1, 144, 0, 1, 59, 4, 1, 59, 43, 1,
59, 0, 1, 58, 4, 1, 58, 43, 1, 58, 0, 1, 48, 4, 1, 48, 43, 1, 48, 0,
1, 141, 1, 1, 141, 2, 1, 141, 3, 1, 141, 4, 1, 141, 5, 1, 141, 6, 1,
141, 7, 1, 141, 8, 1, 141, 9, 1, 141, 10, 1, 141, 11, 1, 141, 12, 1,
141, 13, 1, 141, 14, 1, 141, 15, 1, 141, 16, 1, 141, 17, 1, 141, 18,
1, 141, 19, 1, 141, 20, 1, 141, 21, 1, 141, 22, 1, 141, 23, 1, 141,
24, 1, 141, 25, 1, 141, 26, 1, 141, 27, 1, 141, 28, 1, 141, 29, 1,
141, 30, 1, 141, 31, 1, 141, 32, 1, 141, 33, 1, 141, 34, 1, 141, 35,
1, 141, 36, 1, 141, 37, 1, 141, 38, 1, 141, 39, 1, 141, 40, 1, 141,
41, 1, 141, 0, 1, 47, 4, 1, 47, 43, 1, 47, 0, 1, 142, 1, 1, 142, 2,
1, 142, 3, 1, 142, 4, 1, 142, 5, 1, 142, 6, 1, 142, 7, 1, 142, 8, 1,
142, 9, 1, 142, 10, 1, 142, 11, 1, 142, 12, 1, 142, 13, 1, 142, 14,
1, 142, 15, 1, 142, 16, 1, 142, 17, 1, 142, 18, 1, 142, 19, 1, 142,
20, 1, 142, 21, 1, 142, 22, 1, 142, 23, 1, 142, 24, 1, 142, 25, 1,
142, 26, 1, 142, 27, 1, 142, 28, 1, 142, 29, 1, 142, 30, 1, 142, 31,
1, 142, 32, 1, 142, 33, 1, 142, 34, 1, 142, 35, 1, 142, 36, 1, 142,
37, 1, 142, 38, 1, 142, 39, 1, 142, 40, 1, 142, 41, 1, 142, 0, 1, 49,
4, 1, 49, 43, 1, 49, 0, 1, 50, 4, 1, 50, 43, 1, 50, 0, 1, 51, 4, 1,
51, 43, 1, 51, 0, 1, 53, 4, 1, 53, 43, 1, 53, 0, 1, 52, 4, 1, 52, 43,
1, 52, 0, 1, 55, 4, 1, 55, 43, 1, 55, 0, 1, 54, 4, 1, 54, 43, 1, 54,
0, 1, 63, 4, 1, 63, 43, 1, 63, 0, 1, 62, 4, 1, 62, 43, 1, 62, 0, 1,
65, 4, 1, 65, 43, 1, 65, 0, 1, 64, 4, 1, 64, 43, 1, 64, 0, 1, 68, 4,
1, 68, 43, 1, 68, 0, 1, 69, 4, 1, 69, 43, 1, 69, 0, 1, 66, 4, 1, 66,
43, 1, 66, 0, 1, 67, 4, 1, 67, 43, 1, 67, 0, 1, 61, 4, 1, 61, 43, 1,
61, 0, 1, 60, 4, 1, 60, 43, 1, 60, 0, 1, 70, 4, 1, 70, 43, 1, 70, 0,
1, 71, 4, 1, 71, 43, 1, 71, 0, 1, 73, 4, 1, 73, 43, 1, 73, 0, 1, 72,
4, 1, 72, 43, 1, 72, 0, 1, 74, 4, 1, 74, 43, 1, 74, 0, 1, 75, 4, 1,
75, 43, 1, 75, 43, 1, 145, 43, 1, 146,
];
static REDUCE_OFFSETS: &[u32] = &[
0, 0, 3, 6, 6, 18, 72, 72, 135, 198, 198, 198, 198, 261, 324, 387,
450, 456, 468, 480, 483, 495, 495, 507, 519, 531, 531, 543, 555, 567,
567, 579, 591, 603, 606, 618, 618, 681, 744, 744, 744, 744, 807, 840,
903, 966, 1029, 1092, 1092, 1143, 1149, 1182, 1188, 1188, 1194, 1200,
1263, 1266, 1269, 1269, 1332, 1332, 1395, 1395, 1458, 1458, 1521,
1521, 1584, 1623, 1623, 1635, 1641, 1680, 1719, 1731, 1770, 1779,
1779, 1779, 1800, 1821, 1842, 1854, 1866, 1866, 1878, 1890, 1902,
1914, 1923, 1935, 1941, 1947, 1953, 1962, 1968, 1968, 1968, 1968,
1977, 1989, 1989, 1998, 2010, 2010, 2010, 2019, 2019, 2028, 2028,
2028, 2037, 2163, 2163, 2172, 2298, 2298, 2307, 2307, 2307, 2316,
2316, 2325, 2325, 2334, 2334, 2343, 2343, 2352, 2352, 2361, 2361,
2370, 2370, 2379, 2379, 2388, 2388, 2397, 2397, 2406, 2406, 2415,
2415, 2424, 2424, 2433, 2433, 2433, 2442, 2442, 2451, 2451, 2460,
2460, 2469, 2469, 2478, 2478, 2487, 2487, 2496, 2505, 2508, 2511,
2511, 2511,
];
static CAN_ACCEPT_ERROR: &[u8] = &[
0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 2, 2, 2, 2, 1, 0, 0, 0, 0, 1, 0,
0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 2, 0, 2, 2, 2,
2, 0, 2, 0, 0, 0, 0, 0, 0, 2, 1, 1, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0,
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
];
let num_rules = 148usize;
let mut rules = Vec::with_capacity(num_rules);
for i in 0..num_rules {
let name = GrammarNonTerminals::from_usize(RULE_NAMES[i] as usize);
let prec_val = RULE_PRECEDENCES[i];
let precedence = match prec_val & 3 {
0 => ::rusty_lr_core::rule::Precedence::None,
1 => {
::rusty_lr_core::rule::Precedence::Fixed(
(prec_val >> 2) as usize,
)
}
2 => {
::rusty_lr_core::rule::Precedence::Dynamic(
(prec_val >> 2) as usize,
)
}
_ => unreachable!(),
};
rules
.push(::rusty_lr_core::parser::table::RuleInfo {
name,
len: RULE_LENGTHS[i] as usize,
precedence,
});
}
let num_states = 167usize;
let mut state_rows = Vec::with_capacity(num_states);
for i in 0..num_states {
let term_start = SHIFT_TERM_OFFSETS[i] as usize;
let term_end = SHIFT_TERM_OFFSETS[i + 1] as usize;
let mut shift_goto_map_term = Vec::with_capacity(
term_end - term_start,
);
for idx in term_start..term_end {
let val = SHIFT_TERM_DATA[idx];
let term_class = GrammarTerminalClasses::from_usize(
(val & 0x7fff) as usize,
);
let state = ((val >> 15) & 0xffff) as u8;
let push = (val >> 31) != 0;
shift_goto_map_term
.push((
term_class,
::rusty_lr_core::parser::state::ShiftTarget::new(
state,
push,
),
));
}
let nonterm_start = SHIFT_NONTERM_OFFSETS[i] as usize;
let nonterm_end = SHIFT_NONTERM_OFFSETS[i + 1] as usize;
let mut shift_goto_map_nonterm = Vec::with_capacity(
nonterm_end - nonterm_start,
);
for idx in nonterm_start..nonterm_end {
let val = SHIFT_NONTERM_DATA[idx];
let nonterm = GrammarNonTerminals::from_usize(
(val & 0x7fff) as usize,
);
let state = ((val >> 15) & 0xffff) as u8;
let push = (val >> 31) != 0;
shift_goto_map_nonterm
.push((
nonterm,
::rusty_lr_core::parser::state::ShiftTarget::new(
state,
push,
),
));
}
let reduce_start = REDUCE_OFFSETS[i] as usize;
let reduce_end = REDUCE_OFFSETS[i + 1] as usize;
let mut reduce_map = Vec::new();
let mut idx = reduce_start;
while idx < reduce_end {
let term_val = REDUCE_DATA[idx];
let term_class = GrammarTerminalClasses::from_usize(
term_val as usize,
);
let len = REDUCE_DATA[idx + 1] as usize;
let mut rules = Vec::with_capacity(len);
for r_idx in 0..len {
rules.push(REDUCE_DATA[idx + 2 + r_idx] as u8);
}
reduce_map.push((term_class, rules));
idx += 2 + len;
}
let can_accept_error = match CAN_ACCEPT_ERROR[i] {
0 => ::rusty_lr_core::TriState::False,
1 => ::rusty_lr_core::TriState::True,
2 => ::rusty_lr_core::TriState::Maybe,
_ => unreachable!(),
};
let intermediate = ::rusty_lr_core::parser::state::IntermediateState {
shift_goto_map_term,
shift_goto_map_nonterm,
reduce_map,
ruleset: Vec::new(),
can_accept_error,
};
state_rows.push(intermediate);
}
::rusty_lr_core::parser::table::IntermediateTables {
state_rows,
rules,
}
.into()
})
}
}