use crate::parser::args::AllowTarget;
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::production::Associativity;
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::production::Production<GrammarTerminalClasses, GrammarNonTerminals>;
#[allow(non_camel_case_types, dead_code)]
pub type GrammarTables = ::rusty_lr_core::parser::table::SparseFlatTables<
GrammarTerminalClasses,
GrammarNonTerminals,
u8,
u8,
>;
#[allow(non_camel_case_types, dead_code)]
pub type GrammarParseError = ::rusty_lr_core::parser::deterministic::ParseError<
Lexed,
Location,
::rusty_lr_core::DefaultReduceActionError,
>;
#[allow(non_camel_case_types, dead_code)]
#[derive(
Clone,
Copy,
std::hash::Hash,
std::cmp::PartialEq,
std::cmp::Eq,
std::cmp::PartialOrd,
std::cmp::Ord,
)]
#[repr(usize)]
pub enum GrammarTerminalClasses {
ident,
TermClass1,
colon,
pipe,
percent,
equal,
caret,
dot,
dollar,
comma,
int_literal,
byte_literal,
byte_str_literal,
char_literal,
str_literal,
parengroup,
bracegroup,
lparen,
rparen,
lbracket,
rbracket,
left,
right,
token,
start,
tokentype,
userdata,
errortype,
moduleprefix,
lalr,
glr,
prec,
precedence,
nooptim,
dprec,
location,
allow,
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::dprec => "dprec",
GrammarTerminalClasses::location => "location",
GrammarTerminalClasses::allow => "allow",
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 from_term(terminal: &Self::Term) -> Self {
#[allow(unreachable_patterns, unused_variables)]
match terminal {
Lexed::Ident(ident) => GrammarTerminalClasses::ident,
Lexed::Colon(_) => GrammarTerminalClasses::colon,
Lexed::Pipe(_) => GrammarTerminalClasses::pipe,
Lexed::Percent(_) => GrammarTerminalClasses::percent,
Lexed::Equal(_) => GrammarTerminalClasses::equal,
Lexed::Caret(_) => GrammarTerminalClasses::caret,
Lexed::Dot(_) => GrammarTerminalClasses::dot,
Lexed::Dollar(_) => GrammarTerminalClasses::dollar,
Lexed::Comma(_) => GrammarTerminalClasses::comma,
Lexed::IntLiteral(_) => GrammarTerminalClasses::int_literal,
Lexed::ByteLiteral(_) => GrammarTerminalClasses::byte_literal,
Lexed::ByteStrLiteral(_) => GrammarTerminalClasses::byte_str_literal,
Lexed::CharLiteral(_) => GrammarTerminalClasses::char_literal,
Lexed::StrLiteral(_) => GrammarTerminalClasses::str_literal,
Lexed::ParenGroup(parengroup) => GrammarTerminalClasses::parengroup,
Lexed::BraceGroup(bracegroup) => GrammarTerminalClasses::bracegroup,
Lexed::LParen => GrammarTerminalClasses::lparen,
Lexed::RParen => GrammarTerminalClasses::rparen,
Lexed::LBracket => GrammarTerminalClasses::lbracket,
Lexed::RBracket => GrammarTerminalClasses::rbracket,
Lexed::Left(_) => GrammarTerminalClasses::left,
Lexed::Right(_) => GrammarTerminalClasses::right,
Lexed::Token(_) => GrammarTerminalClasses::token,
Lexed::Start(_) => GrammarTerminalClasses::start,
Lexed::TokenType(_) => GrammarTerminalClasses::tokentype,
Lexed::UserData(_) => GrammarTerminalClasses::userdata,
Lexed::ErrorType(_) => GrammarTerminalClasses::errortype,
Lexed::ModulePrefix(_) => GrammarTerminalClasses::moduleprefix,
Lexed::Lalr(_) => GrammarTerminalClasses::lalr,
Lexed::Glr(_) => GrammarTerminalClasses::glr,
Lexed::Prec(_) => GrammarTerminalClasses::prec,
Lexed::Precedence(_) => GrammarTerminalClasses::precedence,
Lexed::NoOptim(_) => GrammarTerminalClasses::nooptim,
Lexed::DPrec(_) => GrammarTerminalClasses::dprec,
Lexed::Location(_) => GrammarTerminalClasses::location,
Lexed::Allow(_) => GrammarTerminalClasses::allow,
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,
MappedSymbol,
TerminalSetItem,
TerminalSet,
Pattern,
Action,
IdentOrLiteral,
AllowTarget,
Directive,
GrammarLine,
Grammar,
_MappedSymbolPlus16,
_MappedSymbolStar17,
_PrecDefPlus18,
_PrecDefStar19,
_caretQuestion20,
_TerminalSetItemPlus21,
_TerminalSetItemStar22,
_PatternPlus23,
_PatternStar24,
__PatternStar24SepPlus25,
_commaQuestion26,
_TermSet27,
__TermSet27Plus28,
_IdentOrLiteralPlus29,
_GrammarLinePlus30,
Augmented,
}
impl GrammarNonTerminals {
#[inline]
pub fn from_usize(value: usize) -> Self {
debug_assert!(
value < 31usize,
"Non-terminal index {} is out of bounds (max {})",
value,
31usize
);
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::MappedSymbol => "MappedSymbol",
GrammarNonTerminals::TerminalSetItem => "TerminalSetItem",
GrammarNonTerminals::TerminalSet => "TerminalSet",
GrammarNonTerminals::Pattern => "Pattern",
GrammarNonTerminals::Action => "Action",
GrammarNonTerminals::IdentOrLiteral => "IdentOrLiteral",
GrammarNonTerminals::AllowTarget => "AllowTarget",
GrammarNonTerminals::Directive => "Directive",
GrammarNonTerminals::GrammarLine => "GrammarLine",
GrammarNonTerminals::Grammar => "Grammar",
GrammarNonTerminals::_MappedSymbolPlus16 => "MappedSymbol+",
GrammarNonTerminals::_MappedSymbolStar17 => "MappedSymbol*",
GrammarNonTerminals::_PrecDefPlus18 => "PrecDef+",
GrammarNonTerminals::_PrecDefStar19 => "PrecDef*",
GrammarNonTerminals::_caretQuestion20 => "caret?",
GrammarNonTerminals::_TerminalSetItemPlus21 => "TerminalSetItem+",
GrammarNonTerminals::_TerminalSetItemStar22 => "TerminalSetItem*",
GrammarNonTerminals::_PatternPlus23 => "Pattern+",
GrammarNonTerminals::_PatternStar24 => "Pattern*",
GrammarNonTerminals::__PatternStar24SepPlus25 => "$sep(Pattern*, pipe, +)",
GrammarNonTerminals::_commaQuestion26 => "comma?",
GrammarNonTerminals::_TermSet27 => "[^semicolon]",
GrammarNonTerminals::__TermSet27Plus28 => "[^semicolon]+",
GrammarNonTerminals::_IdentOrLiteralPlus29 => "IdentOrLiteral+",
GrammarNonTerminals::_GrammarLinePlus30 => "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::MappedSymbol => None,
GrammarNonTerminals::TerminalSetItem => None,
GrammarNonTerminals::TerminalSet => None,
GrammarNonTerminals::Pattern => None,
GrammarNonTerminals::Action => None,
GrammarNonTerminals::IdentOrLiteral => None,
GrammarNonTerminals::AllowTarget => None,
GrammarNonTerminals::Directive => None,
GrammarNonTerminals::GrammarLine => None,
GrammarNonTerminals::Grammar => None,
GrammarNonTerminals::_MappedSymbolPlus16 => {
Some(::rusty_lr_core::parser::nonterminal::NonTerminalType::PlusLeft)
}
GrammarNonTerminals::_MappedSymbolStar17 => {
Some(::rusty_lr_core::parser::nonterminal::NonTerminalType::Star)
}
GrammarNonTerminals::_PrecDefPlus18 => {
Some(::rusty_lr_core::parser::nonterminal::NonTerminalType::PlusLeft)
}
GrammarNonTerminals::_PrecDefStar19 => {
Some(::rusty_lr_core::parser::nonterminal::NonTerminalType::Star)
}
GrammarNonTerminals::_caretQuestion20 => {
Some(::rusty_lr_core::parser::nonterminal::NonTerminalType::Optional)
}
GrammarNonTerminals::_TerminalSetItemPlus21 => {
Some(::rusty_lr_core::parser::nonterminal::NonTerminalType::PlusLeft)
}
GrammarNonTerminals::_TerminalSetItemStar22 => {
Some(::rusty_lr_core::parser::nonterminal::NonTerminalType::Star)
}
GrammarNonTerminals::_PatternPlus23 => {
Some(::rusty_lr_core::parser::nonterminal::NonTerminalType::PlusLeft)
}
GrammarNonTerminals::_PatternStar24 => {
Some(::rusty_lr_core::parser::nonterminal::NonTerminalType::Star)
}
GrammarNonTerminals::__PatternStar24SepPlus25 => {
Some(::rusty_lr_core::parser::nonterminal::NonTerminalType::PlusLeft)
}
GrammarNonTerminals::_commaQuestion26 => {
Some(::rusty_lr_core::parser::nonterminal::NonTerminalType::Optional)
}
GrammarNonTerminals::_TermSet27 => {
Some(::rusty_lr_core::parser::nonterminal::NonTerminalType::TerminalSet)
}
GrammarNonTerminals::__TermSet27Plus28 => {
Some(::rusty_lr_core::parser::nonterminal::NonTerminalType::PlusLeft)
}
GrammarNonTerminals::_IdentOrLiteralPlus29 => {
Some(::rusty_lr_core::parser::nonterminal::NonTerminalType::PlusLeft)
}
GrammarNonTerminals::_GrammarLinePlus30 => {
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(AllowTarget),
__variant12(Vec<(Option<Located<String>>, PatternArgs)>),
__variant13(Vec<PrecDPrecArgs>),
__variant14(Option<Lexed>),
__variant15(Vec<TerminalSetItem>),
__variant16(Vec<PatternArgs>),
__variant17(Vec<Vec<PatternArgs>>),
__variant18(Vec<Lexed>),
__variant19(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::__variant13(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__variant12(_)))
);
}
__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::__variant13(val) => val,
_ => unreachable!(),
};
let mut MappedSymbol = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant12(val) => val,
_ => unreachable!(),
};
let __res = {
RuleLineArgs {
tokens: MappedSymbol,
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_MappedSymbol_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_MappedSymbol_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::__variant15(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__variant14(_)))
);
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::__variant15(val) => val,
_ => unreachable!(),
};
let mut caret = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant14(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::__variant17(_)))
);
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::__variant17(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_AllowTarget_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!("AllowTarget-Ident");
};
AllowTarget::Ident(Located::new(ident.to_string(), __rustylr_location_ident))
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant11(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_AllowTarget_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!("AllowTarget-ByteLiteral");
};
AllowTarget::Byte(Located::new(b.value(), __rustylr_location_byte_literal))
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant11(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_AllowTarget_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!("AllowTarget-CharLiteral");
};
AllowTarget::Char(Located::new(c.value(), __rustylr_location_char_literal))
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant11(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_AllowTarget_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::__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!("AllowTarget-CharLiteralRange1");
};
let Lexed::CharLiteral(last) = last else {
unreachable!("AllowTarget-CharLiteralRange2");
};
AllowTarget::CharRange(
Located::new(first.value(), __rustylr_location_first),
Located::new(last.value(), __rustylr_location_last),
)
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant11(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_AllowTarget_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::ByteLiteral(first) = first else {
unreachable!("AllowTarget-ByteLiteralRange1");
};
let Lexed::ByteLiteral(last) = last else {
unreachable!("AllowTarget-ByteLiteralRange2");
};
AllowTarget::ByteRange(
Located::new(first.value(), __rustylr_location_first),
Located::new(last.value(), __rustylr_location_last),
)
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant11(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce_AllowTarget_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 = { AllowTarget::TerminalSet(TerminalSet) };
if __push_data {
__data_stack.__stack.push(GrammarData::__variant11(__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::__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(_)))
);
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::__variant18(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::__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_tokentype = __location_stack.pop().unwrap();
__location_stack.pop();
__data_stack.__stack.pop();
let mut __rustylr_data_2 = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant18(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::__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_userdata = __location_stack.pop().unwrap();
__location_stack.pop();
__data_stack.__stack.pop();
let mut __rustylr_data_2 = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant18(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::__variant19(_)))
);
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::__variant19(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.truncate(__data_stack.__stack.len() - 2);
{
data.precedences
.push((
__rustylr_location_left,
Some(Associativity::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::__variant19(_)))
);
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::__variant19(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.truncate(__data_stack.__stack.len() - 2);
{
data.precedences
.push((
__rustylr_location_right,
Some(Associativity::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::__variant19(_)))
);
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::__variant19(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::__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_errortype = __location_stack.pop().unwrap();
__location_stack.pop();
__data_stack.__stack.pop();
let mut __rustylr_data_2 = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant18(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::__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_moduleprefix = __location_stack.pop().unwrap();
__location_stack.pop();
__data_stack.__stack.pop();
let mut __rustylr_data_2 = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant18(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::__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_location = __location_stack.pop().unwrap();
__location_stack.pop();
__data_stack.__stack.pop();
let mut __rustylr_data_2 = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant18(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.truncate(__data_stack.__stack.len() - 2);
let __rustylr_data_2 = Self::custom_reduce_action_0(
__rustylr_data_2,
data,
__rustylr_location0,
)?;
let mut RustCode = __rustylr_data_2;
{
data.location_typename.push((__rustylr_location_location, RustCode));
};
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
#[inline]
fn reduce_Directive_26(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__terminals(_)))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
2usize), Some(& GrammarData::__terminals(_)))
);
}
__location_stack.pop();
let mut __rustylr_location_location = __location_stack.pop().unwrap();
__location_stack.pop();
__data_stack.__stack.pop();
let mut location = match __data_stack.__stack.pop().unwrap() {
GrammarData::__terminals(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.pop();
{
data.error_recovered
.push(RecoveredError {
message: "Expected location type definition".to_string(),
link: "https://github.com/ehwan/RustyLR/blob/main/SYNTAX.md#location-tracking"
.to_string(),
location: __rustylr_location_location,
});
};
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
#[inline]
fn reduce_Directive_27(
__data_stack: &mut Self,
__location_stack: &mut Vec<Location>,
__push_data: bool,
shift: &mut bool,
lookahead: &::rusty_lr_core::TerminalSymbol<Lexed>,
data: &mut GrammarArgs,
__rustylr_location0: &mut Location,
) -> Result<(), ::rusty_lr_core::DefaultReduceActionError> {
#[cfg(debug_assertions)]
{
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
0usize), Some(& GrammarData::Empty))
);
debug_assert!(
matches!(__data_stack.__stack.get(__data_stack.__stack.len() - 1 -
1usize), Some(& GrammarData::__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!("AllowDef-Ident");
};
data.allowed_diagnostics
.push((Located::new(ident.to_string(), __rustylr_location_ident), None));
};
__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::__variant11(_)))
);
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(_)))
);
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(_)))
);
}
__location_stack.truncate(__location_stack.len() - 4);
let mut __rustylr_location_ident = __location_stack.pop().unwrap();
__location_stack.truncate(__location_stack.len() - 2);
__data_stack.__stack.truncate(__data_stack.__stack.len() - 2);
let mut AllowTarget = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant11(val) => val,
_ => unreachable!(),
};
__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!("AllowDef-Ident");
};
data.allowed_diagnostics
.push((
Located::new(ident.to_string(), __rustylr_location_ident),
Some(AllowTarget),
));
};
__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(_)))
);
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 diagnostic name".to_string(),
link: "https://github.com/ehwan/RustyLR/blob/main/SYNTAX.md#diagnostic-suppression"
.to_string(),
location: __rustylr_location_error,
});
};
__data_stack.__stack.push(GrammarData::Empty);
Ok(())
}
#[inline]
fn reduce_Directive_30(
__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__MappedSymbolPlus16_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::__variant12(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce__MappedSymbolPlus16_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::__variant12(_)))
);
}
__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::__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__MappedSymbolStar17_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__MappedSymbolStar17_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__PrecDefPlus18_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::__variant13(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce__PrecDefPlus18_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::__variant13(_)))
);
}
__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::__variant13(val) => val,
_ => unreachable!(),
};
let __res = {
Ap.push(A);
Ap
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant13(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce__PrecDefStar19_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::__variant13(_)))
);
}
__location_stack.pop();
let mut __token0 = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant13(val) => val,
_ => unreachable!(),
};
let __res = __token0;
if __push_data {
__data_stack.__stack.push(GrammarData::__variant13(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce__PrecDefStar19_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::__variant13(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce__caretQuestion20_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::__variant14(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce__caretQuestion20_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::__variant14(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce__TerminalSetItemPlus21_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::__variant15(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce__TerminalSetItemPlus21_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::__variant15(_)))
);
}
__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::__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__TerminalSetItemStar22_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__TerminalSetItemStar22_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__PatternPlus23_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::__variant16(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce__PatternPlus23_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::__variant16(_)))
);
}
__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::__variant16(val) => val,
_ => unreachable!(),
};
let __res = {
Ap.push(A);
Ap
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant16(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce__PatternStar24_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::__variant16(_)))
);
}
__location_stack.pop();
let mut __token0 = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant16(val) => val,
_ => unreachable!(),
};
let __res = __token0;
if __push_data {
__data_stack.__stack.push(GrammarData::__variant16(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce__PatternStar24_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::__variant16(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce___PatternStar24SepPlus25_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::__variant16(_)))
);
}
__location_stack.pop();
let mut __token0 = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant16(val) => val,
_ => unreachable!(),
};
let __res = { vec![__token0] };
if __push_data {
__data_stack.__stack.push(GrammarData::__variant17(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce___PatternStar24SepPlus25_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::__variant16(_)))
);
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::__variant17(_)))
);
}
__location_stack.truncate(__location_stack.len() - 3);
let mut __token1 = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant16(val) => val,
_ => unreachable!(),
};
__data_stack.__stack.pop();
let mut __token0 = match __data_stack.__stack.pop().unwrap() {
GrammarData::__variant17(val) => val,
_ => unreachable!(),
};
let __res = {
__token0.push(__token1);
__token0
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant17(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce__commaQuestion26_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__commaQuestion26_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___TermSet27Plus28_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::__variant18(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce___TermSet27Plus28_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::__variant18(_)))
);
}
__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::__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__IdentOrLiteralPlus29_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::__variant19(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce__IdentOrLiteralPlus29_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::__variant19(_)))
);
}
__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::__variant19(val) => val,
_ => unreachable!(),
};
let __res = {
Ap.push(A);
Ap
};
if __push_data {
__data_stack.__stack.push(GrammarData::__variant19(__res));
} else {
__data_stack.__stack.push(GrammarData::Empty);
}
Ok(())
}
#[inline]
fn reduce__GrammarLinePlus30_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__GrammarLinePlus30_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_MappedSymbol_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
12usize => {
Self::reduce_MappedSymbol_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_AllowTarget_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
48usize => {
Self::reduce_AllowTarget_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
49usize => {
Self::reduce_AllowTarget_2(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
50usize => {
Self::reduce_AllowTarget_3(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
51usize => {
Self::reduce_AllowTarget_4(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
52usize => {
Self::reduce_AllowTarget_5(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
53usize => {
Self::reduce_Directive_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
54usize => {
Self::reduce_Directive_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
55usize => {
Self::reduce_Directive_2(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
56usize => {
Self::reduce_Directive_3(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
57usize => {
Self::reduce_Directive_4(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
58usize => {
Self::reduce_Directive_5(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
59usize => {
Self::reduce_Directive_6(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
60usize => {
Self::reduce_Directive_7(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
61usize => {
Self::reduce_Directive_8(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
62usize => {
Self::reduce_Directive_9(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
63usize => {
Self::reduce_Directive_10(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
64usize => {
Self::reduce_Directive_11(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
65usize => {
Self::reduce_Directive_12(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
66usize => {
Self::reduce_Directive_13(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
67usize => {
Self::reduce_Directive_14(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
68usize => {
Self::reduce_Directive_15(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
69usize => {
Self::reduce_Directive_16(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
70usize => {
Self::reduce_Directive_17(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
71usize => {
Self::reduce_Directive_18(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
72usize => {
Self::reduce_Directive_19(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
73usize => {
Self::reduce_Directive_20(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
74usize => {
Self::reduce_Directive_21(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
75usize => {
Self::reduce_Directive_22(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
76usize => {
Self::reduce_Directive_23(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
77usize => {
Self::reduce_Directive_24(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
78usize => {
Self::reduce_Directive_25(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
79usize => {
Self::reduce_Directive_26(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
80usize => {
Self::reduce_Directive_27(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
81usize => {
Self::reduce_Directive_28(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
82usize => {
Self::reduce_Directive_29(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
83usize => {
Self::reduce_Directive_30(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
84usize => {
Self::reduce_GrammarLine_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
87usize => {
Self::reduce__MappedSymbolPlus16_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
88usize => {
Self::reduce__MappedSymbolPlus16_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
89usize => {
Self::reduce__MappedSymbolStar17_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
90usize => {
Self::reduce__MappedSymbolStar17_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
91usize => {
Self::reduce__PrecDefPlus18_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
92usize => {
Self::reduce__PrecDefPlus18_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
93usize => {
Self::reduce__PrecDefStar19_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
94usize => {
Self::reduce__PrecDefStar19_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
95usize => {
Self::reduce__caretQuestion20_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
96usize => {
Self::reduce__caretQuestion20_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
97usize => {
Self::reduce__TerminalSetItemPlus21_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
98usize => {
Self::reduce__TerminalSetItemPlus21_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
99usize => {
Self::reduce__TerminalSetItemStar22_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
100usize => {
Self::reduce__TerminalSetItemStar22_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
101usize => {
Self::reduce__PatternPlus23_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
102usize => {
Self::reduce__PatternPlus23_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
103usize => {
Self::reduce__PatternStar24_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
104usize => {
Self::reduce__PatternStar24_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
105usize => {
Self::reduce___PatternStar24SepPlus25_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
106usize => {
Self::reduce___PatternStar24SepPlus25_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
107usize => {
Self::reduce__commaQuestion26_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
108usize => {
Self::reduce__commaQuestion26_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
151usize => {
Self::reduce___TermSet27Plus28_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
152usize => {
Self::reduce___TermSet27Plus28_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
153usize => {
Self::reduce__IdentOrLiteralPlus29_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
154usize => {
Self::reduce__IdentOrLiteralPlus29_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
155usize => {
Self::reduce__GrammarLinePlus30_0(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
156usize => {
Self::reduce__GrammarLinePlus30_1(
data_stack,
location_stack,
push_data,
shift,
lookahead,
user_data,
location0,
)
}
_ => {
unreachable!("Invalid Rule: {}", rule_index);
}
}
}
}
#[allow(
unused_braces,
unused_parens,
unused_variables,
non_snake_case,
unused_mut
)]
#[derive(Clone, Copy)]
pub struct GrammarParser;
unsafe impl ::std::marker::Send for GrammarParser {}
unsafe impl ::std::marker::Sync for GrammarParser {}
#[rustfmt::skip]
impl ::rusty_lr_core::parser::Parser for GrammarParser {
type Term = Lexed;
type TermClass = GrammarTerminalClasses;
type NonTerm = GrammarNonTerminals;
type StateIndex = u8;
type ReduceRules = u8;
type Tables = GrammarTables;
const ERROR_USED: bool = true;
fn get_tables() -> &'static GrammarTables {
static TABLES: std::sync::OnceLock<GrammarTables> = std::sync::OnceLock::new();
TABLES
.get_or_init(|| {
static RULE_NAMES: &[u32] = &[
0, 1, 1, 2, 2, 3, 4, 4, 4, 4, 4, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7,
7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 10,
10, 10, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 13, 13, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19,
19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 26, 26,
26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
26, 26, 26, 26, 27, 27, 28, 28, 29, 29, 30,
];
static RULE_LENGTHS: &[u32] = &[
5, 1, 0, 3, 1, 3, 3, 3, 3, 3, 2, 1, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 4,
1, 1, 2, 2, 2, 2, 1, 3, 3, 1, 1, 1, 1, 3, 8, 9, 9, 8, 9, 1, 0, 1, 1,
1, 1, 1, 1, 3, 3, 1, 5, 4, 4, 4, 4, 4, 3, 4, 3, 4, 4, 4, 4, 4, 4, 4,
3, 4, 3, 3, 4, 3, 4, 3, 4, 4, 3, 4, 7, 4, 3, 1, 1, 1, 1, 2, 1, 0, 1,
2, 1, 0, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 3, 1, 0, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 2,
];
static SHIFT_TERM_DATA: &[u32] = &[
2147516416, 2150629380, 2147549199, 2147614722, 2147647488,
2147745799, 2147778568, 2147876875, 2147909644, 2147942413,
2147975182, 2148007953, 2148040723, 2147680261, 2147713024,
2147745799, 2147778568, 2147876875, 2147909644, 2147942413,
2147975182, 2148007953, 2148040723, 2147811328, 2147844113,
2147713024, 2147745799, 2147778568, 2147876875, 2147909644,
2147942413, 2147975182, 2148007953, 2148040723, 2147713024,
2147745799, 2147778568, 2147876875, 2147909644, 2147942413,
2147975182, 2148007953, 2148040723, 2148794411, 2148073478,
2148139008, 2148270091, 2148401165, 2148171818, 2148204544,
2148237355, 2148302890, 2148335627, 2148368427, 2148433962,
2148466701, 2148499499, 2148139008, 2148270091, 2148401165,
2148663316, 2148761609, 2148892710, 2148925479, 2148958248,
2148991017, 2149023786, 2147713024, 2147745799, 2147778568,
2147876875, 2147909644, 2147942413, 2147975182, 2148007953,
2148040723, 2148827154, 2148892710, 2148925479, 2148958248,
2148991017, 2149023786, 2147713024, 2147745799, 2147778568,
2147876875, 2147909644, 2147942413, 2147975182, 2148007953,
2148040723, 2148892710, 2148925479, 2148958248, 2148991017,
2147713024, 2147745799, 2147778568, 2147876875, 2147909644,
2147942413, 2147975182, 2148007953, 2148040723, 2148892710,
2148925479, 2148958248, 2148991017, 2149023786, 2149220355,
2149285906, 2147713024, 2147745799, 2147778568, 2147876875,
2147909644, 2147942413, 2147975182, 2148007953, 2148040723,
2149351433, 2148892710, 2148925479, 2148958248, 2148991017,
2149023786, 2149580843, 2149384230, 2149449767, 2149515307,
2149416978, 2149482514, 2149548050, 2149613586, 2149679122,
2148892710, 2148925479, 2148958248, 2148991017, 2149023786,
2149777411, 3080229, 2147647488, 2147745799, 2147778568, 2147876875,
2147909644, 2147942413, 2147975182, 2148007953, 2148040723,
2148892710, 2148925479, 2148958248, 2148991017, 2149023786,
2147647488, 2147745799, 2147778568, 2147876875, 2147909644,
2147942413, 2147975182, 2148007953, 2148040723, 2150006788,
2150039583, 2150236194, 2150334507, 2150072320, 2150105099,
2150137869, 2150170667, 2150268938, 2150301739, 2150006788,
2150498320, 2150662165, 2150891542, 2151055383, 2151350296,
2151514137, 2151645210, 2151776283, 2151907356, 2152038429,
2152169502, 2152300576, 2152464417, 2152595491, 2152726564,
2153283627, 2150072320, 2150105099, 2150137869, 2150694955, 3244069,
2150072320, 2150105099, 2150137869, 3342373, 2150072320, 2150105099,
2150137869, 2150924331, 3473445, 2150072320, 2150105099, 2150137869,
3538981, 2151088128, 2151284779, 2151153664, 2151153665, 2151153666,
2151153667, 2151153668, 2151153669, 2151153670, 2151153671,
2151153672, 2151153673, 2151153674, 2151153675, 2151153676,
2151153677, 2151153678, 2151153679, 2151153680, 2151153681,
2151153682, 2151153683, 2151153684, 2151153685, 2151153686,
2151153687, 2151153688, 2151153689, 2151153690, 2151153691,
2151153692, 2151153693, 2151153694, 2151153695, 2151153696,
2151153697, 2151153698, 2151153699, 2151153700, 3637285, 2151153702,
2151153703, 2151153704, 2151153705, 2151153706, 2151251968,
2151251969, 2151251970, 2151251971, 2151251972, 2151251973,
2151251974, 2151251975, 2151251976, 2151251977, 2151251978,
2151251979, 2151251980, 2151251981, 2151251982, 2151251983,
2151251984, 2151251985, 2151251986, 2151251987, 2151251988,
2151251989, 2151251990, 2151251991, 2151251992, 2151251993,
2151251994, 2151251995, 2151251996, 2151251997, 2151251998,
2151251999, 2151252000, 2151252001, 2151252002, 2151252003,
2151252004, 3735589, 2151252006, 2151252007, 2151252008, 2151252009,
2151252010, 3833893, 2151383040, 2151448619, 3932197, 3997733,
2151153664, 2151153665, 2151153666, 2151153667, 2151153668,
2151153669, 2151153670, 2151153671, 2151153672, 2151153673,
2151153674, 2151153675, 2151153676, 2151153677, 2151153678,
2151153679, 2151153680, 2151153681, 2151153682, 2151153683,
2151153684, 2151153685, 2151153686, 2151153687, 2151153688,
2151153689, 2151153690, 2151153691, 2151153692, 2151153693,
2151153694, 2151153695, 2151153696, 2151153697, 2151153698,
2151153699, 2151153700, 4063269, 2151153702, 2151153703, 2151153704,
2151153705, 2151153706, 2151251968, 2151251969, 2151251970,
2151251971, 2151251972, 2151251973, 2151251974, 2151251975,
2151251976, 2151251977, 2151251978, 2151251979, 2151251980,
2151251981, 2151251982, 2151251983, 2151251984, 2151251985,
2151251986, 2151251987, 2151251988, 2151251989, 2151251990,
2151251991, 2151251992, 2151251993, 2151251994, 2151251995,
2151251996, 2151251997, 2151251998, 2151251999, 2151252000,
2151252001, 2151252002, 2151252003, 2151252004, 4128805, 2151252006,
2151252007, 2151252008, 2151252009, 2151252010, 2151153664,
2151153665, 2151153666, 2151153667, 2151153668, 2151153669,
2151153670, 2151153671, 2151153672, 2151153673, 2151153674,
2151153675, 2151153676, 2151153677, 2151153678, 2151153679,
2151153680, 2151153681, 2151153682, 2151153683, 2151153684,
2151153685, 2151153686, 2151153687, 2151153688, 2151153689,
2151153690, 2151153691, 2151153692, 2151153693, 2151153694,
2151153695, 2151153696, 2151153697, 2151153698, 2151153699,
2151153700, 4194341, 2151153702, 2151153703, 2151153704, 2151153705,
2151153706, 2151251968, 2151251969, 2151251970, 2151251971,
2151251972, 2151251973, 2151251974, 2151251975, 2151251976,
2151251977, 2151251978, 2151251979, 2151251980, 2151251981,
2151251982, 2151251983, 2151251984, 2151251985, 2151251986,
2151251987, 2151251988, 2151251989, 2151251990, 2151251991,
2151251992, 2151251993, 2151251994, 2151251995, 2151251996,
2151251997, 2151251998, 2151251999, 2151252000, 2151252001,
2151252002, 2151252003, 2151252004, 4259877, 2151252006, 2151252007,
2151252008, 2151252009, 2151252010, 2151153664, 2151153665,
2151153666, 2151153667, 2151153668, 2151153669, 2151153670,
2151153671, 2151153672, 2151153673, 2151153674, 2151153675,
2151153676, 2151153677, 2151153678, 2151153679, 2151153680,
2151153681, 2151153682, 2151153683, 2151153684, 2151153685,
2151153686, 2151153687, 2151153688, 2151153689, 2151153690,
2151153691, 2151153692, 2151153693, 2151153694, 2151153695,
2151153696, 2151153697, 2151153698, 2151153699, 2151153700, 4325413,
2151153702, 2151153703, 2151153704, 2151153705, 2151153706,
2151251968, 2151251969, 2151251970, 2151251971, 2151251972,
2151251973, 2151251974, 2151251975, 2151251976, 2151251977,
2151251978, 2151251979, 2151251980, 2151251981, 2151251982,
2151251983, 2151251984, 2151251985, 2151251986, 2151251987,
2151251988, 2151251989, 2151251990, 2151251991, 2151251992,
2151251993, 2151251994, 2151251995, 2151251996, 2151251997,
2151251998, 2151251999, 2151252000, 2151252001, 2151252002,
2151252003, 2151252004, 4390949, 2151252006, 2151252007, 2151252008,
2151252009, 2151252010, 2151153664, 2151153665, 2151153666,
2151153667, 2151153668, 2151153669, 2151153670, 2151153671,
2151153672, 2151153673, 2151153674, 2151153675, 2151153676,
2151153677, 2151153678, 2151153679, 2151153680, 2151153681,
2151153682, 2151153683, 2151153684, 2151153685, 2151153686,
2151153687, 2151153688, 2151153689, 2151153690, 2151153691,
2151153692, 2151153693, 2151153694, 2151153695, 2151153696,
2151153697, 2151153698, 2151153699, 2151153700, 4456485, 2151153702,
2151153703, 2151153704, 2151153705, 2151153706, 2151251968,
2151251969, 2151251970, 2151251971, 2151251972, 2151251973,
2151251974, 2151251975, 2151251976, 2151251977, 2151251978,
2151251979, 2151251980, 2151251981, 2151251982, 2151251983,
2151251984, 2151251985, 2151251986, 2151251987, 2151251988,
2151251989, 2151251990, 2151251991, 2151251992, 2151251993,
2151251994, 2151251995, 2151251996, 2151251997, 2151251998,
2151251999, 2151252000, 2151252001, 2151252002, 2151252003,
2151252004, 4522021, 2151252006, 2151252007, 2151252008, 2151252009,
2151252010, 4587557, 2152103979, 4653093, 4718629, 2152235051,
4784165, 2150072320, 2150105099, 2150137869, 2152333355, 4882469,
2150072320, 2150105099, 2150137869, 4948005, 5013541, 2152529963,
5079077, 2151153664, 2151153665, 2151153666, 2151153667, 2151153668,
2151153669, 2151153670, 2151153671, 2151153672, 2151153673,
2151153674, 2151153675, 2151153676, 2151153677, 2151153678,
2151153679, 2151153680, 2151153681, 2151153682, 2151153683,
2151153684, 2151153685, 2151153686, 2151153687, 2151153688,
2151153689, 2151153690, 2151153691, 2151153692, 2151153693,
2151153694, 2151153695, 2151153696, 2151153697, 2151153698,
2151153699, 2151153700, 5144613, 2151153702, 2151153703, 2151153704,
2151153705, 2151153706, 2151251968, 2151251969, 2151251970,
2151251971, 2151251972, 2151251973, 2151251974, 2151251975,
2151251976, 2151251977, 2151251978, 2151251979, 2151251980,
2151251981, 2151251982, 2151251983, 2151251984, 2151251985,
2151251986, 2151251987, 2151251988, 2151251989, 2151251990,
2151251991, 2151251992, 2151251993, 2151251994, 2151251995,
2151251996, 2151251997, 2151251998, 2151251999, 2151252000,
2151252001, 2151252002, 2151252003, 2151252004, 5210149, 2151252006,
2151252007, 2151252008, 2151252009, 2151252010, 2152759296,
2153218091, 2152792081, 5701669, 2152824832, 2147745799, 2152857611,
2152955917, 2148040723, 2152890410, 2152923147, 2152988714,
2153021453, 2153119762, 5668901, 5767205, 5832741, 2147516416,
2150629380, 2153480236,
];
static SHIFT_TERM_OFFSETS: &[u32] = &[
0, 2, 3, 3, 4, 13, 14, 23, 23, 23, 24, 25, 34, 34, 34, 34, 34, 44,
45, 45, 48, 49, 51, 51, 51, 52, 54, 54, 54, 55, 57, 57, 57, 57, 60,
60, 61, 61, 61, 67, 76, 77, 77, 82, 82, 82, 82, 82, 91, 95, 104, 109,
109, 111, 120, 120, 120, 127, 130, 131, 131, 132, 132, 133, 133, 134,
134, 135, 135, 140, 142, 151, 151, 151, 156, 165, 165, 166, 169, 173,
173, 173, 173, 173, 173, 175, 175, 175, 175, 175, 176, 176, 177, 177,
177, 177, 177, 192, 196, 197, 197, 197, 201, 201, 201, 205, 206, 206,
210, 210, 212, 255, 255, 255, 298, 298, 298, 299, 299, 301, 302, 302,
303, 303, 346, 346, 389, 389, 432, 432, 475, 475, 518, 518, 561, 561,
604, 604, 647, 647, 649, 649, 650, 650, 652, 652, 653, 653, 657, 658,
658, 662, 662, 664, 664, 665, 665, 708, 708, 751, 751, 753, 755, 760,
760, 761, 762, 762, 763, 764, 764, 764, 765, 766, 766, 766, 767, 767,
768, 768, 768, 770, 770, 771, 771,
];
static SHIFT_NONTERM_DATA: &[u32] = &[
2153349120, 5898252, 2153381901, 2153447438, 5963805, 2147581953,
2149744642, 2150596611, 2149842949, 2148696071, 2149875720,
2149908495, 2149974032, 2148696071, 2149711880, 2148696071,
2148728840, 2148696071, 2148859912, 2149089302, 2149154839,
2149187608, 2148106259, 2148532230, 2148565012, 2148630549,
2148597766, 2148696071, 2149318664, 2148696071, 2149056520,
2148696071, 2149122056, 2148696071, 2148859912, 2149089302,
2149253143, 2149646361, 2149810179, 2149842949, 2148696071,
2149875720, 2149908495, 2149974032, 2149941253, 2148696071,
2149875720, 2150367236, 2150400017, 2150465554, 2150203402,
2150432772, 2150531081, 2150760458, 2150793244, 2150858762,
2150760458, 2150989852, 2150858762, 2151153690, 2151186459,
2151251994, 2151153690, 2151579675, 2151251994, 2151153690,
2151710747, 2151251994, 2151153690, 2151841819, 2151251994,
2151153690, 2151972891, 2151251994, 2150760458, 2152398876,
2150858762, 2151153690, 2152661019, 2151251994, 2153054215,
2153086987, 2153349120, 5898252, 2153381901, 2153414685,
];
static SHIFT_NONTERM_OFFSETS: &[u32] = &[
0, 5, 6, 6, 6, 13, 13, 15, 15, 15, 15, 15, 17, 17, 17, 17, 17, 22,
23, 23, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27,
27, 27, 27, 27, 27, 29, 29, 29, 29, 29, 29, 29, 29, 31, 31, 33, 33,
33, 33, 37, 37, 37, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 44, 44, 44, 44, 47, 47, 50, 50, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 52, 52, 53, 53, 53, 53, 53, 53, 55, 55, 55, 55, 56,
56, 56, 58, 58, 58, 59, 59, 59, 61, 61, 61, 62, 62, 62, 62, 62, 62,
62, 62, 62, 62, 64, 64, 65, 65, 67, 67, 68, 68, 70, 70, 71, 71, 73,
73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 76, 76, 76, 77, 77, 77,
77, 77, 77, 79, 79, 80, 80, 80, 80, 82, 82, 82, 82, 82, 82, 82, 82,
82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 86, 86, 86, 86,
];
static REDUCE_DATA: &[u32] = &[
2, 1, 2, 2, 1, 1, 3, 1, 90, 4, 1, 90, 16, 1, 90, 37, 1, 90, 0, 1, 24,
3, 1, 24, 4, 1, 24, 7, 1, 24, 8, 1, 24, 11, 1, 24, 12, 1, 24, 13, 1,
24, 14, 1, 24, 16, 1, 24, 17, 1, 24, 19, 1, 24, 37, 1, 24, 38, 1, 24,
39, 1, 24, 40, 1, 24, 41, 1, 24, 42, 1, 24, 0, 1, 24, 3, 1, 24, 4, 1,
24, 7, 1, 24, 8, 1, 24, 9, 1, 24, 11, 1, 24, 12, 1, 24, 13, 1, 24,
14, 1, 24, 16, 1, 24, 17, 1, 24, 18, 1, 24, 19, 1, 24, 37, 1, 24, 38,
1, 24, 39, 1, 24, 40, 1, 24, 41, 1, 24, 42, 1, 24, 43, 1, 24, 0, 1,
23, 3, 1, 23, 4, 1, 23, 7, 1, 23, 8, 1, 23, 9, 1, 23, 11, 1, 23, 12,
1, 23, 13, 1, 23, 14, 1, 23, 16, 1, 23, 17, 1, 23, 18, 1, 23, 19, 1,
23, 37, 1, 23, 38, 1, 23, 39, 1, 23, 40, 1, 23, 41, 1, 23, 42, 1, 23,
43, 1, 23, 0, 1, 32, 3, 1, 32, 4, 1, 32, 7, 1, 32, 8, 1, 32, 9, 1,
32, 11, 1, 32, 12, 1, 32, 13, 1, 32, 14, 1, 32, 16, 1, 32, 17, 1, 32,
18, 1, 32, 19, 1, 32, 37, 1, 32, 38, 1, 32, 39, 1, 32, 40, 1, 32, 41,
1, 32, 42, 1, 32, 43, 1, 32, 0, 1, 33, 3, 1, 33, 4, 1, 33, 7, 1, 33,
8, 1, 33, 9, 1, 33, 11, 1, 33, 12, 1, 33, 13, 1, 33, 14, 1, 33, 16,
1, 33, 17, 1, 33, 18, 1, 33, 19, 1, 33, 37, 1, 33, 38, 1, 33, 39, 1,
33, 40, 1, 33, 41, 1, 33, 42, 1, 33, 43, 1, 33, 0, 1, 34, 3, 1, 34,
4, 1, 34, 7, 1, 34, 8, 1, 34, 9, 1, 34, 11, 1, 34, 12, 1, 34, 13, 1,
34, 14, 1, 34, 16, 1, 34, 17, 1, 34, 18, 1, 34, 19, 1, 34, 37, 1, 34,
38, 1, 34, 39, 1, 34, 40, 1, 34, 41, 1, 34, 42, 1, 34, 43, 1, 34, 0,
1, 35, 3, 1, 35, 4, 1, 35, 7, 1, 35, 8, 1, 35, 9, 1, 35, 11, 1, 35,
12, 1, 35, 13, 1, 35, 14, 1, 35, 16, 1, 35, 17, 1, 35, 18, 1, 35, 19,
1, 35, 37, 1, 35, 38, 1, 35, 39, 1, 35, 40, 1, 35, 41, 1, 35, 42, 1,
35, 43, 1, 35, 3, 1, 104, 18, 1, 104, 0, 1, 96, 11, 1, 96, 13, 1, 96,
20, 1, 96, 0, 1, 95, 11, 1, 95, 13, 1, 95, 20, 1, 95, 20, 1, 100, 0,
1, 13, 11, 1, 13, 13, 1, 13, 20, 1, 13, 0, 1, 14, 11, 1, 14, 13, 1,
14, 20, 1, 14, 0, 1, 15, 11, 1, 15, 13, 1, 15, 20, 1, 15, 0, 1, 19,
11, 1, 19, 13, 1, 19, 20, 1, 19, 0, 1, 20, 11, 1, 20, 13, 1, 20, 20,
1, 20, 0, 1, 21, 11, 1, 21, 13, 1, 21, 20, 1, 21, 0, 1, 16, 11, 1,
16, 13, 1, 16, 20, 1, 16, 0, 1, 17, 11, 1, 17, 13, 1, 17, 20, 1, 17,
0, 1, 18, 11, 1, 18, 13, 1, 18, 20, 1, 18, 0, 1, 97, 11, 1, 97, 13,
1, 97, 20, 1, 97, 20, 1, 99, 0, 1, 98, 11, 1, 98, 13, 1, 98, 20, 1,
98, 0, 1, 22, 3, 1, 22, 4, 1, 22, 7, 1, 22, 8, 1, 22, 9, 1, 22, 11,
1, 22, 12, 1, 22, 13, 1, 22, 14, 1, 22, 16, 1, 22, 17, 1, 22, 18, 1,
22, 19, 1, 22, 37, 1, 22, 38, 1, 22, 39, 1, 22, 40, 1, 22, 41, 1, 22,
42, 1, 22, 43, 1, 22, 0, 1, 29, 3, 1, 29, 4, 1, 29, 7, 1, 29, 8, 1,
29, 9, 1, 29, 11, 1, 29, 12, 1, 29, 13, 1, 29, 14, 1, 29, 16, 1, 29,
17, 1, 29, 18, 1, 29, 19, 1, 29, 37, 1, 29, 38, 1, 29, 39, 1, 29, 40,
1, 29, 41, 1, 29, 42, 1, 29, 43, 1, 29, 0, 1, 31, 3, 1, 31, 4, 1, 31,
7, 1, 31, 8, 1, 31, 9, 1, 31, 11, 1, 31, 12, 1, 31, 13, 1, 31, 14, 1,
31, 16, 1, 31, 17, 1, 31, 18, 1, 31, 19, 1, 31, 37, 1, 31, 38, 1, 31,
39, 1, 31, 40, 1, 31, 41, 1, 31, 42, 1, 31, 43, 1, 31, 0, 1, 101, 3,
1, 101, 7, 1, 101, 8, 1, 101, 11, 1, 101, 12, 1, 101, 13, 1, 101, 14,
1, 101, 17, 1, 101, 18, 1, 101, 19, 1, 101, 0, 1, 25, 3, 1, 25, 4, 1,
25, 7, 1, 25, 8, 1, 25, 9, 1, 25, 11, 1, 25, 12, 1, 25, 13, 1, 25,
14, 1, 25, 16, 1, 25, 17, 1, 25, 18, 1, 25, 19, 1, 25, 37, 1, 25, 38,
1, 25, 39, 1, 25, 40, 1, 25, 41, 1, 25, 42, 1, 25, 43, 1, 25, 0, 1,
26, 3, 1, 26, 4, 1, 26, 7, 1, 26, 8, 1, 26, 9, 1, 26, 11, 1, 26, 12,
1, 26, 13, 1, 26, 14, 1, 26, 16, 1, 26, 17, 1, 26, 18, 1, 26, 19, 1,
26, 37, 1, 26, 38, 1, 26, 39, 1, 26, 40, 1, 26, 41, 1, 26, 42, 1, 26,
43, 1, 26, 0, 1, 27, 3, 1, 27, 4, 1, 27, 7, 1, 27, 8, 1, 27, 9, 1,
27, 11, 1, 27, 12, 1, 27, 13, 1, 27, 14, 1, 27, 16, 1, 27, 17, 1, 27,
18, 1, 27, 19, 1, 27, 37, 1, 27, 38, 1, 27, 39, 1, 27, 40, 1, 27, 41,
1, 27, 42, 1, 27, 43, 1, 27, 0, 1, 28, 3, 1, 28, 4, 1, 28, 7, 1, 28,
8, 1, 28, 9, 1, 28, 11, 1, 28, 12, 1, 28, 13, 1, 28, 14, 1, 28, 16,
1, 28, 17, 1, 28, 18, 1, 28, 19, 1, 28, 37, 1, 28, 38, 1, 28, 39, 1,
28, 40, 1, 28, 41, 1, 28, 42, 1, 28, 43, 1, 28, 0, 1, 36, 3, 1, 36,
4, 1, 36, 7, 1, 36, 8, 1, 36, 9, 1, 36, 11, 1, 36, 12, 1, 36, 13, 1,
36, 14, 1, 36, 16, 1, 36, 17, 1, 36, 18, 1, 36, 19, 1, 36, 37, 1, 36,
42, 1, 36, 43, 1, 36, 3, 1, 103, 18, 1, 103, 0, 1, 102, 3, 1, 102, 7,
1, 102, 8, 1, 102, 11, 1, 102, 12, 1, 102, 13, 1, 102, 14, 1, 102,
17, 1, 102, 18, 1, 102, 19, 1, 102, 3, 1, 105, 18, 1, 105, 3, 1, 104,
18, 1, 104, 3, 1, 106, 18, 1, 106, 0, 1, 30, 3, 1, 30, 4, 1, 30, 7,
1, 30, 8, 1, 30, 9, 1, 30, 11, 1, 30, 12, 1, 30, 13, 1, 30, 14, 1,
30, 16, 1, 30, 17, 1, 30, 18, 1, 30, 19, 1, 30, 37, 1, 30, 38, 1, 30,
39, 1, 30, 40, 1, 30, 41, 1, 30, 42, 1, 30, 43, 1, 30, 18, 1, 108,
18, 1, 107, 0, 1, 38, 3, 1, 38, 4, 1, 38, 7, 1, 38, 8, 1, 38, 9, 1,
38, 11, 1, 38, 12, 1, 38, 13, 1, 38, 14, 1, 38, 16, 1, 38, 17, 1, 38,
18, 1, 38, 19, 1, 38, 37, 1, 38, 38, 1, 38, 39, 1, 38, 40, 1, 38, 41,
1, 38, 42, 1, 38, 43, 1, 38, 0, 1, 39, 3, 1, 39, 4, 1, 39, 7, 1, 39,
8, 1, 39, 9, 1, 39, 11, 1, 39, 12, 1, 39, 13, 1, 39, 14, 1, 39, 16,
1, 39, 17, 1, 39, 18, 1, 39, 19, 1, 39, 37, 1, 39, 38, 1, 39, 39, 1,
39, 40, 1, 39, 41, 1, 39, 42, 1, 39, 43, 1, 39, 0, 1, 41, 3, 1, 41,
4, 1, 41, 7, 1, 41, 8, 1, 41, 9, 1, 41, 11, 1, 41, 12, 1, 41, 13, 1,
41, 14, 1, 41, 16, 1, 41, 17, 1, 41, 18, 1, 41, 19, 1, 41, 37, 1, 41,
38, 1, 41, 39, 1, 41, 40, 1, 41, 41, 1, 41, 42, 1, 41, 43, 1, 41, 0,
1, 40, 3, 1, 40, 4, 1, 40, 7, 1, 40, 8, 1, 40, 9, 1, 40, 11, 1, 40,
12, 1, 40, 13, 1, 40, 14, 1, 40, 16, 1, 40, 17, 1, 40, 18, 1, 40, 19,
1, 40, 37, 1, 40, 38, 1, 40, 39, 1, 40, 40, 1, 40, 41, 1, 40, 42, 1,
40, 43, 1, 40, 0, 1, 37, 3, 1, 37, 4, 1, 37, 7, 1, 37, 8, 1, 37, 9,
1, 37, 11, 1, 37, 12, 1, 37, 13, 1, 37, 14, 1, 37, 16, 1, 37, 17, 1,
37, 18, 1, 37, 19, 1, 37, 37, 1, 37, 38, 1, 37, 39, 1, 37, 40, 1, 37,
41, 1, 37, 42, 1, 37, 43, 1, 37, 0, 1, 12, 3, 1, 12, 4, 1, 12, 7, 1,
12, 8, 1, 12, 11, 1, 12, 12, 1, 12, 13, 1, 12, 14, 1, 12, 16, 1, 12,
17, 1, 12, 19, 1, 12, 37, 1, 12, 3, 1, 90, 4, 1, 90, 16, 1, 90, 37,
1, 90, 3, 1, 3, 37, 1, 3, 0, 1, 87, 3, 1, 87, 4, 1, 87, 7, 1, 87, 8,
1, 87, 11, 1, 87, 12, 1, 87, 13, 1, 87, 14, 1, 87, 16, 1, 87, 17, 1,
87, 19, 1, 87, 37, 1, 87, 0, 1, 11, 3, 1, 11, 4, 1, 11, 7, 1, 11, 8,
1, 11, 11, 1, 11, 12, 1, 11, 13, 1, 11, 14, 1, 11, 16, 1, 11, 17, 1,
11, 19, 1, 11, 37, 1, 11, 3, 1, 89, 4, 1, 89, 16, 1, 89, 37, 1, 89,
0, 1, 88, 3, 1, 88, 4, 1, 88, 7, 1, 88, 8, 1, 88, 11, 1, 88, 12, 1,
88, 13, 1, 88, 14, 1, 88, 16, 1, 88, 17, 1, 88, 19, 1, 88, 37, 1, 88,
3, 1, 94, 16, 1, 94, 37, 1, 94, 0, 1, 44, 3, 1, 44, 4, 1, 44, 11, 1,
44, 13, 1, 44, 16, 1, 44, 37, 1, 44, 0, 1, 45, 3, 1, 45, 4, 1, 45,
11, 1, 45, 13, 1, 45, 16, 1, 45, 37, 1, 45, 0, 1, 46, 3, 1, 46, 4, 1,
46, 11, 1, 46, 13, 1, 46, 16, 1, 46, 37, 1, 46, 3, 1, 7, 4, 1, 7, 16,
1, 7, 37, 1, 7, 3, 1, 6, 4, 1, 6, 16, 1, 6, 37, 1, 6, 3, 1, 8, 4, 1,
8, 16, 1, 8, 37, 1, 8, 3, 1, 9, 4, 1, 9, 16, 1, 9, 37, 1, 9, 3, 1,
10, 4, 1, 10, 16, 1, 10, 37, 1, 10, 3, 1, 91, 4, 1, 91, 16, 1, 91,
37, 1, 91, 3, 1, 93, 16, 1, 93, 37, 1, 93, 3, 1, 92, 4, 1, 92, 16, 1,
92, 37, 1, 92, 3, 1, 43, 37, 1, 43, 3, 1, 42, 37, 1, 42, 3, 1, 5, 37,
1, 5, 0, 1, 0, 4, 1, 0, 44, 1, 0, 3, 1, 4, 37, 1, 4, 0, 1, 63, 4, 1,
63, 44, 1, 63, 0, 1, 153, 11, 1, 153, 13, 1, 153, 37, 1, 153, 0, 1,
62, 4, 1, 62, 44, 1, 62, 0, 1, 154, 11, 1, 154, 13, 1, 154, 37, 1,
154, 0, 1, 65, 4, 1, 65, 44, 1, 65, 0, 1, 64, 4, 1, 64, 44, 1, 64, 0,
1, 54, 4, 1, 54, 44, 1, 54, 0, 1, 151, 1, 1, 151, 2, 1, 151, 3, 1,
151, 4, 1, 151, 5, 1, 151, 6, 1, 151, 7, 1, 151, 8, 1, 151, 9, 1,
151, 10, 1, 151, 11, 1, 151, 12, 1, 151, 13, 1, 151, 14, 1, 151, 15,
1, 151, 16, 1, 151, 17, 1, 151, 18, 1, 151, 19, 1, 151, 20, 1, 151,
21, 1, 151, 22, 1, 151, 23, 1, 151, 24, 1, 151, 25, 1, 151, 26, 1,
151, 27, 1, 151, 28, 1, 151, 29, 1, 151, 30, 1, 151, 31, 1, 151, 32,
1, 151, 33, 1, 151, 34, 1, 151, 35, 1, 151, 36, 1, 151, 37, 1, 151,
38, 1, 151, 39, 1, 151, 40, 1, 151, 41, 1, 151, 42, 1, 151, 0, 1, 53,
4, 1, 53, 44, 1, 53, 0, 1, 152, 1, 1, 152, 2, 1, 152, 3, 1, 152, 4,
1, 152, 5, 1, 152, 6, 1, 152, 7, 1, 152, 8, 1, 152, 9, 1, 152, 10, 1,
152, 11, 1, 152, 12, 1, 152, 13, 1, 152, 14, 1, 152, 15, 1, 152, 16,
1, 152, 17, 1, 152, 18, 1, 152, 19, 1, 152, 20, 1, 152, 21, 1, 152,
22, 1, 152, 23, 1, 152, 24, 1, 152, 25, 1, 152, 26, 1, 152, 27, 1,
152, 28, 1, 152, 29, 1, 152, 30, 1, 152, 31, 1, 152, 32, 1, 152, 33,
1, 152, 34, 1, 152, 35, 1, 152, 36, 1, 152, 37, 1, 152, 38, 1, 152,
39, 1, 152, 40, 1, 152, 41, 1, 152, 42, 1, 152, 0, 1, 55, 4, 1, 55,
44, 1, 55, 0, 1, 56, 4, 1, 56, 44, 1, 56, 0, 1, 57, 4, 1, 57, 44, 1,
57, 0, 1, 59, 4, 1, 59, 44, 1, 59, 0, 1, 58, 4, 1, 58, 44, 1, 58, 0,
1, 61, 4, 1, 61, 44, 1, 61, 0, 1, 60, 4, 1, 60, 44, 1, 60, 0, 1, 69,
4, 1, 69, 44, 1, 69, 0, 1, 68, 4, 1, 68, 44, 1, 68, 0, 1, 71, 4, 1,
71, 44, 1, 71, 0, 1, 70, 4, 1, 70, 44, 1, 70, 0, 1, 74, 4, 1, 74, 44,
1, 74, 0, 1, 75, 4, 1, 75, 44, 1, 75, 0, 1, 72, 4, 1, 72, 44, 1, 72,
0, 1, 73, 4, 1, 73, 44, 1, 73, 0, 1, 67, 4, 1, 67, 44, 1, 67, 0, 1,
66, 4, 1, 66, 44, 1, 66, 0, 1, 76, 4, 1, 76, 44, 1, 76, 0, 1, 77, 4,
1, 77, 44, 1, 77, 0, 1, 79, 4, 1, 79, 44, 1, 79, 0, 1, 78, 4, 1, 78,
44, 1, 78, 18, 1, 47, 18, 1, 48, 18, 1, 51, 18, 1, 49, 18, 1, 50, 18,
1, 52, 0, 1, 81, 4, 1, 81, 44, 1, 81, 0, 1, 80, 4, 1, 80, 44, 1, 80,
0, 1, 82, 4, 1, 82, 44, 1, 82, 0, 1, 83, 4, 1, 83, 44, 1, 83, 0, 1,
84, 4, 1, 84, 44, 1, 84, 44, 1, 155, 44, 1, 156,
];
static REDUCE_OFFSETS: &[u32] = &[
0, 0, 3, 6, 6, 18, 72, 72, 135, 198, 198, 198, 198, 261, 324, 387,
450, 456, 468, 480, 483, 495, 495, 507, 519, 531, 531, 543, 555, 567,
567, 579, 591, 603, 606, 618, 618, 681, 744, 744, 744, 744, 807, 840,
903, 966, 1029, 1092, 1092, 1143, 1149, 1182, 1188, 1188, 1194, 1200,
1263, 1266, 1269, 1269, 1332, 1332, 1395, 1395, 1458, 1458, 1521,
1521, 1584, 1623, 1623, 1635, 1641, 1680, 1719, 1731, 1770, 1779,
1779, 1779, 1800, 1821, 1842, 1854, 1866, 1866, 1878, 1890, 1902,
1914, 1923, 1935, 1941, 1947, 1953, 1962, 1968, 1968, 1968, 1968,
1977, 1989, 1989, 1998, 2010, 2010, 2010, 2019, 2019, 2028, 2028,
2028, 2037, 2166, 2166, 2175, 2304, 2304, 2313, 2313, 2313, 2322,
2322, 2331, 2331, 2340, 2340, 2349, 2349, 2358, 2358, 2367, 2367,
2376, 2376, 2385, 2385, 2394, 2394, 2403, 2403, 2412, 2412, 2421,
2421, 2430, 2430, 2439, 2439, 2439, 2448, 2448, 2457, 2457, 2466,
2466, 2475, 2475, 2484, 2484, 2493, 2493, 2493, 2493, 2496, 2499,
2499, 2502, 2505, 2505, 2508, 2511, 2511, 2511, 2520, 2529, 2529,
2538, 2538, 2547, 2556, 2559, 2562, 2562, 2562,
];
static CAN_ACCEPT_ERROR: &[u8] = &[
0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 2, 2, 2, 2, 1, 0, 0, 0, 0, 1, 0,
0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 2, 0, 2, 2, 2,
2, 0, 2, 0, 0, 0, 0, 0, 0, 2, 1, 1, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0,
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
];
let num_rules = 158usize;
let mut rules = Vec::with_capacity(num_rules);
for i in 0..num_rules {
let lhs = GrammarNonTerminals::from_usize(RULE_NAMES[i] as usize);
rules
.push(::rusty_lr_core::parser::table::RuleInfo {
lhs,
len: RULE_LENGTHS[i] as usize,
});
}
let num_states = 184usize;
let mut state_rows = Vec::with_capacity(num_states);
for i in 0..num_states {
let term_start = SHIFT_TERM_OFFSETS[i] as usize;
let term_end = SHIFT_TERM_OFFSETS[i + 1] as usize;
let mut shift_goto_map_term = Vec::with_capacity(
term_end - term_start,
);
for idx in term_start..term_end {
let val = SHIFT_TERM_DATA[idx];
let term_class = GrammarTerminalClasses::from_usize(
(val & 0x7fff) as usize,
);
let state = ((val >> 15) & 0xffff) as usize;
let push = (val >> 31) != 0;
shift_goto_map_term
.push((
term_class,
::rusty_lr_core::parser::table::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 usize;
let push = (val >> 31) != 0;
shift_goto_map_nonterm
.push((
nonterm,
::rusty_lr_core::parser::table::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 usize);
}
reduce_map.push((term_class, rules));
idx += 2 + len;
}
let can_accept_error = match CAN_ACCEPT_ERROR[i] {
0 => ::rusty_lr_core::TriState::False,
1 => ::rusty_lr_core::TriState::True,
2 => ::rusty_lr_core::TriState::Maybe,
_ => unreachable!(),
};
let intermediate = ::rusty_lr_core::parser::state::IntermediateState {
shift_goto_map_term,
shift_goto_map_nonterm,
reduce_map,
ruleset: Vec::new(),
can_accept_error,
};
state_rows.push(intermediate);
}
::rusty_lr_core::parser::table::IntermediateTables {
state_rows,
rules,
}
.into()
})
}
}