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 GrammarState = ::rusty_lr_core::parser::state::SparseState<
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,
dense,
dprec,
location,
semicolon,
plus,
star,
question,
exclamation,
minus,
error,
eof,
}
impl GrammarTerminalClasses {
#[inline]
pub fn from_usize(value: usize) -> Self {
debug_assert!(
value < 45usize,
"Terminal class index {} is out of bounds (max {})",
value,
45usize
);
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::dense => "dense",
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::Dense(_) => GrammarTerminalClasses::dense,
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::__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 dense = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.pop();
{
data.dense = true;
};
__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::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#dense-parser-table"
.to_string(),
location: __rustylr_location_error,
});
};
__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::__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_28(
__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_29(
__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_Directive_28(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
76usize => {
Self::reduce_Directive_29(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
77usize => {
Self::reduce_GrammarLine_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
80usize => {
Self::reduce__TokenMappedPlus15_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
81usize => {
Self::reduce__TokenMappedPlus15_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
82usize => {
Self::reduce__TokenMappedStar16_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
83usize => {
Self::reduce__TokenMappedStar16_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
84usize => {
Self::reduce__PrecDefPlus17_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
85usize => {
Self::reduce__PrecDefPlus17_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
86usize => {
Self::reduce__PrecDefStar18_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
87usize => {
Self::reduce__PrecDefStar18_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
88usize => {
Self::reduce__caretQuestion19_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
89usize => {
Self::reduce__caretQuestion19_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
90usize => {
Self::reduce__TerminalSetItemPlus20_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
91usize => {
Self::reduce__TerminalSetItemPlus20_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
92usize => {
Self::reduce__TerminalSetItemStar21_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
93usize => {
Self::reduce__TerminalSetItemStar21_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
94usize => {
Self::reduce__PatternPlus22_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
95usize => {
Self::reduce__PatternPlus22_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
96usize => {
Self::reduce__PatternStar23_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
97usize => {
Self::reduce__PatternStar23_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
98usize => {
Self::reduce___PatternStar23SepPlus24_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
99usize => {
Self::reduce___PatternStar23SepPlus24_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
100usize => {
Self::reduce__commaQuestion25_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
101usize => {
Self::reduce__commaQuestion25_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
144usize => {
Self::reduce___TermSet26Plus27_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
145usize => {
Self::reduce___TermSet26Plus27_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
146usize => {
Self::reduce__IdentOrLiteralPlus28_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
147usize => {
Self::reduce__IdentOrLiteralPlus28_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
148usize => {
Self::reduce__GrammarLinePlus29_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
149usize => {
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 State = GrammarState;
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_rules() -> &'static [GrammarRule] {
static RULES: std::sync::OnceLock<Vec<GrammarRule>> = std::sync::OnceLock::new();
RULES
.get_or_init(|| {
static RULE_NAMES: &[u32] = &[
0u32, 1u32, 1u32, 2u32, 2u32, 3u32, 4u32, 4u32, 4u32, 4u32, 4u32,
5u32, 5u32, 6u32, 6u32, 6u32, 6u32, 6u32, 6u32, 6u32, 6u32, 6u32,
7u32, 7u32, 8u32, 8u32, 8u32, 8u32, 8u32, 8u32, 8u32, 8u32, 8u32,
8u32, 8u32, 8u32, 8u32, 8u32, 8u32, 8u32, 8u32, 8u32, 9u32, 9u32,
10u32, 10u32, 10u32, 11u32, 11u32, 11u32, 11u32, 11u32, 11u32, 11u32,
11u32, 11u32, 11u32, 11u32, 11u32, 11u32, 11u32, 11u32, 11u32, 11u32,
11u32, 11u32, 11u32, 11u32, 11u32, 11u32, 11u32, 11u32, 11u32, 11u32,
11u32, 11u32, 11u32, 12u32, 12u32, 13u32, 14u32, 14u32, 15u32, 15u32,
16u32, 16u32, 17u32, 17u32, 18u32, 18u32, 19u32, 19u32, 20u32, 20u32,
21u32, 21u32, 22u32, 22u32, 23u32, 23u32, 24u32, 24u32, 25u32, 25u32,
25u32, 25u32, 25u32, 25u32, 25u32, 25u32, 25u32, 25u32, 25u32, 25u32,
25u32, 25u32, 25u32, 25u32, 25u32, 25u32, 25u32, 25u32, 25u32, 25u32,
25u32, 25u32, 25u32, 25u32, 25u32, 25u32, 25u32, 25u32, 25u32, 25u32,
25u32, 25u32, 25u32, 25u32, 25u32, 25u32, 25u32, 25u32, 25u32, 25u32,
26u32, 26u32, 27u32, 27u32, 28u32, 28u32, 29u32,
];
static RULE_PRECEDENCES: &[u32] = &[
0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32,
0u32, 0u32, 0u32, 1u32, 1u32, 0u32, 1u32, 1u32, 0u32, 1u32, 1u32,
0u32, 0u32, 0u32, 5u32, 5u32, 5u32, 5u32, 0u32, 0u32, 0u32, 0u32,
0u32, 0u32, 0u32, 1u32, 0u32, 5u32, 5u32, 0u32, 0u32, 0u32, 0u32,
0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32,
0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32,
0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32,
0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32,
0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32,
0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32,
0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32,
0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32,
0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32,
0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32, 0u32,
];
static RULE_TOKENS_DATA: &[u32] = &[
0u32, 3u32, 4u32, 5u32, 74u32, 30u32, 5u32, 6u32, 7u32, 7u32, 31u32,
35u32, 19u32, 8u32, 62u32, 21u32, 8u32, 62u32, 86u32, 8u32, 70u32,
20u32, 8u32, 70u32, 86u32, 8u32, 86u32, 17u32, 0u32, 10u32, 17u32,
0u32, 0u32, 84u32, 0u32, 0u32, 84u32, 86u32, 26u32, 26u32, 84u32,
26u32, 26u32, 84u32, 86u32, 22u32, 22u32, 84u32, 22u32, 22u32, 84u32,
86u32, 38u32, 37u32, 41u32, 40u32, 14u32, 0u32, 17u32, 76u32, 17u32,
78u32, 17u32, 80u32, 17u32, 82u32, 15u32, 34u32, 47u32, 36u32, 34u32,
86u32, 36u32, 22u32, 24u32, 26u32, 28u32, 17u32, 84u32, 17u32, 16u32,
0u32, 34u32, 17u32, 18u32, 17u32, 49u32, 36u32, 16u32, 0u32, 34u32,
17u32, 18u32, 17u32, 18u32, 76u32, 36u32, 16u32, 0u32, 34u32, 17u32,
18u32, 17u32, 18u32, 78u32, 36u32, 16u32, 0u32, 34u32, 17u32, 18u32,
17u32, 86u32, 36u32, 16u32, 0u32, 34u32, 17u32, 18u32, 17u32, 18u32,
86u32, 36u32, 32u32, 0u32, 22u32, 26u32, 8u32, 46u32, 0u32, 53u32,
74u32, 8u32, 46u32, 0u32, 74u32, 8u32, 46u32, 86u32, 74u32, 8u32,
48u32, 0u32, 74u32, 8u32, 48u32, 86u32, 74u32, 8u32, 50u32, 53u32,
74u32, 8u32, 50u32, 74u32, 8u32, 52u32, 53u32, 74u32, 8u32, 52u32,
74u32, 8u32, 42u32, 55u32, 74u32, 8u32, 42u32, 86u32, 74u32, 8u32,
44u32, 55u32, 74u32, 8u32, 44u32, 86u32, 74u32, 8u32, 64u32, 55u32,
74u32, 8u32, 64u32, 86u32, 74u32, 8u32, 54u32, 53u32, 74u32, 8u32,
54u32, 74u32, 8u32, 56u32, 53u32, 74u32, 8u32, 56u32, 74u32, 8u32,
60u32, 74u32, 8u32, 60u32, 86u32, 74u32, 8u32, 58u32, 74u32, 8u32,
58u32, 86u32, 74u32, 8u32, 66u32, 74u32, 8u32, 66u32, 86u32, 74u32,
8u32, 68u32, 74u32, 8u32, 68u32, 86u32, 74u32, 8u32, 72u32, 53u32,
74u32, 8u32, 72u32, 74u32, 8u32, 86u32, 74u32, 1u32, 23u32, 57u32,
11u32, 29u32, 11u32, 29u32, 9u32, 33u32, 9u32, 33u32, 12u32, 13u32,
39u32, 13u32, 39u32, 17u32, 43u32, 17u32, 43u32, 45u32, 47u32, 6u32,
45u32, 18u32, 0u32, 4u32, 6u32, 8u32, 10u32, 76u32, 78u32, 80u32,
12u32, 84u32, 82u32, 14u32, 16u32, 18u32, 20u32, 22u32, 24u32, 26u32,
28u32, 2u32, 30u32, 32u32, 34u32, 36u32, 38u32, 40u32, 42u32, 44u32,
46u32, 48u32, 50u32, 52u32, 54u32, 56u32, 58u32, 60u32, 62u32, 64u32,
66u32, 68u32, 70u32, 72u32, 51u32, 53u32, 51u32, 21u32, 55u32, 21u32,
25u32, 25u32, 57u32, 27u32, 88u32,
];
static RULE_TOKENS_OFFSETS: &[u32] = &[
0u32, 5u32, 6u32, 6u32, 9u32, 10u32, 13u32, 16u32, 19u32, 22u32,
25u32, 27u32, 28u32, 31u32, 32u32, 35u32, 38u32, 39u32, 42u32, 45u32,
46u32, 49u32, 52u32, 56u32, 57u32, 58u32, 60u32, 62u32, 64u32, 66u32,
67u32, 70u32, 73u32, 74u32, 75u32, 76u32, 77u32, 80u32, 88u32, 97u32,
106u32, 114u32, 123u32, 124u32, 124u32, 125u32, 126u32, 127u32,
132u32, 136u32, 140u32, 144u32, 148u32, 152u32, 155u32, 159u32,
162u32, 166u32, 170u32, 174u32, 178u32, 182u32, 186u32, 190u32,
193u32, 197u32, 200u32, 203u32, 207u32, 210u32, 214u32, 217u32,
221u32, 224u32, 228u32, 232u32, 235u32, 238u32, 239u32, 240u32,
241u32, 242u32, 244u32, 245u32, 245u32, 246u32, 248u32, 249u32,
249u32, 250u32, 250u32, 251u32, 253u32, 254u32, 254u32, 255u32,
257u32, 258u32, 258u32, 259u32, 262u32, 263u32, 263u32, 264u32,
265u32, 266u32, 267u32, 268u32, 269u32, 270u32, 271u32, 272u32,
273u32, 274u32, 275u32, 276u32, 277u32, 278u32, 279u32, 280u32,
281u32, 282u32, 283u32, 284u32, 285u32, 286u32, 287u32, 288u32,
289u32, 290u32, 291u32, 292u32, 293u32, 294u32, 295u32, 296u32,
297u32, 298u32, 299u32, 300u32, 301u32, 302u32, 303u32, 304u32,
305u32, 306u32, 308u32, 309u32, 311u32, 312u32, 314u32, 316u32,
];
let num_rules = 151usize;
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 => None,
1 => {
Some(
::rusty_lr_core::rule::Precedence::Fixed(
(prec_val >> 2) as usize,
),
)
}
2 => {
Some(
::rusty_lr_core::rule::Precedence::Dynamic(
(prec_val >> 2) as usize,
),
)
}
_ => unreachable!(),
};
let token_start = RULE_TOKENS_OFFSETS[i] as usize;
let token_end = RULE_TOKENS_OFFSETS[i + 1] as usize;
let mut rule = Vec::with_capacity(token_end - token_start);
for idx in token_start..token_end {
let val = RULE_TOKENS_DATA[idx];
let is_nonterm = (val & 1) != 0;
let sym_idx = (val >> 1) as usize;
let token = if is_nonterm {
::rusty_lr_core::Token::NonTerm(
GrammarNonTerminals::from_usize(sym_idx),
)
} else {
::rusty_lr_core::Token::Term(
GrammarTerminalClasses::from_usize(sym_idx),
)
};
rule.push(token);
}
rules
.push(::rusty_lr_core::rule::ProductionRule {
name,
rule,
precedence,
});
}
rules
})
}
fn get_states() -> &'static [GrammarState] {
static STATES: std::sync::OnceLock<Vec<GrammarState>> = std::sync::OnceLock::new();
STATES
.get_or_init(|| {
static SHIFT_TERM_DATA: &[u32] = &[
2147516416u32, 2150629380u32, 2147549199u32, 2147614722u32,
2147647488u32, 2147745799u32, 2147778568u32, 2147876875u32,
2147909644u32, 2147942413u32, 2147975182u32, 2148007953u32,
2148040723u32, 2147680261u32, 2147713024u32, 2147745799u32,
2147778568u32, 2147876875u32, 2147909644u32, 2147942413u32,
2147975182u32, 2148007953u32, 2148040723u32, 2147811328u32,
2147844113u32, 2147713024u32, 2147745799u32, 2147778568u32,
2147876875u32, 2147909644u32, 2147942413u32, 2147975182u32,
2148007953u32, 2148040723u32, 2147713024u32, 2147745799u32,
2147778568u32, 2147876875u32, 2147909644u32, 2147942413u32,
2147975182u32, 2148007953u32, 2148040723u32, 2148794411u32,
2148073478u32, 2148139008u32, 2148270091u32, 2148401165u32,
2148171818u32, 2148204544u32, 2148237355u32, 2148302890u32,
2148335627u32, 2148368427u32, 2148433962u32, 2148466701u32,
2148499499u32, 2148139008u32, 2148270091u32, 2148401165u32,
2148663316u32, 2148761609u32, 2148892710u32, 2148925479u32,
2148958248u32, 2148991017u32, 2149023786u32, 2147713024u32,
2147745799u32, 2147778568u32, 2147876875u32, 2147909644u32,
2147942413u32, 2147975182u32, 2148007953u32, 2148040723u32,
2148827154u32, 2148892710u32, 2148925479u32, 2148958248u32,
2148991017u32, 2149023786u32, 2147713024u32, 2147745799u32,
2147778568u32, 2147876875u32, 2147909644u32, 2147942413u32,
2147975182u32, 2148007953u32, 2148040723u32, 2148892710u32,
2148925479u32, 2148958248u32, 2148991017u32, 2147713024u32,
2147745799u32, 2147778568u32, 2147876875u32, 2147909644u32,
2147942413u32, 2147975182u32, 2148007953u32, 2148040723u32,
2148892710u32, 2148925479u32, 2148958248u32, 2148991017u32,
2149023786u32, 2149220355u32, 2149285906u32, 2147713024u32,
2147745799u32, 2147778568u32, 2147876875u32, 2147909644u32,
2147942413u32, 2147975182u32, 2148007953u32, 2148040723u32,
2149351433u32, 2148892710u32, 2148925479u32, 2148958248u32,
2148991017u32, 2149023786u32, 2149580843u32, 2149384230u32,
2149449767u32, 2149515307u32, 2149416978u32, 2149482514u32,
2149548050u32, 2149613586u32, 2149679122u32, 2148892710u32,
2148925479u32, 2148958248u32, 2148991017u32, 2149023786u32,
2149777411u32, 3080229u32, 2147647488u32, 2147745799u32,
2147778568u32, 2147876875u32, 2147909644u32, 2147942413u32,
2147975182u32, 2148007953u32, 2148040723u32, 2148892710u32,
2148925479u32, 2148958248u32, 2148991017u32, 2149023786u32,
2147647488u32, 2147745799u32, 2147778568u32, 2147876875u32,
2147909644u32, 2147942413u32, 2147975182u32, 2148007953u32,
2148040723u32, 2150006788u32, 2150039583u32, 2150236195u32,
2150334507u32, 2150072320u32, 2150105099u32, 2150137869u32,
2150170667u32, 2150268938u32, 2150301739u32, 2150006788u32,
2150498320u32, 2150662165u32, 2150891542u32, 2151055383u32,
2151350296u32, 2151514137u32, 2151645210u32, 2151776283u32,
2151907356u32, 2152038429u32, 2152169502u32, 2152300576u32,
2152464417u32, 2152595490u32, 2152726564u32, 2152857643u32,
2150072320u32, 2150105099u32, 2150137869u32, 2150694955u32,
3244069u32, 2150072320u32, 2150105099u32, 2150137869u32, 3342373u32,
2150072320u32, 2150105099u32, 2150137869u32, 2150924331u32,
3473445u32, 2150072320u32, 2150105099u32, 2150137869u32, 3538981u32,
2151088128u32, 2151284779u32, 2151153664u32, 2151153665u32,
2151153666u32, 2151153667u32, 2151153668u32, 2151153669u32,
2151153670u32, 2151153671u32, 2151153672u32, 2151153673u32,
2151153674u32, 2151153675u32, 2151153676u32, 2151153677u32,
2151153678u32, 2151153679u32, 2151153680u32, 2151153681u32,
2151153682u32, 2151153683u32, 2151153684u32, 2151153685u32,
2151153686u32, 2151153687u32, 2151153688u32, 2151153689u32,
2151153690u32, 2151153691u32, 2151153692u32, 2151153693u32,
2151153694u32, 2151153695u32, 2151153696u32, 2151153697u32,
2151153698u32, 2151153699u32, 2151153700u32, 3637285u32,
2151153702u32, 2151153703u32, 2151153704u32, 2151153705u32,
2151153706u32, 2151251968u32, 2151251969u32, 2151251970u32,
2151251971u32, 2151251972u32, 2151251973u32, 2151251974u32,
2151251975u32, 2151251976u32, 2151251977u32, 2151251978u32,
2151251979u32, 2151251980u32, 2151251981u32, 2151251982u32,
2151251983u32, 2151251984u32, 2151251985u32, 2151251986u32,
2151251987u32, 2151251988u32, 2151251989u32, 2151251990u32,
2151251991u32, 2151251992u32, 2151251993u32, 2151251994u32,
2151251995u32, 2151251996u32, 2151251997u32, 2151251998u32,
2151251999u32, 2151252000u32, 2151252001u32, 2151252002u32,
2151252003u32, 2151252004u32, 3735589u32, 2151252006u32,
2151252007u32, 2151252008u32, 2151252009u32, 2151252010u32,
3833893u32, 2151383040u32, 2151448619u32, 3932197u32, 3997733u32,
2151153664u32, 2151153665u32, 2151153666u32, 2151153667u32,
2151153668u32, 2151153669u32, 2151153670u32, 2151153671u32,
2151153672u32, 2151153673u32, 2151153674u32, 2151153675u32,
2151153676u32, 2151153677u32, 2151153678u32, 2151153679u32,
2151153680u32, 2151153681u32, 2151153682u32, 2151153683u32,
2151153684u32, 2151153685u32, 2151153686u32, 2151153687u32,
2151153688u32, 2151153689u32, 2151153690u32, 2151153691u32,
2151153692u32, 2151153693u32, 2151153694u32, 2151153695u32,
2151153696u32, 2151153697u32, 2151153698u32, 2151153699u32,
2151153700u32, 4063269u32, 2151153702u32, 2151153703u32,
2151153704u32, 2151153705u32, 2151153706u32, 2151251968u32,
2151251969u32, 2151251970u32, 2151251971u32, 2151251972u32,
2151251973u32, 2151251974u32, 2151251975u32, 2151251976u32,
2151251977u32, 2151251978u32, 2151251979u32, 2151251980u32,
2151251981u32, 2151251982u32, 2151251983u32, 2151251984u32,
2151251985u32, 2151251986u32, 2151251987u32, 2151251988u32,
2151251989u32, 2151251990u32, 2151251991u32, 2151251992u32,
2151251993u32, 2151251994u32, 2151251995u32, 2151251996u32,
2151251997u32, 2151251998u32, 2151251999u32, 2151252000u32,
2151252001u32, 2151252002u32, 2151252003u32, 2151252004u32,
4128805u32, 2151252006u32, 2151252007u32, 2151252008u32,
2151252009u32, 2151252010u32, 2151153664u32, 2151153665u32,
2151153666u32, 2151153667u32, 2151153668u32, 2151153669u32,
2151153670u32, 2151153671u32, 2151153672u32, 2151153673u32,
2151153674u32, 2151153675u32, 2151153676u32, 2151153677u32,
2151153678u32, 2151153679u32, 2151153680u32, 2151153681u32,
2151153682u32, 2151153683u32, 2151153684u32, 2151153685u32,
2151153686u32, 2151153687u32, 2151153688u32, 2151153689u32,
2151153690u32, 2151153691u32, 2151153692u32, 2151153693u32,
2151153694u32, 2151153695u32, 2151153696u32, 2151153697u32,
2151153698u32, 2151153699u32, 2151153700u32, 4194341u32,
2151153702u32, 2151153703u32, 2151153704u32, 2151153705u32,
2151153706u32, 2151251968u32, 2151251969u32, 2151251970u32,
2151251971u32, 2151251972u32, 2151251973u32, 2151251974u32,
2151251975u32, 2151251976u32, 2151251977u32, 2151251978u32,
2151251979u32, 2151251980u32, 2151251981u32, 2151251982u32,
2151251983u32, 2151251984u32, 2151251985u32, 2151251986u32,
2151251987u32, 2151251988u32, 2151251989u32, 2151251990u32,
2151251991u32, 2151251992u32, 2151251993u32, 2151251994u32,
2151251995u32, 2151251996u32, 2151251997u32, 2151251998u32,
2151251999u32, 2151252000u32, 2151252001u32, 2151252002u32,
2151252003u32, 2151252004u32, 4259877u32, 2151252006u32,
2151252007u32, 2151252008u32, 2151252009u32, 2151252010u32,
2151153664u32, 2151153665u32, 2151153666u32, 2151153667u32,
2151153668u32, 2151153669u32, 2151153670u32, 2151153671u32,
2151153672u32, 2151153673u32, 2151153674u32, 2151153675u32,
2151153676u32, 2151153677u32, 2151153678u32, 2151153679u32,
2151153680u32, 2151153681u32, 2151153682u32, 2151153683u32,
2151153684u32, 2151153685u32, 2151153686u32, 2151153687u32,
2151153688u32, 2151153689u32, 2151153690u32, 2151153691u32,
2151153692u32, 2151153693u32, 2151153694u32, 2151153695u32,
2151153696u32, 2151153697u32, 2151153698u32, 2151153699u32,
2151153700u32, 4325413u32, 2151153702u32, 2151153703u32,
2151153704u32, 2151153705u32, 2151153706u32, 2151251968u32,
2151251969u32, 2151251970u32, 2151251971u32, 2151251972u32,
2151251973u32, 2151251974u32, 2151251975u32, 2151251976u32,
2151251977u32, 2151251978u32, 2151251979u32, 2151251980u32,
2151251981u32, 2151251982u32, 2151251983u32, 2151251984u32,
2151251985u32, 2151251986u32, 2151251987u32, 2151251988u32,
2151251989u32, 2151251990u32, 2151251991u32, 2151251992u32,
2151251993u32, 2151251994u32, 2151251995u32, 2151251996u32,
2151251997u32, 2151251998u32, 2151251999u32, 2151252000u32,
2151252001u32, 2151252002u32, 2151252003u32, 2151252004u32,
4390949u32, 2151252006u32, 2151252007u32, 2151252008u32,
2151252009u32, 2151252010u32, 2151153664u32, 2151153665u32,
2151153666u32, 2151153667u32, 2151153668u32, 2151153669u32,
2151153670u32, 2151153671u32, 2151153672u32, 2151153673u32,
2151153674u32, 2151153675u32, 2151153676u32, 2151153677u32,
2151153678u32, 2151153679u32, 2151153680u32, 2151153681u32,
2151153682u32, 2151153683u32, 2151153684u32, 2151153685u32,
2151153686u32, 2151153687u32, 2151153688u32, 2151153689u32,
2151153690u32, 2151153691u32, 2151153692u32, 2151153693u32,
2151153694u32, 2151153695u32, 2151153696u32, 2151153697u32,
2151153698u32, 2151153699u32, 2151153700u32, 4456485u32,
2151153702u32, 2151153703u32, 2151153704u32, 2151153705u32,
2151153706u32, 2151251968u32, 2151251969u32, 2151251970u32,
2151251971u32, 2151251972u32, 2151251973u32, 2151251974u32,
2151251975u32, 2151251976u32, 2151251977u32, 2151251978u32,
2151251979u32, 2151251980u32, 2151251981u32, 2151251982u32,
2151251983u32, 2151251984u32, 2151251985u32, 2151251986u32,
2151251987u32, 2151251988u32, 2151251989u32, 2151251990u32,
2151251991u32, 2151251992u32, 2151251993u32, 2151251994u32,
2151251995u32, 2151251996u32, 2151251997u32, 2151251998u32,
2151251999u32, 2151252000u32, 2151252001u32, 2151252002u32,
2151252003u32, 2151252004u32, 4522021u32, 2151252006u32,
2151252007u32, 2151252008u32, 2151252009u32, 2151252010u32,
4587557u32, 2152103979u32, 4653093u32, 4718629u32, 2152235051u32,
4784165u32, 2150072320u32, 2150105099u32, 2150137869u32,
2152333355u32, 4882469u32, 2150072320u32, 2150105099u32,
2150137869u32, 4948005u32, 5013541u32, 2152529963u32, 5079077u32,
5144613u32, 2152661035u32, 5210149u32, 2151153664u32, 2151153665u32,
2151153666u32, 2151153667u32, 2151153668u32, 2151153669u32,
2151153670u32, 2151153671u32, 2151153672u32, 2151153673u32,
2151153674u32, 2151153675u32, 2151153676u32, 2151153677u32,
2151153678u32, 2151153679u32, 2151153680u32, 2151153681u32,
2151153682u32, 2151153683u32, 2151153684u32, 2151153685u32,
2151153686u32, 2151153687u32, 2151153688u32, 2151153689u32,
2151153690u32, 2151153691u32, 2151153692u32, 2151153693u32,
2151153694u32, 2151153695u32, 2151153696u32, 2151153697u32,
2151153698u32, 2151153699u32, 2151153700u32, 5275685u32,
2151153702u32, 2151153703u32, 2151153704u32, 2151153705u32,
2151153706u32, 2151251968u32, 2151251969u32, 2151251970u32,
2151251971u32, 2151251972u32, 2151251973u32, 2151251974u32,
2151251975u32, 2151251976u32, 2151251977u32, 2151251978u32,
2151251979u32, 2151251980u32, 2151251981u32, 2151251982u32,
2151251983u32, 2151251984u32, 2151251985u32, 2151251986u32,
2151251987u32, 2151251988u32, 2151251989u32, 2151251990u32,
2151251991u32, 2151251992u32, 2151251993u32, 2151251994u32,
2151251995u32, 2151251996u32, 2151251997u32, 2151251998u32,
2151251999u32, 2151252000u32, 2151252001u32, 2151252002u32,
2151252003u32, 2151252004u32, 5341221u32, 2151252006u32,
2151252007u32, 2151252008u32, 2151252009u32, 2151252010u32,
5406757u32, 2147516416u32, 2150629380u32, 2153054252u32,
];
static SHIFT_TERM_OFFSETS: &[u32] = &[
0u32, 2u32, 3u32, 3u32, 4u32, 13u32, 14u32, 23u32, 23u32, 23u32,
24u32, 25u32, 34u32, 34u32, 34u32, 34u32, 34u32, 44u32, 45u32, 45u32,
48u32, 49u32, 51u32, 51u32, 51u32, 52u32, 54u32, 54u32, 54u32, 55u32,
57u32, 57u32, 57u32, 57u32, 60u32, 60u32, 61u32, 61u32, 61u32, 67u32,
76u32, 77u32, 77u32, 82u32, 82u32, 82u32, 82u32, 82u32, 91u32, 95u32,
104u32, 109u32, 109u32, 111u32, 120u32, 120u32, 120u32, 127u32,
130u32, 131u32, 131u32, 132u32, 132u32, 133u32, 133u32, 134u32,
134u32, 135u32, 135u32, 140u32, 142u32, 151u32, 151u32, 151u32,
156u32, 165u32, 165u32, 166u32, 169u32, 173u32, 173u32, 173u32,
173u32, 173u32, 173u32, 175u32, 175u32, 175u32, 175u32, 175u32,
176u32, 176u32, 177u32, 177u32, 177u32, 177u32, 177u32, 192u32,
196u32, 197u32, 197u32, 197u32, 201u32, 201u32, 201u32, 205u32,
206u32, 206u32, 210u32, 210u32, 212u32, 255u32, 255u32, 255u32,
298u32, 298u32, 298u32, 299u32, 299u32, 301u32, 302u32, 302u32,
303u32, 303u32, 346u32, 346u32, 389u32, 389u32, 432u32, 432u32,
475u32, 475u32, 518u32, 518u32, 561u32, 561u32, 604u32, 604u32,
647u32, 647u32, 649u32, 649u32, 650u32, 650u32, 652u32, 652u32,
653u32, 653u32, 657u32, 658u32, 658u32, 662u32, 662u32, 664u32,
664u32, 665u32, 665u32, 667u32, 667u32, 668u32, 668u32, 711u32,
711u32, 754u32, 754u32, 755u32, 755u32, 755u32, 757u32, 757u32,
758u32, 758u32,
];
static SHIFT_NONTERM_DATA: &[u32] = &[
2152923136u32, 5472267u32, 2152955916u32, 2153021453u32, 5537820u32,
2147581953u32, 2149744642u32, 2150596611u32, 2149842949u32,
2148696071u32, 2149875720u32, 2149908494u32, 2149974031u32,
2148696071u32, 2149711880u32, 2148696071u32, 2148728840u32,
2148696071u32, 2148859912u32, 2149089301u32, 2149154838u32,
2149187607u32, 2148106258u32, 2148532230u32, 2148565011u32,
2148630548u32, 2148597766u32, 2148696071u32, 2149318664u32,
2148696071u32, 2149056520u32, 2148696071u32, 2149122056u32,
2148696071u32, 2148859912u32, 2149089301u32, 2149253142u32,
2149646360u32, 2149810179u32, 2149842949u32, 2148696071u32,
2149875720u32, 2149908494u32, 2149974031u32, 2149941253u32,
2148696071u32, 2149875720u32, 2150367236u32, 2150400016u32,
2150465553u32, 2150203402u32, 2150432772u32, 2150531081u32,
2150760458u32, 2150793243u32, 2150858762u32, 2150760458u32,
2150989851u32, 2150858762u32, 2151153689u32, 2151186458u32,
2151251993u32, 2151153689u32, 2151579674u32, 2151251993u32,
2151153689u32, 2151710746u32, 2151251993u32, 2151153689u32,
2151841818u32, 2151251993u32, 2151153689u32, 2151972890u32,
2151251993u32, 2150760458u32, 2152398875u32, 2150858762u32,
2151153689u32, 2152792090u32, 2151251993u32, 2152923136u32,
5472267u32, 2152955916u32, 2152988700u32,
];
static SHIFT_NONTERM_OFFSETS: &[u32] = &[
0u32, 5u32, 6u32, 6u32, 6u32, 13u32, 13u32, 15u32, 15u32, 15u32,
15u32, 15u32, 17u32, 17u32, 17u32, 17u32, 17u32, 22u32, 23u32, 23u32,
26u32, 26u32, 26u32, 26u32, 26u32, 26u32, 26u32, 26u32, 26u32, 26u32,
26u32, 26u32, 26u32, 26u32, 27u32, 27u32, 27u32, 27u32, 27u32, 27u32,
29u32, 29u32, 29u32, 29u32, 29u32, 29u32, 29u32, 29u32, 31u32, 31u32,
33u32, 33u32, 33u32, 33u32, 37u32, 37u32, 37u32, 38u32, 38u32, 38u32,
38u32, 38u32, 38u32, 38u32, 38u32, 38u32, 38u32, 38u32, 38u32, 38u32,
38u32, 44u32, 44u32, 44u32, 44u32, 47u32, 47u32, 50u32, 50u32, 51u32,
51u32, 51u32, 51u32, 51u32, 51u32, 51u32, 51u32, 51u32, 51u32, 51u32,
52u32, 52u32, 53u32, 53u32, 53u32, 53u32, 53u32, 53u32, 55u32, 55u32,
55u32, 55u32, 56u32, 56u32, 56u32, 58u32, 58u32, 58u32, 59u32, 59u32,
59u32, 61u32, 61u32, 61u32, 62u32, 62u32, 62u32, 62u32, 62u32, 62u32,
62u32, 62u32, 62u32, 62u32, 64u32, 64u32, 65u32, 65u32, 67u32, 67u32,
68u32, 68u32, 70u32, 70u32, 71u32, 71u32, 73u32, 73u32, 74u32, 74u32,
74u32, 74u32, 74u32, 74u32, 74u32, 74u32, 74u32, 74u32, 76u32, 76u32,
76u32, 77u32, 77u32, 77u32, 77u32, 77u32, 77u32, 77u32, 77u32, 77u32,
77u32, 79u32, 79u32, 80u32, 80u32, 80u32, 80u32, 80u32, 84u32, 84u32,
84u32, 84u32,
];
static REDUCE_DATA: &[u32] = &[
2u32, 1u32, 2u32, 2u32, 1u32, 1u32, 3u32, 1u32, 83u32, 4u32, 1u32,
83u32, 16u32, 1u32, 83u32, 37u32, 1u32, 83u32, 0u32, 1u32, 24u32,
3u32, 1u32, 24u32, 4u32, 1u32, 24u32, 7u32, 1u32, 24u32, 8u32, 1u32,
24u32, 11u32, 1u32, 24u32, 12u32, 1u32, 24u32, 13u32, 1u32, 24u32,
14u32, 1u32, 24u32, 16u32, 1u32, 24u32, 17u32, 1u32, 24u32, 19u32,
1u32, 24u32, 37u32, 1u32, 24u32, 38u32, 1u32, 24u32, 39u32, 1u32,
24u32, 40u32, 1u32, 24u32, 41u32, 1u32, 24u32, 42u32, 1u32, 24u32,
0u32, 1u32, 24u32, 3u32, 1u32, 24u32, 4u32, 1u32, 24u32, 7u32, 1u32,
24u32, 8u32, 1u32, 24u32, 9u32, 1u32, 24u32, 11u32, 1u32, 24u32,
12u32, 1u32, 24u32, 13u32, 1u32, 24u32, 14u32, 1u32, 24u32, 16u32,
1u32, 24u32, 17u32, 1u32, 24u32, 18u32, 1u32, 24u32, 19u32, 1u32,
24u32, 37u32, 1u32, 24u32, 38u32, 1u32, 24u32, 39u32, 1u32, 24u32,
40u32, 1u32, 24u32, 41u32, 1u32, 24u32, 42u32, 1u32, 24u32, 43u32,
1u32, 24u32, 0u32, 1u32, 23u32, 3u32, 1u32, 23u32, 4u32, 1u32, 23u32,
7u32, 1u32, 23u32, 8u32, 1u32, 23u32, 9u32, 1u32, 23u32, 11u32, 1u32,
23u32, 12u32, 1u32, 23u32, 13u32, 1u32, 23u32, 14u32, 1u32, 23u32,
16u32, 1u32, 23u32, 17u32, 1u32, 23u32, 18u32, 1u32, 23u32, 19u32,
1u32, 23u32, 37u32, 1u32, 23u32, 38u32, 1u32, 23u32, 39u32, 1u32,
23u32, 40u32, 1u32, 23u32, 41u32, 1u32, 23u32, 42u32, 1u32, 23u32,
43u32, 1u32, 23u32, 0u32, 1u32, 32u32, 3u32, 1u32, 32u32, 4u32, 1u32,
32u32, 7u32, 1u32, 32u32, 8u32, 1u32, 32u32, 9u32, 1u32, 32u32,
11u32, 1u32, 32u32, 12u32, 1u32, 32u32, 13u32, 1u32, 32u32, 14u32,
1u32, 32u32, 16u32, 1u32, 32u32, 17u32, 1u32, 32u32, 18u32, 1u32,
32u32, 19u32, 1u32, 32u32, 37u32, 1u32, 32u32, 38u32, 1u32, 32u32,
39u32, 1u32, 32u32, 40u32, 1u32, 32u32, 41u32, 1u32, 32u32, 42u32,
1u32, 32u32, 43u32, 1u32, 32u32, 0u32, 1u32, 33u32, 3u32, 1u32,
33u32, 4u32, 1u32, 33u32, 7u32, 1u32, 33u32, 8u32, 1u32, 33u32, 9u32,
1u32, 33u32, 11u32, 1u32, 33u32, 12u32, 1u32, 33u32, 13u32, 1u32,
33u32, 14u32, 1u32, 33u32, 16u32, 1u32, 33u32, 17u32, 1u32, 33u32,
18u32, 1u32, 33u32, 19u32, 1u32, 33u32, 37u32, 1u32, 33u32, 38u32,
1u32, 33u32, 39u32, 1u32, 33u32, 40u32, 1u32, 33u32, 41u32, 1u32,
33u32, 42u32, 1u32, 33u32, 43u32, 1u32, 33u32, 0u32, 1u32, 34u32,
3u32, 1u32, 34u32, 4u32, 1u32, 34u32, 7u32, 1u32, 34u32, 8u32, 1u32,
34u32, 9u32, 1u32, 34u32, 11u32, 1u32, 34u32, 12u32, 1u32, 34u32,
13u32, 1u32, 34u32, 14u32, 1u32, 34u32, 16u32, 1u32, 34u32, 17u32,
1u32, 34u32, 18u32, 1u32, 34u32, 19u32, 1u32, 34u32, 37u32, 1u32,
34u32, 38u32, 1u32, 34u32, 39u32, 1u32, 34u32, 40u32, 1u32, 34u32,
41u32, 1u32, 34u32, 42u32, 1u32, 34u32, 43u32, 1u32, 34u32, 0u32,
1u32, 35u32, 3u32, 1u32, 35u32, 4u32, 1u32, 35u32, 7u32, 1u32, 35u32,
8u32, 1u32, 35u32, 9u32, 1u32, 35u32, 11u32, 1u32, 35u32, 12u32,
1u32, 35u32, 13u32, 1u32, 35u32, 14u32, 1u32, 35u32, 16u32, 1u32,
35u32, 17u32, 1u32, 35u32, 18u32, 1u32, 35u32, 19u32, 1u32, 35u32,
37u32, 1u32, 35u32, 38u32, 1u32, 35u32, 39u32, 1u32, 35u32, 40u32,
1u32, 35u32, 41u32, 1u32, 35u32, 42u32, 1u32, 35u32, 43u32, 1u32,
35u32, 3u32, 1u32, 97u32, 18u32, 1u32, 97u32, 0u32, 1u32, 89u32,
11u32, 1u32, 89u32, 13u32, 1u32, 89u32, 20u32, 1u32, 89u32, 0u32,
1u32, 88u32, 11u32, 1u32, 88u32, 13u32, 1u32, 88u32, 20u32, 1u32,
88u32, 20u32, 1u32, 93u32, 0u32, 1u32, 13u32, 11u32, 1u32, 13u32,
13u32, 1u32, 13u32, 20u32, 1u32, 13u32, 0u32, 1u32, 14u32, 11u32,
1u32, 14u32, 13u32, 1u32, 14u32, 20u32, 1u32, 14u32, 0u32, 1u32,
15u32, 11u32, 1u32, 15u32, 13u32, 1u32, 15u32, 20u32, 1u32, 15u32,
0u32, 1u32, 19u32, 11u32, 1u32, 19u32, 13u32, 1u32, 19u32, 20u32,
1u32, 19u32, 0u32, 1u32, 20u32, 11u32, 1u32, 20u32, 13u32, 1u32,
20u32, 20u32, 1u32, 20u32, 0u32, 1u32, 21u32, 11u32, 1u32, 21u32,
13u32, 1u32, 21u32, 20u32, 1u32, 21u32, 0u32, 1u32, 16u32, 11u32,
1u32, 16u32, 13u32, 1u32, 16u32, 20u32, 1u32, 16u32, 0u32, 1u32,
17u32, 11u32, 1u32, 17u32, 13u32, 1u32, 17u32, 20u32, 1u32, 17u32,
0u32, 1u32, 18u32, 11u32, 1u32, 18u32, 13u32, 1u32, 18u32, 20u32,
1u32, 18u32, 0u32, 1u32, 90u32, 11u32, 1u32, 90u32, 13u32, 1u32,
90u32, 20u32, 1u32, 90u32, 20u32, 1u32, 92u32, 0u32, 1u32, 91u32,
11u32, 1u32, 91u32, 13u32, 1u32, 91u32, 20u32, 1u32, 91u32, 0u32,
1u32, 22u32, 3u32, 1u32, 22u32, 4u32, 1u32, 22u32, 7u32, 1u32, 22u32,
8u32, 1u32, 22u32, 9u32, 1u32, 22u32, 11u32, 1u32, 22u32, 12u32,
1u32, 22u32, 13u32, 1u32, 22u32, 14u32, 1u32, 22u32, 16u32, 1u32,
22u32, 17u32, 1u32, 22u32, 18u32, 1u32, 22u32, 19u32, 1u32, 22u32,
37u32, 1u32, 22u32, 38u32, 1u32, 22u32, 39u32, 1u32, 22u32, 40u32,
1u32, 22u32, 41u32, 1u32, 22u32, 42u32, 1u32, 22u32, 43u32, 1u32,
22u32, 0u32, 1u32, 29u32, 3u32, 1u32, 29u32, 4u32, 1u32, 29u32, 7u32,
1u32, 29u32, 8u32, 1u32, 29u32, 9u32, 1u32, 29u32, 11u32, 1u32,
29u32, 12u32, 1u32, 29u32, 13u32, 1u32, 29u32, 14u32, 1u32, 29u32,
16u32, 1u32, 29u32, 17u32, 1u32, 29u32, 18u32, 1u32, 29u32, 19u32,
1u32, 29u32, 37u32, 1u32, 29u32, 38u32, 1u32, 29u32, 39u32, 1u32,
29u32, 40u32, 1u32, 29u32, 41u32, 1u32, 29u32, 42u32, 1u32, 29u32,
43u32, 1u32, 29u32, 0u32, 1u32, 31u32, 3u32, 1u32, 31u32, 4u32, 1u32,
31u32, 7u32, 1u32, 31u32, 8u32, 1u32, 31u32, 9u32, 1u32, 31u32,
11u32, 1u32, 31u32, 12u32, 1u32, 31u32, 13u32, 1u32, 31u32, 14u32,
1u32, 31u32, 16u32, 1u32, 31u32, 17u32, 1u32, 31u32, 18u32, 1u32,
31u32, 19u32, 1u32, 31u32, 37u32, 1u32, 31u32, 38u32, 1u32, 31u32,
39u32, 1u32, 31u32, 40u32, 1u32, 31u32, 41u32, 1u32, 31u32, 42u32,
1u32, 31u32, 43u32, 1u32, 31u32, 0u32, 1u32, 94u32, 3u32, 1u32,
94u32, 7u32, 1u32, 94u32, 8u32, 1u32, 94u32, 11u32, 1u32, 94u32,
12u32, 1u32, 94u32, 13u32, 1u32, 94u32, 14u32, 1u32, 94u32, 17u32,
1u32, 94u32, 18u32, 1u32, 94u32, 19u32, 1u32, 94u32, 0u32, 1u32,
25u32, 3u32, 1u32, 25u32, 4u32, 1u32, 25u32, 7u32, 1u32, 25u32, 8u32,
1u32, 25u32, 9u32, 1u32, 25u32, 11u32, 1u32, 25u32, 12u32, 1u32,
25u32, 13u32, 1u32, 25u32, 14u32, 1u32, 25u32, 16u32, 1u32, 25u32,
17u32, 1u32, 25u32, 18u32, 1u32, 25u32, 19u32, 1u32, 25u32, 37u32,
1u32, 25u32, 38u32, 1u32, 25u32, 39u32, 1u32, 25u32, 40u32, 1u32,
25u32, 41u32, 1u32, 25u32, 42u32, 1u32, 25u32, 43u32, 1u32, 25u32,
0u32, 1u32, 26u32, 3u32, 1u32, 26u32, 4u32, 1u32, 26u32, 7u32, 1u32,
26u32, 8u32, 1u32, 26u32, 9u32, 1u32, 26u32, 11u32, 1u32, 26u32,
12u32, 1u32, 26u32, 13u32, 1u32, 26u32, 14u32, 1u32, 26u32, 16u32,
1u32, 26u32, 17u32, 1u32, 26u32, 18u32, 1u32, 26u32, 19u32, 1u32,
26u32, 37u32, 1u32, 26u32, 38u32, 1u32, 26u32, 39u32, 1u32, 26u32,
40u32, 1u32, 26u32, 41u32, 1u32, 26u32, 42u32, 1u32, 26u32, 43u32,
1u32, 26u32, 0u32, 1u32, 27u32, 3u32, 1u32, 27u32, 4u32, 1u32, 27u32,
7u32, 1u32, 27u32, 8u32, 1u32, 27u32, 9u32, 1u32, 27u32, 11u32, 1u32,
27u32, 12u32, 1u32, 27u32, 13u32, 1u32, 27u32, 14u32, 1u32, 27u32,
16u32, 1u32, 27u32, 17u32, 1u32, 27u32, 18u32, 1u32, 27u32, 19u32,
1u32, 27u32, 37u32, 1u32, 27u32, 38u32, 1u32, 27u32, 39u32, 1u32,
27u32, 40u32, 1u32, 27u32, 41u32, 1u32, 27u32, 42u32, 1u32, 27u32,
43u32, 1u32, 27u32, 0u32, 1u32, 28u32, 3u32, 1u32, 28u32, 4u32, 1u32,
28u32, 7u32, 1u32, 28u32, 8u32, 1u32, 28u32, 9u32, 1u32, 28u32,
11u32, 1u32, 28u32, 12u32, 1u32, 28u32, 13u32, 1u32, 28u32, 14u32,
1u32, 28u32, 16u32, 1u32, 28u32, 17u32, 1u32, 28u32, 18u32, 1u32,
28u32, 19u32, 1u32, 28u32, 37u32, 1u32, 28u32, 38u32, 1u32, 28u32,
39u32, 1u32, 28u32, 40u32, 1u32, 28u32, 41u32, 1u32, 28u32, 42u32,
1u32, 28u32, 43u32, 1u32, 28u32, 0u32, 1u32, 36u32, 3u32, 1u32,
36u32, 4u32, 1u32, 36u32, 7u32, 1u32, 36u32, 8u32, 1u32, 36u32, 9u32,
1u32, 36u32, 11u32, 1u32, 36u32, 12u32, 1u32, 36u32, 13u32, 1u32,
36u32, 14u32, 1u32, 36u32, 16u32, 1u32, 36u32, 17u32, 1u32, 36u32,
18u32, 1u32, 36u32, 19u32, 1u32, 36u32, 37u32, 1u32, 36u32, 42u32,
1u32, 36u32, 43u32, 1u32, 36u32, 3u32, 1u32, 96u32, 18u32, 1u32,
96u32, 0u32, 1u32, 95u32, 3u32, 1u32, 95u32, 7u32, 1u32, 95u32, 8u32,
1u32, 95u32, 11u32, 1u32, 95u32, 12u32, 1u32, 95u32, 13u32, 1u32,
95u32, 14u32, 1u32, 95u32, 17u32, 1u32, 95u32, 18u32, 1u32, 95u32,
19u32, 1u32, 95u32, 3u32, 1u32, 98u32, 18u32, 1u32, 98u32, 3u32,
1u32, 97u32, 18u32, 1u32, 97u32, 3u32, 1u32, 99u32, 18u32, 1u32,
99u32, 0u32, 1u32, 30u32, 3u32, 1u32, 30u32, 4u32, 1u32, 30u32, 7u32,
1u32, 30u32, 8u32, 1u32, 30u32, 9u32, 1u32, 30u32, 11u32, 1u32,
30u32, 12u32, 1u32, 30u32, 13u32, 1u32, 30u32, 14u32, 1u32, 30u32,
16u32, 1u32, 30u32, 17u32, 1u32, 30u32, 18u32, 1u32, 30u32, 19u32,
1u32, 30u32, 37u32, 1u32, 30u32, 38u32, 1u32, 30u32, 39u32, 1u32,
30u32, 40u32, 1u32, 30u32, 41u32, 1u32, 30u32, 42u32, 1u32, 30u32,
43u32, 1u32, 30u32, 18u32, 1u32, 101u32, 18u32, 1u32, 100u32, 0u32,
1u32, 38u32, 3u32, 1u32, 38u32, 4u32, 1u32, 38u32, 7u32, 1u32, 38u32,
8u32, 1u32, 38u32, 9u32, 1u32, 38u32, 11u32, 1u32, 38u32, 12u32,
1u32, 38u32, 13u32, 1u32, 38u32, 14u32, 1u32, 38u32, 16u32, 1u32,
38u32, 17u32, 1u32, 38u32, 18u32, 1u32, 38u32, 19u32, 1u32, 38u32,
37u32, 1u32, 38u32, 38u32, 1u32, 38u32, 39u32, 1u32, 38u32, 40u32,
1u32, 38u32, 41u32, 1u32, 38u32, 42u32, 1u32, 38u32, 43u32, 1u32,
38u32, 0u32, 1u32, 39u32, 3u32, 1u32, 39u32, 4u32, 1u32, 39u32, 7u32,
1u32, 39u32, 8u32, 1u32, 39u32, 9u32, 1u32, 39u32, 11u32, 1u32,
39u32, 12u32, 1u32, 39u32, 13u32, 1u32, 39u32, 14u32, 1u32, 39u32,
16u32, 1u32, 39u32, 17u32, 1u32, 39u32, 18u32, 1u32, 39u32, 19u32,
1u32, 39u32, 37u32, 1u32, 39u32, 38u32, 1u32, 39u32, 39u32, 1u32,
39u32, 40u32, 1u32, 39u32, 41u32, 1u32, 39u32, 42u32, 1u32, 39u32,
43u32, 1u32, 39u32, 0u32, 1u32, 41u32, 3u32, 1u32, 41u32, 4u32, 1u32,
41u32, 7u32, 1u32, 41u32, 8u32, 1u32, 41u32, 9u32, 1u32, 41u32,
11u32, 1u32, 41u32, 12u32, 1u32, 41u32, 13u32, 1u32, 41u32, 14u32,
1u32, 41u32, 16u32, 1u32, 41u32, 17u32, 1u32, 41u32, 18u32, 1u32,
41u32, 19u32, 1u32, 41u32, 37u32, 1u32, 41u32, 38u32, 1u32, 41u32,
39u32, 1u32, 41u32, 40u32, 1u32, 41u32, 41u32, 1u32, 41u32, 42u32,
1u32, 41u32, 43u32, 1u32, 41u32, 0u32, 1u32, 40u32, 3u32, 1u32,
40u32, 4u32, 1u32, 40u32, 7u32, 1u32, 40u32, 8u32, 1u32, 40u32, 9u32,
1u32, 40u32, 11u32, 1u32, 40u32, 12u32, 1u32, 40u32, 13u32, 1u32,
40u32, 14u32, 1u32, 40u32, 16u32, 1u32, 40u32, 17u32, 1u32, 40u32,
18u32, 1u32, 40u32, 19u32, 1u32, 40u32, 37u32, 1u32, 40u32, 38u32,
1u32, 40u32, 39u32, 1u32, 40u32, 40u32, 1u32, 40u32, 41u32, 1u32,
40u32, 42u32, 1u32, 40u32, 43u32, 1u32, 40u32, 0u32, 1u32, 37u32,
3u32, 1u32, 37u32, 4u32, 1u32, 37u32, 7u32, 1u32, 37u32, 8u32, 1u32,
37u32, 9u32, 1u32, 37u32, 11u32, 1u32, 37u32, 12u32, 1u32, 37u32,
13u32, 1u32, 37u32, 14u32, 1u32, 37u32, 16u32, 1u32, 37u32, 17u32,
1u32, 37u32, 18u32, 1u32, 37u32, 19u32, 1u32, 37u32, 37u32, 1u32,
37u32, 38u32, 1u32, 37u32, 39u32, 1u32, 37u32, 40u32, 1u32, 37u32,
41u32, 1u32, 37u32, 42u32, 1u32, 37u32, 43u32, 1u32, 37u32, 0u32,
1u32, 12u32, 3u32, 1u32, 12u32, 4u32, 1u32, 12u32, 7u32, 1u32, 12u32,
8u32, 1u32, 12u32, 11u32, 1u32, 12u32, 12u32, 1u32, 12u32, 13u32,
1u32, 12u32, 14u32, 1u32, 12u32, 16u32, 1u32, 12u32, 17u32, 1u32,
12u32, 19u32, 1u32, 12u32, 37u32, 1u32, 12u32, 3u32, 1u32, 83u32,
4u32, 1u32, 83u32, 16u32, 1u32, 83u32, 37u32, 1u32, 83u32, 3u32,
1u32, 3u32, 37u32, 1u32, 3u32, 0u32, 1u32, 80u32, 3u32, 1u32, 80u32,
4u32, 1u32, 80u32, 7u32, 1u32, 80u32, 8u32, 1u32, 80u32, 11u32, 1u32,
80u32, 12u32, 1u32, 80u32, 13u32, 1u32, 80u32, 14u32, 1u32, 80u32,
16u32, 1u32, 80u32, 17u32, 1u32, 80u32, 19u32, 1u32, 80u32, 37u32,
1u32, 80u32, 0u32, 1u32, 11u32, 3u32, 1u32, 11u32, 4u32, 1u32, 11u32,
7u32, 1u32, 11u32, 8u32, 1u32, 11u32, 11u32, 1u32, 11u32, 12u32,
1u32, 11u32, 13u32, 1u32, 11u32, 14u32, 1u32, 11u32, 16u32, 1u32,
11u32, 17u32, 1u32, 11u32, 19u32, 1u32, 11u32, 37u32, 1u32, 11u32,
3u32, 1u32, 82u32, 4u32, 1u32, 82u32, 16u32, 1u32, 82u32, 37u32,
1u32, 82u32, 0u32, 1u32, 81u32, 3u32, 1u32, 81u32, 4u32, 1u32, 81u32,
7u32, 1u32, 81u32, 8u32, 1u32, 81u32, 11u32, 1u32, 81u32, 12u32,
1u32, 81u32, 13u32, 1u32, 81u32, 14u32, 1u32, 81u32, 16u32, 1u32,
81u32, 17u32, 1u32, 81u32, 19u32, 1u32, 81u32, 37u32, 1u32, 81u32,
3u32, 1u32, 87u32, 16u32, 1u32, 87u32, 37u32, 1u32, 87u32, 0u32,
1u32, 44u32, 3u32, 1u32, 44u32, 4u32, 1u32, 44u32, 11u32, 1u32,
44u32, 13u32, 1u32, 44u32, 16u32, 1u32, 44u32, 37u32, 1u32, 44u32,
0u32, 1u32, 45u32, 3u32, 1u32, 45u32, 4u32, 1u32, 45u32, 11u32, 1u32,
45u32, 13u32, 1u32, 45u32, 16u32, 1u32, 45u32, 37u32, 1u32, 45u32,
0u32, 1u32, 46u32, 3u32, 1u32, 46u32, 4u32, 1u32, 46u32, 11u32, 1u32,
46u32, 13u32, 1u32, 46u32, 16u32, 1u32, 46u32, 37u32, 1u32, 46u32,
3u32, 1u32, 7u32, 4u32, 1u32, 7u32, 16u32, 1u32, 7u32, 37u32, 1u32,
7u32, 3u32, 1u32, 6u32, 4u32, 1u32, 6u32, 16u32, 1u32, 6u32, 37u32,
1u32, 6u32, 3u32, 1u32, 8u32, 4u32, 1u32, 8u32, 16u32, 1u32, 8u32,
37u32, 1u32, 8u32, 3u32, 1u32, 9u32, 4u32, 1u32, 9u32, 16u32, 1u32,
9u32, 37u32, 1u32, 9u32, 3u32, 1u32, 10u32, 4u32, 1u32, 10u32, 16u32,
1u32, 10u32, 37u32, 1u32, 10u32, 3u32, 1u32, 84u32, 4u32, 1u32,
84u32, 16u32, 1u32, 84u32, 37u32, 1u32, 84u32, 3u32, 1u32, 86u32,
16u32, 1u32, 86u32, 37u32, 1u32, 86u32, 3u32, 1u32, 85u32, 4u32,
1u32, 85u32, 16u32, 1u32, 85u32, 37u32, 1u32, 85u32, 3u32, 1u32,
43u32, 37u32, 1u32, 43u32, 3u32, 1u32, 42u32, 37u32, 1u32, 42u32,
3u32, 1u32, 5u32, 37u32, 1u32, 5u32, 0u32, 1u32, 0u32, 4u32, 1u32,
0u32, 44u32, 1u32, 0u32, 3u32, 1u32, 4u32, 37u32, 1u32, 4u32, 0u32,
1u32, 57u32, 4u32, 1u32, 57u32, 44u32, 1u32, 57u32, 0u32, 1u32,
146u32, 11u32, 1u32, 146u32, 13u32, 1u32, 146u32, 37u32, 1u32,
146u32, 0u32, 1u32, 56u32, 4u32, 1u32, 56u32, 44u32, 1u32, 56u32,
0u32, 1u32, 147u32, 11u32, 1u32, 147u32, 13u32, 1u32, 147u32, 37u32,
1u32, 147u32, 0u32, 1u32, 59u32, 4u32, 1u32, 59u32, 44u32, 1u32,
59u32, 0u32, 1u32, 58u32, 4u32, 1u32, 58u32, 44u32, 1u32, 58u32,
0u32, 1u32, 48u32, 4u32, 1u32, 48u32, 44u32, 1u32, 48u32, 0u32, 1u32,
144u32, 1u32, 1u32, 144u32, 2u32, 1u32, 144u32, 3u32, 1u32, 144u32,
4u32, 1u32, 144u32, 5u32, 1u32, 144u32, 6u32, 1u32, 144u32, 7u32,
1u32, 144u32, 8u32, 1u32, 144u32, 9u32, 1u32, 144u32, 10u32, 1u32,
144u32, 11u32, 1u32, 144u32, 12u32, 1u32, 144u32, 13u32, 1u32,
144u32, 14u32, 1u32, 144u32, 15u32, 1u32, 144u32, 16u32, 1u32,
144u32, 17u32, 1u32, 144u32, 18u32, 1u32, 144u32, 19u32, 1u32,
144u32, 20u32, 1u32, 144u32, 21u32, 1u32, 144u32, 22u32, 1u32,
144u32, 23u32, 1u32, 144u32, 24u32, 1u32, 144u32, 25u32, 1u32,
144u32, 26u32, 1u32, 144u32, 27u32, 1u32, 144u32, 28u32, 1u32,
144u32, 29u32, 1u32, 144u32, 30u32, 1u32, 144u32, 31u32, 1u32,
144u32, 32u32, 1u32, 144u32, 33u32, 1u32, 144u32, 34u32, 1u32,
144u32, 35u32, 1u32, 144u32, 36u32, 1u32, 144u32, 37u32, 1u32,
144u32, 38u32, 1u32, 144u32, 39u32, 1u32, 144u32, 40u32, 1u32,
144u32, 41u32, 1u32, 144u32, 42u32, 1u32, 144u32, 0u32, 1u32, 47u32,
4u32, 1u32, 47u32, 44u32, 1u32, 47u32, 0u32, 1u32, 145u32, 1u32,
1u32, 145u32, 2u32, 1u32, 145u32, 3u32, 1u32, 145u32, 4u32, 1u32,
145u32, 5u32, 1u32, 145u32, 6u32, 1u32, 145u32, 7u32, 1u32, 145u32,
8u32, 1u32, 145u32, 9u32, 1u32, 145u32, 10u32, 1u32, 145u32, 11u32,
1u32, 145u32, 12u32, 1u32, 145u32, 13u32, 1u32, 145u32, 14u32, 1u32,
145u32, 15u32, 1u32, 145u32, 16u32, 1u32, 145u32, 17u32, 1u32,
145u32, 18u32, 1u32, 145u32, 19u32, 1u32, 145u32, 20u32, 1u32,
145u32, 21u32, 1u32, 145u32, 22u32, 1u32, 145u32, 23u32, 1u32,
145u32, 24u32, 1u32, 145u32, 25u32, 1u32, 145u32, 26u32, 1u32,
145u32, 27u32, 1u32, 145u32, 28u32, 1u32, 145u32, 29u32, 1u32,
145u32, 30u32, 1u32, 145u32, 31u32, 1u32, 145u32, 32u32, 1u32,
145u32, 33u32, 1u32, 145u32, 34u32, 1u32, 145u32, 35u32, 1u32,
145u32, 36u32, 1u32, 145u32, 37u32, 1u32, 145u32, 38u32, 1u32,
145u32, 39u32, 1u32, 145u32, 40u32, 1u32, 145u32, 41u32, 1u32,
145u32, 42u32, 1u32, 145u32, 0u32, 1u32, 49u32, 4u32, 1u32, 49u32,
44u32, 1u32, 49u32, 0u32, 1u32, 50u32, 4u32, 1u32, 50u32, 44u32,
1u32, 50u32, 0u32, 1u32, 51u32, 4u32, 1u32, 51u32, 44u32, 1u32,
51u32, 0u32, 1u32, 53u32, 4u32, 1u32, 53u32, 44u32, 1u32, 53u32,
0u32, 1u32, 52u32, 4u32, 1u32, 52u32, 44u32, 1u32, 52u32, 0u32, 1u32,
55u32, 4u32, 1u32, 55u32, 44u32, 1u32, 55u32, 0u32, 1u32, 54u32,
4u32, 1u32, 54u32, 44u32, 1u32, 54u32, 0u32, 1u32, 63u32, 4u32, 1u32,
63u32, 44u32, 1u32, 63u32, 0u32, 1u32, 62u32, 4u32, 1u32, 62u32,
44u32, 1u32, 62u32, 0u32, 1u32, 65u32, 4u32, 1u32, 65u32, 44u32,
1u32, 65u32, 0u32, 1u32, 64u32, 4u32, 1u32, 64u32, 44u32, 1u32,
64u32, 0u32, 1u32, 68u32, 4u32, 1u32, 68u32, 44u32, 1u32, 68u32,
0u32, 1u32, 69u32, 4u32, 1u32, 69u32, 44u32, 1u32, 69u32, 0u32, 1u32,
66u32, 4u32, 1u32, 66u32, 44u32, 1u32, 66u32, 0u32, 1u32, 67u32,
4u32, 1u32, 67u32, 44u32, 1u32, 67u32, 0u32, 1u32, 61u32, 4u32, 1u32,
61u32, 44u32, 1u32, 61u32, 0u32, 1u32, 60u32, 4u32, 1u32, 60u32,
44u32, 1u32, 60u32, 0u32, 1u32, 70u32, 4u32, 1u32, 70u32, 44u32,
1u32, 70u32, 0u32, 1u32, 71u32, 4u32, 1u32, 71u32, 44u32, 1u32,
71u32, 0u32, 1u32, 72u32, 4u32, 1u32, 72u32, 44u32, 1u32, 72u32,
0u32, 1u32, 73u32, 4u32, 1u32, 73u32, 44u32, 1u32, 73u32, 0u32, 1u32,
75u32, 4u32, 1u32, 75u32, 44u32, 1u32, 75u32, 0u32, 1u32, 74u32,
4u32, 1u32, 74u32, 44u32, 1u32, 74u32, 0u32, 1u32, 76u32, 4u32, 1u32,
76u32, 44u32, 1u32, 76u32, 0u32, 1u32, 77u32, 4u32, 1u32, 77u32,
44u32, 1u32, 77u32, 44u32, 1u32, 148u32, 44u32, 1u32, 149u32,
];
static REDUCE_OFFSETS: &[u32] = &[
0u32, 0u32, 3u32, 6u32, 6u32, 18u32, 72u32, 72u32, 135u32, 198u32,
198u32, 198u32, 198u32, 261u32, 324u32, 387u32, 450u32, 456u32,
468u32, 480u32, 483u32, 495u32, 495u32, 507u32, 519u32, 531u32,
531u32, 543u32, 555u32, 567u32, 567u32, 579u32, 591u32, 603u32,
606u32, 618u32, 618u32, 681u32, 744u32, 744u32, 744u32, 744u32,
807u32, 840u32, 903u32, 966u32, 1029u32, 1092u32, 1092u32, 1143u32,
1149u32, 1182u32, 1188u32, 1188u32, 1194u32, 1200u32, 1263u32,
1266u32, 1269u32, 1269u32, 1332u32, 1332u32, 1395u32, 1395u32,
1458u32, 1458u32, 1521u32, 1521u32, 1584u32, 1623u32, 1623u32,
1635u32, 1641u32, 1680u32, 1719u32, 1731u32, 1770u32, 1779u32,
1779u32, 1779u32, 1800u32, 1821u32, 1842u32, 1854u32, 1866u32,
1866u32, 1878u32, 1890u32, 1902u32, 1914u32, 1923u32, 1935u32,
1941u32, 1947u32, 1953u32, 1962u32, 1968u32, 1968u32, 1968u32,
1968u32, 1977u32, 1989u32, 1989u32, 1998u32, 2010u32, 2010u32,
2010u32, 2019u32, 2019u32, 2028u32, 2028u32, 2028u32, 2037u32,
2166u32, 2166u32, 2175u32, 2304u32, 2304u32, 2313u32, 2313u32,
2313u32, 2322u32, 2322u32, 2331u32, 2331u32, 2340u32, 2340u32,
2349u32, 2349u32, 2358u32, 2358u32, 2367u32, 2367u32, 2376u32,
2376u32, 2385u32, 2385u32, 2394u32, 2394u32, 2403u32, 2403u32,
2412u32, 2412u32, 2421u32, 2421u32, 2430u32, 2430u32, 2439u32,
2439u32, 2439u32, 2448u32, 2448u32, 2457u32, 2457u32, 2466u32,
2466u32, 2475u32, 2475u32, 2484u32, 2484u32, 2493u32, 2493u32,
2502u32, 2502u32, 2511u32, 2511u32, 2520u32, 2529u32, 2532u32,
2535u32, 2535u32, 2535u32,
];
static RULESET_DATA: &[u32] = &[
0u32, 47u32, 48u32, 49u32, 50u32, 51u32, 52u32, 53u32, 54u32, 55u32,
56u32, 57u32, 58u32, 59u32, 60u32, 61u32, 62u32, 63u32, 64u32, 65u32,
66u32, 67u32, 68u32, 69u32, 70u32, 71u32, 72u32, 73u32, 74u32, 75u32,
76u32, 77u32, 78u32, 79u32, 148u32, 149u32, 150u32, 65536u32, 1u32,
2u32, 65537u32, 131072u32, 196608u32, 3u32, 4u32, 5u32, 11u32, 12u32,
22u32, 23u32, 24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32,
32u32, 33u32, 34u32, 35u32, 36u32, 37u32, 38u32, 39u32, 40u32, 41u32,
80u32, 81u32, 82u32, 83u32, 65548u32, 65560u32, 131084u32, 22u32,
23u32, 24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32,
33u32, 34u32, 35u32, 36u32, 37u32, 38u32, 39u32, 40u32, 41u32,
65560u32, 65559u32, 65573u32, 65574u32, 65575u32, 65576u32, 65577u32,
131109u32, 131110u32, 131111u32, 131112u32, 131113u32, 22u32, 23u32,
24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32, 33u32,
34u32, 35u32, 36u32, 37u32, 196645u32, 38u32, 196646u32, 39u32,
196647u32, 40u32, 196648u32, 41u32, 196649u32, 65568u32, 65569u32,
65570u32, 65571u32, 22u32, 23u32, 24u32, 25u32, 26u32, 27u32, 28u32,
29u32, 30u32, 65566u32, 31u32, 65567u32, 32u32, 33u32, 34u32, 35u32,
36u32, 37u32, 38u32, 39u32, 40u32, 41u32, 94u32, 95u32, 96u32, 97u32,
98u32, 99u32, 65558u32, 88u32, 89u32, 65624u32, 13u32, 14u32, 15u32,
16u32, 17u32, 18u32, 19u32, 20u32, 21u32, 131094u32, 90u32, 91u32,
92u32, 93u32, 65549u32, 65550u32, 65551u32, 131086u32, 131087u32,
196622u32, 196623u32, 65555u32, 65556u32, 65557u32, 131092u32,
131093u32, 196628u32, 196629u32, 65552u32, 65553u32, 65554u32,
131089u32, 131090u32, 196625u32, 196626u32, 65626u32, 13u32, 14u32,
15u32, 16u32, 17u32, 18u32, 19u32, 20u32, 21u32, 65627u32, 65628u32,
131163u32, 196630u32, 262166u32, 65565u32, 65561u32, 65562u32,
65563u32, 65564u32, 65572u32, 262181u32, 262182u32, 262183u32,
262184u32, 262185u32, 22u32, 23u32, 24u32, 25u32, 26u32, 27u32,
28u32, 29u32, 30u32, 31u32, 32u32, 33u32, 34u32, 35u32, 36u32, 37u32,
327717u32, 38u32, 327718u32, 39u32, 327719u32, 40u32, 327720u32,
41u32, 327721u32, 131103u32, 196639u32, 65561u32, 65562u32, 65563u32,
65564u32, 65572u32, 65630u32, 131097u32, 131098u32, 131099u32,
131100u32, 22u32, 23u32, 24u32, 25u32, 26u32, 27u32, 28u32, 29u32,
30u32, 31u32, 32u32, 33u32, 34u32, 35u32, 36u32, 131108u32, 37u32,
38u32, 39u32, 40u32, 41u32, 65561u32, 65562u32, 65563u32, 65564u32,
196644u32, 22u32, 23u32, 24u32, 25u32, 26u32, 27u32, 28u32, 29u32,
30u32, 31u32, 32u32, 33u32, 34u32, 35u32, 36u32, 37u32, 38u32, 39u32,
40u32, 41u32, 65631u32, 65632u32, 65561u32, 65562u32, 65563u32,
65564u32, 65572u32, 131167u32, 65634u32, 131102u32, 65635u32, 22u32,
23u32, 24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32,
33u32, 34u32, 35u32, 36u32, 37u32, 38u32, 39u32, 40u32, 41u32, 94u32,
95u32, 96u32, 97u32, 131171u32, 196707u32, 196638u32, 65561u32,
65562u32, 65563u32, 65564u32, 65572u32, 393253u32, 393254u32,
393255u32, 393256u32, 393257u32, 100u32, 101u32, 458790u32,
458791u32, 458793u32, 65636u32, 524326u32, 589862u32, 524327u32,
589863u32, 524329u32, 589865u32, 458792u32, 524328u32, 458789u32,
524325u32, 196620u32, 65561u32, 65562u32, 65563u32, 65564u32,
65572u32, 262144u32, 65539u32, 131075u32, 5u32, 11u32, 12u32, 22u32,
23u32, 24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32,
33u32, 34u32, 35u32, 36u32, 37u32, 38u32, 39u32, 40u32, 41u32, 80u32,
81u32, 82u32, 83u32, 196611u32, 65616u32, 65547u32, 65561u32,
65562u32, 65563u32, 65564u32, 65572u32, 11u32, 12u32, 22u32, 23u32,
24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32, 33u32,
34u32, 35u32, 36u32, 37u32, 38u32, 39u32, 40u32, 41u32, 65617u32,
65618u32, 131153u32, 65541u32, 6u32, 7u32, 8u32, 9u32, 10u32, 84u32,
85u32, 86u32, 87u32, 65542u32, 65543u32, 65544u32, 65545u32,
65546u32, 131078u32, 131079u32, 44u32, 45u32, 46u32, 65580u32,
65581u32, 65582u32, 196615u32, 196614u32, 131080u32, 131081u32,
196616u32, 196617u32, 131082u32, 65620u32, 6u32, 7u32, 8u32, 9u32,
10u32, 65621u32, 65622u32, 131157u32, 131077u32, 42u32, 43u32,
65578u32, 196613u32, 327680u32, 65540u32, 65583u32, 65584u32,
65585u32, 65586u32, 65587u32, 65588u32, 65589u32, 65590u32, 65591u32,
65592u32, 65593u32, 65594u32, 65595u32, 65596u32, 65597u32, 65598u32,
65599u32, 65600u32, 65601u32, 65602u32, 65603u32, 65604u32, 65605u32,
65606u32, 65607u32, 65608u32, 65609u32, 65610u32, 65611u32, 65612u32,
44u32, 45u32, 46u32, 131128u32, 131129u32, 146u32, 147u32, 196665u32,
262201u32, 65682u32, 44u32, 45u32, 46u32, 196664u32, 65683u32,
262200u32, 131219u32, 44u32, 45u32, 46u32, 131130u32, 131131u32,
146u32, 147u32, 196667u32, 262203u32, 44u32, 45u32, 46u32, 196666u32,
65683u32, 262202u32, 131119u32, 131120u32, 131121u32, 196655u32,
196656u32, 102u32, 103u32, 104u32, 105u32, 106u32, 107u32, 108u32,
109u32, 110u32, 111u32, 112u32, 113u32, 114u32, 115u32, 116u32,
117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32,
125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32,
133u32, 134u32, 135u32, 136u32, 137u32, 138u32, 139u32, 140u32,
141u32, 142u32, 143u32, 144u32, 145u32, 262192u32, 65680u32,
262191u32, 102u32, 103u32, 104u32, 105u32, 106u32, 107u32, 108u32,
109u32, 110u32, 111u32, 112u32, 113u32, 114u32, 115u32, 116u32,
117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32,
125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32,
133u32, 134u32, 135u32, 136u32, 137u32, 138u32, 139u32, 140u32,
141u32, 142u32, 143u32, 65681u32, 327727u32, 131217u32, 196657u32,
262193u32, 131122u32, 131123u32, 196658u32, 262194u32, 196659u32,
262195u32, 131124u32, 131125u32, 102u32, 103u32, 104u32, 105u32,
106u32, 107u32, 108u32, 109u32, 110u32, 111u32, 112u32, 113u32,
114u32, 115u32, 116u32, 117u32, 118u32, 119u32, 120u32, 121u32,
122u32, 123u32, 124u32, 125u32, 126u32, 127u32, 128u32, 129u32,
130u32, 131u32, 132u32, 133u32, 134u32, 135u32, 136u32, 137u32,
138u32, 139u32, 140u32, 141u32, 142u32, 143u32, 144u32, 145u32,
196661u32, 196660u32, 102u32, 103u32, 104u32, 105u32, 106u32, 107u32,
108u32, 109u32, 110u32, 111u32, 112u32, 113u32, 114u32, 115u32,
116u32, 117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32,
124u32, 125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32,
132u32, 133u32, 134u32, 135u32, 136u32, 137u32, 138u32, 139u32,
140u32, 141u32, 142u32, 143u32, 65681u32, 262196u32, 131126u32,
131127u32, 102u32, 103u32, 104u32, 105u32, 106u32, 107u32, 108u32,
109u32, 110u32, 111u32, 112u32, 113u32, 114u32, 115u32, 116u32,
117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32,
125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32,
133u32, 134u32, 135u32, 136u32, 137u32, 138u32, 139u32, 140u32,
141u32, 142u32, 143u32, 144u32, 145u32, 196663u32, 196662u32, 102u32,
103u32, 104u32, 105u32, 106u32, 107u32, 108u32, 109u32, 110u32,
111u32, 112u32, 113u32, 114u32, 115u32, 116u32, 117u32, 118u32,
119u32, 120u32, 121u32, 122u32, 123u32, 124u32, 125u32, 126u32,
127u32, 128u32, 129u32, 130u32, 131u32, 132u32, 133u32, 134u32,
135u32, 136u32, 137u32, 138u32, 139u32, 140u32, 141u32, 142u32,
143u32, 65681u32, 262198u32, 131134u32, 131135u32, 102u32, 103u32,
104u32, 105u32, 106u32, 107u32, 108u32, 109u32, 110u32, 111u32,
112u32, 113u32, 114u32, 115u32, 116u32, 117u32, 118u32, 119u32,
120u32, 121u32, 122u32, 123u32, 124u32, 125u32, 126u32, 127u32,
128u32, 129u32, 130u32, 131u32, 132u32, 133u32, 134u32, 135u32,
136u32, 137u32, 138u32, 139u32, 140u32, 141u32, 142u32, 143u32,
144u32, 145u32, 196671u32, 196670u32, 102u32, 103u32, 104u32, 105u32,
106u32, 107u32, 108u32, 109u32, 110u32, 111u32, 112u32, 113u32,
114u32, 115u32, 116u32, 117u32, 118u32, 119u32, 120u32, 121u32,
122u32, 123u32, 124u32, 125u32, 126u32, 127u32, 128u32, 129u32,
130u32, 131u32, 132u32, 133u32, 134u32, 135u32, 136u32, 137u32,
138u32, 139u32, 140u32, 141u32, 142u32, 143u32, 65681u32, 262206u32,
131136u32, 131137u32, 102u32, 103u32, 104u32, 105u32, 106u32, 107u32,
108u32, 109u32, 110u32, 111u32, 112u32, 113u32, 114u32, 115u32,
116u32, 117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32,
124u32, 125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32,
132u32, 133u32, 134u32, 135u32, 136u32, 137u32, 138u32, 139u32,
140u32, 141u32, 142u32, 143u32, 144u32, 145u32, 196673u32, 196672u32,
102u32, 103u32, 104u32, 105u32, 106u32, 107u32, 108u32, 109u32,
110u32, 111u32, 112u32, 113u32, 114u32, 115u32, 116u32, 117u32,
118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32, 125u32,
126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32, 133u32,
134u32, 135u32, 136u32, 137u32, 138u32, 139u32, 140u32, 141u32,
142u32, 143u32, 65681u32, 262208u32, 131140u32, 131141u32, 196676u32,
196677u32, 262213u32, 131138u32, 131139u32, 196674u32, 196675u32,
262211u32, 44u32, 45u32, 46u32, 131132u32, 131133u32, 146u32, 147u32,
196669u32, 262205u32, 44u32, 45u32, 46u32, 196668u32, 65683u32,
262204u32, 131142u32, 131143u32, 196678u32, 196679u32, 262215u32,
131144u32, 131145u32, 196680u32, 196681u32, 262217u32, 131146u32,
131147u32, 102u32, 103u32, 104u32, 105u32, 106u32, 107u32, 108u32,
109u32, 110u32, 111u32, 112u32, 113u32, 114u32, 115u32, 116u32,
117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32,
125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32,
133u32, 134u32, 135u32, 136u32, 137u32, 138u32, 139u32, 140u32,
141u32, 142u32, 143u32, 144u32, 145u32, 196683u32, 196682u32, 102u32,
103u32, 104u32, 105u32, 106u32, 107u32, 108u32, 109u32, 110u32,
111u32, 112u32, 113u32, 114u32, 115u32, 116u32, 117u32, 118u32,
119u32, 120u32, 121u32, 122u32, 123u32, 124u32, 125u32, 126u32,
127u32, 128u32, 129u32, 130u32, 131u32, 132u32, 133u32, 134u32,
135u32, 136u32, 137u32, 138u32, 139u32, 140u32, 141u32, 142u32,
143u32, 65681u32, 262218u32, 131148u32, 196684u32, 65613u32, 0u32,
47u32, 48u32, 49u32, 50u32, 51u32, 52u32, 53u32, 54u32, 55u32, 56u32,
57u32, 58u32, 59u32, 60u32, 61u32, 62u32, 63u32, 64u32, 65u32, 66u32,
67u32, 68u32, 69u32, 70u32, 71u32, 72u32, 73u32, 74u32, 75u32, 76u32,
77u32, 78u32, 148u32, 65684u32, 149u32, 65685u32, 131221u32,
65686u32, 131222u32,
];
static RULESET_OFFSETS: &[u32] = &[
0u32, 37u32, 40u32, 41u32, 42u32, 72u32, 74u32, 95u32, 96u32, 97u32,
102u32, 107u32, 132u32, 133u32, 134u32, 135u32, 136u32, 164u32,
167u32, 168u32, 182u32, 185u32, 187u32, 188u32, 189u32, 192u32,
194u32, 195u32, 196u32, 199u32, 201u32, 202u32, 203u32, 204u32,
215u32, 216u32, 217u32, 218u32, 219u32, 229u32, 254u32, 255u32,
256u32, 262u32, 263u32, 264u32, 265u32, 266u32, 287u32, 292u32,
314u32, 320u32, 321u32, 323u32, 348u32, 349u32, 350u32, 362u32,
366u32, 367u32, 368u32, 369u32, 370u32, 371u32, 372u32, 373u32,
374u32, 375u32, 376u32, 382u32, 384u32, 412u32, 413u32, 414u32,
420u32, 444u32, 445u32, 455u32, 460u32, 465u32, 466u32, 467u32,
468u32, 469u32, 470u32, 472u32, 473u32, 474u32, 475u32, 476u32,
483u32, 484u32, 487u32, 488u32, 489u32, 490u32, 491u32, 521u32,
528u32, 529u32, 530u32, 531u32, 536u32, 537u32, 538u32, 545u32,
546u32, 547u32, 552u32, 553u32, 556u32, 602u32, 603u32, 604u32,
648u32, 649u32, 650u32, 651u32, 652u32, 654u32, 655u32, 656u32,
657u32, 658u32, 704u32, 705u32, 749u32, 750u32, 796u32, 797u32,
841u32, 842u32, 888u32, 889u32, 933u32, 934u32, 980u32, 981u32,
1025u32, 1026u32, 1028u32, 1029u32, 1030u32, 1031u32, 1033u32,
1034u32, 1035u32, 1036u32, 1043u32, 1044u32, 1045u32, 1050u32,
1051u32, 1053u32, 1054u32, 1055u32, 1056u32, 1058u32, 1059u32,
1060u32, 1061u32, 1107u32, 1108u32, 1152u32, 1153u32, 1154u32,
1155u32, 1156u32, 1193u32, 1194u32, 1195u32, 1196u32,
];
static CAN_ACCEPT_ERROR: &[u8] = &[
0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 2u8, 2u8, 0u8, 0u8, 0u8, 2u8, 2u8,
2u8, 2u8, 1u8, 0u8, 0u8, 0u8, 0u8, 1u8, 0u8, 0u8, 0u8, 1u8, 0u8, 0u8,
0u8, 1u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 2u8, 2u8, 0u8, 0u8, 0u8, 2u8,
0u8, 2u8, 2u8, 2u8, 2u8, 0u8, 2u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 2u8,
1u8, 1u8, 0u8, 2u8, 0u8, 2u8, 0u8, 2u8, 0u8, 2u8, 0u8, 2u8, 0u8, 0u8,
0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 1u8, 0u8, 0u8, 0u8, 0u8, 0u8,
1u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 1u8,
0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 0u8, 0u8, 0u8, 0u8, 1u8, 0u8, 0u8,
0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,
0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8,
0u8, 0u8, 0u8, 1u8, 0u8, 0u8, 0u8, 1u8, 0u8, 0u8, 0u8, 0u8, 1u8, 0u8,
0u8, 0u8, 1u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,
0u8, 0u8, 0u8,
];
let num_states = 171usize;
let mut states = 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 ruleset_start = RULESET_OFFSETS[i] as usize;
let ruleset_end = RULESET_OFFSETS[i + 1] as usize;
let mut ruleset = Vec::with_capacity(ruleset_end - ruleset_start);
for idx in ruleset_start..ruleset_end {
let val = RULESET_DATA[idx];
let rule = (val & 0xffff) as usize;
let shifted = (val >> 16) as usize;
ruleset
.push(::rusty_lr_core::rule::ShiftedRuleRef {
rule,
shifted,
});
}
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,
can_accept_error,
};
states.push(intermediate.into());
}
states
})
}
}