#![allow(non_snake_case)]
#![allow(dead_code)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Token {
Underscore(crate::data::ByteIndex),
Ident(crate::data::token::Ident),
TerminalIdent(crate::data::token::TerminalIdent),
OuterAttribute(crate::data::token::Attribute),
StartKw(crate::data::ByteIndex),
StructKw(crate::data::ByteIndex),
EnumKw(crate::data::ByteIndex),
TerminalKw(crate::data::ByteIndex),
Colon(crate::data::ByteIndex),
DoubleColon(crate::data::ByteIndex),
Comma(crate::data::ByteIndex),
LParen(crate::data::ByteIndex),
RParen(crate::data::ByteIndex),
LCurly(crate::data::ByteIndex),
RCurly(crate::data::ByteIndex),
LAngle(crate::data::ByteIndex),
RAngle(crate::data::ByteIndex),
}
pub struct File {
pub items: Box<OptItems>,
}
pub enum OptItems {
Nil,
Cons(
Box<OptItems>,
Box<FileItem>,
),
}
pub enum FileItem {
Start(
crate::data::token::Ident,
),
Struct(
Box<Struct>,
),
Enum(
Box<Enum>,
),
Terminal(
Box<TerminalEnum>,
),
}
pub struct Struct {
pub attributes: Box<OptOuterAttributes>,
pub name: crate::data::token::Ident,
pub fieldset: Box<Fieldset>,
}
pub struct Enum {
pub attributes: Box<OptOuterAttributes>,
pub name: crate::data::token::Ident,
pub variants: Box<OptEnumVariants>,
}
pub struct TerminalEnum {
pub attributes: Box<OptOuterAttributes>,
pub name: crate::data::token::Ident,
pub variants: Box<OptTerminalEnumVariants>,
}
pub enum OptOuterAttributes {
Nil,
Cons(
Box<OptOuterAttributes>,
crate::data::token::Attribute,
),
}
pub enum Fieldset {
Empty,
Named(
Box<NamedFieldset>,
),
Tuple(
Box<TupleFieldset>,
),
}
pub struct NamedFieldset {
pub fields: Box<NamedFields>,
}
pub enum NamedFields {
One(
Box<NamedField>,
),
Cons(
Box<NamedFields>,
Box<NamedField>,
),
}
pub struct NamedField {
pub name: Box<IdentOrUnderscore>,
pub symbol: Box<IdentOrTerminalIdent>,
}
pub struct TupleFieldset {
pub fields: Box<TupleFields>,
}
pub enum TupleFields {
One(
Box<TupleField>,
),
Cons(
Box<TupleFields>,
Box<TupleField>,
),
}
pub enum TupleField {
Used(
Box<IdentOrTerminalIdent>,
),
Skipped(
Box<IdentOrTerminalIdent>,
),
}
pub enum OptEnumVariants {
Nil,
Cons(
Box<OptEnumVariants>,
Box<EnumVariant>,
),
}
pub struct EnumVariant {
pub name: crate::data::token::Ident,
pub fieldset: Box<Fieldset>,
}
pub enum OptTerminalEnumVariants {
Nil,
Cons(
Box<OptTerminalEnumVariants>,
Box<TerminalEnumVariant>,
),
}
pub struct TerminalEnumVariant {
pub name: crate::data::token::TerminalIdent,
pub type_: Box<Type>,
}
pub enum Type {
Unit,
Path(
Box<Path>,
),
Complex(
Box<ComplexType>,
),
}
pub enum Path {
One(
crate::data::token::Ident,
),
Cons(
Box<Path>,
crate::data::token::Ident,
),
}
pub struct ComplexType {
pub callee: Box<Path>,
pub args: Box<CommaSeparatedTypes>,
}
pub enum CommaSeparatedTypes {
One(
Box<Type>,
),
Cons(
Box<CommaSeparatedTypes>,
Box<Type>,
),
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum IdentOrUnderscore {
Ident(
crate::data::token::Ident,
),
Underscore(
crate::data::ByteIndex,
),
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum IdentOrTerminalIdent {
Ident(
crate::data::token::Ident,
),
Terminal(
crate::data::token::TerminalIdent,
),
}
pub fn parse<S>(src: S) -> Result<File, Option<Token>>
where S: IntoIterator<Item = Token> {
let mut quasiterminals = src.into_iter()
.map(Quasiterminal::Terminal)
.chain(std::iter::once(Quasiterminal::Eof))
.peekable();
let mut states = vec![State::S0];
let mut nodes: Vec<Node> = vec![];
loop {
let top_state = *states.last().unwrap();
let next_quasiterminal_kind = QuasiterminalKind::from_quasiterminal(quasiterminals.peek().unwrap());
match get_action(top_state, next_quasiterminal_kind) {
Action::Shift(new_state) => {
states.push(new_state);
nodes.push(Node::from_terminal(quasiterminals.next().unwrap().try_into_terminal().unwrap()));
}
Action::Reduce(rule_kind) => {
let (new_node, new_node_kind) = pop_and_reduce(&mut states, &mut nodes, rule_kind);
nodes.push(new_node);
let temp_top_state = *states.last().unwrap();
let Some(new_state) = get_goto(temp_top_state, new_node_kind) else {
return Err(quasiterminals.next().unwrap().try_into_terminal().ok());
};
states.push(new_state);
}
Action::Accept => {
return Ok(File::try_from(nodes.pop().unwrap()).ok().unwrap());
}
Action::Err => {
return Err(quasiterminals.next().unwrap().try_into_terminal().ok());
}
}
}
}
enum Quasiterminal {
Terminal(Token),
Eof,
}
#[derive(Clone, Copy, Debug)]
enum QuasiterminalKind {
Underscore = 0,
Ident = 1,
TerminalIdent = 2,
OuterAttribute = 3,
StartKw = 4,
StructKw = 5,
EnumKw = 6,
TerminalKw = 7,
Colon = 8,
DoubleColon = 9,
Comma = 10,
LParen = 11,
RParen = 12,
LCurly = 13,
RCurly = 14,
LAngle = 15,
RAngle = 16,
Eof = 17,
}
#[derive(Clone, Copy, Debug)]
enum NonterminalKind {
File = 0,
OptItems = 1,
FileItem = 2,
Struct = 3,
Enum = 4,
TerminalEnum = 5,
OptOuterAttributes = 6,
Fieldset = 7,
NamedFieldset = 8,
NamedFields = 9,
NamedField = 10,
TupleFieldset = 11,
TupleFields = 12,
TupleField = 13,
OptEnumVariants = 14,
EnumVariant = 15,
OptTerminalEnumVariants = 16,
TerminalEnumVariant = 17,
Type = 18,
Path = 19,
ComplexType = 20,
CommaSeparatedTypes = 21,
IdentOrUnderscore = 22,
IdentOrTerminalIdent = 23,
}
#[derive(Clone, Copy, Debug)]
enum State {
S0 = 0,
S1 = 1,
S2 = 2,
S3 = 3,
S4 = 4,
S5 = 5,
S6 = 6,
S7 = 7,
S8 = 8,
S9 = 9,
S10 = 10,
S11 = 11,
S12 = 12,
S13 = 13,
S14 = 14,
S15 = 15,
S16 = 16,
S17 = 17,
S18 = 18,
S19 = 19,
S20 = 20,
S21 = 21,
S22 = 22,
S23 = 23,
S24 = 24,
S25 = 25,
S26 = 26,
S27 = 27,
S28 = 28,
S29 = 29,
S30 = 30,
S31 = 31,
S32 = 32,
S33 = 33,
S34 = 34,
S35 = 35,
S36 = 36,
S37 = 37,
S38 = 38,
S39 = 39,
S40 = 40,
S41 = 41,
S42 = 42,
S43 = 43,
S44 = 44,
S45 = 45,
S46 = 46,
S47 = 47,
S48 = 48,
S49 = 49,
S50 = 50,
S51 = 51,
S52 = 52,
S53 = 53,
S54 = 54,
S55 = 55,
S56 = 56,
S57 = 57,
S58 = 58,
S59 = 59,
S60 = 60,
S61 = 61,
S62 = 62,
S63 = 63,
S64 = 64,
S65 = 65,
S66 = 66,
}
enum Node {
File(File),
OptItems(OptItems),
FileItem(FileItem),
Struct(Struct),
Enum(Enum),
TerminalEnum(TerminalEnum),
OptOuterAttributes(OptOuterAttributes),
Fieldset(Fieldset),
NamedFieldset(NamedFieldset),
NamedFields(NamedFields),
NamedField(NamedField),
TupleFieldset(TupleFieldset),
TupleFields(TupleFields),
TupleField(TupleField),
OptEnumVariants(OptEnumVariants),
EnumVariant(EnumVariant),
OptTerminalEnumVariants(OptTerminalEnumVariants),
TerminalEnumVariant(TerminalEnumVariant),
Type(Type),
Path(Path),
ComplexType(ComplexType),
CommaSeparatedTypes(CommaSeparatedTypes),
IdentOrUnderscore(IdentOrUnderscore),
IdentOrTerminalIdent(IdentOrTerminalIdent),
Underscore(crate::data::ByteIndex),
Ident(crate::data::token::Ident),
TerminalIdent(crate::data::token::TerminalIdent),
OuterAttribute(crate::data::token::Attribute),
StartKw(crate::data::ByteIndex),
StructKw(crate::data::ByteIndex),
EnumKw(crate::data::ByteIndex),
TerminalKw(crate::data::ByteIndex),
Colon(crate::data::ByteIndex),
DoubleColon(crate::data::ByteIndex),
Comma(crate::data::ByteIndex),
LParen(crate::data::ByteIndex),
RParen(crate::data::ByteIndex),
LCurly(crate::data::ByteIndex),
RCurly(crate::data::ByteIndex),
LAngle(crate::data::ByteIndex),
RAngle(crate::data::ByteIndex),
}
#[derive(Clone, Copy, Debug)]
enum Action {
Shift(State),
Reduce(RuleKind),
Accept,
Err,
}
#[derive(Clone, Copy, Debug)]
enum RuleKind {
R0 = 0,
R1 = 1,
R2 = 2,
R3 = 3,
R4 = 4,
R5 = 5,
R6 = 6,
R7 = 7,
R8 = 8,
R9 = 9,
R10 = 10,
R11 = 11,
R12 = 12,
R13 = 13,
R14 = 14,
R15 = 15,
R16 = 16,
R17 = 17,
R18 = 18,
R19 = 19,
R20 = 20,
R21 = 21,
R22 = 22,
R23 = 23,
R24 = 24,
R25 = 25,
R26 = 26,
R27 = 27,
R28 = 28,
R29 = 29,
R30 = 30,
R31 = 31,
R32 = 32,
R33 = 33,
R34 = 34,
R35 = 35,
R36 = 36,
R37 = 37,
R38 = 38,
R39 = 39,
R40 = 40,
R41 = 41,
}
fn pop_and_reduce(states: &mut Vec<State>, nodes: &mut Vec<Node>, rule_kind: RuleKind) -> (Node, NonterminalKind) {
match rule_kind {
RuleKind::R0 => {
let items_0 = Box::new(OptItems::try_from(nodes.pop().unwrap()).ok().unwrap());
states.truncate(states.len() - 1);
(
Node::File(File {
items: items_0,
}),
NonterminalKind::File,
)
}
RuleKind::R1 => {
(
Node::OptItems(OptItems::Nil),
NonterminalKind::OptItems,
)
}
RuleKind::R2 => {
let t1 = Box::new(FileItem::try_from(nodes.pop().unwrap()).ok().unwrap());
let t0 = Box::new(OptItems::try_from(nodes.pop().unwrap()).ok().unwrap());
states.truncate(states.len() - 2);
(
Node::OptItems(OptItems::Cons(
t0,
t1,
)),
NonterminalKind::OptItems,
)
}
RuleKind::R3 => {
let t1 = nodes.pop().unwrap().try_into_ident_1().ok().unwrap();
nodes.pop().unwrap();
states.truncate(states.len() - 2);
(
Node::FileItem(FileItem::Start(
t1,
)),
NonterminalKind::FileItem,
)
}
RuleKind::R4 => {
let t0 = Box::new(Struct::try_from(nodes.pop().unwrap()).ok().unwrap());
states.truncate(states.len() - 1);
(
Node::FileItem(FileItem::Struct(
t0,
)),
NonterminalKind::FileItem,
)
}
RuleKind::R5 => {
let t0 = Box::new(Enum::try_from(nodes.pop().unwrap()).ok().unwrap());
states.truncate(states.len() - 1);
(
Node::FileItem(FileItem::Enum(
t0,
)),
NonterminalKind::FileItem,
)
}
RuleKind::R6 => {
let t0 = Box::new(TerminalEnum::try_from(nodes.pop().unwrap()).ok().unwrap());
states.truncate(states.len() - 1);
(
Node::FileItem(FileItem::Terminal(
t0,
)),
NonterminalKind::FileItem,
)
}
RuleKind::R7 => {
let fieldset_3 = Box::new(Fieldset::try_from(nodes.pop().unwrap()).ok().unwrap());
let name_2 = nodes.pop().unwrap().try_into_ident_1().ok().unwrap();
nodes.pop().unwrap();
let attributes_0 = Box::new(OptOuterAttributes::try_from(nodes.pop().unwrap()).ok().unwrap());
states.truncate(states.len() - 4);
(
Node::Struct(Struct {
attributes: attributes_0,
name: name_2,
fieldset: fieldset_3,
}),
NonterminalKind::Struct,
)
}
RuleKind::R8 => {
nodes.pop().unwrap();
let variants_4 = Box::new(OptEnumVariants::try_from(nodes.pop().unwrap()).ok().unwrap());
nodes.pop().unwrap();
let name_2 = nodes.pop().unwrap().try_into_ident_1().ok().unwrap();
nodes.pop().unwrap();
let attributes_0 = Box::new(OptOuterAttributes::try_from(nodes.pop().unwrap()).ok().unwrap());
states.truncate(states.len() - 6);
(
Node::Enum(Enum {
attributes: attributes_0,
name: name_2,
variants: variants_4,
}),
NonterminalKind::Enum,
)
}
RuleKind::R9 => {
nodes.pop().unwrap();
let variants_4 = Box::new(OptTerminalEnumVariants::try_from(nodes.pop().unwrap()).ok().unwrap());
nodes.pop().unwrap();
let name_2 = nodes.pop().unwrap().try_into_ident_1().ok().unwrap();
nodes.pop().unwrap();
let attributes_0 = Box::new(OptOuterAttributes::try_from(nodes.pop().unwrap()).ok().unwrap());
states.truncate(states.len() - 6);
(
Node::TerminalEnum(TerminalEnum {
attributes: attributes_0,
name: name_2,
variants: variants_4,
}),
NonterminalKind::TerminalEnum,
)
}
RuleKind::R10 => {
(
Node::OptOuterAttributes(OptOuterAttributes::Nil),
NonterminalKind::OptOuterAttributes,
)
}
RuleKind::R11 => {
let t1 = nodes.pop().unwrap().try_into_outer_attribute_3().ok().unwrap();
let t0 = Box::new(OptOuterAttributes::try_from(nodes.pop().unwrap()).ok().unwrap());
states.truncate(states.len() - 2);
(
Node::OptOuterAttributes(OptOuterAttributes::Cons(
t0,
t1,
)),
NonterminalKind::OptOuterAttributes,
)
}
RuleKind::R12 => {
(
Node::Fieldset(Fieldset::Empty),
NonterminalKind::Fieldset,
)
}
RuleKind::R13 => {
let t0 = Box::new(NamedFieldset::try_from(nodes.pop().unwrap()).ok().unwrap());
states.truncate(states.len() - 1);
(
Node::Fieldset(Fieldset::Named(
t0,
)),
NonterminalKind::Fieldset,
)
}
RuleKind::R14 => {
let t0 = Box::new(TupleFieldset::try_from(nodes.pop().unwrap()).ok().unwrap());
states.truncate(states.len() - 1);
(
Node::Fieldset(Fieldset::Tuple(
t0,
)),
NonterminalKind::Fieldset,
)
}
RuleKind::R15 => {
nodes.pop().unwrap();
let fields_1 = Box::new(NamedFields::try_from(nodes.pop().unwrap()).ok().unwrap());
nodes.pop().unwrap();
states.truncate(states.len() - 3);
(
Node::NamedFieldset(NamedFieldset {
fields: fields_1,
}),
NonterminalKind::NamedFieldset,
)
}
RuleKind::R16 => {
let t0 = Box::new(NamedField::try_from(nodes.pop().unwrap()).ok().unwrap());
states.truncate(states.len() - 1);
(
Node::NamedFields(NamedFields::One(
t0,
)),
NonterminalKind::NamedFields,
)
}
RuleKind::R17 => {
let t1 = Box::new(NamedField::try_from(nodes.pop().unwrap()).ok().unwrap());
let t0 = Box::new(NamedFields::try_from(nodes.pop().unwrap()).ok().unwrap());
states.truncate(states.len() - 2);
(
Node::NamedFields(NamedFields::Cons(
t0,
t1,
)),
NonterminalKind::NamedFields,
)
}
RuleKind::R18 => {
let symbol_2 = Box::new(IdentOrTerminalIdent::try_from(nodes.pop().unwrap()).ok().unwrap());
nodes.pop().unwrap();
let name_0 = Box::new(IdentOrUnderscore::try_from(nodes.pop().unwrap()).ok().unwrap());
states.truncate(states.len() - 3);
(
Node::NamedField(NamedField {
name: name_0,
symbol: symbol_2,
}),
NonterminalKind::NamedField,
)
}
RuleKind::R19 => {
nodes.pop().unwrap();
let fields_1 = Box::new(TupleFields::try_from(nodes.pop().unwrap()).ok().unwrap());
nodes.pop().unwrap();
states.truncate(states.len() - 3);
(
Node::TupleFieldset(TupleFieldset {
fields: fields_1,
}),
NonterminalKind::TupleFieldset,
)
}
RuleKind::R20 => {
let t0 = Box::new(TupleField::try_from(nodes.pop().unwrap()).ok().unwrap());
states.truncate(states.len() - 1);
(
Node::TupleFields(TupleFields::One(
t0,
)),
NonterminalKind::TupleFields,
)
}
RuleKind::R21 => {
let t1 = Box::new(TupleField::try_from(nodes.pop().unwrap()).ok().unwrap());
let t0 = Box::new(TupleFields::try_from(nodes.pop().unwrap()).ok().unwrap());
states.truncate(states.len() - 2);
(
Node::TupleFields(TupleFields::Cons(
t0,
t1,
)),
NonterminalKind::TupleFields,
)
}
RuleKind::R22 => {
let t0 = Box::new(IdentOrTerminalIdent::try_from(nodes.pop().unwrap()).ok().unwrap());
states.truncate(states.len() - 1);
(
Node::TupleField(TupleField::Used(
t0,
)),
NonterminalKind::TupleField,
)
}
RuleKind::R23 => {
let t2 = Box::new(IdentOrTerminalIdent::try_from(nodes.pop().unwrap()).ok().unwrap());
nodes.pop().unwrap();
nodes.pop().unwrap();
states.truncate(states.len() - 3);
(
Node::TupleField(TupleField::Skipped(
t2,
)),
NonterminalKind::TupleField,
)
}
RuleKind::R24 => {
(
Node::OptEnumVariants(OptEnumVariants::Nil),
NonterminalKind::OptEnumVariants,
)
}
RuleKind::R25 => {
let t1 = Box::new(EnumVariant::try_from(nodes.pop().unwrap()).ok().unwrap());
let t0 = Box::new(OptEnumVariants::try_from(nodes.pop().unwrap()).ok().unwrap());
states.truncate(states.len() - 2);
(
Node::OptEnumVariants(OptEnumVariants::Cons(
t0,
t1,
)),
NonterminalKind::OptEnumVariants,
)
}
RuleKind::R26 => {
let fieldset_1 = Box::new(Fieldset::try_from(nodes.pop().unwrap()).ok().unwrap());
let name_0 = nodes.pop().unwrap().try_into_ident_1().ok().unwrap();
states.truncate(states.len() - 2);
(
Node::EnumVariant(EnumVariant {
name: name_0,
fieldset: fieldset_1,
}),
NonterminalKind::EnumVariant,
)
}
RuleKind::R27 => {
(
Node::OptTerminalEnumVariants(OptTerminalEnumVariants::Nil),
NonterminalKind::OptTerminalEnumVariants,
)
}
RuleKind::R28 => {
let t1 = Box::new(TerminalEnumVariant::try_from(nodes.pop().unwrap()).ok().unwrap());
let t0 = Box::new(OptTerminalEnumVariants::try_from(nodes.pop().unwrap()).ok().unwrap());
states.truncate(states.len() - 2);
(
Node::OptTerminalEnumVariants(OptTerminalEnumVariants::Cons(
t0,
t1,
)),
NonterminalKind::OptTerminalEnumVariants,
)
}
RuleKind::R29 => {
let type__2 = Box::new(Type::try_from(nodes.pop().unwrap()).ok().unwrap());
nodes.pop().unwrap();
let name_0 = nodes.pop().unwrap().try_into_terminal_ident_2().ok().unwrap();
states.truncate(states.len() - 3);
(
Node::TerminalEnumVariant(TerminalEnumVariant {
name: name_0,
type_: type__2,
}),
NonterminalKind::TerminalEnumVariant,
)
}
RuleKind::R30 => {
nodes.pop().unwrap();
nodes.pop().unwrap();
states.truncate(states.len() - 2);
(
Node::Type(Type::Unit),
NonterminalKind::Type,
)
}
RuleKind::R31 => {
let t0 = Box::new(Path::try_from(nodes.pop().unwrap()).ok().unwrap());
states.truncate(states.len() - 1);
(
Node::Type(Type::Path(
t0,
)),
NonterminalKind::Type,
)
}
RuleKind::R32 => {
let t0 = Box::new(ComplexType::try_from(nodes.pop().unwrap()).ok().unwrap());
states.truncate(states.len() - 1);
(
Node::Type(Type::Complex(
t0,
)),
NonterminalKind::Type,
)
}
RuleKind::R33 => {
let t0 = nodes.pop().unwrap().try_into_ident_1().ok().unwrap();
states.truncate(states.len() - 1);
(
Node::Path(Path::One(
t0,
)),
NonterminalKind::Path,
)
}
RuleKind::R34 => {
let t2 = nodes.pop().unwrap().try_into_ident_1().ok().unwrap();
nodes.pop().unwrap();
let t0 = Box::new(Path::try_from(nodes.pop().unwrap()).ok().unwrap());
states.truncate(states.len() - 3);
(
Node::Path(Path::Cons(
t0,
t2,
)),
NonterminalKind::Path,
)
}
RuleKind::R35 => {
nodes.pop().unwrap();
let args_2 = Box::new(CommaSeparatedTypes::try_from(nodes.pop().unwrap()).ok().unwrap());
nodes.pop().unwrap();
let callee_0 = Box::new(Path::try_from(nodes.pop().unwrap()).ok().unwrap());
states.truncate(states.len() - 4);
(
Node::ComplexType(ComplexType {
callee: callee_0,
args: args_2,
}),
NonterminalKind::ComplexType,
)
}
RuleKind::R36 => {
let t0 = Box::new(Type::try_from(nodes.pop().unwrap()).ok().unwrap());
states.truncate(states.len() - 1);
(
Node::CommaSeparatedTypes(CommaSeparatedTypes::One(
t0,
)),
NonterminalKind::CommaSeparatedTypes,
)
}
RuleKind::R37 => {
let t2 = Box::new(Type::try_from(nodes.pop().unwrap()).ok().unwrap());
nodes.pop().unwrap();
let t0 = Box::new(CommaSeparatedTypes::try_from(nodes.pop().unwrap()).ok().unwrap());
states.truncate(states.len() - 3);
(
Node::CommaSeparatedTypes(CommaSeparatedTypes::Cons(
t0,
t2,
)),
NonterminalKind::CommaSeparatedTypes,
)
}
RuleKind::R38 => {
let t0 = nodes.pop().unwrap().try_into_ident_1().ok().unwrap();
states.truncate(states.len() - 1);
(
Node::IdentOrUnderscore(IdentOrUnderscore::Ident(
t0,
)),
NonterminalKind::IdentOrUnderscore,
)
}
RuleKind::R39 => {
let t0 = nodes.pop().unwrap().try_into_underscore_0().ok().unwrap();
states.truncate(states.len() - 1);
(
Node::IdentOrUnderscore(IdentOrUnderscore::Underscore(
t0,
)),
NonterminalKind::IdentOrUnderscore,
)
}
RuleKind::R40 => {
let t0 = nodes.pop().unwrap().try_into_ident_1().ok().unwrap();
states.truncate(states.len() - 1);
(
Node::IdentOrTerminalIdent(IdentOrTerminalIdent::Ident(
t0,
)),
NonterminalKind::IdentOrTerminalIdent,
)
}
RuleKind::R41 => {
let t0 = nodes.pop().unwrap().try_into_terminal_ident_2().ok().unwrap();
states.truncate(states.len() - 1);
(
Node::IdentOrTerminalIdent(IdentOrTerminalIdent::Terminal(
t0,
)),
NonterminalKind::IdentOrTerminalIdent,
)
}
}
}
impl QuasiterminalKind {
fn from_quasiterminal(quasiterminal: &Quasiterminal) -> Self {
match quasiterminal {
Quasiterminal::Terminal(terminal) => Self::from_terminal(terminal),
Quasiterminal::Eof => Self::Eof,
}
}
fn from_terminal(terminal: &Token) -> Self {
match terminal {
Token::Underscore(_) => Self::Underscore,
Token::Ident(_) => Self::Ident,
Token::TerminalIdent(_) => Self::TerminalIdent,
Token::OuterAttribute(_) => Self::OuterAttribute,
Token::StartKw(_) => Self::StartKw,
Token::StructKw(_) => Self::StructKw,
Token::EnumKw(_) => Self::EnumKw,
Token::TerminalKw(_) => Self::TerminalKw,
Token::Colon(_) => Self::Colon,
Token::DoubleColon(_) => Self::DoubleColon,
Token::Comma(_) => Self::Comma,
Token::LParen(_) => Self::LParen,
Token::RParen(_) => Self::RParen,
Token::LCurly(_) => Self::LCurly,
Token::RCurly(_) => Self::RCurly,
Token::LAngle(_) => Self::LAngle,
Token::RAngle(_) => Self::RAngle,
}
}
}
impl Node {
fn from_terminal(terminal: Token) -> Self {
match terminal {
Token::Underscore(t) => Self::Underscore(t),
Token::Ident(t) => Self::Ident(t),
Token::TerminalIdent(t) => Self::TerminalIdent(t),
Token::OuterAttribute(t) => Self::OuterAttribute(t),
Token::StartKw(t) => Self::StartKw(t),
Token::StructKw(t) => Self::StructKw(t),
Token::EnumKw(t) => Self::EnumKw(t),
Token::TerminalKw(t) => Self::TerminalKw(t),
Token::Colon(t) => Self::Colon(t),
Token::DoubleColon(t) => Self::DoubleColon(t),
Token::Comma(t) => Self::Comma(t),
Token::LParen(t) => Self::LParen(t),
Token::RParen(t) => Self::RParen(t),
Token::LCurly(t) => Self::LCurly(t),
Token::RCurly(t) => Self::RCurly(t),
Token::LAngle(t) => Self::LAngle(t),
Token::RAngle(t) => Self::RAngle(t),
}
}
}
impl Quasiterminal {
fn try_into_terminal(self) -> Result<Token, ()> {
match self {
Self::Terminal(terminal) => Ok(terminal),
Self::Eof => Err(()),
}
}
}
const ACTION_TABLE: [[Action; 18]; 67] = [
[
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R1),
Action::Reduce(RuleKind::R1),
Action::Reduce(RuleKind::R1),
Action::Reduce(RuleKind::R1),
Action::Reduce(RuleKind::R1),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R1),
],
[
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R10),
Action::Shift(State::S3),
Action::Reduce(RuleKind::R10),
Action::Reduce(RuleKind::R10),
Action::Reduce(RuleKind::R10),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R0),
],
[
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R2),
Action::Reduce(RuleKind::R2),
Action::Reduce(RuleKind::R2),
Action::Reduce(RuleKind::R2),
Action::Reduce(RuleKind::R2),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R2),
],
[
Action::Err,
Action::Shift(State::S4),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R3),
Action::Reduce(RuleKind::R3),
Action::Reduce(RuleKind::R3),
Action::Reduce(RuleKind::R3),
Action::Reduce(RuleKind::R3),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R3),
],
[
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R4),
Action::Reduce(RuleKind::R4),
Action::Reduce(RuleKind::R4),
Action::Reduce(RuleKind::R4),
Action::Reduce(RuleKind::R4),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R4),
],
[
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R5),
Action::Reduce(RuleKind::R5),
Action::Reduce(RuleKind::R5),
Action::Reduce(RuleKind::R5),
Action::Reduce(RuleKind::R5),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R5),
],
[
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R6),
Action::Reduce(RuleKind::R6),
Action::Reduce(RuleKind::R6),
Action::Reduce(RuleKind::R6),
Action::Reduce(RuleKind::R6),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R6),
],
[
Action::Err,
Action::Err,
Action::Err,
Action::Shift(State::S22),
Action::Err,
Action::Shift(State::S9),
Action::Shift(State::S12),
Action::Shift(State::S17),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Err,
Action::Shift(State::S10),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R12),
Action::Reduce(RuleKind::R12),
Action::Reduce(RuleKind::R12),
Action::Reduce(RuleKind::R12),
Action::Reduce(RuleKind::R12),
Action::Err,
Action::Err,
Action::Err,
Action::Shift(State::S34),
Action::Err,
Action::Shift(State::S26),
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R12),
],
[
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R7),
Action::Reduce(RuleKind::R7),
Action::Reduce(RuleKind::R7),
Action::Reduce(RuleKind::R7),
Action::Reduce(RuleKind::R7),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R7),
],
[
Action::Err,
Action::Shift(State::S13),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Shift(State::S14),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Err,
Action::Reduce(RuleKind::R24),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R24),
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Err,
Action::Shift(State::S23),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Shift(State::S16),
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R8),
Action::Reduce(RuleKind::R8),
Action::Reduce(RuleKind::R8),
Action::Reduce(RuleKind::R8),
Action::Reduce(RuleKind::R8),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R8),
],
[
Action::Err,
Action::Shift(State::S18),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Shift(State::S19),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R27),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R27),
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Err,
Action::Err,
Action::Shift(State::S46),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Shift(State::S21),
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R9),
Action::Reduce(RuleKind::R9),
Action::Reduce(RuleKind::R9),
Action::Reduce(RuleKind::R9),
Action::Reduce(RuleKind::R9),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R9),
],
[
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R11),
Action::Err,
Action::Reduce(RuleKind::R11),
Action::Reduce(RuleKind::R11),
Action::Reduce(RuleKind::R11),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Err,
Action::Reduce(RuleKind::R12),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Shift(State::S34),
Action::Err,
Action::Shift(State::S26),
Action::Reduce(RuleKind::R12),
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Err,
Action::Reduce(RuleKind::R13),
Action::Err,
Action::Reduce(RuleKind::R13),
Action::Reduce(RuleKind::R13),
Action::Reduce(RuleKind::R13),
Action::Reduce(RuleKind::R13),
Action::Reduce(RuleKind::R13),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R13),
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R13),
],
[
Action::Err,
Action::Reduce(RuleKind::R14),
Action::Err,
Action::Reduce(RuleKind::R14),
Action::Reduce(RuleKind::R14),
Action::Reduce(RuleKind::R14),
Action::Reduce(RuleKind::R14),
Action::Reduce(RuleKind::R14),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R14),
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R14),
],
[
Action::Shift(State::S63),
Action::Shift(State::S62),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Shift(State::S63),
Action::Shift(State::S62),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Shift(State::S28),
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Err,
Action::Reduce(RuleKind::R15),
Action::Err,
Action::Reduce(RuleKind::R15),
Action::Reduce(RuleKind::R15),
Action::Reduce(RuleKind::R15),
Action::Reduce(RuleKind::R15),
Action::Reduce(RuleKind::R15),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R15),
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R15),
],
[
Action::Reduce(RuleKind::R16),
Action::Reduce(RuleKind::R16),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R16),
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Reduce(RuleKind::R17),
Action::Reduce(RuleKind::R17),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R17),
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Shift(State::S32),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Err,
Action::Shift(State::S64),
Action::Shift(State::S65),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Reduce(RuleKind::R18),
Action::Reduce(RuleKind::R18),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R18),
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Shift(State::S40),
Action::Shift(State::S64),
Action::Shift(State::S65),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Shift(State::S40),
Action::Shift(State::S64),
Action::Shift(State::S65),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Shift(State::S36),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Err,
Action::Reduce(RuleKind::R19),
Action::Err,
Action::Reduce(RuleKind::R19),
Action::Reduce(RuleKind::R19),
Action::Reduce(RuleKind::R19),
Action::Reduce(RuleKind::R19),
Action::Reduce(RuleKind::R19),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R19),
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R19),
],
[
Action::Reduce(RuleKind::R20),
Action::Reduce(RuleKind::R20),
Action::Reduce(RuleKind::R20),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R20),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Reduce(RuleKind::R21),
Action::Reduce(RuleKind::R21),
Action::Reduce(RuleKind::R21),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R21),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Reduce(RuleKind::R22),
Action::Reduce(RuleKind::R22),
Action::Reduce(RuleKind::R22),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R22),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Shift(State::S41),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Err,
Action::Shift(State::S64),
Action::Shift(State::S65),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Reduce(RuleKind::R23),
Action::Reduce(RuleKind::R23),
Action::Reduce(RuleKind::R23),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R23),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Err,
Action::Reduce(RuleKind::R25),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R25),
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Err,
Action::Reduce(RuleKind::R26),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R26),
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R28),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R28),
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Shift(State::S47),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Err,
Action::Shift(State::S55),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Shift(State::S51),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R29),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R29),
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Err,
Action::Shift(State::S55),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Shift(State::S51),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Err,
Action::Shift(State::S55),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Shift(State::S51),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Shift(State::S52),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R30),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R30),
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R30),
Action::Err,
Action::Reduce(RuleKind::R30),
Action::Err,
],
[
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R31),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Shift(State::S56),
Action::Reduce(RuleKind::R31),
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R31),
Action::Shift(State::S49),
Action::Reduce(RuleKind::R31),
Action::Err,
],
[
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R32),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R32),
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R32),
Action::Err,
Action::Reduce(RuleKind::R32),
Action::Err,
],
[
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R33),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R33),
Action::Reduce(RuleKind::R33),
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R33),
Action::Reduce(RuleKind::R33),
Action::Reduce(RuleKind::R33),
Action::Err,
],
[
Action::Err,
Action::Shift(State::S57),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R34),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R34),
Action::Reduce(RuleKind::R34),
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R34),
Action::Reduce(RuleKind::R34),
Action::Reduce(RuleKind::R34),
Action::Err,
],
[
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Shift(State::S50),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Shift(State::S59),
Action::Err,
],
[
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R35),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R35),
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R35),
Action::Err,
Action::Reduce(RuleKind::R35),
Action::Err,
],
[
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R36),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R36),
Action::Err,
],
[
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R37),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R37),
Action::Err,
],
[
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R38),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R39),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Reduce(RuleKind::R40),
Action::Reduce(RuleKind::R40),
Action::Reduce(RuleKind::R40),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R40),
Action::Err,
Action::Reduce(RuleKind::R40),
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Reduce(RuleKind::R41),
Action::Reduce(RuleKind::R41),
Action::Reduce(RuleKind::R41),
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Reduce(RuleKind::R41),
Action::Err,
Action::Reduce(RuleKind::R41),
Action::Err,
Action::Err,
Action::Err,
],
[
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Err,
Action::Accept,
],
];
fn get_action(top_state: State, next_quasiterminal_kind: QuasiterminalKind) -> Action {
ACTION_TABLE[top_state as usize][next_quasiterminal_kind as usize]
}
const GOTO_TABLE: [[Option<State>; 24]; 67] = [
[
Some(State::S66),
Some(State::S1),
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
Some(State::S2),
Some(State::S5),
Some(State::S6),
Some(State::S7),
Some(State::S8),
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
Some(State::S11),
Some(State::S24),
None,
None,
Some(State::S25),
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
Some(State::S15),
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
Some(State::S43),
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
Some(State::S20),
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
Some(State::S45),
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
Some(State::S44),
Some(State::S24),
None,
None,
Some(State::S25),
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
Some(State::S27),
Some(State::S29),
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
Some(State::S31),
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
Some(State::S30),
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
Some(State::S31),
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
Some(State::S33),
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
Some(State::S35),
Some(State::S37),
None,
None,
None,
None,
None,
None,
None,
None,
None,
Some(State::S39),
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
Some(State::S38),
None,
None,
None,
None,
None,
None,
None,
None,
None,
Some(State::S39),
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
Some(State::S42),
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
Some(State::S48),
Some(State::S53),
Some(State::S54),
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
Some(State::S60),
Some(State::S53),
Some(State::S54),
Some(State::S58),
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
Some(State::S61),
Some(State::S53),
Some(State::S54),
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
[
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
],
];
fn get_goto(top_state: State, new_node_kind: NonterminalKind) -> Option<State> {
GOTO_TABLE[top_state as usize][new_node_kind as usize]
}
impl TryFrom<Node> for File {
type Error = Node;
fn try_from(node: Node) -> Result<Self, Self::Error> {
match node {
Node::File(n) => Ok(n),
_ => Err(node),
}
}
}
impl TryFrom<Node> for OptItems {
type Error = Node;
fn try_from(node: Node) -> Result<Self, Self::Error> {
match node {
Node::OptItems(n) => Ok(n),
_ => Err(node),
}
}
}
impl TryFrom<Node> for FileItem {
type Error = Node;
fn try_from(node: Node) -> Result<Self, Self::Error> {
match node {
Node::FileItem(n) => Ok(n),
_ => Err(node),
}
}
}
impl TryFrom<Node> for Struct {
type Error = Node;
fn try_from(node: Node) -> Result<Self, Self::Error> {
match node {
Node::Struct(n) => Ok(n),
_ => Err(node),
}
}
}
impl TryFrom<Node> for Enum {
type Error = Node;
fn try_from(node: Node) -> Result<Self, Self::Error> {
match node {
Node::Enum(n) => Ok(n),
_ => Err(node),
}
}
}
impl TryFrom<Node> for TerminalEnum {
type Error = Node;
fn try_from(node: Node) -> Result<Self, Self::Error> {
match node {
Node::TerminalEnum(n) => Ok(n),
_ => Err(node),
}
}
}
impl TryFrom<Node> for OptOuterAttributes {
type Error = Node;
fn try_from(node: Node) -> Result<Self, Self::Error> {
match node {
Node::OptOuterAttributes(n) => Ok(n),
_ => Err(node),
}
}
}
impl TryFrom<Node> for Fieldset {
type Error = Node;
fn try_from(node: Node) -> Result<Self, Self::Error> {
match node {
Node::Fieldset(n) => Ok(n),
_ => Err(node),
}
}
}
impl TryFrom<Node> for NamedFieldset {
type Error = Node;
fn try_from(node: Node) -> Result<Self, Self::Error> {
match node {
Node::NamedFieldset(n) => Ok(n),
_ => Err(node),
}
}
}
impl TryFrom<Node> for NamedFields {
type Error = Node;
fn try_from(node: Node) -> Result<Self, Self::Error> {
match node {
Node::NamedFields(n) => Ok(n),
_ => Err(node),
}
}
}
impl TryFrom<Node> for NamedField {
type Error = Node;
fn try_from(node: Node) -> Result<Self, Self::Error> {
match node {
Node::NamedField(n) => Ok(n),
_ => Err(node),
}
}
}
impl TryFrom<Node> for TupleFieldset {
type Error = Node;
fn try_from(node: Node) -> Result<Self, Self::Error> {
match node {
Node::TupleFieldset(n) => Ok(n),
_ => Err(node),
}
}
}
impl TryFrom<Node> for TupleFields {
type Error = Node;
fn try_from(node: Node) -> Result<Self, Self::Error> {
match node {
Node::TupleFields(n) => Ok(n),
_ => Err(node),
}
}
}
impl TryFrom<Node> for TupleField {
type Error = Node;
fn try_from(node: Node) -> Result<Self, Self::Error> {
match node {
Node::TupleField(n) => Ok(n),
_ => Err(node),
}
}
}
impl TryFrom<Node> for OptEnumVariants {
type Error = Node;
fn try_from(node: Node) -> Result<Self, Self::Error> {
match node {
Node::OptEnumVariants(n) => Ok(n),
_ => Err(node),
}
}
}
impl TryFrom<Node> for EnumVariant {
type Error = Node;
fn try_from(node: Node) -> Result<Self, Self::Error> {
match node {
Node::EnumVariant(n) => Ok(n),
_ => Err(node),
}
}
}
impl TryFrom<Node> for OptTerminalEnumVariants {
type Error = Node;
fn try_from(node: Node) -> Result<Self, Self::Error> {
match node {
Node::OptTerminalEnumVariants(n) => Ok(n),
_ => Err(node),
}
}
}
impl TryFrom<Node> for TerminalEnumVariant {
type Error = Node;
fn try_from(node: Node) -> Result<Self, Self::Error> {
match node {
Node::TerminalEnumVariant(n) => Ok(n),
_ => Err(node),
}
}
}
impl TryFrom<Node> for Type {
type Error = Node;
fn try_from(node: Node) -> Result<Self, Self::Error> {
match node {
Node::Type(n) => Ok(n),
_ => Err(node),
}
}
}
impl TryFrom<Node> for Path {
type Error = Node;
fn try_from(node: Node) -> Result<Self, Self::Error> {
match node {
Node::Path(n) => Ok(n),
_ => Err(node),
}
}
}
impl TryFrom<Node> for ComplexType {
type Error = Node;
fn try_from(node: Node) -> Result<Self, Self::Error> {
match node {
Node::ComplexType(n) => Ok(n),
_ => Err(node),
}
}
}
impl TryFrom<Node> for CommaSeparatedTypes {
type Error = Node;
fn try_from(node: Node) -> Result<Self, Self::Error> {
match node {
Node::CommaSeparatedTypes(n) => Ok(n),
_ => Err(node),
}
}
}
impl TryFrom<Node> for IdentOrUnderscore {
type Error = Node;
fn try_from(node: Node) -> Result<Self, Self::Error> {
match node {
Node::IdentOrUnderscore(n) => Ok(n),
_ => Err(node),
}
}
}
impl TryFrom<Node> for IdentOrTerminalIdent {
type Error = Node;
fn try_from(node: Node) -> Result<Self, Self::Error> {
match node {
Node::IdentOrTerminalIdent(n) => Ok(n),
_ => Err(node),
}
}
}
impl Node {
fn try_into_underscore_0(self) -> Result<crate::data::ByteIndex, Self> {
match self {
Self::Underscore(t) => Ok(t),
_ => Err(self),
}
}
fn try_into_ident_1(self) -> Result<crate::data::token::Ident, Self> {
match self {
Self::Ident(t) => Ok(t),
_ => Err(self),
}
}
fn try_into_terminal_ident_2(self) -> Result<crate::data::token::TerminalIdent, Self> {
match self {
Self::TerminalIdent(t) => Ok(t),
_ => Err(self),
}
}
fn try_into_outer_attribute_3(self) -> Result<crate::data::token::Attribute, Self> {
match self {
Self::OuterAttribute(t) => Ok(t),
_ => Err(self),
}
}
fn try_into_start_kw_4(self) -> Result<crate::data::ByteIndex, Self> {
match self {
Self::StartKw(t) => Ok(t),
_ => Err(self),
}
}
fn try_into_struct_kw_5(self) -> Result<crate::data::ByteIndex, Self> {
match self {
Self::StructKw(t) => Ok(t),
_ => Err(self),
}
}
fn try_into_enum_kw_6(self) -> Result<crate::data::ByteIndex, Self> {
match self {
Self::EnumKw(t) => Ok(t),
_ => Err(self),
}
}
fn try_into_terminal_kw_7(self) -> Result<crate::data::ByteIndex, Self> {
match self {
Self::TerminalKw(t) => Ok(t),
_ => Err(self),
}
}
fn try_into_colon_8(self) -> Result<crate::data::ByteIndex, Self> {
match self {
Self::Colon(t) => Ok(t),
_ => Err(self),
}
}
fn try_into_double_colon_9(self) -> Result<crate::data::ByteIndex, Self> {
match self {
Self::DoubleColon(t) => Ok(t),
_ => Err(self),
}
}
fn try_into_comma_10(self) -> Result<crate::data::ByteIndex, Self> {
match self {
Self::Comma(t) => Ok(t),
_ => Err(self),
}
}
fn try_into_l_paren_11(self) -> Result<crate::data::ByteIndex, Self> {
match self {
Self::LParen(t) => Ok(t),
_ => Err(self),
}
}
fn try_into_r_paren_12(self) -> Result<crate::data::ByteIndex, Self> {
match self {
Self::RParen(t) => Ok(t),
_ => Err(self),
}
}
fn try_into_l_curly_13(self) -> Result<crate::data::ByteIndex, Self> {
match self {
Self::LCurly(t) => Ok(t),
_ => Err(self),
}
}
fn try_into_r_curly_14(self) -> Result<crate::data::ByteIndex, Self> {
match self {
Self::RCurly(t) => Ok(t),
_ => Err(self),
}
}
fn try_into_l_angle_15(self) -> Result<crate::data::ByteIndex, Self> {
match self {
Self::LAngle(t) => Ok(t),
_ => Err(self),
}
}
fn try_into_r_angle_16(self) -> Result<crate::data::ByteIndex, Self> {
match self {
Self::RAngle(t) => Ok(t),
_ => Err(self),
}
}
}