From 6269711c83839f70fba44f9af87d0070ec8c23a3 Mon Sep 17 00:00:00 2001 From: fwilliams42 Date: Tue, 2 Jun 2026 13:33:06 +1000 Subject: [PATCH 01/15] normalise the line endings in generated and test files --- .gitattributes | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitattributes b/.gitattributes index cf1d2fb8d..998014357 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5,3 +5,9 @@ /crates/runtime/src/pluralization/icu/**/* linguist-generated=true .idea/**/* linguist-generated=true Cargo.lock linguist-generated=true +/crates/compiler/src/parser/generated/*.rs linguist-generated=true text eol=lf +/crates/compiler/src/parser/generated/*.interp linguist-generated=true text eol=lf +/crates/compiler/src/parser/generated/*.tokens linguist-generated=true text eol=lf +/crates/core/src/generated/yarn.rs linguist-generated=true text eol=lf +crates/**/*.yarn text eol=lf +crates/**/*.testplan text eol=lf From 31c60e511608adf179ed769b5a50867b8d08eed9 Mon Sep 17 00:00:00 2001 From: fwilliams42 Date: Tue, 2 Jun 2026 14:16:00 +1000 Subject: [PATCH 02/15] regenerate with antlr4rust 0.5.2, rename crate imports, token consts are now in the generated lexer, and fix the one regression found from the new dep compared to previous in get_hashable_interval. --- Cargo.lock | 82 +- crates/compiler/Cargo.toml | 2 +- .../add_error_for_empty_nodes.rs | 2 +- .../src/compilation_steps/check_types.rs | 2 +- .../compilation_steps/find_tracking_nodes.rs | 2 +- .../src/compilation_steps/generate_code.rs | 3 +- .../src/compilation_steps/get_declarations.rs | 2 +- .../src/compilation_steps/register_strings.rs | 2 +- .../validate_unique_node_names.rs | 2 +- .../src/compiler/add_tags_to_lines.rs | 14 +- .../compiler/src/compiler/antlr_rust_ext.rs | 44 +- crates/compiler/src/compiler/utils.rs | 33 +- crates/compiler/src/error_strategy.rs | 33 +- .../src/listeners/compiler_listener.rs | 6 +- .../src/listeners/compiler_listener/emit.rs | 2 +- .../compiler/src/listeners/error_listener.rs | 14 +- .../listeners/error_listener/diagnostic.rs | 6 +- .../src/listeners/untagged_line_listener.rs | 10 +- crates/compiler/src/output/declaration.rs | 6 +- crates/compiler/src/parser/actual_types.rs | 8 +- crates/compiler/src/parser/generated.rs | 4 +- .../parser/generated/YarnSpinnerLexer.interp | 2 +- .../parser/generated/YarnSpinnerParser.interp | 2 +- .../src/parser/generated/yarnspinnerlexer.rs | 1124 +- .../src/parser/generated/yarnspinnerparser.rs | 11647 +++++++--------- .../generated/yarnspinnerparserlistener.rs | 6 +- .../generated/yarnspinnerparservisitor.rs | 4 +- .../compiler/src/parser/indent_aware_lexer.rs | 26 +- .../compiler/src/parser_rule_context_ext.rs | 6 +- crates/compiler/src/token_ext.rs | 2 +- .../src/visitors/code_generation_visitor.rs | 8 +- .../src/visitors/constant_value_visitor.rs | 4 +- .../src/visitors/declaration_visitor.rs | 6 +- .../src/visitors/hashable_interval.rs | 10 +- .../last_line_before_options_visitor.rs | 2 +- .../src/visitors/node_tracking_visitor.rs | 17 +- .../string_table_generator_visitor.rs | 10 +- .../src/visitors/type_check_visitor.rs | 6 +- .../type_check_visitor/check_operation.rs | 8 +- 39 files changed, 5836 insertions(+), 7333 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d6338bc96..112a5dd9b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -195,20 +195,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" [[package]] -name = "antlr-rust" -version = "0.3.0-beta" +name = "antlr4rust" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfc6ab5594c6b2b7aa8719f4ecb785a268b2e0c2529042046035d5cebe9fa7d7" +checksum = "093d520274bfff7278d776f7ea12981a0a0a6f96db90964658e0f38fc6e9a6a6" dependencies = [ "better_any", - "bit-set 0.5.3", + "bit-set 0.8.0", "byteorder", "lazy_static", "murmur3", "once_cell", - "parking_lot 0.11.2", + "parking_lot", "typed-arena", - "uuid 0.8.2", + "uuid", ] [[package]] @@ -441,7 +441,7 @@ dependencies = [ "thiserror 2.0.18", "thread_local", "tracing", - "uuid 1.21.0", + "uuid", ] [[package]] @@ -537,7 +537,7 @@ dependencies = [ "stackfuture", "thiserror 2.0.18", "tracing", - "uuid 1.21.0", + "uuid", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -1140,7 +1140,7 @@ dependencies = [ "bevy_window", "crossbeam-channel", "tracing", - "uuid 1.21.0", + "uuid", ] [[package]] @@ -1223,7 +1223,7 @@ dependencies = [ "smallvec", "smol_str", "thiserror 2.0.18", - "uuid 1.21.0", + "uuid", "variadics_please", "wgpu-types", ] @@ -1239,7 +1239,7 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.117", - "uuid 1.21.0", + "uuid", ] [[package]] @@ -1323,7 +1323,7 @@ dependencies = [ "ron", "serde", "thiserror 2.0.18", - "uuid 1.21.0", + "uuid", ] [[package]] @@ -1546,7 +1546,7 @@ dependencies = [ "taffy", "thiserror 2.0.18", "tracing", - "uuid 1.21.0", + "uuid", ] [[package]] @@ -2240,7 +2240,7 @@ dependencies = [ "derive_more", "document-features", "mio", - "parking_lot 0.12.5", + "parking_lot", "rustix 1.1.4", "signal-hook", "signal-hook-mio", @@ -2888,7 +2888,7 @@ dependencies = [ "fnv", "gilrs-core", "log", - "uuid 1.21.0", + "uuid", "vec_map", ] @@ -2906,7 +2906,7 @@ dependencies = [ "nix 0.30.1", "objc2-core-foundation", "objc2-io-kit", - "uuid 1.21.0", + "uuid", "vec_map", "wasm-bindgen", "web-sys", @@ -4364,17 +4364,6 @@ version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" -[[package]] -name = "parking_lot" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core 0.8.6", -] - [[package]] name = "parking_lot" version = "0.12.5" @@ -4382,21 +4371,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" dependencies = [ "lock_api", - "parking_lot_core 0.9.12", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" -dependencies = [ - "cfg-if", - "instant", - "libc", - "redox_syscall 0.2.16", - "smallvec", - "winapi", + "parking_lot_core", ] [[package]] @@ -4985,15 +4960,6 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0d463f2884048e7153449a55166f91028d5b0ea53c79377099ce4e8cf0cf9bb" -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_syscall" version = "0.4.1" @@ -5986,12 +5952,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" -[[package]] -name = "uuid" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" - [[package]] name = "uuid" version = "1.21.0" @@ -6318,7 +6278,7 @@ dependencies = [ "mac_address", "sha2", "thiserror 1.0.69", - "uuid 1.21.0", + "uuid", ] [[package]] @@ -6415,7 +6375,7 @@ dependencies = [ "log", "naga", "once_cell", - "parking_lot 0.12.5", + "parking_lot", "portable-atomic", "profiling", "raw-window-handle", @@ -6489,7 +6449,7 @@ dependencies = [ "objc", "once_cell", "ordered-float 5.1.0", - "parking_lot 0.12.5", + "parking_lot", "portable-atomic", "portable-atomic-util", "profiling", @@ -7319,7 +7279,7 @@ name = "yarnspinner_compiler" version = "0.8.0" dependencies = [ "annotate-snippets", - "antlr-rust", + "antlr4rust", "better_any", "bevy", "crc32fast", diff --git a/crates/compiler/Cargo.toml b/crates/compiler/Cargo.toml index 5136d1bb4..5736e2c53 100644 --- a/crates/compiler/Cargo.toml +++ b/crates/compiler/Cargo.toml @@ -15,7 +15,7 @@ serde = [ "dep:serde", "dep:serde_json", "bevy?/serialize", "yarnspinner_core/se bevy = [ "dep:bevy", "yarnspinner_core/bevy" ] [dependencies] -antlr-rust = "=0.3.0-beta" +antlr4rust = "=0.5.2" better_any = "=0.2.0" regex = "1" yarnspinner_internal_shared = { path = "../internal_shared", version = "0.1.0" } diff --git a/crates/compiler/src/compilation_steps/add_error_for_empty_nodes.rs b/crates/compiler/src/compilation_steps/add_error_for_empty_nodes.rs index dd14d9caa..d8b388996 100644 --- a/crates/compiler/src/compilation_steps/add_error_for_empty_nodes.rs +++ b/crates/compiler/src/compilation_steps/add_error_for_empty_nodes.rs @@ -2,7 +2,7 @@ use std::collections::HashSet; -use antlr_rust::token::Token; +use antlr4rust::token::Token; use crate::parser::generated::yarnspinnerparser::{ BodyContextAttrs, DialogueContextAttrs, NodeContextAttrs, diff --git a/crates/compiler/src/compilation_steps/check_types.rs b/crates/compiler/src/compilation_steps/check_types.rs index 4dc8165d2..482bc4596 100644 --- a/crates/compiler/src/compilation_steps/check_types.rs +++ b/crates/compiler/src/compilation_steps/check_types.rs @@ -1,6 +1,6 @@ use crate::prelude::*; use crate::visitors::TypeCheckVisitor; -use antlr_rust::tree::ParseTreeVisitorCompat; +use antlr4rust::tree::ParseTreeVisitorCompat; pub(crate) fn check_types(mut state: CompilationIntermediate) -> CompilationIntermediate { for (file, known_types) in &mut state.parsed_files { diff --git a/crates/compiler/src/compilation_steps/find_tracking_nodes.rs b/crates/compiler/src/compilation_steps/find_tracking_nodes.rs index ac6992f68..313d5df55 100644 --- a/crates/compiler/src/compilation_steps/find_tracking_nodes.rs +++ b/crates/compiler/src/compilation_steps/find_tracking_nodes.rs @@ -1,6 +1,6 @@ use crate::prelude::*; use crate::visitors::NodeTrackingVisitor; -use antlr_rust::tree::ParseTreeVisitorCompat; +use antlr4rust::tree::ParseTreeVisitorCompat; use std::collections::HashSet; pub(crate) fn find_tracking_nodes(mut state: CompilationIntermediate) -> CompilationIntermediate { diff --git a/crates/compiler/src/compilation_steps/generate_code.rs b/crates/compiler/src/compilation_steps/generate_code.rs index 04b688937..d5757eae9 100644 --- a/crates/compiler/src/compilation_steps/generate_code.rs +++ b/crates/compiler/src/compilation_steps/generate_code.rs @@ -74,7 +74,8 @@ fn generate_code_for_file<'a, 'b: 'a, 'input: 'a + 'b>( let compiler_program = compiler_listener.program.clone(); let compiler_debug_infos = compiler_listener.debug_infos.clone(); - YarnSpinnerParserTreeWalker::walk(compiler_listener, file.tree.as_ref()); + YarnSpinnerParserTreeWalker::walk(compiler_listener, file.tree.as_ref()) + .expect("internal error: tree walk failed"); tracking_nodes.extend(compiler_tracking_nodes.borrow().iter().cloned()); diff --git a/crates/compiler/src/compilation_steps/get_declarations.rs b/crates/compiler/src/compilation_steps/get_declarations.rs index c6ffd2b92..c7fd86030 100644 --- a/crates/compiler/src/compilation_steps/get_declarations.rs +++ b/crates/compiler/src/compilation_steps/get_declarations.rs @@ -1,6 +1,6 @@ use crate::prelude::*; use crate::visitors::DeclarationVisitor; -use antlr_rust::tree::ParseTreeVisitorCompat; +use antlr4rust::tree::ParseTreeVisitorCompat; pub(crate) fn get_declarations(mut state: CompilationIntermediate) -> CompilationIntermediate { // Find the variable declarations in these files. diff --git a/crates/compiler/src/compilation_steps/register_strings.rs b/crates/compiler/src/compilation_steps/register_strings.rs index 201809243..fd087769d 100644 --- a/crates/compiler/src/compilation_steps/register_strings.rs +++ b/crates/compiler/src/compilation_steps/register_strings.rs @@ -1,6 +1,6 @@ use crate::prelude::*; use crate::visitors::{LastLineBeforeOptionsVisitor, StringTableGeneratorVisitor}; -use antlr_rust::tree::ParseTreeVisitorCompat; +use antlr4rust::tree::ParseTreeVisitorCompat; pub(crate) fn register_strings(mut state: CompilationIntermediate) -> CompilationIntermediate { // First pass: parse all files, generate their syntax trees, diff --git a/crates/compiler/src/compilation_steps/validate_unique_node_names.rs b/crates/compiler/src/compilation_steps/validate_unique_node_names.rs index a3466885f..2f614b7a6 100644 --- a/crates/compiler/src/compilation_steps/validate_unique_node_names.rs +++ b/crates/compiler/src/compilation_steps/validate_unique_node_names.rs @@ -1,6 +1,6 @@ use crate::prelude::generated::yarnspinnerparser::{DialogueContextAttrs, NodeContextAttrs}; use crate::prelude::*; -use antlr_rust::token::Token; +use antlr4rust::token::Token; use std::collections::HashMap; pub(crate) fn validate_unique_node_names( diff --git a/crates/compiler/src/compiler/add_tags_to_lines.rs b/crates/compiler/src/compiler/add_tags_to_lines.rs index dee692c25..2232d1e10 100644 --- a/crates/compiler/src/compiler/add_tags_to_lines.rs +++ b/crates/compiler/src/compiler/add_tags_to_lines.rs @@ -34,7 +34,7 @@ impl Compiler { pub fn add_tags_to_lines( contents: impl Into, existing_line_tags: Vec, - ) -> crate::Result> { + ) -> crate::Result)>> { let contents = contents.into(); let chars: Vec<_> = contents.chars().map(|c| c as u32).collect(); // First, get the parse tree for this source code. @@ -57,14 +57,19 @@ impl Compiler { let rewrote_anything = untagged_line_listener.rewrote_anything.clone(); // Walk the tree with this listener, and generate text replacements containing line tags. - YarnSpinnerParserTreeWalker::walk(untagged_line_listener, tree.as_ref()); + let untagged_line_listener = + YarnSpinnerParserTreeWalker::walk(untagged_line_listener, tree.as_ref()) + .expect("internal error: tree walk failed"); // Apply these text replacements to the original source and return it. if rewrote_anything.load(Ordering::Relaxed) { let result = rewritten_nodes.take(); let mut string = result.join("\n"); string.push('\n'); - Ok(Some(string)) + Ok(Some(( + string, + untagged_line_listener.existing_line_tags.clone(), + ))) } else { Ok(None) } @@ -119,7 +124,8 @@ impl Compiler { // Walk the tree with this listener, and generate text replacements containing line tags. let untagged_line_listener = - YarnSpinnerParserTreeWalker::walk(untagged_line_listener, tree.as_ref()); + YarnSpinnerParserTreeWalker::walk(untagged_line_listener, tree.as_ref()) + .expect("interal error: tree walk failed"); // Apply these text replacements to the original source and return it. if rewrote_anything.load(Ordering::Relaxed) { diff --git a/crates/compiler/src/compiler/antlr_rust_ext.rs b/crates/compiler/src/compiler/antlr_rust_ext.rs index 12248501b..30b2599b4 100644 --- a/crates/compiler/src/compiler/antlr_rust_ext.rs +++ b/crates/compiler/src/compiler/antlr_rust_ext.rs @@ -2,11 +2,11 @@ use crate::parser::ActualTokenStream; use crate::prelude::generated::yarnspinnerparser::YarnSpinnerParserContext; -use antlr_rust::InputStream; -use antlr_rust::int_stream::IntStream; -use antlr_rust::token::{CommonToken, TOKEN_DEFAULT_CHANNEL, Token}; -use antlr_rust::token_factory::{CommonTokenFactory, TokenFactory}; -use antlr_rust::token_stream::TokenStream; +use antlr4rust::InputStream; +use antlr4rust::int_stream::IntStream; +use antlr4rust::token::{CommonToken, TOKEN_DEFAULT_CHANNEL, Token}; +use antlr4rust::token_factory::{CommonTokenFactory, TokenFactory}; +use antlr4rust::token_stream::TokenStream; use better_any::TidExt; use std::rc::Rc; @@ -18,7 +18,7 @@ pub(crate) trait CommonTokenStreamExt<'input> { fn get_hidden_tokens_to_left( &self, token_index: isize, - channel: isize, + channel: i32, ) -> Vec>; /// Collect all tokens on specified channel to the right of @@ -28,7 +28,7 @@ pub(crate) trait CommonTokenStreamExt<'input> { fn get_hidden_tokens_to_right( &self, token_index: isize, - channel: isize, + channel: i32, ) -> Vec>; /// A collection of all tokens fetched from the token source. @@ -49,7 +49,7 @@ trait PrivateCommonTokenStreamExt<'input> { /// If `token_index` specifies an index at or after the EOF token, the EOF token /// index is returned. This is due to the fact that the EOF token is treated /// as though it were on every channel. - fn previous_token_on_channel(&self, token_index: isize, channel: isize) -> isize; + fn previous_token_on_channel(&self, token_index: isize, channel: i32) -> isize; /// Given a starting index, return the index of the next token on channel. /// @@ -58,21 +58,16 @@ trait PrivateCommonTokenStreamExt<'input> { /// /// Return the index of /// the EOF token if there are no tokens on channel between `token_index` and EOF - fn next_token_on_channel(&self, token_index: isize, channel: isize) -> isize; + fn next_token_on_channel(&self, token_index: isize, channel: i32) -> isize; - fn filter_for_channel( - &self, - from: isize, - to: isize, - channel: isize, - ) -> Vec>; + fn filter_for_channel(&self, from: isize, to: isize, channel: i32) -> Vec>; } impl<'input> CommonTokenStreamExt<'input> for ActualTokenStream<'input> { fn get_hidden_tokens_to_left( &self, token_index: isize, - channel: isize, + channel: i32, ) -> Vec> { // Adapted from @@ -96,7 +91,7 @@ impl<'input> CommonTokenStreamExt<'input> for ActualTokenStream<'input> { fn get_hidden_tokens_to_right( &self, token_index: isize, - channel: isize, + channel: i32, ) -> Vec> { // Adapted from @@ -127,7 +122,7 @@ impl<'input> CommonTokenStreamExt<'input> for ActualTokenStream<'input> { } impl<'input> PrivateCommonTokenStreamExt<'input> for ActualTokenStream<'input> { - fn previous_token_on_channel(&self, mut token_index: isize, channel: isize) -> isize { + fn previous_token_on_channel(&self, mut token_index: isize, channel: i32) -> isize { // Adapted from // This method is private, but it should be alright to leave it out. @@ -146,7 +141,7 @@ impl<'input> PrivateCommonTokenStreamExt<'input> for ActualTokenStream<'input> { token_index } - fn next_token_on_channel(&self, mut token_index: isize, channel: isize) -> isize { + fn next_token_on_channel(&self, mut token_index: isize, channel: i32) -> isize { // Already in antlr4rust, but private // This method is private, but it should be alright to leave it out. // this.sync(token_index); @@ -158,7 +153,7 @@ impl<'input> PrivateCommonTokenStreamExt<'input> for ActualTokenStream<'input> { let tokens = self.get_tokens(); let mut token = &tokens[token_index as usize]; while token.get_channel() != channel { - if token.get_token_type() == antlr_rust::int_stream::EOF || token_index < 0 { + if token.get_token_type() == antlr4rust::int_stream::EOF || token_index < 0 { return token_index; } @@ -170,12 +165,7 @@ impl<'input> PrivateCommonTokenStreamExt<'input> for ActualTokenStream<'input> { token_index } - fn filter_for_channel( - &self, - from: isize, - to: isize, - channel: isize, - ) -> Vec> { + fn filter_for_channel(&self, from: isize, to: isize, channel: i32) -> Vec> { // Adapted from let mut token_list = Vec::new(); @@ -212,7 +202,7 @@ impl<'input, T: YarnSpinnerParserContext<'input> + ?Sized> YarnSpinnerParserCont } pub(crate) fn create_common_token<'a>( - token_type: isize, + token_type: i32, text: impl Into, ) -> Box> { // The default values can be found strewn across diff --git a/crates/compiler/src/compiler/utils.rs b/crates/compiler/src/compiler/utils.rs index 15820a750..46ac7ec4e 100644 --- a/crates/compiler/src/compiler/utils.rs +++ b/crates/compiler/src/compiler/utils.rs @@ -3,13 +3,13 @@ use crate::error_strategy::ErrorStrategy; use crate::listeners::*; +use crate::prelude::generated::yarnspinnerlexer; use crate::prelude::generated::yarnspinnerparser::*; -use crate::prelude::generated::{yarnspinnerlexer, yarnspinnerparser}; use crate::prelude::*; -use antlr_rust::Parser; -use antlr_rust::common_token_stream::CommonTokenStream; -use antlr_rust::input_stream::CodePoint32BitCharStream; -use antlr_rust::token::{TOKEN_DEFAULT_CHANNEL, Token}; +use antlr4rust::Parser; +use antlr4rust::common_token_stream::CommonTokenStream; +use antlr4rust::input_stream::CodePoint32BitCharStream; +use antlr4rust::token::{TOKEN_DEFAULT_CHANNEL, Token}; use std::collections::HashSet; use std::rc::Rc; use yarnspinner_core::prelude::*; @@ -49,7 +49,7 @@ pub(crate) fn parse_syntax_tree<'a, 'b: 'a>( lexer.add_error_listener(Box::new(lexer_error_listener)); let tokens = CommonTokenStream::new(lexer); - let mut parser = YarnSpinnerParser::with_strategy(tokens, ErrorStrategy::new()); + let mut parser = YarnSpinnerParser::with_strategy(tokens, Box::new(ErrorStrategy::new())); let parser_error_listener = ParserErrorListener::new(file.clone()); let parser_error_listener_diagnostics = parser_error_listener.diagnostics.clone(); @@ -77,6 +77,13 @@ pub(crate) fn get_line_id_for_node_name(name: &str) -> LineId { format!("{LINE_ID_PREFIX}{name}").into() } +pub(crate) fn get_comments_channel() -> i32 { + yarnspinnerlexer::channelNames + .iter() + .position(|&name| name == "COMMENTS") + .expect("internal error: no comments channel is defined") as i32 +} + /// Gets the text of the documentation comments that either immediately /// precede `context`, or are on the same line as `context`. /// @@ -100,10 +107,8 @@ pub(crate) fn get_document_comments<'input>( Ctx = YarnSpinnerParserContextType, >, ) -> String { - let subsequent_comments = tokens.get_hidden_tokens_to_right( - context.stop().get_token_index(), - yarnspinnerlexer::COMMENTS as isize, - ); + let subsequent_comments = + tokens.get_hidden_tokens_to_right(context.stop().get_token_index(), get_comments_channel()); let subsequent_doc_comment = subsequent_comments .iter() @@ -121,10 +126,8 @@ pub(crate) fn get_document_comments<'input>( return subsequent_doc_comment; } - let preceding_comments = tokens.get_hidden_tokens_to_left( - context.start().get_token_index(), - yarnspinnerlexer::COMMENTS as isize, - ); + let preceding_comments = + tokens.get_hidden_tokens_to_left(context.start().get_token_index(), get_comments_channel()); let preceding_doc_comments: Vec<_> = preceding_comments .iter() @@ -155,7 +158,7 @@ pub(crate) fn add_hashtag_child<'input>( text: impl Into, ) { let parent = parent.ref_to_rc(); - let string_id_token = create_common_token(yarnspinnerparser::HASHTAG_TEXT, text); + let string_id_token = create_common_token(yarnspinnerlexer::HASHTAG_TEXT, text); let invoking_state_according_to_original_implementation = 0; // `new_with_text` was hacked into the generated parser. Also, `FooContextExt::new` is usually private... let hashtag = HashtagContextExt::new_with_text( diff --git a/crates/compiler/src/error_strategy.rs b/crates/compiler/src/error_strategy.rs index 7dadf0797..2179198f9 100644 --- a/crates/compiler/src/error_strategy.rs +++ b/crates/compiler/src/error_strategy.rs @@ -1,15 +1,16 @@ //! Adapted from +use crate::prelude::generated::yarnspinnerlexer; use crate::prelude::generated::yarnspinnerparser; use crate::prelude::*; -use antlr_rust::errors::{ANTLRError, InputMisMatchError, NoViableAltError}; -use antlr_rust::parser::ParserNodeType; -use antlr_rust::parser_rule_context::ParserRuleContext; -use antlr_rust::rule_context::CustomRuleContext; -use antlr_rust::token::Token; -use antlr_rust::token_factory::TokenFactory; -use antlr_rust::tree::Tree; -use antlr_rust::{DefaultErrorStrategy, ErrorStrategy as AntlrErrorStrategy, Parser}; +use antlr4rust::errors::{ANTLRError, InputMisMatchError, NoViableAltError}; +use antlr4rust::parser::ParserNodeType; +use antlr4rust::parser_rule_context::ParserRuleContext; +use antlr4rust::rule_context::CustomRuleContext; +use antlr4rust::token::Token; +use antlr4rust::token_factory::TokenFactory; +use antlr4rust::tree::Tree; +use antlr4rust::{DefaultErrorStrategy, ErrorStrategy as AntlrErrorStrategy, Parser}; use std::rc::Rc; pub(crate) struct ErrorStrategy<'input, Ctx: ParserNodeType<'input>> { @@ -89,15 +90,15 @@ impl<'input, Ctx: ParserNodeType<'input>> ErrorStrategy<'input, Ctx> { if is_inside_rule(recognizer, yarnspinnerparser::RULE_if_statement) && recognizer.get_parser_rule_context().get_rule_index() == yarnspinnerparser::RULE_statement - && e.start_token.token_type == yarnspinnerparser::COMMAND_START - && e.base.offending_token.token_type == yarnspinnerparser::COMMAND_ELSE + && e.start_token.token_type == yarnspinnerlexer::COMMAND_START + && e.base.offending_token.token_type == yarnspinnerlexer::COMMAND_ELSE { // We are inside an if statement, we're attempting to parse a // statement, and we got an '<<', 'else', and we weren't able // to match that. The programmer included an extra '<>'. "More than one <> statement in an <> statement isn't allowed".to_owned() - } else if e.start_token.token_type == yarnspinnerparser::COMMAND_START - && e.base.offending_token.token_type == yarnspinnerparser::COMMAND_END + } else if e.start_token.token_type == yarnspinnerlexer::COMMAND_START + && e.base.offending_token.token_type == yarnspinnerlexer::COMMAND_END { // We saw a << immediately followed by a >>. The programmer // forgot to include command text. @@ -121,7 +122,7 @@ impl<'input, Ctx: ParserNodeType<'input>> ErrorStrategy<'input, Ctx> { let msg = match rule_context.get_rule_index() { yarnspinnerparser::RULE_if_statement => { match e.base.offending_token.token_type { - yarnspinnerparser::BODY_END => { + yarnspinnerlexer::BODY_END => { // We have exited a body in the middle of an if // statement. The programmer forgot to include an // <>. @@ -130,10 +131,10 @@ impl<'input, Ctx: ParserNodeType<'input>> ErrorStrategy<'input, Ctx> { rule_context.start().get_line_as_usize() )) } - yarnspinnerparser::COMMAND_ELSE + yarnspinnerlexer::COMMAND_ELSE if recognizer .get_expected_tokens() - .contains(yarnspinnerparser::COMMAND_ENDIF) => + .contains(yarnspinnerlexer::COMMAND_ENDIF) => { // We saw an else, but we expected to see an endif. The // programmer wrote an additional <>. @@ -146,7 +147,7 @@ impl<'input, Ctx: ParserNodeType<'input>> ErrorStrategy<'input, Ctx> { } } yarnspinnerparser::RULE_variable - if e.base.offending_token.token_type == yarnspinnerparser::FUNC_ID => + if e.base.offending_token.token_type == yarnspinnerlexer::FUNC_ID => { // We're parsing a variable (which starts with a '$'), // but we encountered a FUNC_ID (which doesn't). The diff --git a/crates/compiler/src/listeners/compiler_listener.rs b/crates/compiler/src/listeners/compiler_listener.rs index a4f603731..31d705aa9 100644 --- a/crates/compiler/src/listeners/compiler_listener.rs +++ b/crates/compiler/src/listeners/compiler_listener.rs @@ -1,9 +1,9 @@ //! Adapted from the listener part of use crate::prelude::*; -use antlr_rust::parser_rule_context::ParserRuleContext; -use antlr_rust::token::Token; -use antlr_rust::tree::{ParseTreeListener, ParseTreeVisitorCompat}; +use antlr4rust::parser_rule_context::ParserRuleContext; +use antlr4rust::token::Token; +use antlr4rust::tree::{ParseTreeListener, ParseTreeVisitorCompat}; use std::cell::RefCell; use std::collections::HashSet; use std::rc::Rc; diff --git a/crates/compiler/src/listeners/compiler_listener/emit.rs b/crates/compiler/src/listeners/compiler_listener/emit.rs index d1a371824..605241dc7 100644 --- a/crates/compiler/src/listeners/compiler_listener/emit.rs +++ b/crates/compiler/src/listeners/compiler_listener/emit.rs @@ -1,6 +1,6 @@ use crate::listeners::CompilerListener; use crate::prelude::*; -use antlr_rust::token::Token; +use antlr4rust::token::Token; use yarnspinner_core::prelude::OpCode; use yarnspinner_core::prelude::*; diff --git a/crates/compiler/src/listeners/error_listener.rs b/crates/compiler/src/listeners/error_listener.rs index 27cd7aec3..7c6d1869d 100644 --- a/crates/compiler/src/listeners/error_listener.rs +++ b/crates/compiler/src/listeners/error_listener.rs @@ -3,13 +3,13 @@ use crate::prelude::generated::yarnspinnerparser::YarnSpinnerParserContextType; use crate::prelude::generated::yarnspinnerparserlistener::YarnSpinnerParserListener; use crate::prelude::*; -use antlr_rust::char_stream::InputData; -use antlr_rust::error_listener::ErrorListener; -use antlr_rust::errors::ANTLRError; -use antlr_rust::recognizer::Recognizer; -use antlr_rust::token::Token; -use antlr_rust::token_factory::TokenFactory; -use antlr_rust::tree::ParseTreeListener; +use antlr4rust::char_stream::InputData; +use antlr4rust::error_listener::ErrorListener; +use antlr4rust::errors::ANTLRError; +use antlr4rust::recognizer::Recognizer; +use antlr4rust::token::Token; +use antlr4rust::token_factory::TokenFactory; +use antlr4rust::tree::ParseTreeListener; pub use diagnostic::*; use std::cell::RefCell; use std::rc::Rc; diff --git a/crates/compiler/src/listeners/error_listener/diagnostic.rs b/crates/compiler/src/listeners/error_listener/diagnostic.rs index c767ded26..a595a880e 100644 --- a/crates/compiler/src/listeners/error_listener/diagnostic.rs +++ b/crates/compiler/src/listeners/error_listener/diagnostic.rs @@ -2,9 +2,9 @@ use crate::parser_rule_context_ext::ParserRuleContextExt; use crate::prelude::*; use annotate_snippets::renderer::DecorStyle; use annotate_snippets::{AnnotationKind, Level, Renderer, Snippet}; -use antlr_rust::rule_context::CustomRuleContext; -use antlr_rust::token::Token; -use antlr_rust::token_factory::TokenFactory; +use antlr4rust::rule_context::CustomRuleContext; +use antlr4rust::token::Token; +use antlr4rust::token_factory::TokenFactory; use core::fmt; use std::fmt::{Display, Formatter}; use std::ops::Range; diff --git a/crates/compiler/src/listeners/untagged_line_listener.rs b/crates/compiler/src/listeners/untagged_line_listener.rs index 5b602a9d4..852c120dc 100644 --- a/crates/compiler/src/listeners/untagged_line_listener.rs +++ b/crates/compiler/src/listeners/untagged_line_listener.rs @@ -7,11 +7,11 @@ use crate::prelude::generated::yarnspinnerparser::{ use crate::prelude::generated::yarnspinnerparserlistener::YarnSpinnerParserListener; use crate::prelude::*; use crate::visitors::get_hashtag_texts; -use antlr_rust::int_stream::IntStream; -use antlr_rust::parser_rule_context::ParserRuleContext; -use antlr_rust::token::Token; -use antlr_rust::token_stream::TokenStream; -use antlr_rust::tree::ParseTreeListener; +use antlr4rust::int_stream::IntStream; +use antlr4rust::parser_rule_context::ParserRuleContext; +use antlr4rust::token::Token; +use antlr4rust::token_stream::TokenStream; +use antlr4rust::tree::ParseTreeListener; use rand::RngExt as _; use rand::rngs::SysRng; use rand::{SeedableRng, rngs::SmallRng}; diff --git a/crates/compiler/src/output/declaration.rs b/crates/compiler/src/output/declaration.rs index 35bfea14d..8d027abe1 100644 --- a/crates/compiler/src/output/declaration.rs +++ b/crates/compiler/src/output/declaration.rs @@ -5,9 +5,9 @@ //! [`Range`] has been replaced with the more idiomatic [`Range`]. use crate::prelude::*; -use antlr_rust::rule_context::CustomRuleContext; -use antlr_rust::token::Token; -use antlr_rust::token_factory::TokenFactory; +use antlr4rust::rule_context::CustomRuleContext; +use antlr4rust::token::Token; +use antlr4rust::token_factory::TokenFactory; use std::fmt::{Debug, Display}; use std::ops::Range; use yarnspinner_core::prelude::*; diff --git a/crates/compiler/src/parser/actual_types.rs b/crates/compiler/src/parser/actual_types.rs index 36047d376..709bef590 100644 --- a/crates/compiler/src/parser/actual_types.rs +++ b/crates/compiler/src/parser/actual_types.rs @@ -1,19 +1,17 @@ //! Contains the actual types used in the real-world parser without all the generic type parameters. -use crate::error_strategy::ErrorStrategy; use crate::prelude::*; -use antlr_rust::InputStream; -use antlr_rust::common_token_stream::CommonTokenStream; +use antlr4rust::InputStream; +use antlr4rust::common_token_stream::CommonTokenStream; use generated::yarnspinnerparser::*; pub(crate) type ActualInputStream<'input> = InputStream<&'input [u32]>; pub(crate) type ActualYarnSpinnerLexer<'input> = YarnSpinnerLexer<'input, ActualInputStream<'input>>; -pub(crate) type ActualErrorStrategy<'input> = ErrorStrategy<'input, YarnSpinnerParserContextType>; pub(crate) type ActualTokenStream<'input> = CommonTokenStream<'input, ActualYarnSpinnerLexer<'input>>; pub(crate) type ActualYarnSpinnerParser<'input> = - YarnSpinnerParser<'input, ActualTokenStream<'input>, ActualErrorStrategy<'input>>; + YarnSpinnerParser<'input, ActualTokenStream<'input>>; pub(crate) type ActualParserContext<'input> = dyn YarnSpinnerParserContext< 'input, Ctx = YarnSpinnerParserContextType, diff --git a/crates/compiler/src/parser/generated.rs b/crates/compiler/src/parser/generated.rs index f37520a23..b331f4343 100644 --- a/crates/compiler/src/parser/generated.rs +++ b/crates/compiler/src/parser/generated.rs @@ -23,8 +23,8 @@ pub(crate) mod yarnspinnerparservisitor; #[cfg(test)] mod tests { use super::*; - use antlr_rust::tree::ParseTree; - use antlr_rust::{common_token_stream::CommonTokenStream, *}; + use antlr4rust::tree::ParseTree; + use antlr4rust::{common_token_stream::CommonTokenStream, *}; use std::ops::Deref; use yarnspinnerlexer::*; use yarnspinnerparser::*; diff --git a/crates/compiler/src/parser/generated/YarnSpinnerLexer.interp b/crates/compiler/src/parser/generated/YarnSpinnerLexer.interp index 3ff176982..6c642a637 100644 --- a/crates/compiler/src/parser/generated/YarnSpinnerLexer.interp +++ b/crates/compiler/src/parser/generated/YarnSpinnerLexer.interp @@ -308,4 +308,4 @@ CommandIDMode CommandIDOrExpressionMode atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 86, 836, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 4, 75, 9, 75, 4, 76, 9, 76, 4, 77, 9, 77, 4, 78, 9, 78, 4, 79, 9, 79, 4, 80, 9, 80, 4, 81, 9, 81, 4, 82, 9, 82, 4, 83, 9, 83, 4, 84, 9, 84, 4, 85, 9, 85, 4, 86, 9, 86, 4, 87, 9, 87, 4, 88, 9, 88, 4, 89, 9, 89, 4, 90, 9, 90, 4, 91, 9, 91, 4, 92, 9, 92, 4, 93, 9, 93, 4, 94, 9, 94, 4, 95, 9, 95, 4, 96, 9, 96, 4, 97, 9, 97, 4, 98, 9, 98, 4, 99, 9, 99, 4, 100, 9, 100, 4, 101, 9, 101, 4, 102, 9, 102, 4, 103, 9, 103, 4, 104, 9, 104, 4, 105, 9, 105, 4, 106, 9, 106, 4, 107, 9, 107, 4, 108, 9, 108, 4, 109, 9, 109, 4, 110, 9, 110, 4, 111, 9, 111, 4, 112, 9, 112, 3, 2, 6, 2, 238, 10, 2, 13, 2, 14, 2, 239, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 7, 3, 248, 10, 3, 12, 3, 14, 3, 251, 11, 3, 3, 3, 3, 3, 3, 4, 5, 4, 256, 10, 4, 3, 4, 3, 4, 5, 4, 260, 10, 4, 3, 4, 7, 4, 263, 10, 4, 12, 4, 14, 4, 266, 11, 4, 3, 4, 3, 4, 3, 5, 3, 5, 5, 5, 272, 10, 5, 3, 6, 5, 6, 275, 10, 6, 3, 7, 3, 7, 5, 7, 279, 10, 7, 3, 8, 6, 8, 282, 10, 8, 13, 8, 14, 8, 283, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 7, 10, 294, 10, 10, 12, 10, 14, 10, 297, 11, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 6, 12, 306, 10, 12, 13, 12, 14, 12, 307, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 5, 26, 381, 10, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 6, 32, 413, 10, 32, 13, 32, 14, 32, 414, 3, 32, 5, 32, 418, 10, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 41, 3, 41, 3, 42, 3, 42, 3, 42, 3, 42, 3, 43, 3, 43, 3, 43, 3, 43, 3, 44, 6, 44, 466, 10, 44, 13, 44, 14, 44, 467, 3, 44, 3, 44, 3, 45, 3, 45, 3, 45, 3, 45, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 48, 3, 48, 3, 48, 3, 48, 3, 48, 3, 49, 3, 49, 3, 49, 5, 49, 495, 10, 49, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 5, 50, 502, 10, 50, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 5, 51, 509, 10, 51, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 5, 52, 517, 10, 52, 3, 53, 3, 53, 3, 53, 5, 53, 522, 10, 53, 3, 54, 3, 54, 3, 54, 5, 54, 527, 10, 54, 3, 55, 3, 55, 3, 55, 3, 55, 3, 55, 5, 55, 534, 10, 55, 3, 56, 3, 56, 3, 56, 3, 56, 3, 56, 5, 56, 541, 10, 56, 3, 57, 3, 57, 3, 57, 3, 57, 5, 57, 547, 10, 57, 3, 58, 3, 58, 3, 58, 3, 58, 5, 58, 553, 10, 58, 3, 59, 3, 59, 3, 59, 3, 59, 5, 59, 559, 10, 59, 3, 60, 3, 60, 3, 60, 3, 61, 3, 61, 3, 61, 3, 62, 3, 62, 3, 62, 3, 63, 3, 63, 3, 63, 3, 64, 3, 64, 3, 64, 3, 65, 3, 65, 3, 66, 3, 66, 3, 67, 3, 67, 3, 68, 3, 68, 3, 69, 3, 69, 3, 70, 3, 70, 3, 71, 3, 71, 3, 72, 3, 72, 3, 73, 3, 73, 3, 73, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 3, 77, 3, 77, 3, 77, 3, 77, 7, 77, 624, 10, 77, 12, 77, 14, 77, 627, 11, 77, 3, 77, 3, 77, 3, 78, 3, 78, 3, 79, 3, 79, 3, 79, 3, 79, 3, 80, 3, 80, 3, 80, 3, 80, 3, 80, 3, 80, 3, 80, 3, 81, 3, 81, 3, 81, 3, 82, 3, 82, 3, 83, 3, 83, 3, 83, 3, 83, 3, 83, 5, 83, 654, 10, 83, 3, 84, 6, 84, 657, 10, 84, 13, 84, 14, 84, 658, 3, 85, 3, 85, 3, 86, 3, 86, 3, 87, 3, 87, 3, 87, 3, 87, 3, 88, 3, 88, 3, 88, 3, 88, 3, 88, 3, 88, 3, 88, 3, 89, 3, 89, 3, 89, 3, 89, 3, 89, 3, 89, 3, 89, 3, 89, 3, 89, 3, 89, 3, 89, 3, 90, 3, 90, 3, 90, 3, 90, 3, 90, 3, 90, 5, 90, 693, 10, 90, 3, 91, 3, 91, 3, 91, 3, 91, 3, 91, 3, 91, 3, 91, 3, 91, 3, 92, 3, 92, 3, 92, 3, 92, 3, 92, 3, 92, 3, 93, 3, 93, 3, 93, 3, 93, 3, 93, 3, 93, 3, 93, 3, 93, 3, 93, 3, 94, 3, 94, 3, 94, 3, 94, 3, 94, 3, 94, 3, 94, 3, 94, 3, 94, 3, 94, 3, 94, 3, 94, 3, 95, 3, 95, 3, 95, 3, 95, 3, 95, 3, 95, 3, 95, 3, 95, 3, 95, 3, 96, 3, 96, 3, 96, 3, 96, 3, 96, 3, 96, 3, 96, 3, 96, 3, 96, 3, 97, 3, 97, 3, 97, 3, 97, 3, 97, 3, 97, 3, 97, 3, 97, 3, 97, 3, 98, 3, 98, 3, 98, 3, 98, 3, 98, 3, 98, 3, 98, 3, 98, 3, 98, 5, 98, 766, 10, 98, 3, 99, 3, 99, 3, 99, 3, 99, 3, 99, 3, 99, 3, 99, 3, 99, 3, 100, 3, 100, 3, 100, 3, 100, 3, 100, 3, 101, 3, 101, 3, 101, 3, 101, 3, 101, 3, 101, 3, 102, 3, 102, 3, 102, 3, 102, 3, 102, 3, 103, 3, 103, 3, 104, 3, 104, 3, 104, 3, 104, 3, 104, 3, 105, 3, 105, 3, 105, 3, 105, 3, 106, 6, 106, 804, 10, 106, 13, 106, 14, 106, 805, 3, 107, 3, 107, 3, 108, 3, 108, 3, 108, 3, 108, 3, 108, 3, 109, 3, 109, 3, 109, 3, 109, 3, 109, 3, 109, 3, 110, 3, 110, 3, 110, 3, 110, 3, 110, 3, 111, 3, 111, 3, 111, 3, 111, 3, 111, 3, 112, 3, 112, 3, 112, 3, 112, 3, 112, 3, 112, 2, 2, 113, 14, 6, 16, 7, 18, 8, 20, 9, 22, 2, 24, 2, 26, 2, 28, 10, 30, 11, 32, 12, 34, 13, 36, 2, 38, 14, 40, 2, 42, 2, 44, 15, 46, 16, 48, 17, 50, 2, 52, 18, 54, 2, 56, 19, 58, 2, 60, 2, 62, 2, 64, 20, 66, 2, 68, 2, 70, 2, 72, 21, 74, 22, 76, 2, 78, 2, 80, 23, 82, 24, 84, 25, 86, 2, 88, 2, 90, 2, 92, 26, 94, 27, 96, 2, 98, 28, 100, 29, 102, 30, 104, 31, 106, 32, 108, 33, 110, 34, 112, 35, 114, 36, 116, 37, 118, 38, 120, 39, 122, 40, 124, 41, 126, 42, 128, 43, 130, 44, 132, 45, 134, 46, 136, 47, 138, 48, 140, 49, 142, 50, 144, 51, 146, 52, 148, 53, 150, 54, 152, 55, 154, 56, 156, 57, 158, 84, 160, 85, 162, 86, 164, 58, 166, 59, 168, 60, 170, 2, 172, 61, 174, 62, 176, 63, 178, 2, 180, 2, 182, 64, 184, 65, 186, 66, 188, 67, 190, 68, 192, 69, 194, 70, 196, 71, 198, 72, 200, 73, 202, 74, 204, 75, 206, 76, 208, 77, 210, 78, 212, 2, 214, 2, 216, 79, 218, 80, 220, 81, 222, 82, 224, 83, 226, 2, 228, 2, 230, 2, 232, 2, 234, 2, 14, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 4, 2, 11, 11, 34, 34, 4, 2, 12, 12, 15, 15, 7, 2, 50, 59, 770, 881, 7618, 7681, 8402, 8449, 65058, 65073, 3, 2, 34, 34, 4, 2, 49, 49, 62, 62, 9, 2, 12, 12, 15, 15, 37, 37, 49, 49, 62, 62, 94, 94, 125, 125, 9, 2, 37, 37, 49, 49, 62, 62, 64, 64, 94, 94, 125, 125, 127, 127, 7, 2, 11, 12, 15, 15, 34, 34, 37, 38, 62, 62, 6, 2, 12, 12, 15, 15, 36, 36, 94, 94, 4, 2, 36, 36, 94, 94, 3, 2, 50, 59, 12, 2, 11, 15, 34, 34, 135, 135, 162, 162, 5762, 5762, 8194, 8204, 8234, 8235, 8241, 8241, 8289, 8289, 12290, 12290, 6, 2, 12, 12, 15, 15, 64, 64, 125, 125, 3, 51, 2, 67, 2, 92, 2, 97, 2, 97, 2, 99, 2, 124, 2, 170, 2, 170, 2, 172, 2, 172, 2, 175, 2, 175, 2, 177, 2, 177, 2, 180, 2, 183, 2, 185, 2, 188, 2, 190, 2, 192, 2, 194, 2, 216, 2, 218, 2, 248, 2, 250, 2, 769, 2, 882, 2, 5761, 2, 5763, 2, 6159, 2, 6161, 2, 7617, 2, 7682, 2, 8193, 2, 8205, 2, 8207, 2, 8236, 2, 8240, 2, 8257, 2, 8258, 2, 8278, 2, 8278, 2, 8290, 2, 8401, 2, 8450, 2, 8593, 2, 9314, 2, 9473, 2, 10104, 2, 10133, 2, 11266, 2, 11777, 2, 11906, 2, 12289, 2, 12294, 2, 12297, 2, 12323, 2, 12337, 2, 12339, 2, 55297, 2, 63746, 2, 64831, 2, 64834, 2, 64977, 2, 65010, 2, 65057, 2, 65074, 2, 65094, 2, 65097, 2, 65535, 2, 2, 3, 65535, 3, 2, 4, 65535, 4, 2, 5, 65535, 5, 2, 6, 65535, 6, 2, 7, 65535, 7, 2, 8, 65535, 8, 2, 9, 65535, 9, 2, 10, 65535, 10, 2, 11, 65535, 11, 2, 12, 65535, 12, 2, 13, 65535, 13, 2, 14, 65535, 14, 2, 15, 65535, 15, 2, 16, 65535, 16, 851, 2, 14, 3, 2, 2, 2, 2, 16, 3, 2, 2, 2, 2, 18, 3, 2, 2, 2, 2, 20, 3, 2, 2, 2, 2, 28, 3, 2, 2, 2, 2, 30, 3, 2, 2, 2, 2, 32, 3, 2, 2, 2, 3, 34, 3, 2, 2, 2, 3, 36, 3, 2, 2, 2, 4, 38, 3, 2, 2, 2, 4, 40, 3, 2, 2, 2, 4, 42, 3, 2, 2, 2, 4, 44, 3, 2, 2, 2, 4, 46, 3, 2, 2, 2, 4, 48, 3, 2, 2, 2, 4, 50, 3, 2, 2, 2, 4, 52, 3, 2, 2, 2, 4, 54, 3, 2, 2, 2, 4, 56, 3, 2, 2, 2, 4, 58, 3, 2, 2, 2, 5, 60, 3, 2, 2, 2, 5, 62, 3, 2, 2, 2, 5, 64, 3, 2, 2, 2, 5, 66, 3, 2, 2, 2, 5, 68, 3, 2, 2, 2, 5, 70, 3, 2, 2, 2, 5, 72, 3, 2, 2, 2, 5, 74, 3, 2, 2, 2, 6, 78, 3, 2, 2, 2, 6, 80, 3, 2, 2, 2, 7, 82, 3, 2, 2, 2, 7, 84, 3, 2, 2, 2, 7, 86, 3, 2, 2, 2, 7, 88, 3, 2, 2, 2, 7, 90, 3, 2, 2, 2, 7, 92, 3, 2, 2, 2, 8, 94, 3, 2, 2, 2, 8, 96, 3, 2, 2, 2, 8, 98, 3, 2, 2, 2, 9, 100, 3, 2, 2, 2, 9, 102, 3, 2, 2, 2, 9, 104, 3, 2, 2, 2, 9, 106, 3, 2, 2, 2, 9, 108, 3, 2, 2, 2, 9, 110, 3, 2, 2, 2, 9, 112, 3, 2, 2, 2, 9, 114, 3, 2, 2, 2, 9, 116, 3, 2, 2, 2, 9, 118, 3, 2, 2, 2, 9, 120, 3, 2, 2, 2, 9, 122, 3, 2, 2, 2, 9, 124, 3, 2, 2, 2, 9, 126, 3, 2, 2, 2, 9, 128, 3, 2, 2, 2, 9, 130, 3, 2, 2, 2, 9, 132, 3, 2, 2, 2, 9, 134, 3, 2, 2, 2, 9, 136, 3, 2, 2, 2, 9, 138, 3, 2, 2, 2, 9, 140, 3, 2, 2, 2, 9, 142, 3, 2, 2, 2, 9, 144, 3, 2, 2, 2, 9, 146, 3, 2, 2, 2, 9, 148, 3, 2, 2, 2, 9, 150, 3, 2, 2, 2, 9, 152, 3, 2, 2, 2, 9, 154, 3, 2, 2, 2, 9, 156, 3, 2, 2, 2, 9, 158, 3, 2, 2, 2, 9, 160, 3, 2, 2, 2, 9, 162, 3, 2, 2, 2, 9, 164, 3, 2, 2, 2, 9, 166, 3, 2, 2, 2, 9, 168, 3, 2, 2, 2, 9, 170, 3, 2, 2, 2, 9, 172, 3, 2, 2, 2, 9, 174, 3, 2, 2, 2, 9, 176, 3, 2, 2, 2, 10, 182, 3, 2, 2, 2, 10, 184, 3, 2, 2, 2, 10, 186, 3, 2, 2, 2, 10, 188, 3, 2, 2, 2, 10, 190, 3, 2, 2, 2, 10, 192, 3, 2, 2, 2, 10, 194, 3, 2, 2, 2, 10, 196, 3, 2, 2, 2, 10, 198, 3, 2, 2, 2, 10, 200, 3, 2, 2, 2, 10, 202, 3, 2, 2, 2, 10, 204, 3, 2, 2, 2, 10, 206, 3, 2, 2, 2, 10, 208, 3, 2, 2, 2, 10, 210, 3, 2, 2, 2, 10, 212, 3, 2, 2, 2, 10, 214, 3, 2, 2, 2, 11, 216, 3, 2, 2, 2, 11, 218, 3, 2, 2, 2, 11, 220, 3, 2, 2, 2, 11, 222, 3, 2, 2, 2, 12, 224, 3, 2, 2, 2, 12, 226, 3, 2, 2, 2, 12, 228, 3, 2, 2, 2, 13, 230, 3, 2, 2, 2, 13, 232, 3, 2, 2, 2, 13, 234, 3, 2, 2, 2, 14, 237, 3, 2, 2, 2, 16, 243, 3, 2, 2, 2, 18, 259, 3, 2, 2, 2, 20, 269, 3, 2, 2, 2, 22, 274, 3, 2, 2, 2, 24, 278, 3, 2, 2, 2, 26, 281, 3, 2, 2, 2, 28, 285, 3, 2, 2, 2, 30, 291, 3, 2, 2, 2, 32, 300, 3, 2, 2, 2, 34, 305, 3, 2, 2, 2, 36, 309, 3, 2, 2, 2, 38, 315, 3, 2, 2, 2, 40, 319, 3, 2, 2, 2, 42, 324, 3, 2, 2, 2, 44, 329, 3, 2, 2, 2, 46, 335, 3, 2, 2, 2, 48, 338, 3, 2, 2, 2, 50, 343, 3, 2, 2, 2, 52, 349, 3, 2, 2, 2, 54, 354, 3, 2, 2, 2, 56, 360, 3, 2, 2, 2, 58, 366, 3, 2, 2, 2, 60, 371, 3, 2, 2, 2, 62, 380, 3, 2, 2, 2, 64, 384, 3, 2, 2, 2, 66, 389, 3, 2, 2, 2, 68, 395, 3, 2, 2, 2, 70, 400, 3, 2, 2, 2, 72, 407, 3, 2, 2, 2, 74, 417, 3, 2, 2, 2, 76, 419, 3, 2, 2, 2, 78, 421, 3, 2, 2, 2, 80, 426, 3, 2, 2, 2, 82, 430, 3, 2, 2, 2, 84, 434, 3, 2, 2, 2, 86, 438, 3, 2, 2, 2, 88, 444, 3, 2, 2, 2, 90, 449, 3, 2, 2, 2, 92, 454, 3, 2, 2, 2, 94, 456, 3, 2, 2, 2, 96, 460, 3, 2, 2, 2, 98, 465, 3, 2, 2, 2, 100, 471, 3, 2, 2, 2, 102, 475, 3, 2, 2, 2, 104, 480, 3, 2, 2, 2, 106, 486, 3, 2, 2, 2, 108, 494, 3, 2, 2, 2, 110, 501, 3, 2, 2, 2, 112, 508, 3, 2, 2, 2, 114, 516, 3, 2, 2, 2, 116, 521, 3, 2, 2, 2, 118, 526, 3, 2, 2, 2, 120, 533, 3, 2, 2, 2, 122, 540, 3, 2, 2, 2, 124, 546, 3, 2, 2, 2, 126, 552, 3, 2, 2, 2, 128, 558, 3, 2, 2, 2, 130, 560, 3, 2, 2, 2, 132, 563, 3, 2, 2, 2, 134, 566, 3, 2, 2, 2, 136, 569, 3, 2, 2, 2, 138, 572, 3, 2, 2, 2, 140, 575, 3, 2, 2, 2, 142, 577, 3, 2, 2, 2, 144, 579, 3, 2, 2, 2, 146, 581, 3, 2, 2, 2, 148, 583, 3, 2, 2, 2, 150, 585, 3, 2, 2, 2, 152, 587, 3, 2, 2, 2, 154, 589, 3, 2, 2, 2, 156, 591, 3, 2, 2, 2, 158, 594, 3, 2, 2, 2, 160, 603, 3, 2, 2, 2, 162, 612, 3, 2, 2, 2, 164, 619, 3, 2, 2, 2, 166, 630, 3, 2, 2, 2, 168, 632, 3, 2, 2, 2, 170, 636, 3, 2, 2, 2, 172, 643, 3, 2, 2, 2, 174, 646, 3, 2, 2, 2, 176, 653, 3, 2, 2, 2, 178, 656, 3, 2, 2, 2, 180, 660, 3, 2, 2, 2, 182, 662, 3, 2, 2, 2, 184, 664, 3, 2, 2, 2, 186, 668, 3, 2, 2, 2, 188, 675, 3, 2, 2, 2, 190, 686, 3, 2, 2, 2, 192, 694, 3, 2, 2, 2, 194, 702, 3, 2, 2, 2, 196, 708, 3, 2, 2, 2, 198, 717, 3, 2, 2, 2, 200, 729, 3, 2, 2, 2, 202, 738, 3, 2, 2, 2, 204, 747, 3, 2, 2, 2, 206, 756, 3, 2, 2, 2, 208, 767, 3, 2, 2, 2, 210, 775, 3, 2, 2, 2, 212, 780, 3, 2, 2, 2, 214, 786, 3, 2, 2, 2, 216, 791, 3, 2, 2, 2, 218, 793, 3, 2, 2, 2, 220, 798, 3, 2, 2, 2, 222, 803, 3, 2, 2, 2, 224, 807, 3, 2, 2, 2, 226, 809, 3, 2, 2, 2, 228, 814, 3, 2, 2, 2, 230, 820, 3, 2, 2, 2, 232, 825, 3, 2, 2, 2, 234, 830, 3, 2, 2, 2, 236, 238, 9, 2, 2, 2, 237, 236, 3, 2, 2, 2, 238, 239, 3, 2, 2, 2, 239, 237, 3, 2, 2, 2, 239, 240, 3, 2, 2, 2, 240, 241, 3, 2, 2, 2, 241, 242, 8, 2, 2, 2, 242, 15, 3, 2, 2, 2, 243, 244, 7, 49, 2, 2, 244, 245, 7, 49, 2, 2, 245, 249, 3, 2, 2, 2, 246, 248, 10, 3, 2, 2, 247, 246, 3, 2, 2, 2, 248, 251, 3, 2, 2, 2, 249, 247, 3, 2, 2, 2, 249, 250, 3, 2, 2, 2, 250, 252, 3, 2, 2, 2, 251, 249, 3, 2, 2, 2, 252, 253, 8, 3, 3, 2, 253, 17, 3, 2, 2, 2, 254, 256, 7, 15, 2, 2, 255, 254, 3, 2, 2, 2, 255, 256, 3, 2, 2, 2, 256, 257, 3, 2, 2, 2, 257, 260, 7, 12, 2, 2, 258, 260, 7, 15, 2, 2, 259, 255, 3, 2, 2, 2, 259, 258, 3, 2, 2, 2, 260, 264, 3, 2, 2, 2, 261, 263, 9, 2, 2, 2, 262, 261, 3, 2, 2, 2, 263, 266, 3, 2, 2, 2, 264, 262, 3, 2, 2, 2, 264, 265, 3, 2, 2, 2, 265, 267, 3, 2, 2, 2, 266, 264, 3, 2, 2, 2, 267, 268, 8, 4, 4, 2, 268, 19, 3, 2, 2, 2, 269, 271, 5, 22, 6, 2, 270, 272, 5, 26, 8, 2, 271, 270, 3, 2, 2, 2, 271, 272, 3, 2, 2, 2, 272, 21, 3, 2, 2, 2, 273, 275, 9, 15, 2, 2, 274, 273, 3, 2, 2, 2, 275, 23, 3, 2, 2, 2, 276, 279, 9, 4, 2, 2, 277, 279, 5, 22, 6, 2, 278, 276, 3, 2, 2, 2, 278, 277, 3, 2, 2, 2, 279, 25, 3, 2, 2, 2, 280, 282, 5, 24, 7, 2, 281, 280, 3, 2, 2, 2, 282, 283, 3, 2, 2, 2, 283, 281, 3, 2, 2, 2, 283, 284, 3, 2, 2, 2, 284, 27, 3, 2, 2, 2, 285, 286, 7, 47, 2, 2, 286, 287, 7, 47, 2, 2, 287, 288, 7, 47, 2, 2, 288, 289, 3, 2, 2, 2, 289, 290, 8, 9, 5, 2, 290, 29, 3, 2, 2, 2, 291, 295, 7, 60, 2, 2, 292, 294, 9, 5, 2, 2, 293, 292, 3, 2, 2, 2, 294, 297, 3, 2, 2, 2, 295, 293, 3, 2, 2, 2, 295, 296, 3, 2, 2, 2, 296, 298, 3, 2, 2, 2, 297, 295, 3, 2, 2, 2, 298, 299, 8, 10, 6, 2, 299, 31, 3, 2, 2, 2, 300, 301, 7, 37, 2, 2, 301, 302, 3, 2, 2, 2, 302, 303, 8, 11, 7, 2, 303, 33, 3, 2, 2, 2, 304, 306, 10, 3, 2, 2, 305, 304, 3, 2, 2, 2, 306, 307, 3, 2, 2, 2, 307, 305, 3, 2, 2, 2, 307, 308, 3, 2, 2, 2, 308, 35, 3, 2, 2, 2, 309, 310, 5, 18, 4, 2, 310, 311, 3, 2, 2, 2, 311, 312, 8, 13, 8, 2, 312, 313, 8, 13, 4, 2, 313, 314, 8, 13, 9, 2, 314, 37, 3, 2, 2, 2, 315, 316, 5, 14, 2, 2, 316, 317, 3, 2, 2, 2, 317, 318, 8, 14, 2, 2, 318, 39, 3, 2, 2, 2, 319, 320, 5, 18, 4, 2, 320, 321, 3, 2, 2, 2, 321, 322, 8, 15, 8, 2, 322, 323, 8, 15, 4, 2, 323, 41, 3, 2, 2, 2, 324, 325, 5, 16, 3, 2, 325, 326, 3, 2, 2, 2, 326, 327, 8, 16, 10, 2, 327, 328, 8, 16, 3, 2, 328, 43, 3, 2, 2, 2, 329, 330, 7, 63, 2, 2, 330, 331, 7, 63, 2, 2, 331, 332, 7, 63, 2, 2, 332, 333, 3, 2, 2, 2, 333, 334, 8, 17, 9, 2, 334, 45, 3, 2, 2, 2, 335, 336, 7, 47, 2, 2, 336, 337, 7, 64, 2, 2, 337, 47, 3, 2, 2, 2, 338, 339, 7, 62, 2, 2, 339, 340, 7, 62, 2, 2, 340, 341, 3, 2, 2, 2, 341, 342, 8, 19, 11, 2, 342, 49, 3, 2, 2, 2, 343, 344, 7, 37, 2, 2, 344, 345, 3, 2, 2, 2, 345, 346, 8, 20, 12, 2, 346, 347, 8, 20, 13, 2, 347, 348, 8, 20, 7, 2, 348, 51, 3, 2, 2, 2, 349, 350, 7, 125, 2, 2, 350, 351, 3, 2, 2, 2, 351, 352, 8, 21, 14, 2, 352, 353, 8, 21, 15, 2, 353, 53, 3, 2, 2, 2, 354, 355, 7, 94, 2, 2, 355, 356, 7, 93, 2, 2, 356, 357, 3, 2, 2, 2, 357, 358, 8, 22, 16, 2, 358, 359, 8, 22, 14, 2, 359, 55, 3, 2, 2, 2, 360, 361, 7, 94, 2, 2, 361, 362, 3, 2, 2, 2, 362, 363, 8, 23, 2, 2, 363, 364, 8, 23, 14, 2, 364, 365, 8, 23, 17, 2, 365, 57, 3, 2, 2, 2, 366, 367, 11, 2, 2, 2, 367, 368, 3, 2, 2, 2, 368, 369, 8, 24, 16, 2, 369, 370, 8, 24, 14, 2, 370, 59, 3, 2, 2, 2, 371, 372, 5, 18, 4, 2, 372, 373, 3, 2, 2, 2, 373, 374, 8, 25, 8, 2, 374, 375, 8, 25, 9, 2, 375, 61, 3, 2, 2, 2, 376, 377, 7, 94, 2, 2, 377, 381, 7, 93, 2, 2, 378, 379, 7, 94, 2, 2, 379, 381, 7, 95, 2, 2, 380, 376, 3, 2, 2, 2, 380, 378, 3, 2, 2, 2, 381, 382, 3, 2, 2, 2, 382, 383, 8, 26, 16, 2, 383, 63, 3, 2, 2, 2, 384, 385, 7, 94, 2, 2, 385, 386, 3, 2, 2, 2, 386, 387, 8, 27, 18, 2, 387, 388, 8, 27, 17, 2, 388, 65, 3, 2, 2, 2, 389, 390, 5, 32, 11, 2, 390, 391, 3, 2, 2, 2, 391, 392, 8, 28, 12, 2, 392, 393, 8, 28, 19, 2, 393, 394, 8, 28, 7, 2, 394, 67, 3, 2, 2, 2, 395, 396, 7, 125, 2, 2, 396, 397, 3, 2, 2, 2, 397, 398, 8, 29, 20, 2, 398, 399, 8, 29, 15, 2, 399, 69, 3, 2, 2, 2, 400, 401, 7, 62, 2, 2, 401, 402, 7, 62, 2, 2, 402, 403, 3, 2, 2, 2, 403, 404, 8, 30, 21, 2, 404, 405, 8, 30, 19, 2, 405, 406, 8, 30, 11, 2, 406, 71, 3, 2, 2, 2, 407, 408, 5, 16, 3, 2, 408, 409, 3, 2, 2, 2, 409, 410, 8, 31, 3, 2, 410, 73, 3, 2, 2, 2, 411, 413, 5, 76, 33, 2, 412, 411, 3, 2, 2, 2, 413, 414, 3, 2, 2, 2, 414, 412, 3, 2, 2, 2, 414, 415, 3, 2, 2, 2, 415, 418, 3, 2, 2, 2, 416, 418, 9, 6, 2, 2, 417, 412, 3, 2, 2, 2, 417, 416, 3, 2, 2, 2, 418, 75, 3, 2, 2, 2, 419, 420, 10, 7, 2, 2, 420, 77, 3, 2, 2, 2, 421, 422, 9, 8, 2, 2, 422, 423, 3, 2, 2, 2, 423, 424, 8, 34, 16, 2, 424, 425, 8, 34, 9, 2, 425, 79, 3, 2, 2, 2, 426, 427, 11, 2, 2, 2, 427, 428, 3, 2, 2, 2, 428, 429, 8, 35, 9, 2, 429, 81, 3, 2, 2, 2, 430, 431, 5, 14, 2, 2, 431, 432, 3, 2, 2, 2, 432, 433, 8, 36, 2, 2, 433, 83, 3, 2, 2, 2, 434, 435, 5, 16, 3, 2, 435, 436, 3, 2, 2, 2, 436, 437, 8, 37, 3, 2, 437, 85, 3, 2, 2, 2, 438, 439, 7, 62, 2, 2, 439, 440, 7, 62, 2, 2, 440, 441, 3, 2, 2, 2, 441, 442, 8, 38, 21, 2, 442, 443, 8, 38, 11, 2, 443, 87, 3, 2, 2, 2, 444, 445, 7, 37, 2, 2, 445, 446, 3, 2, 2, 2, 446, 447, 8, 39, 12, 2, 447, 448, 8, 39, 7, 2, 448, 89, 3, 2, 2, 2, 449, 450, 5, 18, 4, 2, 450, 451, 3, 2, 2, 2, 451, 452, 8, 40, 8, 2, 452, 453, 8, 40, 9, 2, 453, 91, 3, 2, 2, 2, 454, 455, 11, 2, 2, 2, 455, 93, 3, 2, 2, 2, 456, 457, 5, 14, 2, 2, 457, 458, 3, 2, 2, 2, 458, 459, 8, 42, 2, 2, 459, 95, 3, 2, 2, 2, 460, 461, 5, 32, 11, 2, 461, 462, 3, 2, 2, 2, 462, 463, 8, 43, 12, 2, 463, 97, 3, 2, 2, 2, 464, 466, 10, 9, 2, 2, 465, 464, 3, 2, 2, 2, 466, 467, 3, 2, 2, 2, 467, 465, 3, 2, 2, 2, 467, 468, 3, 2, 2, 2, 468, 469, 3, 2, 2, 2, 469, 470, 8, 44, 9, 2, 470, 99, 3, 2, 2, 2, 471, 472, 5, 14, 2, 2, 472, 473, 3, 2, 2, 2, 473, 474, 8, 45, 2, 2, 474, 101, 3, 2, 2, 2, 475, 476, 7, 118, 2, 2, 476, 477, 7, 116, 2, 2, 477, 478, 7, 119, 2, 2, 478, 479, 7, 103, 2, 2, 479, 103, 3, 2, 2, 2, 480, 481, 7, 104, 2, 2, 481, 482, 7, 99, 2, 2, 482, 483, 7, 110, 2, 2, 483, 484, 7, 117, 2, 2, 484, 485, 7, 103, 2, 2, 485, 105, 3, 2, 2, 2, 486, 487, 7, 112, 2, 2, 487, 488, 7, 119, 2, 2, 488, 489, 7, 110, 2, 2, 489, 490, 7, 110, 2, 2, 490, 107, 3, 2, 2, 2, 491, 495, 7, 63, 2, 2, 492, 493, 7, 118, 2, 2, 493, 495, 7, 113, 2, 2, 494, 491, 3, 2, 2, 2, 494, 492, 3, 2, 2, 2, 495, 109, 3, 2, 2, 2, 496, 497, 7, 62, 2, 2, 497, 502, 7, 63, 2, 2, 498, 499, 7, 110, 2, 2, 499, 500, 7, 118, 2, 2, 500, 502, 7, 103, 2, 2, 501, 496, 3, 2, 2, 2, 501, 498, 3, 2, 2, 2, 502, 111, 3, 2, 2, 2, 503, 504, 7, 64, 2, 2, 504, 509, 7, 63, 2, 2, 505, 506, 7, 105, 2, 2, 506, 507, 7, 118, 2, 2, 507, 509, 7, 103, 2, 2, 508, 503, 3, 2, 2, 2, 508, 505, 3, 2, 2, 2, 509, 113, 3, 2, 2, 2, 510, 511, 7, 63, 2, 2, 511, 517, 7, 63, 2, 2, 512, 513, 7, 107, 2, 2, 513, 517, 7, 117, 2, 2, 514, 515, 7, 103, 2, 2, 515, 517, 7, 115, 2, 2, 516, 510, 3, 2, 2, 2, 516, 512, 3, 2, 2, 2, 516, 514, 3, 2, 2, 2, 517, 115, 3, 2, 2, 2, 518, 522, 7, 62, 2, 2, 519, 520, 7, 110, 2, 2, 520, 522, 7, 118, 2, 2, 521, 518, 3, 2, 2, 2, 521, 519, 3, 2, 2, 2, 522, 117, 3, 2, 2, 2, 523, 527, 7, 64, 2, 2, 524, 525, 7, 105, 2, 2, 525, 527, 7, 118, 2, 2, 526, 523, 3, 2, 2, 2, 526, 524, 3, 2, 2, 2, 527, 119, 3, 2, 2, 2, 528, 529, 7, 35, 2, 2, 529, 534, 7, 63, 2, 2, 530, 531, 7, 112, 2, 2, 531, 532, 7, 103, 2, 2, 532, 534, 7, 115, 2, 2, 533, 528, 3, 2, 2, 2, 533, 530, 3, 2, 2, 2, 534, 121, 3, 2, 2, 2, 535, 536, 7, 99, 2, 2, 536, 537, 7, 112, 2, 2, 537, 541, 7, 102, 2, 2, 538, 539, 7, 40, 2, 2, 539, 541, 7, 40, 2, 2, 540, 535, 3, 2, 2, 2, 540, 538, 3, 2, 2, 2, 541, 123, 3, 2, 2, 2, 542, 543, 7, 113, 2, 2, 543, 547, 7, 116, 2, 2, 544, 545, 7, 126, 2, 2, 545, 547, 7, 126, 2, 2, 546, 542, 3, 2, 2, 2, 546, 544, 3, 2, 2, 2, 547, 125, 3, 2, 2, 2, 548, 549, 7, 122, 2, 2, 549, 550, 7, 113, 2, 2, 550, 553, 7, 116, 2, 2, 551, 553, 7, 96, 2, 2, 552, 548, 3, 2, 2, 2, 552, 551, 3, 2, 2, 2, 553, 127, 3, 2, 2, 2, 554, 555, 7, 112, 2, 2, 555, 556, 7, 113, 2, 2, 556, 559, 7, 118, 2, 2, 557, 559, 7, 35, 2, 2, 558, 554, 3, 2, 2, 2, 558, 557, 3, 2, 2, 2, 559, 129, 3, 2, 2, 2, 560, 561, 7, 45, 2, 2, 561, 562, 7, 63, 2, 2, 562, 131, 3, 2, 2, 2, 563, 564, 7, 47, 2, 2, 564, 565, 7, 63, 2, 2, 565, 133, 3, 2, 2, 2, 566, 567, 7, 44, 2, 2, 567, 568, 7, 63, 2, 2, 568, 135, 3, 2, 2, 2, 569, 570, 7, 39, 2, 2, 570, 571, 7, 63, 2, 2, 571, 137, 3, 2, 2, 2, 572, 573, 7, 49, 2, 2, 573, 574, 7, 63, 2, 2, 574, 139, 3, 2, 2, 2, 575, 576, 7, 45, 2, 2, 576, 141, 3, 2, 2, 2, 577, 578, 7, 47, 2, 2, 578, 143, 3, 2, 2, 2, 579, 580, 7, 44, 2, 2, 580, 145, 3, 2, 2, 2, 581, 582, 7, 49, 2, 2, 582, 147, 3, 2, 2, 2, 583, 584, 7, 39, 2, 2, 584, 149, 3, 2, 2, 2, 585, 586, 7, 42, 2, 2, 586, 151, 3, 2, 2, 2, 587, 588, 7, 43, 2, 2, 588, 153, 3, 2, 2, 2, 589, 590, 7, 46, 2, 2, 590, 155, 3, 2, 2, 2, 591, 592, 7, 99, 2, 2, 592, 593, 7, 117, 2, 2, 593, 157, 3, 2, 2, 2, 594, 595, 7, 117, 2, 2, 595, 596, 7, 118, 2, 2, 596, 597, 7, 116, 2, 2, 597, 598, 7, 107, 2, 2, 598, 599, 7, 112, 2, 2, 599, 600, 7, 105, 2, 2, 600, 601, 3, 2, 2, 2, 601, 602, 8, 74, 22, 2, 602, 159, 3, 2, 2, 2, 603, 604, 7, 112, 2, 2, 604, 605, 7, 119, 2, 2, 605, 606, 7, 111, 2, 2, 606, 607, 7, 100, 2, 2, 607, 608, 7, 103, 2, 2, 608, 609, 7, 116, 2, 2, 609, 610, 3, 2, 2, 2, 610, 611, 8, 75, 22, 2, 611, 161, 3, 2, 2, 2, 612, 613, 7, 100, 2, 2, 613, 614, 7, 113, 2, 2, 614, 615, 7, 113, 2, 2, 615, 616, 7, 110, 2, 2, 616, 617, 3, 2, 2, 2, 617, 618, 8, 76, 22, 2, 618, 163, 3, 2, 2, 2, 619, 625, 7, 36, 2, 2, 620, 624, 10, 10, 2, 2, 621, 622, 7, 94, 2, 2, 622, 624, 9, 11, 2, 2, 623, 620, 3, 2, 2, 2, 623, 621, 3, 2, 2, 2, 624, 627, 3, 2, 2, 2, 625, 623, 3, 2, 2, 2, 625, 626, 3, 2, 2, 2, 626, 628, 3, 2, 2, 2, 627, 625, 3, 2, 2, 2, 628, 629, 7, 36, 2, 2, 629, 165, 3, 2, 2, 2, 630, 631, 5, 20, 5, 2, 631, 167, 3, 2, 2, 2, 632, 633, 7, 127, 2, 2, 633, 634, 3, 2, 2, 2, 634, 635, 8, 79, 9, 2, 635, 169, 3, 2, 2, 2, 636, 637, 7, 64, 2, 2, 637, 638, 7, 64, 2, 2, 638, 639, 3, 2, 2, 2, 639, 640, 8, 80, 23, 2, 640, 641, 8, 80, 9, 2, 641, 642, 8, 80, 9, 2, 642, 171, 3, 2, 2, 2, 643, 644, 7, 38, 2, 2, 644, 645, 5, 20, 5, 2, 645, 173, 3, 2, 2, 2, 646, 647, 7, 48, 2, 2, 647, 175, 3, 2, 2, 2, 648, 654, 5, 178, 84, 2, 649, 650, 5, 178, 84, 2, 650, 651, 7, 48, 2, 2, 651, 652, 5, 178, 84, 2, 652, 654, 3, 2, 2, 2, 653, 648, 3, 2, 2, 2, 653, 649, 3, 2, 2, 2, 654, 177, 3, 2, 2, 2, 655, 657, 5, 180, 85, 2, 656, 655, 3, 2, 2, 2, 657, 658, 3, 2, 2, 2, 658, 656, 3, 2, 2, 2, 658, 659, 3, 2, 2, 2, 659, 179, 3, 2, 2, 2, 660, 661, 9, 12, 2, 2, 661, 181, 3, 2, 2, 2, 662, 663, 5, 18, 4, 2, 663, 183, 3, 2, 2, 2, 664, 665, 5, 14, 2, 2, 665, 666, 3, 2, 2, 2, 666, 667, 8, 87, 2, 2, 667, 185, 3, 2, 2, 2, 668, 669, 7, 107, 2, 2, 669, 670, 7, 104, 2, 2, 670, 671, 3, 2, 2, 2, 671, 672, 9, 13, 2, 2, 672, 673, 3, 2, 2, 2, 673, 674, 8, 88, 15, 2, 674, 187, 3, 2, 2, 2, 675, 676, 7, 103, 2, 2, 676, 677, 7, 110, 2, 2, 677, 678, 7, 117, 2, 2, 678, 679, 7, 103, 2, 2, 679, 680, 7, 107, 2, 2, 680, 681, 7, 104, 2, 2, 681, 682, 3, 2, 2, 2, 682, 683, 9, 13, 2, 2, 683, 684, 3, 2, 2, 2, 684, 685, 8, 89, 15, 2, 685, 189, 3, 2, 2, 2, 686, 687, 7, 103, 2, 2, 687, 688, 7, 110, 2, 2, 688, 689, 7, 117, 2, 2, 689, 690, 7, 103, 2, 2, 690, 692, 3, 2, 2, 2, 691, 693, 9, 13, 2, 2, 692, 691, 3, 2, 2, 2, 692, 693, 3, 2, 2, 2, 693, 191, 3, 2, 2, 2, 694, 695, 7, 117, 2, 2, 695, 696, 7, 103, 2, 2, 696, 697, 7, 118, 2, 2, 697, 698, 3, 2, 2, 2, 698, 699, 9, 13, 2, 2, 699, 700, 3, 2, 2, 2, 700, 701, 8, 91, 15, 2, 701, 193, 3, 2, 2, 2, 702, 703, 7, 103, 2, 2, 703, 704, 7, 112, 2, 2, 704, 705, 7, 102, 2, 2, 705, 706, 7, 107, 2, 2, 706, 707, 7, 104, 2, 2, 707, 195, 3, 2, 2, 2, 708, 709, 7, 101, 2, 2, 709, 710, 7, 99, 2, 2, 710, 711, 7, 110, 2, 2, 711, 712, 7, 110, 2, 2, 712, 713, 3, 2, 2, 2, 713, 714, 9, 13, 2, 2, 714, 715, 3, 2, 2, 2, 715, 716, 8, 93, 15, 2, 716, 197, 3, 2, 2, 2, 717, 718, 7, 102, 2, 2, 718, 719, 7, 103, 2, 2, 719, 720, 7, 101, 2, 2, 720, 721, 7, 110, 2, 2, 721, 722, 7, 99, 2, 2, 722, 723, 7, 116, 2, 2, 723, 724, 7, 103, 2, 2, 724, 725, 3, 2, 2, 2, 725, 726, 9, 13, 2, 2, 726, 727, 3, 2, 2, 2, 727, 728, 8, 94, 15, 2, 728, 199, 3, 2, 2, 2, 729, 730, 7, 108, 2, 2, 730, 731, 7, 119, 2, 2, 731, 732, 7, 111, 2, 2, 732, 733, 7, 114, 2, 2, 733, 734, 3, 2, 2, 2, 734, 735, 9, 13, 2, 2, 735, 736, 3, 2, 2, 2, 736, 737, 8, 95, 24, 2, 737, 201, 3, 2, 2, 2, 738, 739, 7, 103, 2, 2, 739, 740, 7, 112, 2, 2, 740, 741, 7, 119, 2, 2, 741, 742, 7, 111, 2, 2, 742, 743, 3, 2, 2, 2, 743, 744, 9, 13, 2, 2, 744, 745, 3, 2, 2, 2, 745, 746, 8, 96, 25, 2, 746, 203, 3, 2, 2, 2, 747, 748, 7, 101, 2, 2, 748, 749, 7, 99, 2, 2, 749, 750, 7, 117, 2, 2, 750, 751, 7, 103, 2, 2, 751, 752, 3, 2, 2, 2, 752, 753, 9, 13, 2, 2, 753, 754, 3, 2, 2, 2, 754, 755, 8, 97, 25, 2, 755, 205, 3, 2, 2, 2, 756, 757, 7, 103, 2, 2, 757, 758, 7, 112, 2, 2, 758, 759, 7, 102, 2, 2, 759, 760, 7, 103, 2, 2, 760, 761, 7, 112, 2, 2, 761, 762, 7, 119, 2, 2, 762, 763, 7, 111, 2, 2, 763, 765, 3, 2, 2, 2, 764, 766, 9, 13, 2, 2, 765, 764, 3, 2, 2, 2, 765, 766, 3, 2, 2, 2, 766, 207, 3, 2, 2, 2, 767, 768, 7, 110, 2, 2, 768, 769, 7, 113, 2, 2, 769, 770, 7, 101, 2, 2, 770, 771, 7, 99, 2, 2, 771, 772, 7, 110, 2, 2, 772, 773, 3, 2, 2, 2, 773, 774, 9, 13, 2, 2, 774, 209, 3, 2, 2, 2, 775, 776, 7, 64, 2, 2, 776, 777, 7, 64, 2, 2, 777, 778, 3, 2, 2, 2, 778, 779, 8, 100, 9, 2, 779, 211, 3, 2, 2, 2, 780, 781, 7, 125, 2, 2, 781, 782, 3, 2, 2, 2, 782, 783, 8, 101, 26, 2, 783, 784, 8, 101, 27, 2, 784, 785, 8, 101, 15, 2, 785, 213, 3, 2, 2, 2, 786, 787, 11, 2, 2, 2, 787, 788, 3, 2, 2, 2, 788, 789, 8, 102, 28, 2, 789, 790, 8, 102, 27, 2, 790, 215, 3, 2, 2, 2, 791, 792, 5, 18, 4, 2, 792, 217, 3, 2, 2, 2, 793, 794, 7, 64, 2, 2, 794, 795, 7, 64, 2, 2, 795, 796, 3, 2, 2, 2, 796, 797, 8, 104, 9, 2, 797, 219, 3, 2, 2, 2, 798, 799, 7, 125, 2, 2, 799, 800, 3, 2, 2, 2, 800, 801, 8, 105, 15, 2, 801, 221, 3, 2, 2, 2, 802, 804, 10, 14, 2, 2, 803, 802, 3, 2, 2, 2, 804, 805, 3, 2, 2, 2, 805, 803, 3, 2, 2, 2, 805, 806, 3, 2, 2, 2, 806, 223, 3, 2, 2, 2, 807, 808, 5, 18, 4, 2, 808, 225, 3, 2, 2, 2, 809, 810, 5, 20, 5, 2, 810, 811, 3, 2, 2, 2, 811, 812, 8, 108, 29, 2, 812, 813, 8, 108, 9, 2, 813, 227, 3, 2, 2, 2, 814, 815, 7, 64, 2, 2, 815, 816, 7, 64, 2, 2, 816, 817, 3, 2, 2, 2, 817, 818, 8, 109, 23, 2, 818, 819, 8, 109, 9, 2, 819, 229, 3, 2, 2, 2, 820, 821, 5, 20, 5, 2, 821, 822, 3, 2, 2, 2, 822, 823, 8, 110, 29, 2, 823, 824, 8, 110, 9, 2, 824, 231, 3, 2, 2, 2, 825, 826, 5, 52, 21, 2, 826, 827, 3, 2, 2, 2, 827, 828, 8, 111, 20, 2, 828, 829, 8, 111, 30, 2, 829, 233, 3, 2, 2, 2, 830, 831, 7, 64, 2, 2, 831, 832, 7, 64, 2, 2, 832, 833, 3, 2, 2, 2, 833, 834, 8, 112, 23, 2, 834, 835, 8, 112, 9, 2, 835, 235, 3, 2, 2, 2, 47, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 239, 249, 255, 259, 264, 271, 274, 278, 283, 295, 307, 380, 414, 417, 467, 494, 501, 508, 516, 521, 526, 533, 540, 546, 552, 558, 623, 625, 653, 658, 692, 765, 805, 31, 2, 3, 2, 2, 5, 2, 2, 4, 2, 7, 4, 2, 7, 3, 2, 7, 8, 2, 9, 8, 2, 6, 2, 2, 9, 7, 2, 7, 10, 2, 9, 12, 2, 7, 7, 2, 7, 5, 2, 7, 9, 2, 9, 22, 2, 7, 6, 2, 8, 2, 2, 4, 7, 2, 9, 18, 2, 9, 17, 2, 9, 59, 2, 9, 78, 2, 7, 13, 2, 7, 12, 2, 9, 81, 2, 4, 11, 2, 9, 82, 2, 9, 9, 2, 4, 9, 2] \ No newline at end of file +[4, 0, 84, 834, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, 2, 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, 7, 72, 2, 73, 7, 73, 2, 74, 7, 74, 2, 75, 7, 75, 2, 76, 7, 76, 2, 77, 7, 77, 2, 78, 7, 78, 2, 79, 7, 79, 2, 80, 7, 80, 2, 81, 7, 81, 2, 82, 7, 82, 2, 83, 7, 83, 2, 84, 7, 84, 2, 85, 7, 85, 2, 86, 7, 86, 2, 87, 7, 87, 2, 88, 7, 88, 2, 89, 7, 89, 2, 90, 7, 90, 2, 91, 7, 91, 2, 92, 7, 92, 2, 93, 7, 93, 2, 94, 7, 94, 2, 95, 7, 95, 2, 96, 7, 96, 2, 97, 7, 97, 2, 98, 7, 98, 2, 99, 7, 99, 2, 100, 7, 100, 2, 101, 7, 101, 2, 102, 7, 102, 2, 103, 7, 103, 2, 104, 7, 104, 2, 105, 7, 105, 2, 106, 7, 106, 2, 107, 7, 107, 2, 108, 7, 108, 2, 109, 7, 109, 2, 110, 7, 110, 1, 0, 4, 0, 236, 8, 0, 11, 0, 12, 0, 237, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 246, 8, 1, 10, 1, 12, 1, 249, 9, 1, 1, 1, 1, 1, 1, 2, 3, 2, 254, 8, 2, 1, 2, 1, 2, 3, 2, 258, 8, 2, 1, 2, 5, 2, 261, 8, 2, 10, 2, 12, 2, 264, 9, 2, 1, 2, 1, 2, 1, 3, 1, 3, 3, 3, 270, 8, 3, 1, 4, 3, 4, 273, 8, 4, 1, 5, 1, 5, 3, 5, 277, 8, 5, 1, 6, 4, 6, 280, 8, 6, 11, 6, 12, 6, 281, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 5, 8, 292, 8, 8, 10, 8, 12, 8, 295, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 4, 10, 304, 8, 10, 11, 10, 12, 10, 305, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 3, 24, 379, 8, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 4, 30, 411, 8, 30, 11, 30, 12, 30, 412, 1, 30, 3, 30, 416, 8, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 4, 42, 464, 8, 42, 11, 42, 12, 42, 465, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, 47, 3, 47, 493, 8, 47, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 500, 8, 48, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 3, 49, 507, 8, 49, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 3, 50, 515, 8, 50, 1, 51, 1, 51, 1, 51, 3, 51, 520, 8, 51, 1, 52, 1, 52, 1, 52, 3, 52, 525, 8, 52, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 3, 53, 532, 8, 53, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 539, 8, 54, 1, 55, 1, 55, 1, 55, 1, 55, 3, 55, 545, 8, 55, 1, 56, 1, 56, 1, 56, 1, 56, 3, 56, 551, 8, 56, 1, 57, 1, 57, 1, 57, 1, 57, 3, 57, 557, 8, 57, 1, 58, 1, 58, 1, 58, 1, 59, 1, 59, 1, 59, 1, 60, 1, 60, 1, 60, 1, 61, 1, 61, 1, 61, 1, 62, 1, 62, 1, 62, 1, 63, 1, 63, 1, 64, 1, 64, 1, 65, 1, 65, 1, 66, 1, 66, 1, 67, 1, 67, 1, 68, 1, 68, 1, 69, 1, 69, 1, 70, 1, 70, 1, 71, 1, 71, 1, 71, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 73, 1, 73, 1, 73, 1, 73, 1, 73, 1, 73, 1, 73, 1, 73, 1, 73, 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 75, 1, 75, 1, 75, 1, 75, 5, 75, 622, 8, 75, 10, 75, 12, 75, 625, 9, 75, 1, 75, 1, 75, 1, 76, 1, 76, 1, 77, 1, 77, 1, 77, 1, 77, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 79, 1, 79, 1, 79, 1, 80, 1, 80, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 3, 81, 652, 8, 81, 1, 82, 4, 82, 655, 8, 82, 11, 82, 12, 82, 656, 1, 83, 1, 83, 1, 84, 1, 84, 1, 85, 1, 85, 1, 85, 1, 85, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, 3, 88, 691, 8, 88, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 3, 96, 764, 8, 96, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 101, 1, 101, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 103, 1, 103, 1, 103, 1, 103, 1, 104, 4, 104, 802, 8, 104, 11, 104, 12, 104, 803, 1, 105, 1, 105, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 108, 1, 108, 1, 108, 1, 108, 1, 108, 1, 109, 1, 109, 1, 109, 1, 109, 1, 109, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 0, 0, 111, 12, 4, 14, 5, 16, 6, 18, 7, 20, 0, 22, 0, 24, 0, 26, 8, 28, 9, 30, 10, 32, 11, 34, 0, 36, 12, 38, 0, 40, 0, 42, 13, 44, 14, 46, 15, 48, 0, 50, 16, 52, 0, 54, 17, 56, 0, 58, 0, 60, 0, 62, 18, 64, 0, 66, 0, 68, 0, 70, 19, 72, 20, 74, 0, 76, 0, 78, 21, 80, 22, 82, 23, 84, 0, 86, 0, 88, 0, 90, 24, 92, 25, 94, 0, 96, 26, 98, 27, 100, 28, 102, 29, 104, 30, 106, 31, 108, 32, 110, 33, 112, 34, 114, 35, 116, 36, 118, 37, 120, 38, 122, 39, 124, 40, 126, 41, 128, 42, 130, 43, 132, 44, 134, 45, 136, 46, 138, 47, 140, 48, 142, 49, 144, 50, 146, 51, 148, 52, 150, 53, 152, 54, 154, 55, 156, 82, 158, 83, 160, 84, 162, 56, 164, 57, 166, 58, 168, 0, 170, 59, 172, 60, 174, 61, 176, 0, 178, 0, 180, 62, 182, 63, 184, 64, 186, 65, 188, 66, 190, 67, 192, 68, 194, 69, 196, 70, 198, 71, 200, 72, 202, 73, 204, 74, 206, 75, 208, 76, 210, 0, 212, 0, 214, 77, 216, 78, 218, 79, 220, 80, 222, 81, 224, 0, 226, 0, 228, 0, 230, 0, 232, 0, 12, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 14, 2, 0, 9, 9, 32, 32, 2, 0, 10, 10, 13, 13, 49, 0, 65, 90, 95, 95, 97, 122, 168, 168, 170, 170, 173, 173, 175, 175, 178, 181, 183, 186, 188, 190, 192, 214, 216, 246, 248, 767, 880, 5759, 5761, 6157, 6159, 7615, 7680, 8191, 8203, 8205, 8234, 8238, 8255, 8256, 8276, 8276, 8288, 8399, 8448, 8591, 9312, 9471, 10102, 10131, 11264, 11775, 11904, 12287, 12292, 12295, 12321, 12335, 12337, 55295, 63744, 64829, 64832, 64975, 65008, 65055, 65072, 65092, 65095, 65533, 65536, 131069, 131072, 196605, 196608, 262141, 262144, 327677, 327680, 393213, 393216, 458749, 458752, 524285, 524288, 589821, 589824, 655357, 655360, 720893, 720896, 786429, 786432, 851965, 851968, 917501, 917504, 983037, 5, 0, 48, 57, 768, 879, 7616, 7679, 8400, 8447, 65056, 65071, 1, 0, 32, 32, 2, 0, 47, 47, 60, 60, 7, 0, 10, 10, 13, 13, 35, 35, 47, 47, 60, 60, 92, 92, 123, 123, 7, 0, 35, 35, 47, 47, 60, 60, 62, 62, 92, 92, 123, 123, 125, 125, 5, 0, 9, 10, 13, 13, 32, 32, 35, 36, 60, 60, 4, 0, 10, 10, 13, 13, 34, 34, 92, 92, 2, 0, 34, 34, 92, 92, 1, 0, 48, 57, 10, 0, 9, 13, 32, 32, 133, 133, 160, 160, 5760, 5760, 8192, 8202, 8232, 8233, 8239, 8239, 8287, 8287, 12288, 12288, 4, 0, 10, 10, 13, 13, 62, 62, 123, 123, 849, 0, 12, 1, 0, 0, 0, 0, 14, 1, 0, 0, 0, 0, 16, 1, 0, 0, 0, 0, 18, 1, 0, 0, 0, 0, 26, 1, 0, 0, 0, 0, 28, 1, 0, 0, 0, 0, 30, 1, 0, 0, 0, 1, 32, 1, 0, 0, 0, 1, 34, 1, 0, 0, 0, 2, 36, 1, 0, 0, 0, 2, 38, 1, 0, 0, 0, 2, 40, 1, 0, 0, 0, 2, 42, 1, 0, 0, 0, 2, 44, 1, 0, 0, 0, 2, 46, 1, 0, 0, 0, 2, 48, 1, 0, 0, 0, 2, 50, 1, 0, 0, 0, 2, 52, 1, 0, 0, 0, 2, 54, 1, 0, 0, 0, 2, 56, 1, 0, 0, 0, 3, 58, 1, 0, 0, 0, 3, 60, 1, 0, 0, 0, 3, 62, 1, 0, 0, 0, 3, 64, 1, 0, 0, 0, 3, 66, 1, 0, 0, 0, 3, 68, 1, 0, 0, 0, 3, 70, 1, 0, 0, 0, 3, 72, 1, 0, 0, 0, 4, 76, 1, 0, 0, 0, 4, 78, 1, 0, 0, 0, 5, 80, 1, 0, 0, 0, 5, 82, 1, 0, 0, 0, 5, 84, 1, 0, 0, 0, 5, 86, 1, 0, 0, 0, 5, 88, 1, 0, 0, 0, 5, 90, 1, 0, 0, 0, 6, 92, 1, 0, 0, 0, 6, 94, 1, 0, 0, 0, 6, 96, 1, 0, 0, 0, 7, 98, 1, 0, 0, 0, 7, 100, 1, 0, 0, 0, 7, 102, 1, 0, 0, 0, 7, 104, 1, 0, 0, 0, 7, 106, 1, 0, 0, 0, 7, 108, 1, 0, 0, 0, 7, 110, 1, 0, 0, 0, 7, 112, 1, 0, 0, 0, 7, 114, 1, 0, 0, 0, 7, 116, 1, 0, 0, 0, 7, 118, 1, 0, 0, 0, 7, 120, 1, 0, 0, 0, 7, 122, 1, 0, 0, 0, 7, 124, 1, 0, 0, 0, 7, 126, 1, 0, 0, 0, 7, 128, 1, 0, 0, 0, 7, 130, 1, 0, 0, 0, 7, 132, 1, 0, 0, 0, 7, 134, 1, 0, 0, 0, 7, 136, 1, 0, 0, 0, 7, 138, 1, 0, 0, 0, 7, 140, 1, 0, 0, 0, 7, 142, 1, 0, 0, 0, 7, 144, 1, 0, 0, 0, 7, 146, 1, 0, 0, 0, 7, 148, 1, 0, 0, 0, 7, 150, 1, 0, 0, 0, 7, 152, 1, 0, 0, 0, 7, 154, 1, 0, 0, 0, 7, 156, 1, 0, 0, 0, 7, 158, 1, 0, 0, 0, 7, 160, 1, 0, 0, 0, 7, 162, 1, 0, 0, 0, 7, 164, 1, 0, 0, 0, 7, 166, 1, 0, 0, 0, 7, 168, 1, 0, 0, 0, 7, 170, 1, 0, 0, 0, 7, 172, 1, 0, 0, 0, 7, 174, 1, 0, 0, 0, 8, 180, 1, 0, 0, 0, 8, 182, 1, 0, 0, 0, 8, 184, 1, 0, 0, 0, 8, 186, 1, 0, 0, 0, 8, 188, 1, 0, 0, 0, 8, 190, 1, 0, 0, 0, 8, 192, 1, 0, 0, 0, 8, 194, 1, 0, 0, 0, 8, 196, 1, 0, 0, 0, 8, 198, 1, 0, 0, 0, 8, 200, 1, 0, 0, 0, 8, 202, 1, 0, 0, 0, 8, 204, 1, 0, 0, 0, 8, 206, 1, 0, 0, 0, 8, 208, 1, 0, 0, 0, 8, 210, 1, 0, 0, 0, 8, 212, 1, 0, 0, 0, 9, 214, 1, 0, 0, 0, 9, 216, 1, 0, 0, 0, 9, 218, 1, 0, 0, 0, 9, 220, 1, 0, 0, 0, 10, 222, 1, 0, 0, 0, 10, 224, 1, 0, 0, 0, 10, 226, 1, 0, 0, 0, 11, 228, 1, 0, 0, 0, 11, 230, 1, 0, 0, 0, 11, 232, 1, 0, 0, 0, 12, 235, 1, 0, 0, 0, 14, 241, 1, 0, 0, 0, 16, 257, 1, 0, 0, 0, 18, 267, 1, 0, 0, 0, 20, 272, 1, 0, 0, 0, 22, 276, 1, 0, 0, 0, 24, 279, 1, 0, 0, 0, 26, 283, 1, 0, 0, 0, 28, 289, 1, 0, 0, 0, 30, 298, 1, 0, 0, 0, 32, 303, 1, 0, 0, 0, 34, 307, 1, 0, 0, 0, 36, 313, 1, 0, 0, 0, 38, 317, 1, 0, 0, 0, 40, 322, 1, 0, 0, 0, 42, 327, 1, 0, 0, 0, 44, 333, 1, 0, 0, 0, 46, 336, 1, 0, 0, 0, 48, 341, 1, 0, 0, 0, 50, 347, 1, 0, 0, 0, 52, 352, 1, 0, 0, 0, 54, 358, 1, 0, 0, 0, 56, 364, 1, 0, 0, 0, 58, 369, 1, 0, 0, 0, 60, 378, 1, 0, 0, 0, 62, 382, 1, 0, 0, 0, 64, 387, 1, 0, 0, 0, 66, 393, 1, 0, 0, 0, 68, 398, 1, 0, 0, 0, 70, 405, 1, 0, 0, 0, 72, 415, 1, 0, 0, 0, 74, 417, 1, 0, 0, 0, 76, 419, 1, 0, 0, 0, 78, 424, 1, 0, 0, 0, 80, 428, 1, 0, 0, 0, 82, 432, 1, 0, 0, 0, 84, 436, 1, 0, 0, 0, 86, 442, 1, 0, 0, 0, 88, 447, 1, 0, 0, 0, 90, 452, 1, 0, 0, 0, 92, 454, 1, 0, 0, 0, 94, 458, 1, 0, 0, 0, 96, 463, 1, 0, 0, 0, 98, 469, 1, 0, 0, 0, 100, 473, 1, 0, 0, 0, 102, 478, 1, 0, 0, 0, 104, 484, 1, 0, 0, 0, 106, 492, 1, 0, 0, 0, 108, 499, 1, 0, 0, 0, 110, 506, 1, 0, 0, 0, 112, 514, 1, 0, 0, 0, 114, 519, 1, 0, 0, 0, 116, 524, 1, 0, 0, 0, 118, 531, 1, 0, 0, 0, 120, 538, 1, 0, 0, 0, 122, 544, 1, 0, 0, 0, 124, 550, 1, 0, 0, 0, 126, 556, 1, 0, 0, 0, 128, 558, 1, 0, 0, 0, 130, 561, 1, 0, 0, 0, 132, 564, 1, 0, 0, 0, 134, 567, 1, 0, 0, 0, 136, 570, 1, 0, 0, 0, 138, 573, 1, 0, 0, 0, 140, 575, 1, 0, 0, 0, 142, 577, 1, 0, 0, 0, 144, 579, 1, 0, 0, 0, 146, 581, 1, 0, 0, 0, 148, 583, 1, 0, 0, 0, 150, 585, 1, 0, 0, 0, 152, 587, 1, 0, 0, 0, 154, 589, 1, 0, 0, 0, 156, 592, 1, 0, 0, 0, 158, 601, 1, 0, 0, 0, 160, 610, 1, 0, 0, 0, 162, 617, 1, 0, 0, 0, 164, 628, 1, 0, 0, 0, 166, 630, 1, 0, 0, 0, 168, 634, 1, 0, 0, 0, 170, 641, 1, 0, 0, 0, 172, 644, 1, 0, 0, 0, 174, 651, 1, 0, 0, 0, 176, 654, 1, 0, 0, 0, 178, 658, 1, 0, 0, 0, 180, 660, 1, 0, 0, 0, 182, 662, 1, 0, 0, 0, 184, 666, 1, 0, 0, 0, 186, 673, 1, 0, 0, 0, 188, 684, 1, 0, 0, 0, 190, 692, 1, 0, 0, 0, 192, 700, 1, 0, 0, 0, 194, 706, 1, 0, 0, 0, 196, 715, 1, 0, 0, 0, 198, 727, 1, 0, 0, 0, 200, 736, 1, 0, 0, 0, 202, 745, 1, 0, 0, 0, 204, 754, 1, 0, 0, 0, 206, 765, 1, 0, 0, 0, 208, 773, 1, 0, 0, 0, 210, 778, 1, 0, 0, 0, 212, 784, 1, 0, 0, 0, 214, 789, 1, 0, 0, 0, 216, 791, 1, 0, 0, 0, 218, 796, 1, 0, 0, 0, 220, 801, 1, 0, 0, 0, 222, 805, 1, 0, 0, 0, 224, 807, 1, 0, 0, 0, 226, 812, 1, 0, 0, 0, 228, 818, 1, 0, 0, 0, 230, 823, 1, 0, 0, 0, 232, 828, 1, 0, 0, 0, 234, 236, 7, 0, 0, 0, 235, 234, 1, 0, 0, 0, 236, 237, 1, 0, 0, 0, 237, 235, 1, 0, 0, 0, 237, 238, 1, 0, 0, 0, 238, 239, 1, 0, 0, 0, 239, 240, 6, 0, 0, 0, 240, 13, 1, 0, 0, 0, 241, 242, 5, 47, 0, 0, 242, 243, 5, 47, 0, 0, 243, 247, 1, 0, 0, 0, 244, 246, 8, 1, 0, 0, 245, 244, 1, 0, 0, 0, 246, 249, 1, 0, 0, 0, 247, 245, 1, 0, 0, 0, 247, 248, 1, 0, 0, 0, 248, 250, 1, 0, 0, 0, 249, 247, 1, 0, 0, 0, 250, 251, 6, 1, 1, 0, 251, 15, 1, 0, 0, 0, 252, 254, 5, 13, 0, 0, 253, 252, 1, 0, 0, 0, 253, 254, 1, 0, 0, 0, 254, 255, 1, 0, 0, 0, 255, 258, 5, 10, 0, 0, 256, 258, 5, 13, 0, 0, 257, 253, 1, 0, 0, 0, 257, 256, 1, 0, 0, 0, 258, 262, 1, 0, 0, 0, 259, 261, 7, 0, 0, 0, 260, 259, 1, 0, 0, 0, 261, 264, 1, 0, 0, 0, 262, 260, 1, 0, 0, 0, 262, 263, 1, 0, 0, 0, 263, 265, 1, 0, 0, 0, 264, 262, 1, 0, 0, 0, 265, 266, 6, 2, 2, 0, 266, 17, 1, 0, 0, 0, 267, 269, 3, 20, 4, 0, 268, 270, 3, 24, 6, 0, 269, 268, 1, 0, 0, 0, 269, 270, 1, 0, 0, 0, 270, 19, 1, 0, 0, 0, 271, 273, 7, 2, 0, 0, 272, 271, 1, 0, 0, 0, 273, 21, 1, 0, 0, 0, 274, 277, 7, 3, 0, 0, 275, 277, 3, 20, 4, 0, 276, 274, 1, 0, 0, 0, 276, 275, 1, 0, 0, 0, 277, 23, 1, 0, 0, 0, 278, 280, 3, 22, 5, 0, 279, 278, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, 281, 279, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 25, 1, 0, 0, 0, 283, 284, 5, 45, 0, 0, 284, 285, 5, 45, 0, 0, 285, 286, 5, 45, 0, 0, 286, 287, 1, 0, 0, 0, 287, 288, 6, 7, 3, 0, 288, 27, 1, 0, 0, 0, 289, 293, 5, 58, 0, 0, 290, 292, 7, 4, 0, 0, 291, 290, 1, 0, 0, 0, 292, 295, 1, 0, 0, 0, 293, 291, 1, 0, 0, 0, 293, 294, 1, 0, 0, 0, 294, 296, 1, 0, 0, 0, 295, 293, 1, 0, 0, 0, 296, 297, 6, 8, 4, 0, 297, 29, 1, 0, 0, 0, 298, 299, 5, 35, 0, 0, 299, 300, 1, 0, 0, 0, 300, 301, 6, 9, 5, 0, 301, 31, 1, 0, 0, 0, 302, 304, 8, 1, 0, 0, 303, 302, 1, 0, 0, 0, 304, 305, 1, 0, 0, 0, 305, 303, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 33, 1, 0, 0, 0, 307, 308, 3, 16, 2, 0, 308, 309, 1, 0, 0, 0, 309, 310, 6, 11, 6, 0, 310, 311, 6, 11, 2, 0, 311, 312, 6, 11, 7, 0, 312, 35, 1, 0, 0, 0, 313, 314, 3, 12, 0, 0, 314, 315, 1, 0, 0, 0, 315, 316, 6, 12, 0, 0, 316, 37, 1, 0, 0, 0, 317, 318, 3, 16, 2, 0, 318, 319, 1, 0, 0, 0, 319, 320, 6, 13, 6, 0, 320, 321, 6, 13, 2, 0, 321, 39, 1, 0, 0, 0, 322, 323, 3, 14, 1, 0, 323, 324, 1, 0, 0, 0, 324, 325, 6, 14, 8, 0, 325, 326, 6, 14, 1, 0, 326, 41, 1, 0, 0, 0, 327, 328, 5, 61, 0, 0, 328, 329, 5, 61, 0, 0, 329, 330, 5, 61, 0, 0, 330, 331, 1, 0, 0, 0, 331, 332, 6, 15, 7, 0, 332, 43, 1, 0, 0, 0, 333, 334, 5, 45, 0, 0, 334, 335, 5, 62, 0, 0, 335, 45, 1, 0, 0, 0, 336, 337, 5, 60, 0, 0, 337, 338, 5, 60, 0, 0, 338, 339, 1, 0, 0, 0, 339, 340, 6, 17, 9, 0, 340, 47, 1, 0, 0, 0, 341, 342, 5, 35, 0, 0, 342, 343, 1, 0, 0, 0, 343, 344, 6, 18, 10, 0, 344, 345, 6, 18, 11, 0, 345, 346, 6, 18, 5, 0, 346, 49, 1, 0, 0, 0, 347, 348, 5, 123, 0, 0, 348, 349, 1, 0, 0, 0, 349, 350, 6, 19, 12, 0, 350, 351, 6, 19, 13, 0, 351, 51, 1, 0, 0, 0, 352, 353, 5, 92, 0, 0, 353, 354, 5, 91, 0, 0, 354, 355, 1, 0, 0, 0, 355, 356, 6, 20, 14, 0, 356, 357, 6, 20, 12, 0, 357, 53, 1, 0, 0, 0, 358, 359, 5, 92, 0, 0, 359, 360, 1, 0, 0, 0, 360, 361, 6, 21, 0, 0, 361, 362, 6, 21, 12, 0, 362, 363, 6, 21, 15, 0, 363, 55, 1, 0, 0, 0, 364, 365, 9, 0, 0, 0, 365, 366, 1, 0, 0, 0, 366, 367, 6, 22, 14, 0, 367, 368, 6, 22, 12, 0, 368, 57, 1, 0, 0, 0, 369, 370, 3, 16, 2, 0, 370, 371, 1, 0, 0, 0, 371, 372, 6, 23, 6, 0, 372, 373, 6, 23, 7, 0, 373, 59, 1, 0, 0, 0, 374, 375, 5, 92, 0, 0, 375, 379, 5, 91, 0, 0, 376, 377, 5, 92, 0, 0, 377, 379, 5, 93, 0, 0, 378, 374, 1, 0, 0, 0, 378, 376, 1, 0, 0, 0, 379, 380, 1, 0, 0, 0, 380, 381, 6, 24, 14, 0, 381, 61, 1, 0, 0, 0, 382, 383, 5, 92, 0, 0, 383, 384, 1, 0, 0, 0, 384, 385, 6, 25, 16, 0, 385, 386, 6, 25, 15, 0, 386, 63, 1, 0, 0, 0, 387, 388, 3, 30, 9, 0, 388, 389, 1, 0, 0, 0, 389, 390, 6, 26, 10, 0, 390, 391, 6, 26, 17, 0, 391, 392, 6, 26, 5, 0, 392, 65, 1, 0, 0, 0, 393, 394, 5, 123, 0, 0, 394, 395, 1, 0, 0, 0, 395, 396, 6, 27, 18, 0, 396, 397, 6, 27, 13, 0, 397, 67, 1, 0, 0, 0, 398, 399, 5, 60, 0, 0, 399, 400, 5, 60, 0, 0, 400, 401, 1, 0, 0, 0, 401, 402, 6, 28, 19, 0, 402, 403, 6, 28, 17, 0, 403, 404, 6, 28, 9, 0, 404, 69, 1, 0, 0, 0, 405, 406, 3, 14, 1, 0, 406, 407, 1, 0, 0, 0, 407, 408, 6, 29, 1, 0, 408, 71, 1, 0, 0, 0, 409, 411, 3, 74, 31, 0, 410, 409, 1, 0, 0, 0, 411, 412, 1, 0, 0, 0, 412, 410, 1, 0, 0, 0, 412, 413, 1, 0, 0, 0, 413, 416, 1, 0, 0, 0, 414, 416, 7, 5, 0, 0, 415, 410, 1, 0, 0, 0, 415, 414, 1, 0, 0, 0, 416, 73, 1, 0, 0, 0, 417, 418, 8, 6, 0, 0, 418, 75, 1, 0, 0, 0, 419, 420, 7, 7, 0, 0, 420, 421, 1, 0, 0, 0, 421, 422, 6, 32, 14, 0, 422, 423, 6, 32, 7, 0, 423, 77, 1, 0, 0, 0, 424, 425, 9, 0, 0, 0, 425, 426, 1, 0, 0, 0, 426, 427, 6, 33, 7, 0, 427, 79, 1, 0, 0, 0, 428, 429, 3, 12, 0, 0, 429, 430, 1, 0, 0, 0, 430, 431, 6, 34, 0, 0, 431, 81, 1, 0, 0, 0, 432, 433, 3, 14, 1, 0, 433, 434, 1, 0, 0, 0, 434, 435, 6, 35, 1, 0, 435, 83, 1, 0, 0, 0, 436, 437, 5, 60, 0, 0, 437, 438, 5, 60, 0, 0, 438, 439, 1, 0, 0, 0, 439, 440, 6, 36, 19, 0, 440, 441, 6, 36, 9, 0, 441, 85, 1, 0, 0, 0, 442, 443, 5, 35, 0, 0, 443, 444, 1, 0, 0, 0, 444, 445, 6, 37, 10, 0, 445, 446, 6, 37, 5, 0, 446, 87, 1, 0, 0, 0, 447, 448, 3, 16, 2, 0, 448, 449, 1, 0, 0, 0, 449, 450, 6, 38, 6, 0, 450, 451, 6, 38, 7, 0, 451, 89, 1, 0, 0, 0, 452, 453, 9, 0, 0, 0, 453, 91, 1, 0, 0, 0, 454, 455, 3, 12, 0, 0, 455, 456, 1, 0, 0, 0, 456, 457, 6, 40, 0, 0, 457, 93, 1, 0, 0, 0, 458, 459, 3, 30, 9, 0, 459, 460, 1, 0, 0, 0, 460, 461, 6, 41, 10, 0, 461, 95, 1, 0, 0, 0, 462, 464, 8, 8, 0, 0, 463, 462, 1, 0, 0, 0, 464, 465, 1, 0, 0, 0, 465, 463, 1, 0, 0, 0, 465, 466, 1, 0, 0, 0, 466, 467, 1, 0, 0, 0, 467, 468, 6, 42, 7, 0, 468, 97, 1, 0, 0, 0, 469, 470, 3, 12, 0, 0, 470, 471, 1, 0, 0, 0, 471, 472, 6, 43, 0, 0, 472, 99, 1, 0, 0, 0, 473, 474, 5, 116, 0, 0, 474, 475, 5, 114, 0, 0, 475, 476, 5, 117, 0, 0, 476, 477, 5, 101, 0, 0, 477, 101, 1, 0, 0, 0, 478, 479, 5, 102, 0, 0, 479, 480, 5, 97, 0, 0, 480, 481, 5, 108, 0, 0, 481, 482, 5, 115, 0, 0, 482, 483, 5, 101, 0, 0, 483, 103, 1, 0, 0, 0, 484, 485, 5, 110, 0, 0, 485, 486, 5, 117, 0, 0, 486, 487, 5, 108, 0, 0, 487, 488, 5, 108, 0, 0, 488, 105, 1, 0, 0, 0, 489, 493, 5, 61, 0, 0, 490, 491, 5, 116, 0, 0, 491, 493, 5, 111, 0, 0, 492, 489, 1, 0, 0, 0, 492, 490, 1, 0, 0, 0, 493, 107, 1, 0, 0, 0, 494, 495, 5, 60, 0, 0, 495, 500, 5, 61, 0, 0, 496, 497, 5, 108, 0, 0, 497, 498, 5, 116, 0, 0, 498, 500, 5, 101, 0, 0, 499, 494, 1, 0, 0, 0, 499, 496, 1, 0, 0, 0, 500, 109, 1, 0, 0, 0, 501, 502, 5, 62, 0, 0, 502, 507, 5, 61, 0, 0, 503, 504, 5, 103, 0, 0, 504, 505, 5, 116, 0, 0, 505, 507, 5, 101, 0, 0, 506, 501, 1, 0, 0, 0, 506, 503, 1, 0, 0, 0, 507, 111, 1, 0, 0, 0, 508, 509, 5, 61, 0, 0, 509, 515, 5, 61, 0, 0, 510, 511, 5, 105, 0, 0, 511, 515, 5, 115, 0, 0, 512, 513, 5, 101, 0, 0, 513, 515, 5, 113, 0, 0, 514, 508, 1, 0, 0, 0, 514, 510, 1, 0, 0, 0, 514, 512, 1, 0, 0, 0, 515, 113, 1, 0, 0, 0, 516, 520, 5, 60, 0, 0, 517, 518, 5, 108, 0, 0, 518, 520, 5, 116, 0, 0, 519, 516, 1, 0, 0, 0, 519, 517, 1, 0, 0, 0, 520, 115, 1, 0, 0, 0, 521, 525, 5, 62, 0, 0, 522, 523, 5, 103, 0, 0, 523, 525, 5, 116, 0, 0, 524, 521, 1, 0, 0, 0, 524, 522, 1, 0, 0, 0, 525, 117, 1, 0, 0, 0, 526, 527, 5, 33, 0, 0, 527, 532, 5, 61, 0, 0, 528, 529, 5, 110, 0, 0, 529, 530, 5, 101, 0, 0, 530, 532, 5, 113, 0, 0, 531, 526, 1, 0, 0, 0, 531, 528, 1, 0, 0, 0, 532, 119, 1, 0, 0, 0, 533, 534, 5, 97, 0, 0, 534, 535, 5, 110, 0, 0, 535, 539, 5, 100, 0, 0, 536, 537, 5, 38, 0, 0, 537, 539, 5, 38, 0, 0, 538, 533, 1, 0, 0, 0, 538, 536, 1, 0, 0, 0, 539, 121, 1, 0, 0, 0, 540, 541, 5, 111, 0, 0, 541, 545, 5, 114, 0, 0, 542, 543, 5, 124, 0, 0, 543, 545, 5, 124, 0, 0, 544, 540, 1, 0, 0, 0, 544, 542, 1, 0, 0, 0, 545, 123, 1, 0, 0, 0, 546, 547, 5, 120, 0, 0, 547, 548, 5, 111, 0, 0, 548, 551, 5, 114, 0, 0, 549, 551, 5, 94, 0, 0, 550, 546, 1, 0, 0, 0, 550, 549, 1, 0, 0, 0, 551, 125, 1, 0, 0, 0, 552, 553, 5, 110, 0, 0, 553, 554, 5, 111, 0, 0, 554, 557, 5, 116, 0, 0, 555, 557, 5, 33, 0, 0, 556, 552, 1, 0, 0, 0, 556, 555, 1, 0, 0, 0, 557, 127, 1, 0, 0, 0, 558, 559, 5, 43, 0, 0, 559, 560, 5, 61, 0, 0, 560, 129, 1, 0, 0, 0, 561, 562, 5, 45, 0, 0, 562, 563, 5, 61, 0, 0, 563, 131, 1, 0, 0, 0, 564, 565, 5, 42, 0, 0, 565, 566, 5, 61, 0, 0, 566, 133, 1, 0, 0, 0, 567, 568, 5, 37, 0, 0, 568, 569, 5, 61, 0, 0, 569, 135, 1, 0, 0, 0, 570, 571, 5, 47, 0, 0, 571, 572, 5, 61, 0, 0, 572, 137, 1, 0, 0, 0, 573, 574, 5, 43, 0, 0, 574, 139, 1, 0, 0, 0, 575, 576, 5, 45, 0, 0, 576, 141, 1, 0, 0, 0, 577, 578, 5, 42, 0, 0, 578, 143, 1, 0, 0, 0, 579, 580, 5, 47, 0, 0, 580, 145, 1, 0, 0, 0, 581, 582, 5, 37, 0, 0, 582, 147, 1, 0, 0, 0, 583, 584, 5, 40, 0, 0, 584, 149, 1, 0, 0, 0, 585, 586, 5, 41, 0, 0, 586, 151, 1, 0, 0, 0, 587, 588, 5, 44, 0, 0, 588, 153, 1, 0, 0, 0, 589, 590, 5, 97, 0, 0, 590, 591, 5, 115, 0, 0, 591, 155, 1, 0, 0, 0, 592, 593, 5, 115, 0, 0, 593, 594, 5, 116, 0, 0, 594, 595, 5, 114, 0, 0, 595, 596, 5, 105, 0, 0, 596, 597, 5, 110, 0, 0, 597, 598, 5, 103, 0, 0, 598, 599, 1, 0, 0, 0, 599, 600, 6, 72, 20, 0, 600, 157, 1, 0, 0, 0, 601, 602, 5, 110, 0, 0, 602, 603, 5, 117, 0, 0, 603, 604, 5, 109, 0, 0, 604, 605, 5, 98, 0, 0, 605, 606, 5, 101, 0, 0, 606, 607, 5, 114, 0, 0, 607, 608, 1, 0, 0, 0, 608, 609, 6, 73, 20, 0, 609, 159, 1, 0, 0, 0, 610, 611, 5, 98, 0, 0, 611, 612, 5, 111, 0, 0, 612, 613, 5, 111, 0, 0, 613, 614, 5, 108, 0, 0, 614, 615, 1, 0, 0, 0, 615, 616, 6, 74, 20, 0, 616, 161, 1, 0, 0, 0, 617, 623, 5, 34, 0, 0, 618, 622, 8, 9, 0, 0, 619, 620, 5, 92, 0, 0, 620, 622, 7, 10, 0, 0, 621, 618, 1, 0, 0, 0, 621, 619, 1, 0, 0, 0, 622, 625, 1, 0, 0, 0, 623, 621, 1, 0, 0, 0, 623, 624, 1, 0, 0, 0, 624, 626, 1, 0, 0, 0, 625, 623, 1, 0, 0, 0, 626, 627, 5, 34, 0, 0, 627, 163, 1, 0, 0, 0, 628, 629, 3, 18, 3, 0, 629, 165, 1, 0, 0, 0, 630, 631, 5, 125, 0, 0, 631, 632, 1, 0, 0, 0, 632, 633, 6, 77, 7, 0, 633, 167, 1, 0, 0, 0, 634, 635, 5, 62, 0, 0, 635, 636, 5, 62, 0, 0, 636, 637, 1, 0, 0, 0, 637, 638, 6, 78, 21, 0, 638, 639, 6, 78, 7, 0, 639, 640, 6, 78, 7, 0, 640, 169, 1, 0, 0, 0, 641, 642, 5, 36, 0, 0, 642, 643, 3, 18, 3, 0, 643, 171, 1, 0, 0, 0, 644, 645, 5, 46, 0, 0, 645, 173, 1, 0, 0, 0, 646, 652, 3, 176, 82, 0, 647, 648, 3, 176, 82, 0, 648, 649, 5, 46, 0, 0, 649, 650, 3, 176, 82, 0, 650, 652, 1, 0, 0, 0, 651, 646, 1, 0, 0, 0, 651, 647, 1, 0, 0, 0, 652, 175, 1, 0, 0, 0, 653, 655, 3, 178, 83, 0, 654, 653, 1, 0, 0, 0, 655, 656, 1, 0, 0, 0, 656, 654, 1, 0, 0, 0, 656, 657, 1, 0, 0, 0, 657, 177, 1, 0, 0, 0, 658, 659, 7, 11, 0, 0, 659, 179, 1, 0, 0, 0, 660, 661, 3, 16, 2, 0, 661, 181, 1, 0, 0, 0, 662, 663, 3, 12, 0, 0, 663, 664, 1, 0, 0, 0, 664, 665, 6, 85, 0, 0, 665, 183, 1, 0, 0, 0, 666, 667, 5, 105, 0, 0, 667, 668, 5, 102, 0, 0, 668, 669, 1, 0, 0, 0, 669, 670, 7, 12, 0, 0, 670, 671, 1, 0, 0, 0, 671, 672, 6, 86, 13, 0, 672, 185, 1, 0, 0, 0, 673, 674, 5, 101, 0, 0, 674, 675, 5, 108, 0, 0, 675, 676, 5, 115, 0, 0, 676, 677, 5, 101, 0, 0, 677, 678, 5, 105, 0, 0, 678, 679, 5, 102, 0, 0, 679, 680, 1, 0, 0, 0, 680, 681, 7, 12, 0, 0, 681, 682, 1, 0, 0, 0, 682, 683, 6, 87, 13, 0, 683, 187, 1, 0, 0, 0, 684, 685, 5, 101, 0, 0, 685, 686, 5, 108, 0, 0, 686, 687, 5, 115, 0, 0, 687, 688, 5, 101, 0, 0, 688, 690, 1, 0, 0, 0, 689, 691, 7, 12, 0, 0, 690, 689, 1, 0, 0, 0, 690, 691, 1, 0, 0, 0, 691, 189, 1, 0, 0, 0, 692, 693, 5, 115, 0, 0, 693, 694, 5, 101, 0, 0, 694, 695, 5, 116, 0, 0, 695, 696, 1, 0, 0, 0, 696, 697, 7, 12, 0, 0, 697, 698, 1, 0, 0, 0, 698, 699, 6, 89, 13, 0, 699, 191, 1, 0, 0, 0, 700, 701, 5, 101, 0, 0, 701, 702, 5, 110, 0, 0, 702, 703, 5, 100, 0, 0, 703, 704, 5, 105, 0, 0, 704, 705, 5, 102, 0, 0, 705, 193, 1, 0, 0, 0, 706, 707, 5, 99, 0, 0, 707, 708, 5, 97, 0, 0, 708, 709, 5, 108, 0, 0, 709, 710, 5, 108, 0, 0, 710, 711, 1, 0, 0, 0, 711, 712, 7, 12, 0, 0, 712, 713, 1, 0, 0, 0, 713, 714, 6, 91, 13, 0, 714, 195, 1, 0, 0, 0, 715, 716, 5, 100, 0, 0, 716, 717, 5, 101, 0, 0, 717, 718, 5, 99, 0, 0, 718, 719, 5, 108, 0, 0, 719, 720, 5, 97, 0, 0, 720, 721, 5, 114, 0, 0, 721, 722, 5, 101, 0, 0, 722, 723, 1, 0, 0, 0, 723, 724, 7, 12, 0, 0, 724, 725, 1, 0, 0, 0, 725, 726, 6, 92, 13, 0, 726, 197, 1, 0, 0, 0, 727, 728, 5, 106, 0, 0, 728, 729, 5, 117, 0, 0, 729, 730, 5, 109, 0, 0, 730, 731, 5, 112, 0, 0, 731, 732, 1, 0, 0, 0, 732, 733, 7, 12, 0, 0, 733, 734, 1, 0, 0, 0, 734, 735, 6, 93, 22, 0, 735, 199, 1, 0, 0, 0, 736, 737, 5, 101, 0, 0, 737, 738, 5, 110, 0, 0, 738, 739, 5, 117, 0, 0, 739, 740, 5, 109, 0, 0, 740, 741, 1, 0, 0, 0, 741, 742, 7, 12, 0, 0, 742, 743, 1, 0, 0, 0, 743, 744, 6, 94, 23, 0, 744, 201, 1, 0, 0, 0, 745, 746, 5, 99, 0, 0, 746, 747, 5, 97, 0, 0, 747, 748, 5, 115, 0, 0, 748, 749, 5, 101, 0, 0, 749, 750, 1, 0, 0, 0, 750, 751, 7, 12, 0, 0, 751, 752, 1, 0, 0, 0, 752, 753, 6, 95, 23, 0, 753, 203, 1, 0, 0, 0, 754, 755, 5, 101, 0, 0, 755, 756, 5, 110, 0, 0, 756, 757, 5, 100, 0, 0, 757, 758, 5, 101, 0, 0, 758, 759, 5, 110, 0, 0, 759, 760, 5, 117, 0, 0, 760, 761, 5, 109, 0, 0, 761, 763, 1, 0, 0, 0, 762, 764, 7, 12, 0, 0, 763, 762, 1, 0, 0, 0, 763, 764, 1, 0, 0, 0, 764, 205, 1, 0, 0, 0, 765, 766, 5, 108, 0, 0, 766, 767, 5, 111, 0, 0, 767, 768, 5, 99, 0, 0, 768, 769, 5, 97, 0, 0, 769, 770, 5, 108, 0, 0, 770, 771, 1, 0, 0, 0, 771, 772, 7, 12, 0, 0, 772, 207, 1, 0, 0, 0, 773, 774, 5, 62, 0, 0, 774, 775, 5, 62, 0, 0, 775, 776, 1, 0, 0, 0, 776, 777, 6, 98, 7, 0, 777, 209, 1, 0, 0, 0, 778, 779, 5, 123, 0, 0, 779, 780, 1, 0, 0, 0, 780, 781, 6, 99, 24, 0, 781, 782, 6, 99, 25, 0, 782, 783, 6, 99, 13, 0, 783, 211, 1, 0, 0, 0, 784, 785, 9, 0, 0, 0, 785, 786, 1, 0, 0, 0, 786, 787, 6, 100, 26, 0, 787, 788, 6, 100, 25, 0, 788, 213, 1, 0, 0, 0, 789, 790, 3, 16, 2, 0, 790, 215, 1, 0, 0, 0, 791, 792, 5, 62, 0, 0, 792, 793, 5, 62, 0, 0, 793, 794, 1, 0, 0, 0, 794, 795, 6, 102, 7, 0, 795, 217, 1, 0, 0, 0, 796, 797, 5, 123, 0, 0, 797, 798, 1, 0, 0, 0, 798, 799, 6, 103, 13, 0, 799, 219, 1, 0, 0, 0, 800, 802, 8, 13, 0, 0, 801, 800, 1, 0, 0, 0, 802, 803, 1, 0, 0, 0, 803, 801, 1, 0, 0, 0, 803, 804, 1, 0, 0, 0, 804, 221, 1, 0, 0, 0, 805, 806, 3, 16, 2, 0, 806, 223, 1, 0, 0, 0, 807, 808, 3, 18, 3, 0, 808, 809, 1, 0, 0, 0, 809, 810, 6, 106, 27, 0, 810, 811, 6, 106, 7, 0, 811, 225, 1, 0, 0, 0, 812, 813, 5, 62, 0, 0, 813, 814, 5, 62, 0, 0, 814, 815, 1, 0, 0, 0, 815, 816, 6, 107, 21, 0, 816, 817, 6, 107, 7, 0, 817, 227, 1, 0, 0, 0, 818, 819, 3, 18, 3, 0, 819, 820, 1, 0, 0, 0, 820, 821, 6, 108, 27, 0, 821, 822, 6, 108, 7, 0, 822, 229, 1, 0, 0, 0, 823, 824, 3, 50, 19, 0, 824, 825, 1, 0, 0, 0, 825, 826, 6, 109, 18, 0, 826, 827, 6, 109, 28, 0, 827, 231, 1, 0, 0, 0, 828, 829, 5, 62, 0, 0, 829, 830, 5, 62, 0, 0, 830, 831, 1, 0, 0, 0, 831, 832, 6, 110, 21, 0, 832, 833, 6, 110, 7, 0, 833, 233, 1, 0, 0, 0, 45, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 237, 247, 253, 257, 262, 269, 272, 276, 281, 293, 305, 378, 412, 415, 465, 492, 499, 506, 514, 519, 524, 531, 538, 544, 550, 556, 621, 623, 651, 656, 690, 763, 803, 29, 0, 1, 0, 0, 3, 0, 0, 2, 0, 5, 2, 0, 5, 1, 0, 5, 6, 0, 7, 6, 0, 4, 0, 0, 7, 5, 0, 5, 8, 0, 7, 10, 0, 5, 5, 0, 5, 3, 0, 5, 7, 0, 7, 20, 0, 5, 4, 0, 6, 0, 0, 2, 5, 0, 7, 16, 0, 7, 15, 0, 7, 57, 0, 7, 76, 0, 5, 11, 0, 5, 10, 0, 7, 79, 0, 2, 9, 0, 7, 80, 0, 7, 7, 0, 2, 7, 0] \ No newline at end of file diff --git a/crates/compiler/src/parser/generated/YarnSpinnerParser.interp b/crates/compiler/src/parser/generated/YarnSpinnerParser.interp index b0e2f168c..3d90fc51c 100644 --- a/crates/compiler/src/parser/generated/YarnSpinnerParser.interp +++ b/crates/compiler/src/parser/generated/YarnSpinnerParser.interp @@ -202,4 +202,4 @@ jump_statement atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 86, 317, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 3, 2, 7, 2, 56, 10, 2, 12, 2, 14, 2, 59, 11, 2, 3, 2, 6, 2, 62, 10, 2, 13, 2, 14, 2, 63, 3, 3, 3, 3, 3, 3, 3, 4, 6, 4, 70, 10, 4, 13, 4, 14, 4, 71, 3, 4, 3, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 5, 5, 81, 10, 5, 3, 6, 7, 6, 84, 10, 6, 12, 6, 14, 6, 87, 11, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 7, 7, 99, 10, 7, 12, 7, 14, 7, 102, 11, 7, 3, 7, 5, 7, 105, 10, 7, 3, 8, 3, 8, 5, 8, 109, 10, 8, 3, 8, 7, 8, 112, 10, 8, 12, 8, 14, 8, 115, 11, 8, 3, 8, 3, 8, 3, 9, 6, 9, 120, 10, 9, 13, 9, 14, 9, 121, 3, 9, 3, 9, 3, 9, 3, 9, 6, 9, 128, 10, 9, 13, 9, 14, 9, 129, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 5, 12, 150, 10, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 7, 12, 167, 10, 12, 12, 12, 14, 12, 170, 11, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 5, 13, 179, 10, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 5, 15, 186, 10, 15, 3, 15, 3, 15, 7, 15, 190, 10, 15, 12, 15, 14, 15, 193, 11, 15, 3, 15, 3, 15, 3, 16, 3, 16, 7, 16, 199, 10, 16, 12, 16, 14, 16, 202, 11, 16, 3, 16, 5, 16, 205, 10, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 7, 17, 216, 10, 17, 12, 17, 14, 17, 219, 11, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 7, 18, 226, 10, 18, 12, 18, 14, 18, 229, 11, 18, 3, 19, 3, 19, 3, 19, 3, 19, 7, 19, 235, 10, 19, 12, 19, 14, 19, 238, 11, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 7, 22, 256, 10, 22, 12, 22, 14, 22, 259, 11, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 7, 23, 266, 10, 23, 12, 23, 14, 23, 269, 11, 23, 3, 24, 7, 24, 272, 10, 24, 12, 24, 14, 24, 275, 11, 24, 3, 24, 3, 24, 5, 24, 279, 10, 24, 3, 25, 3, 25, 3, 25, 3, 25, 7, 25, 285, 10, 25, 12, 25, 14, 25, 288, 11, 25, 3, 25, 5, 25, 291, 10, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 5, 26, 300, 10, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 5, 27, 315, 10, 27, 3, 27, 2, 3, 22, 28, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 2, 8, 3, 2, 51, 53, 3, 2, 49, 50, 4, 2, 34, 35, 37, 38, 4, 2, 36, 36, 39, 39, 3, 2, 40, 42, 4, 2, 33, 33, 44, 48, 2, 339, 2, 57, 3, 2, 2, 2, 4, 65, 3, 2, 2, 2, 6, 69, 3, 2, 2, 2, 8, 77, 3, 2, 2, 2, 10, 85, 3, 2, 2, 2, 12, 104, 3, 2, 2, 2, 14, 106, 3, 2, 2, 2, 16, 127, 3, 2, 2, 2, 18, 131, 3, 2, 2, 2, 20, 134, 3, 2, 2, 2, 22, 149, 3, 2, 2, 2, 24, 178, 3, 2, 2, 2, 26, 180, 3, 2, 2, 2, 28, 182, 3, 2, 2, 2, 30, 196, 3, 2, 2, 2, 32, 210, 3, 2, 2, 2, 34, 220, 3, 2, 2, 2, 36, 230, 3, 2, 2, 2, 38, 239, 3, 2, 2, 2, 40, 246, 3, 2, 2, 2, 42, 251, 3, 2, 2, 2, 44, 267, 3, 2, 2, 2, 46, 273, 3, 2, 2, 2, 48, 280, 3, 2, 2, 2, 50, 292, 3, 2, 2, 2, 52, 314, 3, 2, 2, 2, 54, 56, 5, 4, 3, 2, 55, 54, 3, 2, 2, 2, 56, 59, 3, 2, 2, 2, 57, 55, 3, 2, 2, 2, 57, 58, 3, 2, 2, 2, 58, 61, 3, 2, 2, 2, 59, 57, 3, 2, 2, 2, 60, 62, 5, 6, 4, 2, 61, 60, 3, 2, 2, 2, 62, 63, 3, 2, 2, 2, 63, 61, 3, 2, 2, 2, 63, 64, 3, 2, 2, 2, 64, 3, 3, 2, 2, 2, 65, 66, 7, 12, 2, 2, 66, 67, 7, 28, 2, 2, 67, 5, 3, 2, 2, 2, 68, 70, 5, 8, 5, 2, 69, 68, 3, 2, 2, 2, 70, 71, 3, 2, 2, 2, 71, 69, 3, 2, 2, 2, 71, 72, 3, 2, 2, 2, 72, 73, 3, 2, 2, 2, 73, 74, 7, 10, 2, 2, 74, 75, 5, 10, 6, 2, 75, 76, 7, 15, 2, 2, 76, 7, 3, 2, 2, 2, 77, 78, 7, 9, 2, 2, 78, 80, 7, 11, 2, 2, 79, 81, 7, 13, 2, 2, 80, 79, 3, 2, 2, 2, 80, 81, 3, 2, 2, 2, 81, 9, 3, 2, 2, 2, 82, 84, 5, 12, 7, 2, 83, 82, 3, 2, 2, 2, 84, 87, 3, 2, 2, 2, 85, 83, 3, 2, 2, 2, 85, 86, 3, 2, 2, 2, 86, 11, 3, 2, 2, 2, 87, 85, 3, 2, 2, 2, 88, 105, 5, 14, 8, 2, 89, 105, 5, 30, 16, 2, 90, 105, 5, 38, 20, 2, 91, 105, 5, 46, 24, 2, 92, 105, 5, 40, 21, 2, 93, 105, 5, 42, 22, 2, 94, 105, 5, 50, 26, 2, 95, 105, 5, 52, 27, 2, 96, 100, 7, 3, 2, 2, 97, 99, 5, 12, 7, 2, 98, 97, 3, 2, 2, 2, 99, 102, 3, 2, 2, 2, 100, 98, 3, 2, 2, 2, 100, 101, 3, 2, 2, 2, 101, 103, 3, 2, 2, 2, 102, 100, 3, 2, 2, 2, 103, 105, 7, 4, 2, 2, 104, 88, 3, 2, 2, 2, 104, 89, 3, 2, 2, 2, 104, 90, 3, 2, 2, 2, 104, 91, 3, 2, 2, 2, 104, 92, 3, 2, 2, 2, 104, 93, 3, 2, 2, 2, 104, 94, 3, 2, 2, 2, 104, 95, 3, 2, 2, 2, 104, 96, 3, 2, 2, 2, 105, 13, 3, 2, 2, 2, 106, 108, 5, 16, 9, 2, 107, 109, 5, 20, 11, 2, 108, 107, 3, 2, 2, 2, 108, 109, 3, 2, 2, 2, 109, 113, 3, 2, 2, 2, 110, 112, 5, 18, 10, 2, 111, 110, 3, 2, 2, 2, 112, 115, 3, 2, 2, 2, 113, 111, 3, 2, 2, 2, 113, 114, 3, 2, 2, 2, 114, 116, 3, 2, 2, 2, 115, 113, 3, 2, 2, 2, 116, 117, 7, 8, 2, 2, 117, 15, 3, 2, 2, 2, 118, 120, 7, 22, 2, 2, 119, 118, 3, 2, 2, 2, 120, 121, 3, 2, 2, 2, 121, 119, 3, 2, 2, 2, 121, 122, 3, 2, 2, 2, 122, 128, 3, 2, 2, 2, 123, 124, 7, 18, 2, 2, 124, 125, 5, 22, 12, 2, 125, 126, 7, 60, 2, 2, 126, 128, 3, 2, 2, 2, 127, 119, 3, 2, 2, 2, 127, 123, 3, 2, 2, 2, 128, 129, 3, 2, 2, 2, 129, 127, 3, 2, 2, 2, 129, 130, 3, 2, 2, 2, 130, 17, 3, 2, 2, 2, 131, 132, 7, 12, 2, 2, 132, 133, 7, 28, 2, 2, 133, 19, 3, 2, 2, 2, 134, 135, 7, 17, 2, 2, 135, 136, 7, 66, 2, 2, 136, 137, 5, 22, 12, 2, 137, 138, 7, 78, 2, 2, 138, 21, 3, 2, 2, 2, 139, 140, 8, 12, 1, 2, 140, 141, 7, 54, 2, 2, 141, 142, 5, 22, 12, 2, 142, 143, 7, 55, 2, 2, 143, 150, 3, 2, 2, 2, 144, 145, 7, 50, 2, 2, 145, 150, 5, 22, 12, 10, 146, 147, 7, 43, 2, 2, 147, 150, 5, 22, 12, 9, 148, 150, 5, 24, 13, 2, 149, 139, 3, 2, 2, 2, 149, 144, 3, 2, 2, 2, 149, 146, 3, 2, 2, 2, 149, 148, 3, 2, 2, 2, 150, 168, 3, 2, 2, 2, 151, 152, 12, 8, 2, 2, 152, 153, 9, 2, 2, 2, 153, 167, 5, 22, 12, 9, 154, 155, 12, 7, 2, 2, 155, 156, 9, 3, 2, 2, 156, 167, 5, 22, 12, 8, 157, 158, 12, 6, 2, 2, 158, 159, 9, 4, 2, 2, 159, 167, 5, 22, 12, 7, 160, 161, 12, 5, 2, 2, 161, 162, 9, 5, 2, 2, 162, 167, 5, 22, 12, 6, 163, 164, 12, 4, 2, 2, 164, 165, 9, 6, 2, 2, 165, 167, 5, 22, 12, 5, 166, 151, 3, 2, 2, 2, 166, 154, 3, 2, 2, 2, 166, 157, 3, 2, 2, 2, 166, 160, 3, 2, 2, 2, 166, 163, 3, 2, 2, 2, 167, 170, 3, 2, 2, 2, 168, 166, 3, 2, 2, 2, 168, 169, 3, 2, 2, 2, 169, 23, 3, 2, 2, 2, 170, 168, 3, 2, 2, 2, 171, 179, 7, 63, 2, 2, 172, 179, 7, 30, 2, 2, 173, 179, 7, 31, 2, 2, 174, 179, 5, 26, 14, 2, 175, 179, 7, 58, 2, 2, 176, 179, 7, 32, 2, 2, 177, 179, 5, 28, 15, 2, 178, 171, 3, 2, 2, 2, 178, 172, 3, 2, 2, 2, 178, 173, 3, 2, 2, 2, 178, 174, 3, 2, 2, 2, 178, 175, 3, 2, 2, 2, 178, 176, 3, 2, 2, 2, 178, 177, 3, 2, 2, 2, 179, 25, 3, 2, 2, 2, 180, 181, 7, 61, 2, 2, 181, 27, 3, 2, 2, 2, 182, 183, 7, 59, 2, 2, 183, 185, 7, 54, 2, 2, 184, 186, 5, 22, 12, 2, 185, 184, 3, 2, 2, 2, 185, 186, 3, 2, 2, 2, 186, 191, 3, 2, 2, 2, 187, 188, 7, 56, 2, 2, 188, 190, 5, 22, 12, 2, 189, 187, 3, 2, 2, 2, 190, 193, 3, 2, 2, 2, 191, 189, 3, 2, 2, 2, 191, 192, 3, 2, 2, 2, 192, 194, 3, 2, 2, 2, 193, 191, 3, 2, 2, 2, 194, 195, 7, 55, 2, 2, 195, 29, 3, 2, 2, 2, 196, 200, 5, 32, 17, 2, 197, 199, 5, 34, 18, 2, 198, 197, 3, 2, 2, 2, 199, 202, 3, 2, 2, 2, 200, 198, 3, 2, 2, 2, 200, 201, 3, 2, 2, 2, 201, 204, 3, 2, 2, 2, 202, 200, 3, 2, 2, 2, 203, 205, 5, 36, 19, 2, 204, 203, 3, 2, 2, 2, 204, 205, 3, 2, 2, 2, 205, 206, 3, 2, 2, 2, 206, 207, 7, 17, 2, 2, 207, 208, 7, 70, 2, 2, 208, 209, 7, 78, 2, 2, 209, 31, 3, 2, 2, 2, 210, 211, 7, 17, 2, 2, 211, 212, 7, 66, 2, 2, 212, 213, 5, 22, 12, 2, 213, 217, 7, 78, 2, 2, 214, 216, 5, 12, 7, 2, 215, 214, 3, 2, 2, 2, 216, 219, 3, 2, 2, 2, 217, 215, 3, 2, 2, 2, 217, 218, 3, 2, 2, 2, 218, 33, 3, 2, 2, 2, 219, 217, 3, 2, 2, 2, 220, 221, 7, 17, 2, 2, 221, 222, 7, 67, 2, 2, 222, 223, 5, 22, 12, 2, 223, 227, 7, 78, 2, 2, 224, 226, 5, 12, 7, 2, 225, 224, 3, 2, 2, 2, 226, 229, 3, 2, 2, 2, 227, 225, 3, 2, 2, 2, 227, 228, 3, 2, 2, 2, 228, 35, 3, 2, 2, 2, 229, 227, 3, 2, 2, 2, 230, 231, 7, 17, 2, 2, 231, 232, 7, 68, 2, 2, 232, 236, 7, 78, 2, 2, 233, 235, 5, 12, 7, 2, 234, 233, 3, 2, 2, 2, 235, 238, 3, 2, 2, 2, 236, 234, 3, 2, 2, 2, 236, 237, 3, 2, 2, 2, 237, 37, 3, 2, 2, 2, 238, 236, 3, 2, 2, 2, 239, 240, 7, 17, 2, 2, 240, 241, 7, 69, 2, 2, 241, 242, 5, 26, 14, 2, 242, 243, 9, 7, 2, 2, 243, 244, 5, 22, 12, 2, 244, 245, 7, 78, 2, 2, 245, 39, 3, 2, 2, 2, 246, 247, 7, 17, 2, 2, 247, 248, 7, 71, 2, 2, 248, 249, 5, 28, 15, 2, 249, 250, 7, 78, 2, 2, 250, 41, 3, 2, 2, 2, 251, 252, 7, 17, 2, 2, 252, 253, 5, 44, 23, 2, 253, 257, 7, 80, 2, 2, 254, 256, 5, 18, 10, 2, 255, 254, 3, 2, 2, 2, 256, 259, 3, 2, 2, 2, 257, 255, 3, 2, 2, 2, 257, 258, 3, 2, 2, 2, 258, 43, 3, 2, 2, 2, 259, 257, 3, 2, 2, 2, 260, 266, 7, 82, 2, 2, 261, 262, 7, 81, 2, 2, 262, 263, 5, 22, 12, 2, 263, 264, 7, 60, 2, 2, 264, 266, 3, 2, 2, 2, 265, 260, 3, 2, 2, 2, 265, 261, 3, 2, 2, 2, 266, 269, 3, 2, 2, 2, 267, 265, 3, 2, 2, 2, 267, 268, 3, 2, 2, 2, 268, 45, 3, 2, 2, 2, 269, 267, 3, 2, 2, 2, 270, 272, 5, 48, 25, 2, 271, 270, 3, 2, 2, 2, 272, 275, 3, 2, 2, 2, 273, 271, 3, 2, 2, 2, 273, 274, 3, 2, 2, 2, 274, 276, 3, 2, 2, 2, 275, 273, 3, 2, 2, 2, 276, 278, 5, 48, 25, 2, 277, 279, 7, 5, 2, 2, 278, 277, 3, 2, 2, 2, 278, 279, 3, 2, 2, 2, 279, 47, 3, 2, 2, 2, 280, 281, 7, 16, 2, 2, 281, 290, 5, 14, 8, 2, 282, 286, 7, 3, 2, 2, 283, 285, 5, 12, 7, 2, 284, 283, 3, 2, 2, 2, 285, 288, 3, 2, 2, 2, 286, 284, 3, 2, 2, 2, 286, 287, 3, 2, 2, 2, 287, 289, 3, 2, 2, 2, 288, 286, 3, 2, 2, 2, 289, 291, 7, 4, 2, 2, 290, 282, 3, 2, 2, 2, 290, 291, 3, 2, 2, 2, 291, 49, 3, 2, 2, 2, 292, 293, 7, 17, 2, 2, 293, 294, 7, 72, 2, 2, 294, 295, 5, 26, 14, 2, 295, 296, 7, 33, 2, 2, 296, 299, 5, 24, 13, 2, 297, 298, 7, 57, 2, 2, 298, 300, 7, 59, 2, 2, 299, 297, 3, 2, 2, 2, 299, 300, 3, 2, 2, 2, 300, 301, 3, 2, 2, 2, 301, 302, 7, 78, 2, 2, 302, 51, 3, 2, 2, 2, 303, 304, 7, 17, 2, 2, 304, 305, 7, 73, 2, 2, 305, 306, 7, 9, 2, 2, 306, 315, 7, 78, 2, 2, 307, 308, 7, 17, 2, 2, 308, 309, 7, 73, 2, 2, 309, 310, 7, 18, 2, 2, 310, 311, 5, 22, 12, 2, 311, 312, 7, 60, 2, 2, 312, 313, 7, 78, 2, 2, 313, 315, 3, 2, 2, 2, 314, 303, 3, 2, 2, 2, 314, 307, 3, 2, 2, 2, 315, 53, 3, 2, 2, 2, 34, 57, 63, 71, 80, 85, 100, 104, 108, 113, 121, 127, 129, 149, 166, 168, 178, 185, 191, 200, 204, 217, 227, 236, 257, 265, 267, 273, 278, 286, 290, 299, 314] \ No newline at end of file +[4, 1, 84, 315, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 1, 0, 5, 0, 54, 8, 0, 10, 0, 12, 0, 57, 9, 0, 1, 0, 4, 0, 60, 8, 0, 11, 0, 12, 0, 61, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 68, 8, 2, 11, 2, 12, 2, 69, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 3, 3, 79, 8, 3, 1, 4, 5, 4, 82, 8, 4, 10, 4, 12, 4, 85, 9, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 97, 8, 5, 10, 5, 12, 5, 100, 9, 5, 1, 5, 3, 5, 103, 8, 5, 1, 6, 1, 6, 3, 6, 107, 8, 6, 1, 6, 5, 6, 110, 8, 6, 10, 6, 12, 6, 113, 9, 6, 1, 6, 1, 6, 1, 7, 4, 7, 118, 8, 7, 11, 7, 12, 7, 119, 1, 7, 1, 7, 1, 7, 1, 7, 4, 7, 126, 8, 7, 11, 7, 12, 7, 127, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 148, 8, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 5, 10, 165, 8, 10, 10, 10, 12, 10, 168, 9, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 177, 8, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 3, 13, 184, 8, 13, 1, 13, 1, 13, 5, 13, 188, 8, 13, 10, 13, 12, 13, 191, 9, 13, 1, 13, 1, 13, 1, 14, 1, 14, 5, 14, 197, 8, 14, 10, 14, 12, 14, 200, 9, 14, 1, 14, 3, 14, 203, 8, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 214, 8, 15, 10, 15, 12, 15, 217, 9, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 224, 8, 16, 10, 16, 12, 16, 227, 9, 16, 1, 17, 1, 17, 1, 17, 1, 17, 5, 17, 233, 8, 17, 10, 17, 12, 17, 236, 9, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 5, 20, 254, 8, 20, 10, 20, 12, 20, 257, 9, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 5, 21, 264, 8, 21, 10, 21, 12, 21, 267, 9, 21, 1, 22, 5, 22, 270, 8, 22, 10, 22, 12, 22, 273, 9, 22, 1, 22, 1, 22, 3, 22, 277, 8, 22, 1, 23, 1, 23, 1, 23, 1, 23, 5, 23, 283, 8, 23, 10, 23, 12, 23, 286, 9, 23, 1, 23, 3, 23, 289, 8, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 3, 24, 298, 8, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 3, 25, 313, 8, 25, 1, 25, 0, 1, 20, 26, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 0, 6, 1, 0, 49, 51, 1, 0, 47, 48, 2, 0, 32, 33, 35, 36, 2, 0, 34, 34, 37, 37, 1, 0, 38, 40, 2, 0, 31, 31, 42, 46, 337, 0, 55, 1, 0, 0, 0, 2, 63, 1, 0, 0, 0, 4, 67, 1, 0, 0, 0, 6, 75, 1, 0, 0, 0, 8, 83, 1, 0, 0, 0, 10, 102, 1, 0, 0, 0, 12, 104, 1, 0, 0, 0, 14, 125, 1, 0, 0, 0, 16, 129, 1, 0, 0, 0, 18, 132, 1, 0, 0, 0, 20, 147, 1, 0, 0, 0, 22, 176, 1, 0, 0, 0, 24, 178, 1, 0, 0, 0, 26, 180, 1, 0, 0, 0, 28, 194, 1, 0, 0, 0, 30, 208, 1, 0, 0, 0, 32, 218, 1, 0, 0, 0, 34, 228, 1, 0, 0, 0, 36, 237, 1, 0, 0, 0, 38, 244, 1, 0, 0, 0, 40, 249, 1, 0, 0, 0, 42, 265, 1, 0, 0, 0, 44, 271, 1, 0, 0, 0, 46, 278, 1, 0, 0, 0, 48, 290, 1, 0, 0, 0, 50, 312, 1, 0, 0, 0, 52, 54, 3, 2, 1, 0, 53, 52, 1, 0, 0, 0, 54, 57, 1, 0, 0, 0, 55, 53, 1, 0, 0, 0, 55, 56, 1, 0, 0, 0, 56, 59, 1, 0, 0, 0, 57, 55, 1, 0, 0, 0, 58, 60, 3, 4, 2, 0, 59, 58, 1, 0, 0, 0, 60, 61, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 61, 62, 1, 0, 0, 0, 62, 1, 1, 0, 0, 0, 63, 64, 5, 10, 0, 0, 64, 65, 5, 26, 0, 0, 65, 3, 1, 0, 0, 0, 66, 68, 3, 6, 3, 0, 67, 66, 1, 0, 0, 0, 68, 69, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 69, 70, 1, 0, 0, 0, 70, 71, 1, 0, 0, 0, 71, 72, 5, 8, 0, 0, 72, 73, 3, 8, 4, 0, 73, 74, 5, 13, 0, 0, 74, 5, 1, 0, 0, 0, 75, 76, 5, 7, 0, 0, 76, 78, 5, 9, 0, 0, 77, 79, 5, 11, 0, 0, 78, 77, 1, 0, 0, 0, 78, 79, 1, 0, 0, 0, 79, 7, 1, 0, 0, 0, 80, 82, 3, 10, 5, 0, 81, 80, 1, 0, 0, 0, 82, 85, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 9, 1, 0, 0, 0, 85, 83, 1, 0, 0, 0, 86, 103, 3, 12, 6, 0, 87, 103, 3, 28, 14, 0, 88, 103, 3, 36, 18, 0, 89, 103, 3, 44, 22, 0, 90, 103, 3, 38, 19, 0, 91, 103, 3, 40, 20, 0, 92, 103, 3, 48, 24, 0, 93, 103, 3, 50, 25, 0, 94, 98, 5, 1, 0, 0, 95, 97, 3, 10, 5, 0, 96, 95, 1, 0, 0, 0, 97, 100, 1, 0, 0, 0, 98, 96, 1, 0, 0, 0, 98, 99, 1, 0, 0, 0, 99, 101, 1, 0, 0, 0, 100, 98, 1, 0, 0, 0, 101, 103, 5, 2, 0, 0, 102, 86, 1, 0, 0, 0, 102, 87, 1, 0, 0, 0, 102, 88, 1, 0, 0, 0, 102, 89, 1, 0, 0, 0, 102, 90, 1, 0, 0, 0, 102, 91, 1, 0, 0, 0, 102, 92, 1, 0, 0, 0, 102, 93, 1, 0, 0, 0, 102, 94, 1, 0, 0, 0, 103, 11, 1, 0, 0, 0, 104, 106, 3, 14, 7, 0, 105, 107, 3, 18, 9, 0, 106, 105, 1, 0, 0, 0, 106, 107, 1, 0, 0, 0, 107, 111, 1, 0, 0, 0, 108, 110, 3, 16, 8, 0, 109, 108, 1, 0, 0, 0, 110, 113, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 114, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, 115, 5, 6, 0, 0, 115, 13, 1, 0, 0, 0, 116, 118, 5, 20, 0, 0, 117, 116, 1, 0, 0, 0, 118, 119, 1, 0, 0, 0, 119, 117, 1, 0, 0, 0, 119, 120, 1, 0, 0, 0, 120, 126, 1, 0, 0, 0, 121, 122, 5, 16, 0, 0, 122, 123, 3, 20, 10, 0, 123, 124, 5, 58, 0, 0, 124, 126, 1, 0, 0, 0, 125, 117, 1, 0, 0, 0, 125, 121, 1, 0, 0, 0, 126, 127, 1, 0, 0, 0, 127, 125, 1, 0, 0, 0, 127, 128, 1, 0, 0, 0, 128, 15, 1, 0, 0, 0, 129, 130, 5, 10, 0, 0, 130, 131, 5, 26, 0, 0, 131, 17, 1, 0, 0, 0, 132, 133, 5, 15, 0, 0, 133, 134, 5, 64, 0, 0, 134, 135, 3, 20, 10, 0, 135, 136, 5, 76, 0, 0, 136, 19, 1, 0, 0, 0, 137, 138, 6, 10, -1, 0, 138, 139, 5, 52, 0, 0, 139, 140, 3, 20, 10, 0, 140, 141, 5, 53, 0, 0, 141, 148, 1, 0, 0, 0, 142, 143, 5, 48, 0, 0, 143, 148, 3, 20, 10, 8, 144, 145, 5, 41, 0, 0, 145, 148, 3, 20, 10, 7, 146, 148, 3, 22, 11, 0, 147, 137, 1, 0, 0, 0, 147, 142, 1, 0, 0, 0, 147, 144, 1, 0, 0, 0, 147, 146, 1, 0, 0, 0, 148, 166, 1, 0, 0, 0, 149, 150, 10, 6, 0, 0, 150, 151, 7, 0, 0, 0, 151, 165, 3, 20, 10, 7, 152, 153, 10, 5, 0, 0, 153, 154, 7, 1, 0, 0, 154, 165, 3, 20, 10, 6, 155, 156, 10, 4, 0, 0, 156, 157, 7, 2, 0, 0, 157, 165, 3, 20, 10, 5, 158, 159, 10, 3, 0, 0, 159, 160, 7, 3, 0, 0, 160, 165, 3, 20, 10, 4, 161, 162, 10, 2, 0, 0, 162, 163, 7, 4, 0, 0, 163, 165, 3, 20, 10, 3, 164, 149, 1, 0, 0, 0, 164, 152, 1, 0, 0, 0, 164, 155, 1, 0, 0, 0, 164, 158, 1, 0, 0, 0, 164, 161, 1, 0, 0, 0, 165, 168, 1, 0, 0, 0, 166, 164, 1, 0, 0, 0, 166, 167, 1, 0, 0, 0, 167, 21, 1, 0, 0, 0, 168, 166, 1, 0, 0, 0, 169, 177, 5, 61, 0, 0, 170, 177, 5, 28, 0, 0, 171, 177, 5, 29, 0, 0, 172, 177, 3, 24, 12, 0, 173, 177, 5, 56, 0, 0, 174, 177, 5, 30, 0, 0, 175, 177, 3, 26, 13, 0, 176, 169, 1, 0, 0, 0, 176, 170, 1, 0, 0, 0, 176, 171, 1, 0, 0, 0, 176, 172, 1, 0, 0, 0, 176, 173, 1, 0, 0, 0, 176, 174, 1, 0, 0, 0, 176, 175, 1, 0, 0, 0, 177, 23, 1, 0, 0, 0, 178, 179, 5, 59, 0, 0, 179, 25, 1, 0, 0, 0, 180, 181, 5, 57, 0, 0, 181, 183, 5, 52, 0, 0, 182, 184, 3, 20, 10, 0, 183, 182, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 189, 1, 0, 0, 0, 185, 186, 5, 54, 0, 0, 186, 188, 3, 20, 10, 0, 187, 185, 1, 0, 0, 0, 188, 191, 1, 0, 0, 0, 189, 187, 1, 0, 0, 0, 189, 190, 1, 0, 0, 0, 190, 192, 1, 0, 0, 0, 191, 189, 1, 0, 0, 0, 192, 193, 5, 53, 0, 0, 193, 27, 1, 0, 0, 0, 194, 198, 3, 30, 15, 0, 195, 197, 3, 32, 16, 0, 196, 195, 1, 0, 0, 0, 197, 200, 1, 0, 0, 0, 198, 196, 1, 0, 0, 0, 198, 199, 1, 0, 0, 0, 199, 202, 1, 0, 0, 0, 200, 198, 1, 0, 0, 0, 201, 203, 3, 34, 17, 0, 202, 201, 1, 0, 0, 0, 202, 203, 1, 0, 0, 0, 203, 204, 1, 0, 0, 0, 204, 205, 5, 15, 0, 0, 205, 206, 5, 68, 0, 0, 206, 207, 5, 76, 0, 0, 207, 29, 1, 0, 0, 0, 208, 209, 5, 15, 0, 0, 209, 210, 5, 64, 0, 0, 210, 211, 3, 20, 10, 0, 211, 215, 5, 76, 0, 0, 212, 214, 3, 10, 5, 0, 213, 212, 1, 0, 0, 0, 214, 217, 1, 0, 0, 0, 215, 213, 1, 0, 0, 0, 215, 216, 1, 0, 0, 0, 216, 31, 1, 0, 0, 0, 217, 215, 1, 0, 0, 0, 218, 219, 5, 15, 0, 0, 219, 220, 5, 65, 0, 0, 220, 221, 3, 20, 10, 0, 221, 225, 5, 76, 0, 0, 222, 224, 3, 10, 5, 0, 223, 222, 1, 0, 0, 0, 224, 227, 1, 0, 0, 0, 225, 223, 1, 0, 0, 0, 225, 226, 1, 0, 0, 0, 226, 33, 1, 0, 0, 0, 227, 225, 1, 0, 0, 0, 228, 229, 5, 15, 0, 0, 229, 230, 5, 66, 0, 0, 230, 234, 5, 76, 0, 0, 231, 233, 3, 10, 5, 0, 232, 231, 1, 0, 0, 0, 233, 236, 1, 0, 0, 0, 234, 232, 1, 0, 0, 0, 234, 235, 1, 0, 0, 0, 235, 35, 1, 0, 0, 0, 236, 234, 1, 0, 0, 0, 237, 238, 5, 15, 0, 0, 238, 239, 5, 67, 0, 0, 239, 240, 3, 24, 12, 0, 240, 241, 7, 5, 0, 0, 241, 242, 3, 20, 10, 0, 242, 243, 5, 76, 0, 0, 243, 37, 1, 0, 0, 0, 244, 245, 5, 15, 0, 0, 245, 246, 5, 69, 0, 0, 246, 247, 3, 26, 13, 0, 247, 248, 5, 76, 0, 0, 248, 39, 1, 0, 0, 0, 249, 250, 5, 15, 0, 0, 250, 251, 3, 42, 21, 0, 251, 255, 5, 78, 0, 0, 252, 254, 3, 16, 8, 0, 253, 252, 1, 0, 0, 0, 254, 257, 1, 0, 0, 0, 255, 253, 1, 0, 0, 0, 255, 256, 1, 0, 0, 0, 256, 41, 1, 0, 0, 0, 257, 255, 1, 0, 0, 0, 258, 264, 5, 80, 0, 0, 259, 260, 5, 79, 0, 0, 260, 261, 3, 20, 10, 0, 261, 262, 5, 58, 0, 0, 262, 264, 1, 0, 0, 0, 263, 258, 1, 0, 0, 0, 263, 259, 1, 0, 0, 0, 264, 267, 1, 0, 0, 0, 265, 263, 1, 0, 0, 0, 265, 266, 1, 0, 0, 0, 266, 43, 1, 0, 0, 0, 267, 265, 1, 0, 0, 0, 268, 270, 3, 46, 23, 0, 269, 268, 1, 0, 0, 0, 270, 273, 1, 0, 0, 0, 271, 269, 1, 0, 0, 0, 271, 272, 1, 0, 0, 0, 272, 274, 1, 0, 0, 0, 273, 271, 1, 0, 0, 0, 274, 276, 3, 46, 23, 0, 275, 277, 5, 3, 0, 0, 276, 275, 1, 0, 0, 0, 276, 277, 1, 0, 0, 0, 277, 45, 1, 0, 0, 0, 278, 279, 5, 14, 0, 0, 279, 288, 3, 12, 6, 0, 280, 284, 5, 1, 0, 0, 281, 283, 3, 10, 5, 0, 282, 281, 1, 0, 0, 0, 283, 286, 1, 0, 0, 0, 284, 282, 1, 0, 0, 0, 284, 285, 1, 0, 0, 0, 285, 287, 1, 0, 0, 0, 286, 284, 1, 0, 0, 0, 287, 289, 5, 2, 0, 0, 288, 280, 1, 0, 0, 0, 288, 289, 1, 0, 0, 0, 289, 47, 1, 0, 0, 0, 290, 291, 5, 15, 0, 0, 291, 292, 5, 70, 0, 0, 292, 293, 3, 24, 12, 0, 293, 294, 5, 31, 0, 0, 294, 297, 3, 22, 11, 0, 295, 296, 5, 55, 0, 0, 296, 298, 5, 57, 0, 0, 297, 295, 1, 0, 0, 0, 297, 298, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 300, 5, 76, 0, 0, 300, 49, 1, 0, 0, 0, 301, 302, 5, 15, 0, 0, 302, 303, 5, 71, 0, 0, 303, 304, 5, 7, 0, 0, 304, 313, 5, 76, 0, 0, 305, 306, 5, 15, 0, 0, 306, 307, 5, 71, 0, 0, 307, 308, 5, 16, 0, 0, 308, 309, 3, 20, 10, 0, 309, 310, 5, 58, 0, 0, 310, 311, 5, 76, 0, 0, 311, 313, 1, 0, 0, 0, 312, 301, 1, 0, 0, 0, 312, 305, 1, 0, 0, 0, 313, 51, 1, 0, 0, 0, 32, 55, 61, 69, 78, 83, 98, 102, 106, 111, 119, 125, 127, 147, 164, 166, 176, 183, 189, 198, 202, 215, 225, 234, 255, 263, 265, 271, 276, 284, 288, 297, 312] \ No newline at end of file diff --git a/crates/compiler/src/parser/generated/yarnspinnerlexer.rs b/crates/compiler/src/parser/generated/yarnspinnerlexer.rs index 03e23de8a..6f133d256 100644 --- a/crates/compiler/src/parser/generated/yarnspinnerlexer.rs +++ b/crates/compiler/src/parser/generated/yarnspinnerlexer.rs @@ -1,26 +1,27 @@ -// Generated from third-party\YarnSpinner\YarnSpinner.Compiler\YarnSpinnerLexer.g4 by ANTLR 4.8 +// Generated from third-party/YarnSpinner/YarnSpinner.Compiler/YarnSpinnerLexer.g4 by ANTLR 4.13.2 #![allow(dead_code)] #![allow(nonstandard_style)] #![allow(unused_imports)] #![allow(unused_variables)] -use antlr_rust::atn::ATN; -use antlr_rust::char_stream::CharStream; -use antlr_rust::int_stream::IntStream; -use antlr_rust::lexer::{BaseLexer, Lexer, LexerRecog}; -use antlr_rust::atn_deserializer::ATNDeserializer; -use antlr_rust::dfa::DFA; -use antlr_rust::lexer_atn_simulator::{LexerATNSimulator, ILexerATNSimulator}; -use antlr_rust::PredictionContextCache; -use antlr_rust::recognizer::{Recognizer,Actions}; -use antlr_rust::error_listener::ErrorListener; -use antlr_rust::TokenSource; -use antlr_rust::token_factory::{TokenFactory,CommonTokenFactory,TokenAware}; -use antlr_rust::token::*; -use antlr_rust::rule_context::{BaseRuleContext,EmptyCustomRuleContext,EmptyContext}; -use antlr_rust::parser_rule_context::{ParserRuleContext,BaseParserRuleContext,cast}; -use antlr_rust::vocabulary::{Vocabulary,VocabularyImpl}; - -use antlr_rust::{lazy_static,Tid,TidAble,TidExt}; +use antlr4rust::atn::ATN; +use antlr4rust::char_stream::CharStream; +use antlr4rust::int_stream::IntStream; +use antlr4rust::tree::ParseTree; +use antlr4rust::lexer::{BaseLexer, Lexer, LexerRecog}; +use antlr4rust::atn_deserializer::ATNDeserializer; +use antlr4rust::dfa::DFA; +use antlr4rust::lexer_atn_simulator::{LexerATNSimulator, ILexerATNSimulator}; +use antlr4rust::PredictionContextCache; +use antlr4rust::recognizer::{Recognizer,Actions}; +use antlr4rust::error_listener::ErrorListener; +use antlr4rust::TokenSource; +use antlr4rust::token_factory::{TokenFactory,CommonTokenFactory,TokenAware}; +use antlr4rust::token::*; +use antlr4rust::rule_context::{BaseRuleContext,EmptyCustomRuleContext,EmptyContext}; +use antlr4rust::parser_rule_context::{ParserRuleContext,BaseParserRuleContext,cast}; +use antlr4rust::vocabulary::{Vocabulary,VocabularyImpl}; + +use antlr4rust::{lazy_static,Tid,TidAble,TidExt}; use std::sync::Arc; use std::cell::RefCell; @@ -29,103 +30,90 @@ use std::marker::PhantomData; use std::ops::{Deref, DerefMut}; - pub const INDENT:isize=1; - pub const DEDENT:isize=2; - pub const BLANK_LINE_FOLLOWING_OPTION:isize=3; - pub const WS:isize=4; - pub const COMMENT:isize=5; - pub const NEWLINE:isize=6; - pub const ID:isize=7; - pub const BODY_START:isize=8; - pub const HEADER_DELIMITER:isize=9; - pub const HASHTAG:isize=10; - pub const REST_OF_LINE:isize=11; - pub const BODY_WS:isize=12; - pub const BODY_END:isize=13; - pub const SHORTCUT_ARROW:isize=14; - pub const COMMAND_START:isize=15; - pub const EXPRESSION_START:isize=16; - pub const ESCAPED_ANY:isize=17; - pub const TEXT_ESCAPE:isize=18; - pub const TEXT_COMMENT:isize=19; - pub const TEXT:isize=20; - pub const UNESCAPABLE_CHARACTER:isize=21; - pub const TEXT_COMMANDHASHTAG_WS:isize=22; - pub const TEXT_COMMANDHASHTAG_COMMENT:isize=23; - pub const TEXT_COMMANDHASHTAG_ERROR:isize=24; - pub const HASHTAG_WS:isize=25; - pub const HASHTAG_TEXT:isize=26; - pub const EXPR_WS:isize=27; - pub const KEYWORD_TRUE:isize=28; - pub const KEYWORD_FALSE:isize=29; - pub const KEYWORD_NULL:isize=30; - pub const OPERATOR_ASSIGNMENT:isize=31; - pub const OPERATOR_LOGICAL_LESS_THAN_EQUALS:isize=32; - pub const OPERATOR_LOGICAL_GREATER_THAN_EQUALS:isize=33; - pub const OPERATOR_LOGICAL_EQUALS:isize=34; - pub const OPERATOR_LOGICAL_LESS:isize=35; - pub const OPERATOR_LOGICAL_GREATER:isize=36; - pub const OPERATOR_LOGICAL_NOT_EQUALS:isize=37; - pub const OPERATOR_LOGICAL_AND:isize=38; - pub const OPERATOR_LOGICAL_OR:isize=39; - pub const OPERATOR_LOGICAL_XOR:isize=40; - pub const OPERATOR_LOGICAL_NOT:isize=41; - pub const OPERATOR_MATHS_ADDITION_EQUALS:isize=42; - pub const OPERATOR_MATHS_SUBTRACTION_EQUALS:isize=43; - pub const OPERATOR_MATHS_MULTIPLICATION_EQUALS:isize=44; - pub const OPERATOR_MATHS_MODULUS_EQUALS:isize=45; - pub const OPERATOR_MATHS_DIVISION_EQUALS:isize=46; - pub const OPERATOR_MATHS_ADDITION:isize=47; - pub const OPERATOR_MATHS_SUBTRACTION:isize=48; - pub const OPERATOR_MATHS_MULTIPLICATION:isize=49; - pub const OPERATOR_MATHS_DIVISION:isize=50; - pub const OPERATOR_MATHS_MODULUS:isize=51; - pub const LPAREN:isize=52; - pub const RPAREN:isize=53; - pub const COMMA:isize=54; - pub const EXPRESSION_AS:isize=55; - pub const STRING:isize=56; - pub const FUNC_ID:isize=57; - pub const EXPRESSION_END:isize=58; - pub const VAR_ID:isize=59; - pub const DOT:isize=60; - pub const NUMBER:isize=61; - pub const COMMAND_NEWLINE:isize=62; - pub const COMMAND_WS:isize=63; - pub const COMMAND_IF:isize=64; - pub const COMMAND_ELSEIF:isize=65; - pub const COMMAND_ELSE:isize=66; - pub const COMMAND_SET:isize=67; - pub const COMMAND_ENDIF:isize=68; - pub const COMMAND_CALL:isize=69; - pub const COMMAND_DECLARE:isize=70; - pub const COMMAND_JUMP:isize=71; - pub const COMMAND_ENUM:isize=72; - pub const COMMAND_CASE:isize=73; - pub const COMMAND_ENDENUM:isize=74; - pub const COMMAND_LOCAL:isize=75; - pub const COMMAND_END:isize=76; - pub const COMMAND_TEXT_NEWLINE:isize=77; - pub const COMMAND_TEXT_END:isize=78; - pub const COMMAND_EXPRESSION_START:isize=79; - pub const COMMAND_TEXT:isize=80; - pub const COMMAND_ID_NEWLINE:isize=81; - pub const TYPE_STRING:isize=82; - pub const TYPE_NUMBER:isize=83; - pub const TYPE_BOOL:isize=84; - pub const WHITESPACE: usize=2; - pub const COMMENTS: usize=3; - pub const HeaderMode: usize=1; - pub const BodyMode: usize=2; - pub const TextMode: usize=3; - pub const TextEscapedMode: usize=4; - pub const TextCommandOrHashtagMode: usize=5; - pub const HashtagMode: usize=6; - pub const ExpressionMode: usize=7; - pub const CommandMode: usize=8; - pub const CommandTextMode: usize=9; - pub const CommandIDMode: usize=10; - pub const CommandIDOrExpressionMode: usize=11; + pub const INDENT:i32=1; + pub const DEDENT:i32=2; + pub const BLANK_LINE_FOLLOWING_OPTION:i32=3; + pub const WS:i32=4; + pub const COMMENT:i32=5; + pub const NEWLINE:i32=6; + pub const ID:i32=7; + pub const BODY_START:i32=8; + pub const HEADER_DELIMITER:i32=9; + pub const HASHTAG:i32=10; + pub const REST_OF_LINE:i32=11; + pub const BODY_WS:i32=12; + pub const BODY_END:i32=13; + pub const SHORTCUT_ARROW:i32=14; + pub const COMMAND_START:i32=15; + pub const EXPRESSION_START:i32=16; + pub const ESCAPED_ANY:i32=17; + pub const TEXT_ESCAPE:i32=18; + pub const TEXT_COMMENT:i32=19; + pub const TEXT:i32=20; + pub const UNESCAPABLE_CHARACTER:i32=21; + pub const TEXT_COMMANDHASHTAG_WS:i32=22; + pub const TEXT_COMMANDHASHTAG_COMMENT:i32=23; + pub const TEXT_COMMANDHASHTAG_ERROR:i32=24; + pub const HASHTAG_WS:i32=25; + pub const HASHTAG_TEXT:i32=26; + pub const EXPR_WS:i32=27; + pub const KEYWORD_TRUE:i32=28; + pub const KEYWORD_FALSE:i32=29; + pub const KEYWORD_NULL:i32=30; + pub const OPERATOR_ASSIGNMENT:i32=31; + pub const OPERATOR_LOGICAL_LESS_THAN_EQUALS:i32=32; + pub const OPERATOR_LOGICAL_GREATER_THAN_EQUALS:i32=33; + pub const OPERATOR_LOGICAL_EQUALS:i32=34; + pub const OPERATOR_LOGICAL_LESS:i32=35; + pub const OPERATOR_LOGICAL_GREATER:i32=36; + pub const OPERATOR_LOGICAL_NOT_EQUALS:i32=37; + pub const OPERATOR_LOGICAL_AND:i32=38; + pub const OPERATOR_LOGICAL_OR:i32=39; + pub const OPERATOR_LOGICAL_XOR:i32=40; + pub const OPERATOR_LOGICAL_NOT:i32=41; + pub const OPERATOR_MATHS_ADDITION_EQUALS:i32=42; + pub const OPERATOR_MATHS_SUBTRACTION_EQUALS:i32=43; + pub const OPERATOR_MATHS_MULTIPLICATION_EQUALS:i32=44; + pub const OPERATOR_MATHS_MODULUS_EQUALS:i32=45; + pub const OPERATOR_MATHS_DIVISION_EQUALS:i32=46; + pub const OPERATOR_MATHS_ADDITION:i32=47; + pub const OPERATOR_MATHS_SUBTRACTION:i32=48; + pub const OPERATOR_MATHS_MULTIPLICATION:i32=49; + pub const OPERATOR_MATHS_DIVISION:i32=50; + pub const OPERATOR_MATHS_MODULUS:i32=51; + pub const LPAREN:i32=52; + pub const RPAREN:i32=53; + pub const COMMA:i32=54; + pub const EXPRESSION_AS:i32=55; + pub const STRING:i32=56; + pub const FUNC_ID:i32=57; + pub const EXPRESSION_END:i32=58; + pub const VAR_ID:i32=59; + pub const DOT:i32=60; + pub const NUMBER:i32=61; + pub const COMMAND_NEWLINE:i32=62; + pub const COMMAND_WS:i32=63; + pub const COMMAND_IF:i32=64; + pub const COMMAND_ELSEIF:i32=65; + pub const COMMAND_ELSE:i32=66; + pub const COMMAND_SET:i32=67; + pub const COMMAND_ENDIF:i32=68; + pub const COMMAND_CALL:i32=69; + pub const COMMAND_DECLARE:i32=70; + pub const COMMAND_JUMP:i32=71; + pub const COMMAND_ENUM:i32=72; + pub const COMMAND_CASE:i32=73; + pub const COMMAND_ENDENUM:i32=74; + pub const COMMAND_LOCAL:i32=75; + pub const COMMAND_END:i32=76; + pub const COMMAND_TEXT_NEWLINE:i32=77; + pub const COMMAND_TEXT_END:i32=78; + pub const COMMAND_EXPRESSION_START:i32=79; + pub const COMMAND_TEXT:i32=80; + pub const COMMAND_ID_NEWLINE:i32=81; + pub const TYPE_STRING:i32=82; + pub const TYPE_NUMBER:i32=83; + pub const TYPE_BOOL:i32=84; pub const channelNames: [&'static str;2+2] = [ "DEFAULT_TOKEN_CHANNEL", "HIDDEN", "WHITESPACE", "COMMENTS" ]; @@ -222,7 +210,7 @@ pub struct YarnSpinnerLexer<'input, Input:CharStream >> { base: BaseLexer<'input,YarnSpinnerLexerActions,Input,LocalTokenFactory<'input>>, } -antlr_rust::tid! { impl<'input,Input> TidAble<'input> for YarnSpinnerLexer<'input,Input> where Input:CharStream > } +antlr4rust::tid! { impl<'input,Input> TidAble<'input> for YarnSpinnerLexer<'input,Input> where Input:CharStream > } impl<'input, Input:CharStream >> Deref for YarnSpinnerLexer<'input,Input>{ type Target = BaseLexer<'input,YarnSpinnerLexerActions,Input,LocalTokenFactory<'input>>; @@ -256,7 +244,7 @@ impl<'input, Input:CharStream >> YarnSpinnerLexer<'input,Input>{ } pub fn new_with_token_factory(input: Input, tf: &'input LocalTokenFactory<'input>) -> Self { - antlr_rust::recognizer::check_version("0","3"); + antlr4rust::recognizer::check_version("0","5"); Self { base: BaseLexer::new_base_lexer( input, @@ -323,512 +311,420 @@ impl<'input, Input:CharStream >> TokenSource<'input> for YarnSpinne fn get_token_factory(&self) -> &'input Self::TF { self.base.get_token_factory() } -} + fn get_dfa_string(&self) -> String { + self.base.get_dfa_string() + } +} - lazy_static! { + lazy_static!{ static ref _ATN: Arc = - Arc::new(ATNDeserializer::new(None).deserialize(_serializedATN.chars())); - static ref _decision_to_DFA: Arc>> = { + Arc::new(ATNDeserializer::new(None).deserialize(&mut _serializedATN.iter())); + static ref _decision_to_DFA: Arc>> = { let mut dfa = Vec::new(); - let size = _ATN.decision_to_state.len(); + let size = _ATN.decision_to_state.len() as i32; for i in 0..size { dfa.push(DFA::new( _ATN.clone(), _ATN.get_decision_state(i), - i as isize, + i, ).into()) } Arc::new(dfa) }; - } - - - - const _serializedATN:&'static str = - "\x03\u{608b}\u{a72a}\u{8133}\u{b9ed}\u{417c}\u{3be7}\u{7786}\u{5964}\x02\ - \x56\u{344}\x08\x01\x08\x01\x08\x01\x08\x01\x08\x01\x08\x01\x08\x01\x08\ - \x01\x08\x01\x08\x01\x08\x01\x08\x01\x04\x02\x09\x02\x04\x03\x09\x03\x04\ - \x04\x09\x04\x04\x05\x09\x05\x04\x06\x09\x06\x04\x07\x09\x07\x04\x08\x09\ - \x08\x04\x09\x09\x09\x04\x0a\x09\x0a\x04\x0b\x09\x0b\x04\x0c\x09\x0c\x04\ - \x0d\x09\x0d\x04\x0e\x09\x0e\x04\x0f\x09\x0f\x04\x10\x09\x10\x04\x11\x09\ - \x11\x04\x12\x09\x12\x04\x13\x09\x13\x04\x14\x09\x14\x04\x15\x09\x15\x04\ - \x16\x09\x16\x04\x17\x09\x17\x04\x18\x09\x18\x04\x19\x09\x19\x04\x1a\x09\ - \x1a\x04\x1b\x09\x1b\x04\x1c\x09\x1c\x04\x1d\x09\x1d\x04\x1e\x09\x1e\x04\ - \x1f\x09\x1f\x04\x20\x09\x20\x04\x21\x09\x21\x04\x22\x09\x22\x04\x23\x09\ - \x23\x04\x24\x09\x24\x04\x25\x09\x25\x04\x26\x09\x26\x04\x27\x09\x27\x04\ - \x28\x09\x28\x04\x29\x09\x29\x04\x2a\x09\x2a\x04\x2b\x09\x2b\x04\x2c\x09\ - \x2c\x04\x2d\x09\x2d\x04\x2e\x09\x2e\x04\x2f\x09\x2f\x04\x30\x09\x30\x04\ - \x31\x09\x31\x04\x32\x09\x32\x04\x33\x09\x33\x04\x34\x09\x34\x04\x35\x09\ - \x35\x04\x36\x09\x36\x04\x37\x09\x37\x04\x38\x09\x38\x04\x39\x09\x39\x04\ - \x3a\x09\x3a\x04\x3b\x09\x3b\x04\x3c\x09\x3c\x04\x3d\x09\x3d\x04\x3e\x09\ - \x3e\x04\x3f\x09\x3f\x04\x40\x09\x40\x04\x41\x09\x41\x04\x42\x09\x42\x04\ - \x43\x09\x43\x04\x44\x09\x44\x04\x45\x09\x45\x04\x46\x09\x46\x04\x47\x09\ - \x47\x04\x48\x09\x48\x04\x49\x09\x49\x04\x4a\x09\x4a\x04\x4b\x09\x4b\x04\ - \x4c\x09\x4c\x04\x4d\x09\x4d\x04\x4e\x09\x4e\x04\x4f\x09\x4f\x04\x50\x09\ - \x50\x04\x51\x09\x51\x04\x52\x09\x52\x04\x53\x09\x53\x04\x54\x09\x54\x04\ - \x55\x09\x55\x04\x56\x09\x56\x04\x57\x09\x57\x04\x58\x09\x58\x04\x59\x09\ - \x59\x04\x5a\x09\x5a\x04\x5b\x09\x5b\x04\x5c\x09\x5c\x04\x5d\x09\x5d\x04\ - \x5e\x09\x5e\x04\x5f\x09\x5f\x04\x60\x09\x60\x04\x61\x09\x61\x04\x62\x09\ - \x62\x04\x63\x09\x63\x04\x64\x09\x64\x04\x65\x09\x65\x04\x66\x09\x66\x04\ - \x67\x09\x67\x04\x68\x09\x68\x04\x69\x09\x69\x04\x6a\x09\x6a\x04\x6b\x09\ - \x6b\x04\x6c\x09\x6c\x04\x6d\x09\x6d\x04\x6e\x09\x6e\x04\x6f\x09\x6f\x04\ - \x70\x09\x70\x03\x02\x06\x02\u{ee}\x0a\x02\x0d\x02\x0e\x02\u{ef}\x03\x02\ - \x03\x02\x03\x03\x03\x03\x03\x03\x03\x03\x07\x03\u{f8}\x0a\x03\x0c\x03\ - \x0e\x03\u{fb}\x0b\x03\x03\x03\x03\x03\x03\x04\x05\x04\u{100}\x0a\x04\x03\ - \x04\x03\x04\x05\x04\u{104}\x0a\x04\x03\x04\x07\x04\u{107}\x0a\x04\x0c\ - \x04\x0e\x04\u{10a}\x0b\x04\x03\x04\x03\x04\x03\x05\x03\x05\x05\x05\u{110}\ - \x0a\x05\x03\x06\x05\x06\u{113}\x0a\x06\x03\x07\x03\x07\x05\x07\u{117}\ - \x0a\x07\x03\x08\x06\x08\u{11a}\x0a\x08\x0d\x08\x0e\x08\u{11b}\x03\x09\ - \x03\x09\x03\x09\x03\x09\x03\x09\x03\x09\x03\x0a\x03\x0a\x07\x0a\u{126}\ - \x0a\x0a\x0c\x0a\x0e\x0a\u{129}\x0b\x0a\x03\x0a\x03\x0a\x03\x0b\x03\x0b\ - \x03\x0b\x03\x0b\x03\x0c\x06\x0c\u{132}\x0a\x0c\x0d\x0c\x0e\x0c\u{133}\ - \x03\x0d\x03\x0d\x03\x0d\x03\x0d\x03\x0d\x03\x0d\x03\x0e\x03\x0e\x03\x0e\ - \x03\x0e\x03\x0f\x03\x0f\x03\x0f\x03\x0f\x03\x0f\x03\x10\x03\x10\x03\x10\ - \x03\x10\x03\x10\x03\x11\x03\x11\x03\x11\x03\x11\x03\x11\x03\x11\x03\x12\ - \x03\x12\x03\x12\x03\x13\x03\x13\x03\x13\x03\x13\x03\x13\x03\x14\x03\x14\ - \x03\x14\x03\x14\x03\x14\x03\x14\x03\x15\x03\x15\x03\x15\x03\x15\x03\x15\ - \x03\x16\x03\x16\x03\x16\x03\x16\x03\x16\x03\x16\x03\x17\x03\x17\x03\x17\ - \x03\x17\x03\x17\x03\x17\x03\x18\x03\x18\x03\x18\x03\x18\x03\x18\x03\x19\ - \x03\x19\x03\x19\x03\x19\x03\x19\x03\x1a\x03\x1a\x03\x1a\x03\x1a\x05\x1a\ - \u{17d}\x0a\x1a\x03\x1a\x03\x1a\x03\x1b\x03\x1b\x03\x1b\x03\x1b\x03\x1b\ - \x03\x1c\x03\x1c\x03\x1c\x03\x1c\x03\x1c\x03\x1c\x03\x1d\x03\x1d\x03\x1d\ - \x03\x1d\x03\x1d\x03\x1e\x03\x1e\x03\x1e\x03\x1e\x03\x1e\x03\x1e\x03\x1e\ - \x03\x1f\x03\x1f\x03\x1f\x03\x1f\x03\x20\x06\x20\u{19d}\x0a\x20\x0d\x20\ - \x0e\x20\u{19e}\x03\x20\x05\x20\u{1a2}\x0a\x20\x03\x21\x03\x21\x03\x22\ - \x03\x22\x03\x22\x03\x22\x03\x22\x03\x23\x03\x23\x03\x23\x03\x23\x03\x24\ - \x03\x24\x03\x24\x03\x24\x03\x25\x03\x25\x03\x25\x03\x25\x03\x26\x03\x26\ - \x03\x26\x03\x26\x03\x26\x03\x26\x03\x27\x03\x27\x03\x27\x03\x27\x03\x27\ - \x03\x28\x03\x28\x03\x28\x03\x28\x03\x28\x03\x29\x03\x29\x03\x2a\x03\x2a\ - \x03\x2a\x03\x2a\x03\x2b\x03\x2b\x03\x2b\x03\x2b\x03\x2c\x06\x2c\u{1d2}\ - \x0a\x2c\x0d\x2c\x0e\x2c\u{1d3}\x03\x2c\x03\x2c\x03\x2d\x03\x2d\x03\x2d\ - \x03\x2d\x03\x2e\x03\x2e\x03\x2e\x03\x2e\x03\x2e\x03\x2f\x03\x2f\x03\x2f\ - \x03\x2f\x03\x2f\x03\x2f\x03\x30\x03\x30\x03\x30\x03\x30\x03\x30\x03\x31\ - \x03\x31\x03\x31\x05\x31\u{1ef}\x0a\x31\x03\x32\x03\x32\x03\x32\x03\x32\ - \x03\x32\x05\x32\u{1f6}\x0a\x32\x03\x33\x03\x33\x03\x33\x03\x33\x03\x33\ - \x05\x33\u{1fd}\x0a\x33\x03\x34\x03\x34\x03\x34\x03\x34\x03\x34\x03\x34\ - \x05\x34\u{205}\x0a\x34\x03\x35\x03\x35\x03\x35\x05\x35\u{20a}\x0a\x35\ - \x03\x36\x03\x36\x03\x36\x05\x36\u{20f}\x0a\x36\x03\x37\x03\x37\x03\x37\ - \x03\x37\x03\x37\x05\x37\u{216}\x0a\x37\x03\x38\x03\x38\x03\x38\x03\x38\ - \x03\x38\x05\x38\u{21d}\x0a\x38\x03\x39\x03\x39\x03\x39\x03\x39\x05\x39\ - \u{223}\x0a\x39\x03\x3a\x03\x3a\x03\x3a\x03\x3a\x05\x3a\u{229}\x0a\x3a\ - \x03\x3b\x03\x3b\x03\x3b\x03\x3b\x05\x3b\u{22f}\x0a\x3b\x03\x3c\x03\x3c\ - \x03\x3c\x03\x3d\x03\x3d\x03\x3d\x03\x3e\x03\x3e\x03\x3e\x03\x3f\x03\x3f\ - \x03\x3f\x03\x40\x03\x40\x03\x40\x03\x41\x03\x41\x03\x42\x03\x42\x03\x43\ - \x03\x43\x03\x44\x03\x44\x03\x45\x03\x45\x03\x46\x03\x46\x03\x47\x03\x47\ - \x03\x48\x03\x48\x03\x49\x03\x49\x03\x49\x03\x4a\x03\x4a\x03\x4a\x03\x4a\ - \x03\x4a\x03\x4a\x03\x4a\x03\x4a\x03\x4a\x03\x4b\x03\x4b\x03\x4b\x03\x4b\ - \x03\x4b\x03\x4b\x03\x4b\x03\x4b\x03\x4b\x03\x4c\x03\x4c\x03\x4c\x03\x4c\ - \x03\x4c\x03\x4c\x03\x4c\x03\x4d\x03\x4d\x03\x4d\x03\x4d\x07\x4d\u{270}\ - \x0a\x4d\x0c\x4d\x0e\x4d\u{273}\x0b\x4d\x03\x4d\x03\x4d\x03\x4e\x03\x4e\ - \x03\x4f\x03\x4f\x03\x4f\x03\x4f\x03\x50\x03\x50\x03\x50\x03\x50\x03\x50\ - \x03\x50\x03\x50\x03\x51\x03\x51\x03\x51\x03\x52\x03\x52\x03\x53\x03\x53\ - \x03\x53\x03\x53\x03\x53\x05\x53\u{28e}\x0a\x53\x03\x54\x06\x54\u{291}\ - \x0a\x54\x0d\x54\x0e\x54\u{292}\x03\x55\x03\x55\x03\x56\x03\x56\x03\x57\ - \x03\x57\x03\x57\x03\x57\x03\x58\x03\x58\x03\x58\x03\x58\x03\x58\x03\x58\ - \x03\x58\x03\x59\x03\x59\x03\x59\x03\x59\x03\x59\x03\x59\x03\x59\x03\x59\ - \x03\x59\x03\x59\x03\x59\x03\x5a\x03\x5a\x03\x5a\x03\x5a\x03\x5a\x03\x5a\ - \x05\x5a\u{2b5}\x0a\x5a\x03\x5b\x03\x5b\x03\x5b\x03\x5b\x03\x5b\x03\x5b\ - \x03\x5b\x03\x5b\x03\x5c\x03\x5c\x03\x5c\x03\x5c\x03\x5c\x03\x5c\x03\x5d\ - \x03\x5d\x03\x5d\x03\x5d\x03\x5d\x03\x5d\x03\x5d\x03\x5d\x03\x5d\x03\x5e\ - \x03\x5e\x03\x5e\x03\x5e\x03\x5e\x03\x5e\x03\x5e\x03\x5e\x03\x5e\x03\x5e\ - \x03\x5e\x03\x5e\x03\x5f\x03\x5f\x03\x5f\x03\x5f\x03\x5f\x03\x5f\x03\x5f\ - \x03\x5f\x03\x5f\x03\x60\x03\x60\x03\x60\x03\x60\x03\x60\x03\x60\x03\x60\ - \x03\x60\x03\x60\x03\x61\x03\x61\x03\x61\x03\x61\x03\x61\x03\x61\x03\x61\ - \x03\x61\x03\x61\x03\x62\x03\x62\x03\x62\x03\x62\x03\x62\x03\x62\x03\x62\ - \x03\x62\x03\x62\x05\x62\u{2fe}\x0a\x62\x03\x63\x03\x63\x03\x63\x03\x63\ - \x03\x63\x03\x63\x03\x63\x03\x63\x03\x64\x03\x64\x03\x64\x03\x64\x03\x64\ - \x03\x65\x03\x65\x03\x65\x03\x65\x03\x65\x03\x65\x03\x66\x03\x66\x03\x66\ - \x03\x66\x03\x66\x03\x67\x03\x67\x03\x68\x03\x68\x03\x68\x03\x68\x03\x68\ - \x03\x69\x03\x69\x03\x69\x03\x69\x03\x6a\x06\x6a\u{324}\x0a\x6a\x0d\x6a\ - \x0e\x6a\u{325}\x03\x6b\x03\x6b\x03\x6c\x03\x6c\x03\x6c\x03\x6c\x03\x6c\ - \x03\x6d\x03\x6d\x03\x6d\x03\x6d\x03\x6d\x03\x6d\x03\x6e\x03\x6e\x03\x6e\ - \x03\x6e\x03\x6e\x03\x6f\x03\x6f\x03\x6f\x03\x6f\x03\x6f\x03\x70\x03\x70\ - \x03\x70\x03\x70\x03\x70\x03\x70\x02\x02\x71\x0e\x06\x10\x07\x12\x08\x14\ - \x09\x16\x02\x18\x02\x1a\x02\x1c\x0a\x1e\x0b\x20\x0c\x22\x0d\x24\x02\x26\ - \x0e\x28\x02\x2a\x02\x2c\x0f\x2e\x10\x30\x11\x32\x02\x34\x12\x36\x02\x38\ - \x13\x3a\x02\x3c\x02\x3e\x02\x40\x14\x42\x02\x44\x02\x46\x02\x48\x15\x4a\ - \x16\x4c\x02\x4e\x02\x50\x17\x52\x18\x54\x19\x56\x02\x58\x02\x5a\x02\x5c\ - \x1a\x5e\x1b\x60\x02\x62\x1c\x64\x1d\x66\x1e\x68\x1f\x6a\x20\x6c\x21\x6e\ - \x22\x70\x23\x72\x24\x74\x25\x76\x26\x78\x27\x7a\x28\x7c\x29\x7e\x2a\u{80}\ - \x2b\u{82}\x2c\u{84}\x2d\u{86}\x2e\u{88}\x2f\u{8a}\x30\u{8c}\x31\u{8e}\ - \x32\u{90}\x33\u{92}\x34\u{94}\x35\u{96}\x36\u{98}\x37\u{9a}\x38\u{9c}\ - \x39\u{9e}\x54\u{a0}\x55\u{a2}\x56\u{a4}\x3a\u{a6}\x3b\u{a8}\x3c\u{aa}\ - \x02\u{ac}\x3d\u{ae}\x3e\u{b0}\x3f\u{b2}\x02\u{b4}\x02\u{b6}\x40\u{b8}\ - \x41\u{ba}\x42\u{bc}\x43\u{be}\x44\u{c0}\x45\u{c2}\x46\u{c4}\x47\u{c6}\ - \x48\u{c8}\x49\u{ca}\x4a\u{cc}\x4b\u{ce}\x4c\u{d0}\x4d\u{d2}\x4e\u{d4}\ - \x02\u{d6}\x02\u{d8}\x4f\u{da}\x50\u{dc}\x51\u{de}\x52\u{e0}\x53\u{e2}\ - \x02\u{e4}\x02\u{e6}\x02\u{e8}\x02\u{ea}\x02\x0e\x02\x03\x04\x05\x06\x07\ - \x08\x09\x0a\x0b\x0c\x0d\x0f\x04\x02\x0b\x0b\x22\x22\x04\x02\x0c\x0c\x0f\ - \x0f\x07\x02\x32\x3b\u{302}\u{371}\u{1dc2}\u{1e01}\u{20d2}\u{2101}\u{fe22}\ - \u{fe31}\x03\x02\x22\x22\x04\x02\x31\x31\x3e\x3e\x09\x02\x0c\x0c\x0f\x0f\ - \x25\x25\x31\x31\x3e\x3e\x5e\x5e\x7d\x7d\x09\x02\x25\x25\x31\x31\x3e\x3e\ - \x40\x40\x5e\x5e\x7d\x7d\x7f\x7f\x07\x02\x0b\x0c\x0f\x0f\x22\x22\x25\x26\ - \x3e\x3e\x06\x02\x0c\x0c\x0f\x0f\x24\x24\x5e\x5e\x04\x02\x24\x24\x5e\x5e\ - \x03\x02\x32\x3b\x0c\x02\x0b\x0f\x22\x22\u{87}\u{87}\u{a2}\u{a2}\u{1682}\ - \u{1682}\u{2002}\u{200c}\u{202a}\u{202b}\u{2031}\u{2031}\u{2061}\u{2061}\ - \u{3002}\u{3002}\x06\x02\x0c\x0c\x0f\x0f\x40\x40\x7d\x7d\x03\x33\x02\x43\ - \x02\x5c\x02\x61\x02\x61\x02\x63\x02\x7c\x02\u{aa}\x02\u{aa}\x02\u{ac}\ - \x02\u{ac}\x02\u{af}\x02\u{af}\x02\u{b1}\x02\u{b1}\x02\u{b4}\x02\u{b7}\ - \x02\u{b9}\x02\u{bc}\x02\u{be}\x02\u{c0}\x02\u{c2}\x02\u{d8}\x02\u{da}\ - \x02\u{f8}\x02\u{fa}\x02\u{301}\x02\u{372}\x02\u{1681}\x02\u{1683}\x02\ - \u{180f}\x02\u{1811}\x02\u{1dc1}\x02\u{1e02}\x02\u{2001}\x02\u{200d}\x02\ - \u{200f}\x02\u{202c}\x02\u{2030}\x02\u{2041}\x02\u{2042}\x02\u{2056}\x02\ - \u{2056}\x02\u{2062}\x02\u{20d1}\x02\u{2102}\x02\u{2191}\x02\u{2462}\x02\ - \u{2501}\x02\u{2778}\x02\u{2795}\x02\u{2c02}\x02\u{2e01}\x02\u{2e82}\x02\ - \u{3001}\x02\u{3006}\x02\u{3009}\x02\u{3023}\x02\u{3031}\x02\u{3033}\x02\ - \u{10801}\x02\u{f902}\x02\u{fd3f}\x02\u{fd42}\x02\u{fdd1}\x02\u{fdf2}\x02\ - \u{fe21}\x02\u{fe32}\x02\u{fe46}\x02\u{fe49}\x02\u{ffff}\x02\x02\x03\u{ffff}\ - \x03\x02\x04\u{ffff}\x04\x02\x05\u{ffff}\x05\x02\x06\u{ffff}\x06\x02\x07\ - \u{ffff}\x07\x02\x08\u{ffff}\x08\x02\x09\u{ffff}\x09\x02\x0a\u{ffff}\x0a\ - \x02\x0b\u{ffff}\x0b\x02\x0c\u{ffff}\x0c\x02\x0d\u{ffff}\x0d\x02\x0e\u{ffff}\ - \x0e\x02\x0f\u{ffff}\x0f\x02\x10\u{ffff}\x10\u{353}\x02\x0e\x03\x02\x02\ - \x02\x02\x10\x03\x02\x02\x02\x02\x12\x03\x02\x02\x02\x02\x14\x03\x02\x02\ - \x02\x02\x1c\x03\x02\x02\x02\x02\x1e\x03\x02\x02\x02\x02\x20\x03\x02\x02\ - \x02\x03\x22\x03\x02\x02\x02\x03\x24\x03\x02\x02\x02\x04\x26\x03\x02\x02\ - \x02\x04\x28\x03\x02\x02\x02\x04\x2a\x03\x02\x02\x02\x04\x2c\x03\x02\x02\ - \x02\x04\x2e\x03\x02\x02\x02\x04\x30\x03\x02\x02\x02\x04\x32\x03\x02\x02\ - \x02\x04\x34\x03\x02\x02\x02\x04\x36\x03\x02\x02\x02\x04\x38\x03\x02\x02\ - \x02\x04\x3a\x03\x02\x02\x02\x05\x3c\x03\x02\x02\x02\x05\x3e\x03\x02\x02\ - \x02\x05\x40\x03\x02\x02\x02\x05\x42\x03\x02\x02\x02\x05\x44\x03\x02\x02\ - \x02\x05\x46\x03\x02\x02\x02\x05\x48\x03\x02\x02\x02\x05\x4a\x03\x02\x02\ - \x02\x06\x4e\x03\x02\x02\x02\x06\x50\x03\x02\x02\x02\x07\x52\x03\x02\x02\ - \x02\x07\x54\x03\x02\x02\x02\x07\x56\x03\x02\x02\x02\x07\x58\x03\x02\x02\ - \x02\x07\x5a\x03\x02\x02\x02\x07\x5c\x03\x02\x02\x02\x08\x5e\x03\x02\x02\ - \x02\x08\x60\x03\x02\x02\x02\x08\x62\x03\x02\x02\x02\x09\x64\x03\x02\x02\ - \x02\x09\x66\x03\x02\x02\x02\x09\x68\x03\x02\x02\x02\x09\x6a\x03\x02\x02\ - \x02\x09\x6c\x03\x02\x02\x02\x09\x6e\x03\x02\x02\x02\x09\x70\x03\x02\x02\ - \x02\x09\x72\x03\x02\x02\x02\x09\x74\x03\x02\x02\x02\x09\x76\x03\x02\x02\ - \x02\x09\x78\x03\x02\x02\x02\x09\x7a\x03\x02\x02\x02\x09\x7c\x03\x02\x02\ - \x02\x09\x7e\x03\x02\x02\x02\x09\u{80}\x03\x02\x02\x02\x09\u{82}\x03\x02\ - \x02\x02\x09\u{84}\x03\x02\x02\x02\x09\u{86}\x03\x02\x02\x02\x09\u{88}\ - \x03\x02\x02\x02\x09\u{8a}\x03\x02\x02\x02\x09\u{8c}\x03\x02\x02\x02\x09\ - \u{8e}\x03\x02\x02\x02\x09\u{90}\x03\x02\x02\x02\x09\u{92}\x03\x02\x02\ - \x02\x09\u{94}\x03\x02\x02\x02\x09\u{96}\x03\x02\x02\x02\x09\u{98}\x03\ - \x02\x02\x02\x09\u{9a}\x03\x02\x02\x02\x09\u{9c}\x03\x02\x02\x02\x09\u{9e}\ - \x03\x02\x02\x02\x09\u{a0}\x03\x02\x02\x02\x09\u{a2}\x03\x02\x02\x02\x09\ - \u{a4}\x03\x02\x02\x02\x09\u{a6}\x03\x02\x02\x02\x09\u{a8}\x03\x02\x02\ - \x02\x09\u{aa}\x03\x02\x02\x02\x09\u{ac}\x03\x02\x02\x02\x09\u{ae}\x03\ - \x02\x02\x02\x09\u{b0}\x03\x02\x02\x02\x0a\u{b6}\x03\x02\x02\x02\x0a\u{b8}\ - \x03\x02\x02\x02\x0a\u{ba}\x03\x02\x02\x02\x0a\u{bc}\x03\x02\x02\x02\x0a\ - \u{be}\x03\x02\x02\x02\x0a\u{c0}\x03\x02\x02\x02\x0a\u{c2}\x03\x02\x02\ - \x02\x0a\u{c4}\x03\x02\x02\x02\x0a\u{c6}\x03\x02\x02\x02\x0a\u{c8}\x03\ - \x02\x02\x02\x0a\u{ca}\x03\x02\x02\x02\x0a\u{cc}\x03\x02\x02\x02\x0a\u{ce}\ - \x03\x02\x02\x02\x0a\u{d0}\x03\x02\x02\x02\x0a\u{d2}\x03\x02\x02\x02\x0a\ - \u{d4}\x03\x02\x02\x02\x0a\u{d6}\x03\x02\x02\x02\x0b\u{d8}\x03\x02\x02\ - \x02\x0b\u{da}\x03\x02\x02\x02\x0b\u{dc}\x03\x02\x02\x02\x0b\u{de}\x03\ - \x02\x02\x02\x0c\u{e0}\x03\x02\x02\x02\x0c\u{e2}\x03\x02\x02\x02\x0c\u{e4}\ - \x03\x02\x02\x02\x0d\u{e6}\x03\x02\x02\x02\x0d\u{e8}\x03\x02\x02\x02\x0d\ - \u{ea}\x03\x02\x02\x02\x0e\u{ed}\x03\x02\x02\x02\x10\u{f3}\x03\x02\x02\ - \x02\x12\u{103}\x03\x02\x02\x02\x14\u{10d}\x03\x02\x02\x02\x16\u{112}\x03\ - \x02\x02\x02\x18\u{116}\x03\x02\x02\x02\x1a\u{119}\x03\x02\x02\x02\x1c\ - \u{11d}\x03\x02\x02\x02\x1e\u{123}\x03\x02\x02\x02\x20\u{12c}\x03\x02\x02\ - \x02\x22\u{131}\x03\x02\x02\x02\x24\u{135}\x03\x02\x02\x02\x26\u{13b}\x03\ - \x02\x02\x02\x28\u{13f}\x03\x02\x02\x02\x2a\u{144}\x03\x02\x02\x02\x2c\ - \u{149}\x03\x02\x02\x02\x2e\u{14f}\x03\x02\x02\x02\x30\u{152}\x03\x02\x02\ - \x02\x32\u{157}\x03\x02\x02\x02\x34\u{15d}\x03\x02\x02\x02\x36\u{162}\x03\ - \x02\x02\x02\x38\u{168}\x03\x02\x02\x02\x3a\u{16e}\x03\x02\x02\x02\x3c\ - \u{173}\x03\x02\x02\x02\x3e\u{17c}\x03\x02\x02\x02\x40\u{180}\x03\x02\x02\ - \x02\x42\u{185}\x03\x02\x02\x02\x44\u{18b}\x03\x02\x02\x02\x46\u{190}\x03\ - \x02\x02\x02\x48\u{197}\x03\x02\x02\x02\x4a\u{1a1}\x03\x02\x02\x02\x4c\ - \u{1a3}\x03\x02\x02\x02\x4e\u{1a5}\x03\x02\x02\x02\x50\u{1aa}\x03\x02\x02\ - \x02\x52\u{1ae}\x03\x02\x02\x02\x54\u{1b2}\x03\x02\x02\x02\x56\u{1b6}\x03\ - \x02\x02\x02\x58\u{1bc}\x03\x02\x02\x02\x5a\u{1c1}\x03\x02\x02\x02\x5c\ - \u{1c6}\x03\x02\x02\x02\x5e\u{1c8}\x03\x02\x02\x02\x60\u{1cc}\x03\x02\x02\ - \x02\x62\u{1d1}\x03\x02\x02\x02\x64\u{1d7}\x03\x02\x02\x02\x66\u{1db}\x03\ - \x02\x02\x02\x68\u{1e0}\x03\x02\x02\x02\x6a\u{1e6}\x03\x02\x02\x02\x6c\ - \u{1ee}\x03\x02\x02\x02\x6e\u{1f5}\x03\x02\x02\x02\x70\u{1fc}\x03\x02\x02\ - \x02\x72\u{204}\x03\x02\x02\x02\x74\u{209}\x03\x02\x02\x02\x76\u{20e}\x03\ - \x02\x02\x02\x78\u{215}\x03\x02\x02\x02\x7a\u{21c}\x03\x02\x02\x02\x7c\ - \u{222}\x03\x02\x02\x02\x7e\u{228}\x03\x02\x02\x02\u{80}\u{22e}\x03\x02\ - \x02\x02\u{82}\u{230}\x03\x02\x02\x02\u{84}\u{233}\x03\x02\x02\x02\u{86}\ - \u{236}\x03\x02\x02\x02\u{88}\u{239}\x03\x02\x02\x02\u{8a}\u{23c}\x03\x02\ - \x02\x02\u{8c}\u{23f}\x03\x02\x02\x02\u{8e}\u{241}\x03\x02\x02\x02\u{90}\ - \u{243}\x03\x02\x02\x02\u{92}\u{245}\x03\x02\x02\x02\u{94}\u{247}\x03\x02\ - \x02\x02\u{96}\u{249}\x03\x02\x02\x02\u{98}\u{24b}\x03\x02\x02\x02\u{9a}\ - \u{24d}\x03\x02\x02\x02\u{9c}\u{24f}\x03\x02\x02\x02\u{9e}\u{252}\x03\x02\ - \x02\x02\u{a0}\u{25b}\x03\x02\x02\x02\u{a2}\u{264}\x03\x02\x02\x02\u{a4}\ - \u{26b}\x03\x02\x02\x02\u{a6}\u{276}\x03\x02\x02\x02\u{a8}\u{278}\x03\x02\ - \x02\x02\u{aa}\u{27c}\x03\x02\x02\x02\u{ac}\u{283}\x03\x02\x02\x02\u{ae}\ - \u{286}\x03\x02\x02\x02\u{b0}\u{28d}\x03\x02\x02\x02\u{b2}\u{290}\x03\x02\ - \x02\x02\u{b4}\u{294}\x03\x02\x02\x02\u{b6}\u{296}\x03\x02\x02\x02\u{b8}\ - \u{298}\x03\x02\x02\x02\u{ba}\u{29c}\x03\x02\x02\x02\u{bc}\u{2a3}\x03\x02\ - \x02\x02\u{be}\u{2ae}\x03\x02\x02\x02\u{c0}\u{2b6}\x03\x02\x02\x02\u{c2}\ - \u{2be}\x03\x02\x02\x02\u{c4}\u{2c4}\x03\x02\x02\x02\u{c6}\u{2cd}\x03\x02\ - \x02\x02\u{c8}\u{2d9}\x03\x02\x02\x02\u{ca}\u{2e2}\x03\x02\x02\x02\u{cc}\ - \u{2eb}\x03\x02\x02\x02\u{ce}\u{2f4}\x03\x02\x02\x02\u{d0}\u{2ff}\x03\x02\ - \x02\x02\u{d2}\u{307}\x03\x02\x02\x02\u{d4}\u{30c}\x03\x02\x02\x02\u{d6}\ - \u{312}\x03\x02\x02\x02\u{d8}\u{317}\x03\x02\x02\x02\u{da}\u{319}\x03\x02\ - \x02\x02\u{dc}\u{31e}\x03\x02\x02\x02\u{de}\u{323}\x03\x02\x02\x02\u{e0}\ - \u{327}\x03\x02\x02\x02\u{e2}\u{329}\x03\x02\x02\x02\u{e4}\u{32e}\x03\x02\ - \x02\x02\u{e6}\u{334}\x03\x02\x02\x02\u{e8}\u{339}\x03\x02\x02\x02\u{ea}\ - \u{33e}\x03\x02\x02\x02\u{ec}\u{ee}\x09\x02\x02\x02\u{ed}\u{ec}\x03\x02\ - \x02\x02\u{ee}\u{ef}\x03\x02\x02\x02\u{ef}\u{ed}\x03\x02\x02\x02\u{ef}\ - \u{f0}\x03\x02\x02\x02\u{f0}\u{f1}\x03\x02\x02\x02\u{f1}\u{f2}\x08\x02\ - \x02\x02\u{f2}\x0f\x03\x02\x02\x02\u{f3}\u{f4}\x07\x31\x02\x02\u{f4}\u{f5}\ - \x07\x31\x02\x02\u{f5}\u{f9}\x03\x02\x02\x02\u{f6}\u{f8}\x0a\x03\x02\x02\ - \u{f7}\u{f6}\x03\x02\x02\x02\u{f8}\u{fb}\x03\x02\x02\x02\u{f9}\u{f7}\x03\ - \x02\x02\x02\u{f9}\u{fa}\x03\x02\x02\x02\u{fa}\u{fc}\x03\x02\x02\x02\u{fb}\ - \u{f9}\x03\x02\x02\x02\u{fc}\u{fd}\x08\x03\x03\x02\u{fd}\x11\x03\x02\x02\ - \x02\u{fe}\u{100}\x07\x0f\x02\x02\u{ff}\u{fe}\x03\x02\x02\x02\u{ff}\u{100}\ - \x03\x02\x02\x02\u{100}\u{101}\x03\x02\x02\x02\u{101}\u{104}\x07\x0c\x02\ - \x02\u{102}\u{104}\x07\x0f\x02\x02\u{103}\u{ff}\x03\x02\x02\x02\u{103}\ - \u{102}\x03\x02\x02\x02\u{104}\u{108}\x03\x02\x02\x02\u{105}\u{107}\x09\ - \x02\x02\x02\u{106}\u{105}\x03\x02\x02\x02\u{107}\u{10a}\x03\x02\x02\x02\ - \u{108}\u{106}\x03\x02\x02\x02\u{108}\u{109}\x03\x02\x02\x02\u{109}\u{10b}\ - \x03\x02\x02\x02\u{10a}\u{108}\x03\x02\x02\x02\u{10b}\u{10c}\x08\x04\x04\ - \x02\u{10c}\x13\x03\x02\x02\x02\u{10d}\u{10f}\x05\x16\x06\x02\u{10e}\u{110}\ - \x05\x1a\x08\x02\u{10f}\u{10e}\x03\x02\x02\x02\u{10f}\u{110}\x03\x02\x02\ - \x02\u{110}\x15\x03\x02\x02\x02\u{111}\u{113}\x09\x0f\x02\x02\u{112}\u{111}\ - \x03\x02\x02\x02\u{113}\x17\x03\x02\x02\x02\u{114}\u{117}\x09\x04\x02\x02\ - \u{115}\u{117}\x05\x16\x06\x02\u{116}\u{114}\x03\x02\x02\x02\u{116}\u{115}\ - \x03\x02\x02\x02\u{117}\x19\x03\x02\x02\x02\u{118}\u{11a}\x05\x18\x07\x02\ - \u{119}\u{118}\x03\x02\x02\x02\u{11a}\u{11b}\x03\x02\x02\x02\u{11b}\u{119}\ - \x03\x02\x02\x02\u{11b}\u{11c}\x03\x02\x02\x02\u{11c}\x1b\x03\x02\x02\x02\ - \u{11d}\u{11e}\x07\x2f\x02\x02\u{11e}\u{11f}\x07\x2f\x02\x02\u{11f}\u{120}\ - \x07\x2f\x02\x02\u{120}\u{121}\x03\x02\x02\x02\u{121}\u{122}\x08\x09\x05\ - \x02\u{122}\x1d\x03\x02\x02\x02\u{123}\u{127}\x07\x3c\x02\x02\u{124}\u{126}\ - \x09\x05\x02\x02\u{125}\u{124}\x03\x02\x02\x02\u{126}\u{129}\x03\x02\x02\ - \x02\u{127}\u{125}\x03\x02\x02\x02\u{127}\u{128}\x03\x02\x02\x02\u{128}\ - \u{12a}\x03\x02\x02\x02\u{129}\u{127}\x03\x02\x02\x02\u{12a}\u{12b}\x08\ - \x0a\x06\x02\u{12b}\x1f\x03\x02\x02\x02\u{12c}\u{12d}\x07\x25\x02\x02\u{12d}\ - \u{12e}\x03\x02\x02\x02\u{12e}\u{12f}\x08\x0b\x07\x02\u{12f}\x21\x03\x02\ - \x02\x02\u{130}\u{132}\x0a\x03\x02\x02\u{131}\u{130}\x03\x02\x02\x02\u{132}\ - \u{133}\x03\x02\x02\x02\u{133}\u{131}\x03\x02\x02\x02\u{133}\u{134}\x03\ - \x02\x02\x02\u{134}\x23\x03\x02\x02\x02\u{135}\u{136}\x05\x12\x04\x02\u{136}\ - \u{137}\x03\x02\x02\x02\u{137}\u{138}\x08\x0d\x08\x02\u{138}\u{139}\x08\ - \x0d\x04\x02\u{139}\u{13a}\x08\x0d\x09\x02\u{13a}\x25\x03\x02\x02\x02\u{13b}\ - \u{13c}\x05\x0e\x02\x02\u{13c}\u{13d}\x03\x02\x02\x02\u{13d}\u{13e}\x08\ - \x0e\x02\x02\u{13e}\x27\x03\x02\x02\x02\u{13f}\u{140}\x05\x12\x04\x02\u{140}\ - \u{141}\x03\x02\x02\x02\u{141}\u{142}\x08\x0f\x08\x02\u{142}\u{143}\x08\ - \x0f\x04\x02\u{143}\x29\x03\x02\x02\x02\u{144}\u{145}\x05\x10\x03\x02\u{145}\ - \u{146}\x03\x02\x02\x02\u{146}\u{147}\x08\x10\x0a\x02\u{147}\u{148}\x08\ - \x10\x03\x02\u{148}\x2b\x03\x02\x02\x02\u{149}\u{14a}\x07\x3f\x02\x02\u{14a}\ - \u{14b}\x07\x3f\x02\x02\u{14b}\u{14c}\x07\x3f\x02\x02\u{14c}\u{14d}\x03\ - \x02\x02\x02\u{14d}\u{14e}\x08\x11\x09\x02\u{14e}\x2d\x03\x02\x02\x02\u{14f}\ - \u{150}\x07\x2f\x02\x02\u{150}\u{151}\x07\x40\x02\x02\u{151}\x2f\x03\x02\ - \x02\x02\u{152}\u{153}\x07\x3e\x02\x02\u{153}\u{154}\x07\x3e\x02\x02\u{154}\ - \u{155}\x03\x02\x02\x02\u{155}\u{156}\x08\x13\x0b\x02\u{156}\x31\x03\x02\ - \x02\x02\u{157}\u{158}\x07\x25\x02\x02\u{158}\u{159}\x03\x02\x02\x02\u{159}\ - \u{15a}\x08\x14\x0c\x02\u{15a}\u{15b}\x08\x14\x0d\x02\u{15b}\u{15c}\x08\ - \x14\x07\x02\u{15c}\x33\x03\x02\x02\x02\u{15d}\u{15e}\x07\x7d\x02\x02\u{15e}\ - \u{15f}\x03\x02\x02\x02\u{15f}\u{160}\x08\x15\x0e\x02\u{160}\u{161}\x08\ - \x15\x0f\x02\u{161}\x35\x03\x02\x02\x02\u{162}\u{163}\x07\x5e\x02\x02\u{163}\ - \u{164}\x07\x5d\x02\x02\u{164}\u{165}\x03\x02\x02\x02\u{165}\u{166}\x08\ - \x16\x10\x02\u{166}\u{167}\x08\x16\x0e\x02\u{167}\x37\x03\x02\x02\x02\u{168}\ - \u{169}\x07\x5e\x02\x02\u{169}\u{16a}\x03\x02\x02\x02\u{16a}\u{16b}\x08\ - \x17\x02\x02\u{16b}\u{16c}\x08\x17\x0e\x02\u{16c}\u{16d}\x08\x17\x11\x02\ - \u{16d}\x39\x03\x02\x02\x02\u{16e}\u{16f}\x0b\x02\x02\x02\u{16f}\u{170}\ - \x03\x02\x02\x02\u{170}\u{171}\x08\x18\x10\x02\u{171}\u{172}\x08\x18\x0e\ - \x02\u{172}\x3b\x03\x02\x02\x02\u{173}\u{174}\x05\x12\x04\x02\u{174}\u{175}\ - \x03\x02\x02\x02\u{175}\u{176}\x08\x19\x08\x02\u{176}\u{177}\x08\x19\x09\ - \x02\u{177}\x3d\x03\x02\x02\x02\u{178}\u{179}\x07\x5e\x02\x02\u{179}\u{17d}\ - \x07\x5d\x02\x02\u{17a}\u{17b}\x07\x5e\x02\x02\u{17b}\u{17d}\x07\x5f\x02\ - \x02\u{17c}\u{178}\x03\x02\x02\x02\u{17c}\u{17a}\x03\x02\x02\x02\u{17d}\ - \u{17e}\x03\x02\x02\x02\u{17e}\u{17f}\x08\x1a\x10\x02\u{17f}\x3f\x03\x02\ - \x02\x02\u{180}\u{181}\x07\x5e\x02\x02\u{181}\u{182}\x03\x02\x02\x02\u{182}\ - \u{183}\x08\x1b\x12\x02\u{183}\u{184}\x08\x1b\x11\x02\u{184}\x41\x03\x02\ - \x02\x02\u{185}\u{186}\x05\x20\x0b\x02\u{186}\u{187}\x03\x02\x02\x02\u{187}\ - \u{188}\x08\x1c\x0c\x02\u{188}\u{189}\x08\x1c\x13\x02\u{189}\u{18a}\x08\ - \x1c\x07\x02\u{18a}\x43\x03\x02\x02\x02\u{18b}\u{18c}\x07\x7d\x02\x02\u{18c}\ - \u{18d}\x03\x02\x02\x02\u{18d}\u{18e}\x08\x1d\x14\x02\u{18e}\u{18f}\x08\ - \x1d\x0f\x02\u{18f}\x45\x03\x02\x02\x02\u{190}\u{191}\x07\x3e\x02\x02\u{191}\ - \u{192}\x07\x3e\x02\x02\u{192}\u{193}\x03\x02\x02\x02\u{193}\u{194}\x08\ - \x1e\x15\x02\u{194}\u{195}\x08\x1e\x13\x02\u{195}\u{196}\x08\x1e\x0b\x02\ - \u{196}\x47\x03\x02\x02\x02\u{197}\u{198}\x05\x10\x03\x02\u{198}\u{199}\ - \x03\x02\x02\x02\u{199}\u{19a}\x08\x1f\x03\x02\u{19a}\x49\x03\x02\x02\x02\ - \u{19b}\u{19d}\x05\x4c\x21\x02\u{19c}\u{19b}\x03\x02\x02\x02\u{19d}\u{19e}\ - \x03\x02\x02\x02\u{19e}\u{19c}\x03\x02\x02\x02\u{19e}\u{19f}\x03\x02\x02\ - \x02\u{19f}\u{1a2}\x03\x02\x02\x02\u{1a0}\u{1a2}\x09\x06\x02\x02\u{1a1}\ - \u{19c}\x03\x02\x02\x02\u{1a1}\u{1a0}\x03\x02\x02\x02\u{1a2}\x4b\x03\x02\ - \x02\x02\u{1a3}\u{1a4}\x0a\x07\x02\x02\u{1a4}\x4d\x03\x02\x02\x02\u{1a5}\ - \u{1a6}\x09\x08\x02\x02\u{1a6}\u{1a7}\x03\x02\x02\x02\u{1a7}\u{1a8}\x08\ - \x22\x10\x02\u{1a8}\u{1a9}\x08\x22\x09\x02\u{1a9}\x4f\x03\x02\x02\x02\u{1aa}\ - \u{1ab}\x0b\x02\x02\x02\u{1ab}\u{1ac}\x03\x02\x02\x02\u{1ac}\u{1ad}\x08\ - \x23\x09\x02\u{1ad}\x51\x03\x02\x02\x02\u{1ae}\u{1af}\x05\x0e\x02\x02\u{1af}\ - \u{1b0}\x03\x02\x02\x02\u{1b0}\u{1b1}\x08\x24\x02\x02\u{1b1}\x53\x03\x02\ - \x02\x02\u{1b2}\u{1b3}\x05\x10\x03\x02\u{1b3}\u{1b4}\x03\x02\x02\x02\u{1b4}\ - \u{1b5}\x08\x25\x03\x02\u{1b5}\x55\x03\x02\x02\x02\u{1b6}\u{1b7}\x07\x3e\ - \x02\x02\u{1b7}\u{1b8}\x07\x3e\x02\x02\u{1b8}\u{1b9}\x03\x02\x02\x02\u{1b9}\ - \u{1ba}\x08\x26\x15\x02\u{1ba}\u{1bb}\x08\x26\x0b\x02\u{1bb}\x57\x03\x02\ - \x02\x02\u{1bc}\u{1bd}\x07\x25\x02\x02\u{1bd}\u{1be}\x03\x02\x02\x02\u{1be}\ - \u{1bf}\x08\x27\x0c\x02\u{1bf}\u{1c0}\x08\x27\x07\x02\u{1c0}\x59\x03\x02\ - \x02\x02\u{1c1}\u{1c2}\x05\x12\x04\x02\u{1c2}\u{1c3}\x03\x02\x02\x02\u{1c3}\ - \u{1c4}\x08\x28\x08\x02\u{1c4}\u{1c5}\x08\x28\x09\x02\u{1c5}\x5b\x03\x02\ - \x02\x02\u{1c6}\u{1c7}\x0b\x02\x02\x02\u{1c7}\x5d\x03\x02\x02\x02\u{1c8}\ - \u{1c9}\x05\x0e\x02\x02\u{1c9}\u{1ca}\x03\x02\x02\x02\u{1ca}\u{1cb}\x08\ - \x2a\x02\x02\u{1cb}\x5f\x03\x02\x02\x02\u{1cc}\u{1cd}\x05\x20\x0b\x02\u{1cd}\ - \u{1ce}\x03\x02\x02\x02\u{1ce}\u{1cf}\x08\x2b\x0c\x02\u{1cf}\x61\x03\x02\ - \x02\x02\u{1d0}\u{1d2}\x0a\x09\x02\x02\u{1d1}\u{1d0}\x03\x02\x02\x02\u{1d2}\ - \u{1d3}\x03\x02\x02\x02\u{1d3}\u{1d1}\x03\x02\x02\x02\u{1d3}\u{1d4}\x03\ - \x02\x02\x02\u{1d4}\u{1d5}\x03\x02\x02\x02\u{1d5}\u{1d6}\x08\x2c\x09\x02\ - \u{1d6}\x63\x03\x02\x02\x02\u{1d7}\u{1d8}\x05\x0e\x02\x02\u{1d8}\u{1d9}\ - \x03\x02\x02\x02\u{1d9}\u{1da}\x08\x2d\x02\x02\u{1da}\x65\x03\x02\x02\x02\ - \u{1db}\u{1dc}\x07\x76\x02\x02\u{1dc}\u{1dd}\x07\x74\x02\x02\u{1dd}\u{1de}\ - \x07\x77\x02\x02\u{1de}\u{1df}\x07\x67\x02\x02\u{1df}\x67\x03\x02\x02\x02\ - \u{1e0}\u{1e1}\x07\x68\x02\x02\u{1e1}\u{1e2}\x07\x63\x02\x02\u{1e2}\u{1e3}\ - \x07\x6e\x02\x02\u{1e3}\u{1e4}\x07\x75\x02\x02\u{1e4}\u{1e5}\x07\x67\x02\ - \x02\u{1e5}\x69\x03\x02\x02\x02\u{1e6}\u{1e7}\x07\x70\x02\x02\u{1e7}\u{1e8}\ - \x07\x77\x02\x02\u{1e8}\u{1e9}\x07\x6e\x02\x02\u{1e9}\u{1ea}\x07\x6e\x02\ - \x02\u{1ea}\x6b\x03\x02\x02\x02\u{1eb}\u{1ef}\x07\x3f\x02\x02\u{1ec}\u{1ed}\ - \x07\x76\x02\x02\u{1ed}\u{1ef}\x07\x71\x02\x02\u{1ee}\u{1eb}\x03\x02\x02\ - \x02\u{1ee}\u{1ec}\x03\x02\x02\x02\u{1ef}\x6d\x03\x02\x02\x02\u{1f0}\u{1f1}\ - \x07\x3e\x02\x02\u{1f1}\u{1f6}\x07\x3f\x02\x02\u{1f2}\u{1f3}\x07\x6e\x02\ - \x02\u{1f3}\u{1f4}\x07\x76\x02\x02\u{1f4}\u{1f6}\x07\x67\x02\x02\u{1f5}\ - \u{1f0}\x03\x02\x02\x02\u{1f5}\u{1f2}\x03\x02\x02\x02\u{1f6}\x6f\x03\x02\ - \x02\x02\u{1f7}\u{1f8}\x07\x40\x02\x02\u{1f8}\u{1fd}\x07\x3f\x02\x02\u{1f9}\ - \u{1fa}\x07\x69\x02\x02\u{1fa}\u{1fb}\x07\x76\x02\x02\u{1fb}\u{1fd}\x07\ - \x67\x02\x02\u{1fc}\u{1f7}\x03\x02\x02\x02\u{1fc}\u{1f9}\x03\x02\x02\x02\ - \u{1fd}\x71\x03\x02\x02\x02\u{1fe}\u{1ff}\x07\x3f\x02\x02\u{1ff}\u{205}\ - \x07\x3f\x02\x02\u{200}\u{201}\x07\x6b\x02\x02\u{201}\u{205}\x07\x75\x02\ - \x02\u{202}\u{203}\x07\x67\x02\x02\u{203}\u{205}\x07\x73\x02\x02\u{204}\ - \u{1fe}\x03\x02\x02\x02\u{204}\u{200}\x03\x02\x02\x02\u{204}\u{202}\x03\ - \x02\x02\x02\u{205}\x73\x03\x02\x02\x02\u{206}\u{20a}\x07\x3e\x02\x02\u{207}\ - \u{208}\x07\x6e\x02\x02\u{208}\u{20a}\x07\x76\x02\x02\u{209}\u{206}\x03\ - \x02\x02\x02\u{209}\u{207}\x03\x02\x02\x02\u{20a}\x75\x03\x02\x02\x02\u{20b}\ - \u{20f}\x07\x40\x02\x02\u{20c}\u{20d}\x07\x69\x02\x02\u{20d}\u{20f}\x07\ - \x76\x02\x02\u{20e}\u{20b}\x03\x02\x02\x02\u{20e}\u{20c}\x03\x02\x02\x02\ - \u{20f}\x77\x03\x02\x02\x02\u{210}\u{211}\x07\x23\x02\x02\u{211}\u{216}\ - \x07\x3f\x02\x02\u{212}\u{213}\x07\x70\x02\x02\u{213}\u{214}\x07\x67\x02\ - \x02\u{214}\u{216}\x07\x73\x02\x02\u{215}\u{210}\x03\x02\x02\x02\u{215}\ - \u{212}\x03\x02\x02\x02\u{216}\x79\x03\x02\x02\x02\u{217}\u{218}\x07\x63\ - \x02\x02\u{218}\u{219}\x07\x70\x02\x02\u{219}\u{21d}\x07\x66\x02\x02\u{21a}\ - \u{21b}\x07\x28\x02\x02\u{21b}\u{21d}\x07\x28\x02\x02\u{21c}\u{217}\x03\ - \x02\x02\x02\u{21c}\u{21a}\x03\x02\x02\x02\u{21d}\x7b\x03\x02\x02\x02\u{21e}\ - \u{21f}\x07\x71\x02\x02\u{21f}\u{223}\x07\x74\x02\x02\u{220}\u{221}\x07\ - \x7e\x02\x02\u{221}\u{223}\x07\x7e\x02\x02\u{222}\u{21e}\x03\x02\x02\x02\ - \u{222}\u{220}\x03\x02\x02\x02\u{223}\x7d\x03\x02\x02\x02\u{224}\u{225}\ - \x07\x7a\x02\x02\u{225}\u{226}\x07\x71\x02\x02\u{226}\u{229}\x07\x74\x02\ - \x02\u{227}\u{229}\x07\x60\x02\x02\u{228}\u{224}\x03\x02\x02\x02\u{228}\ - \u{227}\x03\x02\x02\x02\u{229}\x7f\x03\x02\x02\x02\u{22a}\u{22b}\x07\x70\ - \x02\x02\u{22b}\u{22c}\x07\x71\x02\x02\u{22c}\u{22f}\x07\x76\x02\x02\u{22d}\ - \u{22f}\x07\x23\x02\x02\u{22e}\u{22a}\x03\x02\x02\x02\u{22e}\u{22d}\x03\ - \x02\x02\x02\u{22f}\u{81}\x03\x02\x02\x02\u{230}\u{231}\x07\x2d\x02\x02\ - \u{231}\u{232}\x07\x3f\x02\x02\u{232}\u{83}\x03\x02\x02\x02\u{233}\u{234}\ - \x07\x2f\x02\x02\u{234}\u{235}\x07\x3f\x02\x02\u{235}\u{85}\x03\x02\x02\ - \x02\u{236}\u{237}\x07\x2c\x02\x02\u{237}\u{238}\x07\x3f\x02\x02\u{238}\ - \u{87}\x03\x02\x02\x02\u{239}\u{23a}\x07\x27\x02\x02\u{23a}\u{23b}\x07\ - \x3f\x02\x02\u{23b}\u{89}\x03\x02\x02\x02\u{23c}\u{23d}\x07\x31\x02\x02\ - \u{23d}\u{23e}\x07\x3f\x02\x02\u{23e}\u{8b}\x03\x02\x02\x02\u{23f}\u{240}\ - \x07\x2d\x02\x02\u{240}\u{8d}\x03\x02\x02\x02\u{241}\u{242}\x07\x2f\x02\ - \x02\u{242}\u{8f}\x03\x02\x02\x02\u{243}\u{244}\x07\x2c\x02\x02\u{244}\ - \u{91}\x03\x02\x02\x02\u{245}\u{246}\x07\x31\x02\x02\u{246}\u{93}\x03\x02\ - \x02\x02\u{247}\u{248}\x07\x27\x02\x02\u{248}\u{95}\x03\x02\x02\x02\u{249}\ - \u{24a}\x07\x2a\x02\x02\u{24a}\u{97}\x03\x02\x02\x02\u{24b}\u{24c}\x07\ - \x2b\x02\x02\u{24c}\u{99}\x03\x02\x02\x02\u{24d}\u{24e}\x07\x2e\x02\x02\ - \u{24e}\u{9b}\x03\x02\x02\x02\u{24f}\u{250}\x07\x63\x02\x02\u{250}\u{251}\ - \x07\x75\x02\x02\u{251}\u{9d}\x03\x02\x02\x02\u{252}\u{253}\x07\x75\x02\ - \x02\u{253}\u{254}\x07\x76\x02\x02\u{254}\u{255}\x07\x74\x02\x02\u{255}\ - \u{256}\x07\x6b\x02\x02\u{256}\u{257}\x07\x70\x02\x02\u{257}\u{258}\x07\ - \x69\x02\x02\u{258}\u{259}\x03\x02\x02\x02\u{259}\u{25a}\x08\x4a\x16\x02\ - \u{25a}\u{9f}\x03\x02\x02\x02\u{25b}\u{25c}\x07\x70\x02\x02\u{25c}\u{25d}\ - \x07\x77\x02\x02\u{25d}\u{25e}\x07\x6f\x02\x02\u{25e}\u{25f}\x07\x64\x02\ - \x02\u{25f}\u{260}\x07\x67\x02\x02\u{260}\u{261}\x07\x74\x02\x02\u{261}\ - \u{262}\x03\x02\x02\x02\u{262}\u{263}\x08\x4b\x16\x02\u{263}\u{a1}\x03\ - \x02\x02\x02\u{264}\u{265}\x07\x64\x02\x02\u{265}\u{266}\x07\x71\x02\x02\ - \u{266}\u{267}\x07\x71\x02\x02\u{267}\u{268}\x07\x6e\x02\x02\u{268}\u{269}\ - \x03\x02\x02\x02\u{269}\u{26a}\x08\x4c\x16\x02\u{26a}\u{a3}\x03\x02\x02\ - \x02\u{26b}\u{271}\x07\x24\x02\x02\u{26c}\u{270}\x0a\x0a\x02\x02\u{26d}\ - \u{26e}\x07\x5e\x02\x02\u{26e}\u{270}\x09\x0b\x02\x02\u{26f}\u{26c}\x03\ - \x02\x02\x02\u{26f}\u{26d}\x03\x02\x02\x02\u{270}\u{273}\x03\x02\x02\x02\ - \u{271}\u{26f}\x03\x02\x02\x02\u{271}\u{272}\x03\x02\x02\x02\u{272}\u{274}\ - \x03\x02\x02\x02\u{273}\u{271}\x03\x02\x02\x02\u{274}\u{275}\x07\x24\x02\ - \x02\u{275}\u{a5}\x03\x02\x02\x02\u{276}\u{277}\x05\x14\x05\x02\u{277}\ - \u{a7}\x03\x02\x02\x02\u{278}\u{279}\x07\x7f\x02\x02\u{279}\u{27a}\x03\ - \x02\x02\x02\u{27a}\u{27b}\x08\x4f\x09\x02\u{27b}\u{a9}\x03\x02\x02\x02\ - \u{27c}\u{27d}\x07\x40\x02\x02\u{27d}\u{27e}\x07\x40\x02\x02\u{27e}\u{27f}\ - \x03\x02\x02\x02\u{27f}\u{280}\x08\x50\x17\x02\u{280}\u{281}\x08\x50\x09\ - \x02\u{281}\u{282}\x08\x50\x09\x02\u{282}\u{ab}\x03\x02\x02\x02\u{283}\ - \u{284}\x07\x26\x02\x02\u{284}\u{285}\x05\x14\x05\x02\u{285}\u{ad}\x03\ - \x02\x02\x02\u{286}\u{287}\x07\x30\x02\x02\u{287}\u{af}\x03\x02\x02\x02\ - \u{288}\u{28e}\x05\u{b2}\x54\x02\u{289}\u{28a}\x05\u{b2}\x54\x02\u{28a}\ - \u{28b}\x07\x30\x02\x02\u{28b}\u{28c}\x05\u{b2}\x54\x02\u{28c}\u{28e}\x03\ - \x02\x02\x02\u{28d}\u{288}\x03\x02\x02\x02\u{28d}\u{289}\x03\x02\x02\x02\ - \u{28e}\u{b1}\x03\x02\x02\x02\u{28f}\u{291}\x05\u{b4}\x55\x02\u{290}\u{28f}\ - \x03\x02\x02\x02\u{291}\u{292}\x03\x02\x02\x02\u{292}\u{290}\x03\x02\x02\ - \x02\u{292}\u{293}\x03\x02\x02\x02\u{293}\u{b3}\x03\x02\x02\x02\u{294}\ - \u{295}\x09\x0c\x02\x02\u{295}\u{b5}\x03\x02\x02\x02\u{296}\u{297}\x05\ - \x12\x04\x02\u{297}\u{b7}\x03\x02\x02\x02\u{298}\u{299}\x05\x0e\x02\x02\ - \u{299}\u{29a}\x03\x02\x02\x02\u{29a}\u{29b}\x08\x57\x02\x02\u{29b}\u{b9}\ - \x03\x02\x02\x02\u{29c}\u{29d}\x07\x6b\x02\x02\u{29d}\u{29e}\x07\x68\x02\ - \x02\u{29e}\u{29f}\x03\x02\x02\x02\u{29f}\u{2a0}\x09\x0d\x02\x02\u{2a0}\ - \u{2a1}\x03\x02\x02\x02\u{2a1}\u{2a2}\x08\x58\x0f\x02\u{2a2}\u{bb}\x03\ - \x02\x02\x02\u{2a3}\u{2a4}\x07\x67\x02\x02\u{2a4}\u{2a5}\x07\x6e\x02\x02\ - \u{2a5}\u{2a6}\x07\x75\x02\x02\u{2a6}\u{2a7}\x07\x67\x02\x02\u{2a7}\u{2a8}\ - \x07\x6b\x02\x02\u{2a8}\u{2a9}\x07\x68\x02\x02\u{2a9}\u{2aa}\x03\x02\x02\ - \x02\u{2aa}\u{2ab}\x09\x0d\x02\x02\u{2ab}\u{2ac}\x03\x02\x02\x02\u{2ac}\ - \u{2ad}\x08\x59\x0f\x02\u{2ad}\u{bd}\x03\x02\x02\x02\u{2ae}\u{2af}\x07\ - \x67\x02\x02\u{2af}\u{2b0}\x07\x6e\x02\x02\u{2b0}\u{2b1}\x07\x75\x02\x02\ - \u{2b1}\u{2b2}\x07\x67\x02\x02\u{2b2}\u{2b4}\x03\x02\x02\x02\u{2b3}\u{2b5}\ - \x09\x0d\x02\x02\u{2b4}\u{2b3}\x03\x02\x02\x02\u{2b4}\u{2b5}\x03\x02\x02\ - \x02\u{2b5}\u{bf}\x03\x02\x02\x02\u{2b6}\u{2b7}\x07\x75\x02\x02\u{2b7}\ - \u{2b8}\x07\x67\x02\x02\u{2b8}\u{2b9}\x07\x76\x02\x02\u{2b9}\u{2ba}\x03\ - \x02\x02\x02\u{2ba}\u{2bb}\x09\x0d\x02\x02\u{2bb}\u{2bc}\x03\x02\x02\x02\ - \u{2bc}\u{2bd}\x08\x5b\x0f\x02\u{2bd}\u{c1}\x03\x02\x02\x02\u{2be}\u{2bf}\ - \x07\x67\x02\x02\u{2bf}\u{2c0}\x07\x70\x02\x02\u{2c0}\u{2c1}\x07\x66\x02\ - \x02\u{2c1}\u{2c2}\x07\x6b\x02\x02\u{2c2}\u{2c3}\x07\x68\x02\x02\u{2c3}\ - \u{c3}\x03\x02\x02\x02\u{2c4}\u{2c5}\x07\x65\x02\x02\u{2c5}\u{2c6}\x07\ - \x63\x02\x02\u{2c6}\u{2c7}\x07\x6e\x02\x02\u{2c7}\u{2c8}\x07\x6e\x02\x02\ - \u{2c8}\u{2c9}\x03\x02\x02\x02\u{2c9}\u{2ca}\x09\x0d\x02\x02\u{2ca}\u{2cb}\ - \x03\x02\x02\x02\u{2cb}\u{2cc}\x08\x5d\x0f\x02\u{2cc}\u{c5}\x03\x02\x02\ - \x02\u{2cd}\u{2ce}\x07\x66\x02\x02\u{2ce}\u{2cf}\x07\x67\x02\x02\u{2cf}\ - \u{2d0}\x07\x65\x02\x02\u{2d0}\u{2d1}\x07\x6e\x02\x02\u{2d1}\u{2d2}\x07\ - \x63\x02\x02\u{2d2}\u{2d3}\x07\x74\x02\x02\u{2d3}\u{2d4}\x07\x67\x02\x02\ - \u{2d4}\u{2d5}\x03\x02\x02\x02\u{2d5}\u{2d6}\x09\x0d\x02\x02\u{2d6}\u{2d7}\ - \x03\x02\x02\x02\u{2d7}\u{2d8}\x08\x5e\x0f\x02\u{2d8}\u{c7}\x03\x02\x02\ - \x02\u{2d9}\u{2da}\x07\x6c\x02\x02\u{2da}\u{2db}\x07\x77\x02\x02\u{2db}\ - \u{2dc}\x07\x6f\x02\x02\u{2dc}\u{2dd}\x07\x72\x02\x02\u{2dd}\u{2de}\x03\ - \x02\x02\x02\u{2de}\u{2df}\x09\x0d\x02\x02\u{2df}\u{2e0}\x03\x02\x02\x02\ - \u{2e0}\u{2e1}\x08\x5f\x18\x02\u{2e1}\u{c9}\x03\x02\x02\x02\u{2e2}\u{2e3}\ - \x07\x67\x02\x02\u{2e3}\u{2e4}\x07\x70\x02\x02\u{2e4}\u{2e5}\x07\x77\x02\ - \x02\u{2e5}\u{2e6}\x07\x6f\x02\x02\u{2e6}\u{2e7}\x03\x02\x02\x02\u{2e7}\ - \u{2e8}\x09\x0d\x02\x02\u{2e8}\u{2e9}\x03\x02\x02\x02\u{2e9}\u{2ea}\x08\ - \x60\x19\x02\u{2ea}\u{cb}\x03\x02\x02\x02\u{2eb}\u{2ec}\x07\x65\x02\x02\ - \u{2ec}\u{2ed}\x07\x63\x02\x02\u{2ed}\u{2ee}\x07\x75\x02\x02\u{2ee}\u{2ef}\ - \x07\x67\x02\x02\u{2ef}\u{2f0}\x03\x02\x02\x02\u{2f0}\u{2f1}\x09\x0d\x02\ - \x02\u{2f1}\u{2f2}\x03\x02\x02\x02\u{2f2}\u{2f3}\x08\x61\x19\x02\u{2f3}\ - \u{cd}\x03\x02\x02\x02\u{2f4}\u{2f5}\x07\x67\x02\x02\u{2f5}\u{2f6}\x07\ - \x70\x02\x02\u{2f6}\u{2f7}\x07\x66\x02\x02\u{2f7}\u{2f8}\x07\x67\x02\x02\ - \u{2f8}\u{2f9}\x07\x70\x02\x02\u{2f9}\u{2fa}\x07\x77\x02\x02\u{2fa}\u{2fb}\ - \x07\x6f\x02\x02\u{2fb}\u{2fd}\x03\x02\x02\x02\u{2fc}\u{2fe}\x09\x0d\x02\ - \x02\u{2fd}\u{2fc}\x03\x02\x02\x02\u{2fd}\u{2fe}\x03\x02\x02\x02\u{2fe}\ - \u{cf}\x03\x02\x02\x02\u{2ff}\u{300}\x07\x6e\x02\x02\u{300}\u{301}\x07\ - \x71\x02\x02\u{301}\u{302}\x07\x65\x02\x02\u{302}\u{303}\x07\x63\x02\x02\ - \u{303}\u{304}\x07\x6e\x02\x02\u{304}\u{305}\x03\x02\x02\x02\u{305}\u{306}\ - \x09\x0d\x02\x02\u{306}\u{d1}\x03\x02\x02\x02\u{307}\u{308}\x07\x40\x02\ - \x02\u{308}\u{309}\x07\x40\x02\x02\u{309}\u{30a}\x03\x02\x02\x02\u{30a}\ - \u{30b}\x08\x64\x09\x02\u{30b}\u{d3}\x03\x02\x02\x02\u{30c}\u{30d}\x07\ - \x7d\x02\x02\u{30d}\u{30e}\x03\x02\x02\x02\u{30e}\u{30f}\x08\x65\x1a\x02\ - \u{30f}\u{310}\x08\x65\x1b\x02\u{310}\u{311}\x08\x65\x0f\x02\u{311}\u{d5}\ - \x03\x02\x02\x02\u{312}\u{313}\x0b\x02\x02\x02\u{313}\u{314}\x03\x02\x02\ - \x02\u{314}\u{315}\x08\x66\x1c\x02\u{315}\u{316}\x08\x66\x1b\x02\u{316}\ - \u{d7}\x03\x02\x02\x02\u{317}\u{318}\x05\x12\x04\x02\u{318}\u{d9}\x03\x02\ - \x02\x02\u{319}\u{31a}\x07\x40\x02\x02\u{31a}\u{31b}\x07\x40\x02\x02\u{31b}\ - \u{31c}\x03\x02\x02\x02\u{31c}\u{31d}\x08\x68\x09\x02\u{31d}\u{db}\x03\ - \x02\x02\x02\u{31e}\u{31f}\x07\x7d\x02\x02\u{31f}\u{320}\x03\x02\x02\x02\ - \u{320}\u{321}\x08\x69\x0f\x02\u{321}\u{dd}\x03\x02\x02\x02\u{322}\u{324}\ - \x0a\x0e\x02\x02\u{323}\u{322}\x03\x02\x02\x02\u{324}\u{325}\x03\x02\x02\ - \x02\u{325}\u{323}\x03\x02\x02\x02\u{325}\u{326}\x03\x02\x02\x02\u{326}\ - \u{df}\x03\x02\x02\x02\u{327}\u{328}\x05\x12\x04\x02\u{328}\u{e1}\x03\x02\ - \x02\x02\u{329}\u{32a}\x05\x14\x05\x02\u{32a}\u{32b}\x03\x02\x02\x02\u{32b}\ - \u{32c}\x08\x6c\x1d\x02\u{32c}\u{32d}\x08\x6c\x09\x02\u{32d}\u{e3}\x03\ - \x02\x02\x02\u{32e}\u{32f}\x07\x40\x02\x02\u{32f}\u{330}\x07\x40\x02\x02\ - \u{330}\u{331}\x03\x02\x02\x02\u{331}\u{332}\x08\x6d\x17\x02\u{332}\u{333}\ - \x08\x6d\x09\x02\u{333}\u{e5}\x03\x02\x02\x02\u{334}\u{335}\x05\x14\x05\ - \x02\u{335}\u{336}\x03\x02\x02\x02\u{336}\u{337}\x08\x6e\x1d\x02\u{337}\ - \u{338}\x08\x6e\x09\x02\u{338}\u{e7}\x03\x02\x02\x02\u{339}\u{33a}\x05\ - \x34\x15\x02\u{33a}\u{33b}\x03\x02\x02\x02\u{33b}\u{33c}\x08\x6f\x14\x02\ - \u{33c}\u{33d}\x08\x6f\x1e\x02\u{33d}\u{e9}\x03\x02\x02\x02\u{33e}\u{33f}\ - \x07\x40\x02\x02\u{33f}\u{340}\x07\x40\x02\x02\u{340}\u{341}\x03\x02\x02\ - \x02\u{341}\u{342}\x08\x70\x17\x02\u{342}\u{343}\x08\x70\x09\x02\u{343}\ - \u{eb}\x03\x02\x02\x02\x2f\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\ - \x0d\u{ef}\u{f9}\u{ff}\u{103}\u{108}\u{10f}\u{112}\u{116}\u{11b}\u{127}\ - \u{133}\u{17c}\u{19e}\u{1a1}\u{1d3}\u{1ee}\u{1f5}\u{1fc}\u{204}\u{209}\ - \u{20e}\u{215}\u{21c}\u{222}\u{228}\u{22e}\u{26f}\u{271}\u{28d}\u{292}\ - \u{2b4}\u{2fd}\u{325}\x1f\x02\x03\x02\x02\x05\x02\x02\x04\x02\x07\x04\x02\ - \x07\x03\x02\x07\x08\x02\x09\x08\x02\x06\x02\x02\x09\x07\x02\x07\x0a\x02\ - \x09\x0c\x02\x07\x07\x02\x07\x05\x02\x07\x09\x02\x09\x16\x02\x07\x06\x02\ - \x08\x02\x02\x04\x07\x02\x09\x12\x02\x09\x11\x02\x09\x3b\x02\x09\x4e\x02\ - \x07\x0d\x02\x07\x0c\x02\x09\x51\x02\x04\x0b\x02\x09\x52\x02\x09\x09\x02\ - \x04\x09\x02"; + static ref _serializedATN: Vec = vec![ + 4, 0, 84, 834, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, + 6, -1, 6, -1, 6, -1, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, + 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, + 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, + 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, + 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, + 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, + 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, + 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, + 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, + 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, + 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, + 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, + 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, + 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, 2, 68, 7, 68, 2, 69, + 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, 7, 72, 2, 73, 7, 73, 2, 74, + 7, 74, 2, 75, 7, 75, 2, 76, 7, 76, 2, 77, 7, 77, 2, 78, 7, 78, 2, 79, + 7, 79, 2, 80, 7, 80, 2, 81, 7, 81, 2, 82, 7, 82, 2, 83, 7, 83, 2, 84, + 7, 84, 2, 85, 7, 85, 2, 86, 7, 86, 2, 87, 7, 87, 2, 88, 7, 88, 2, 89, + 7, 89, 2, 90, 7, 90, 2, 91, 7, 91, 2, 92, 7, 92, 2, 93, 7, 93, 2, 94, + 7, 94, 2, 95, 7, 95, 2, 96, 7, 96, 2, 97, 7, 97, 2, 98, 7, 98, 2, 99, + 7, 99, 2, 100, 7, 100, 2, 101, 7, 101, 2, 102, 7, 102, 2, 103, 7, 103, + 2, 104, 7, 104, 2, 105, 7, 105, 2, 106, 7, 106, 2, 107, 7, 107, 2, 108, + 7, 108, 2, 109, 7, 109, 2, 110, 7, 110, 1, 0, 4, 0, 236, 8, 0, 11, 0, + 12, 0, 237, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 246, 8, 1, 10, + 1, 12, 1, 249, 9, 1, 1, 1, 1, 1, 1, 2, 3, 2, 254, 8, 2, 1, 2, 1, 2, 3, + 2, 258, 8, 2, 1, 2, 5, 2, 261, 8, 2, 10, 2, 12, 2, 264, 9, 2, 1, 2, 1, + 2, 1, 3, 1, 3, 3, 3, 270, 8, 3, 1, 4, 3, 4, 273, 8, 4, 1, 5, 1, 5, 3, + 5, 277, 8, 5, 1, 6, 4, 6, 280, 8, 6, 11, 6, 12, 6, 281, 1, 7, 1, 7, 1, + 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 5, 8, 292, 8, 8, 10, 8, 12, 8, 295, + 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 4, 10, 304, 8, 10, 11, + 10, 12, 10, 305, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, + 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, + 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, + 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, + 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, + 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, + 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, + 24, 1, 24, 1, 24, 1, 24, 3, 24, 379, 8, 24, 1, 24, 1, 24, 1, 25, 1, 25, + 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, + 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, + 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 4, 30, 411, 8, 30, 11, 30, + 12, 30, 412, 1, 30, 3, 30, 416, 8, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, + 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, + 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, + 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, + 38, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, + 41, 1, 42, 4, 42, 464, 8, 42, 11, 42, 12, 42, 465, 1, 42, 1, 42, 1, 43, + 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, + 1, 45, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 47, + 1, 47, 1, 47, 3, 47, 493, 8, 47, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, + 48, 500, 8, 48, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 3, 49, 507, 8, 49, + 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 3, 50, 515, 8, 50, 1, 51, 1, + 51, 1, 51, 3, 51, 520, 8, 51, 1, 52, 1, 52, 1, 52, 3, 52, 525, 8, 52, + 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 3, 53, 532, 8, 53, 1, 54, 1, 54, 1, + 54, 1, 54, 1, 54, 3, 54, 539, 8, 54, 1, 55, 1, 55, 1, 55, 1, 55, 3, 55, + 545, 8, 55, 1, 56, 1, 56, 1, 56, 1, 56, 3, 56, 551, 8, 56, 1, 57, 1, + 57, 1, 57, 1, 57, 3, 57, 557, 8, 57, 1, 58, 1, 58, 1, 58, 1, 59, 1, 59, + 1, 59, 1, 60, 1, 60, 1, 60, 1, 61, 1, 61, 1, 61, 1, 62, 1, 62, 1, 62, + 1, 63, 1, 63, 1, 64, 1, 64, 1, 65, 1, 65, 1, 66, 1, 66, 1, 67, 1, 67, + 1, 68, 1, 68, 1, 69, 1, 69, 1, 70, 1, 70, 1, 71, 1, 71, 1, 71, 1, 72, + 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 73, 1, 73, + 1, 73, 1, 73, 1, 73, 1, 73, 1, 73, 1, 73, 1, 73, 1, 74, 1, 74, 1, 74, + 1, 74, 1, 74, 1, 74, 1, 74, 1, 75, 1, 75, 1, 75, 1, 75, 5, 75, 622, 8, + 75, 10, 75, 12, 75, 625, 9, 75, 1, 75, 1, 75, 1, 76, 1, 76, 1, 77, 1, + 77, 1, 77, 1, 77, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, + 79, 1, 79, 1, 79, 1, 80, 1, 80, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 3, + 81, 652, 8, 81, 1, 82, 4, 82, 655, 8, 82, 11, 82, 12, 82, 656, 1, 83, + 1, 83, 1, 84, 1, 84, 1, 85, 1, 85, 1, 85, 1, 85, 1, 86, 1, 86, 1, 86, + 1, 86, 1, 86, 1, 86, 1, 86, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, + 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, + 1, 88, 3, 88, 691, 8, 88, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, + 89, 1, 89, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 91, 1, 91, 1, + 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 92, 1, 92, 1, 92, 1, + 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 93, 1, + 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 94, 1, 94, 1, + 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 95, 1, 95, 1, 95, 1, + 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 96, 1, 96, 1, 96, 1, 96, 1, + 96, 1, 96, 1, 96, 1, 96, 1, 96, 3, 96, 764, 8, 96, 1, 97, 1, 97, 1, 97, + 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, + 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 100, 1, 100, 1, 100, 1, + 100, 1, 100, 1, 101, 1, 101, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, + 1, 103, 1, 103, 1, 103, 1, 103, 1, 104, 4, 104, 802, 8, 104, 11, 104, + 12, 104, 803, 1, 105, 1, 105, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, + 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 108, 1, 108, 1, 108, + 1, 108, 1, 108, 1, 109, 1, 109, 1, 109, 1, 109, 1, 109, 1, 110, 1, 110, + 1, 110, 1, 110, 1, 110, 1, 110, 0, 0, 111, 12, 4, 14, 5, 16, 6, 18, 7, + 20, 0, 22, 0, 24, 0, 26, 8, 28, 9, 30, 10, 32, 11, 34, 0, 36, 12, 38, + 0, 40, 0, 42, 13, 44, 14, 46, 15, 48, 0, 50, 16, 52, 0, 54, 17, 56, 0, + 58, 0, 60, 0, 62, 18, 64, 0, 66, 0, 68, 0, 70, 19, 72, 20, 74, 0, 76, + 0, 78, 21, 80, 22, 82, 23, 84, 0, 86, 0, 88, 0, 90, 24, 92, 25, 94, 0, + 96, 26, 98, 27, 100, 28, 102, 29, 104, 30, 106, 31, 108, 32, 110, 33, + 112, 34, 114, 35, 116, 36, 118, 37, 120, 38, 122, 39, 124, 40, 126, 41, + 128, 42, 130, 43, 132, 44, 134, 45, 136, 46, 138, 47, 140, 48, 142, 49, + 144, 50, 146, 51, 148, 52, 150, 53, 152, 54, 154, 55, 156, 82, 158, 83, + 160, 84, 162, 56, 164, 57, 166, 58, 168, 0, 170, 59, 172, 60, 174, 61, + 176, 0, 178, 0, 180, 62, 182, 63, 184, 64, 186, 65, 188, 66, 190, 67, + 192, 68, 194, 69, 196, 70, 198, 71, 200, 72, 202, 73, 204, 74, 206, 75, + 208, 76, 210, 0, 212, 0, 214, 77, 216, 78, 218, 79, 220, 80, 222, 81, + 224, 0, 226, 0, 228, 0, 230, 0, 232, 0, 12, 0, 1, 2, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 14, 2, 0, 9, 9, 32, 32, 2, 0, 10, 10, 13, 13, 49, 0, 65, 90, + 95, 95, 97, 122, 168, 168, 170, 170, 173, 173, 175, 175, 178, 181, 183, + 186, 188, 190, 192, 214, 216, 246, 248, 767, 880, 5759, 5761, 6157, 6159, + 7615, 7680, 8191, 8203, 8205, 8234, 8238, 8255, 8256, 8276, 8276, 8288, + 8399, 8448, 8591, 9312, 9471, 10102, 10131, 11264, 11775, 11904, 12287, + 12292, 12295, 12321, 12335, 12337, 55295, 63744, 64829, 64832, 64975, + 65008, 65055, 65072, 65092, 65095, 65533, 65536, 131069, 131072, 196605, + 196608, 262141, 262144, 327677, 327680, 393213, 393216, 458749, 458752, + 524285, 524288, 589821, 589824, 655357, 655360, 720893, 720896, 786429, + 786432, 851965, 851968, 917501, 917504, 983037, 5, 0, 48, 57, 768, 879, + 7616, 7679, 8400, 8447, 65056, 65071, 1, 0, 32, 32, 2, 0, 47, 47, 60, + 60, 7, 0, 10, 10, 13, 13, 35, 35, 47, 47, 60, 60, 92, 92, 123, 123, 7, + 0, 35, 35, 47, 47, 60, 60, 62, 62, 92, 92, 123, 123, 125, 125, 5, 0, + 9, 10, 13, 13, 32, 32, 35, 36, 60, 60, 4, 0, 10, 10, 13, 13, 34, 34, + 92, 92, 2, 0, 34, 34, 92, 92, 1, 0, 48, 57, 10, 0, 9, 13, 32, 32, 133, + 133, 160, 160, 5760, 5760, 8192, 8202, 8232, 8233, 8239, 8239, 8287, + 8287, 12288, 12288, 4, 0, 10, 10, 13, 13, 62, 62, 123, 123, 849, 0, 12, + 1, 0, 0, 0, 0, 14, 1, 0, 0, 0, 0, 16, 1, 0, 0, 0, 0, 18, 1, 0, 0, 0, + 0, 26, 1, 0, 0, 0, 0, 28, 1, 0, 0, 0, 0, 30, 1, 0, 0, 0, 1, 32, 1, 0, + 0, 0, 1, 34, 1, 0, 0, 0, 2, 36, 1, 0, 0, 0, 2, 38, 1, 0, 0, 0, 2, 40, + 1, 0, 0, 0, 2, 42, 1, 0, 0, 0, 2, 44, 1, 0, 0, 0, 2, 46, 1, 0, 0, 0, + 2, 48, 1, 0, 0, 0, 2, 50, 1, 0, 0, 0, 2, 52, 1, 0, 0, 0, 2, 54, 1, 0, + 0, 0, 2, 56, 1, 0, 0, 0, 3, 58, 1, 0, 0, 0, 3, 60, 1, 0, 0, 0, 3, 62, + 1, 0, 0, 0, 3, 64, 1, 0, 0, 0, 3, 66, 1, 0, 0, 0, 3, 68, 1, 0, 0, 0, + 3, 70, 1, 0, 0, 0, 3, 72, 1, 0, 0, 0, 4, 76, 1, 0, 0, 0, 4, 78, 1, 0, + 0, 0, 5, 80, 1, 0, 0, 0, 5, 82, 1, 0, 0, 0, 5, 84, 1, 0, 0, 0, 5, 86, + 1, 0, 0, 0, 5, 88, 1, 0, 0, 0, 5, 90, 1, 0, 0, 0, 6, 92, 1, 0, 0, 0, + 6, 94, 1, 0, 0, 0, 6, 96, 1, 0, 0, 0, 7, 98, 1, 0, 0, 0, 7, 100, 1, 0, + 0, 0, 7, 102, 1, 0, 0, 0, 7, 104, 1, 0, 0, 0, 7, 106, 1, 0, 0, 0, 7, + 108, 1, 0, 0, 0, 7, 110, 1, 0, 0, 0, 7, 112, 1, 0, 0, 0, 7, 114, 1, 0, + 0, 0, 7, 116, 1, 0, 0, 0, 7, 118, 1, 0, 0, 0, 7, 120, 1, 0, 0, 0, 7, + 122, 1, 0, 0, 0, 7, 124, 1, 0, 0, 0, 7, 126, 1, 0, 0, 0, 7, 128, 1, 0, + 0, 0, 7, 130, 1, 0, 0, 0, 7, 132, 1, 0, 0, 0, 7, 134, 1, 0, 0, 0, 7, + 136, 1, 0, 0, 0, 7, 138, 1, 0, 0, 0, 7, 140, 1, 0, 0, 0, 7, 142, 1, 0, + 0, 0, 7, 144, 1, 0, 0, 0, 7, 146, 1, 0, 0, 0, 7, 148, 1, 0, 0, 0, 7, + 150, 1, 0, 0, 0, 7, 152, 1, 0, 0, 0, 7, 154, 1, 0, 0, 0, 7, 156, 1, 0, + 0, 0, 7, 158, 1, 0, 0, 0, 7, 160, 1, 0, 0, 0, 7, 162, 1, 0, 0, 0, 7, + 164, 1, 0, 0, 0, 7, 166, 1, 0, 0, 0, 7, 168, 1, 0, 0, 0, 7, 170, 1, 0, + 0, 0, 7, 172, 1, 0, 0, 0, 7, 174, 1, 0, 0, 0, 8, 180, 1, 0, 0, 0, 8, + 182, 1, 0, 0, 0, 8, 184, 1, 0, 0, 0, 8, 186, 1, 0, 0, 0, 8, 188, 1, 0, + 0, 0, 8, 190, 1, 0, 0, 0, 8, 192, 1, 0, 0, 0, 8, 194, 1, 0, 0, 0, 8, + 196, 1, 0, 0, 0, 8, 198, 1, 0, 0, 0, 8, 200, 1, 0, 0, 0, 8, 202, 1, 0, + 0, 0, 8, 204, 1, 0, 0, 0, 8, 206, 1, 0, 0, 0, 8, 208, 1, 0, 0, 0, 8, + 210, 1, 0, 0, 0, 8, 212, 1, 0, 0, 0, 9, 214, 1, 0, 0, 0, 9, 216, 1, 0, + 0, 0, 9, 218, 1, 0, 0, 0, 9, 220, 1, 0, 0, 0, 10, 222, 1, 0, 0, 0, 10, + 224, 1, 0, 0, 0, 10, 226, 1, 0, 0, 0, 11, 228, 1, 0, 0, 0, 11, 230, 1, + 0, 0, 0, 11, 232, 1, 0, 0, 0, 12, 235, 1, 0, 0, 0, 14, 241, 1, 0, 0, + 0, 16, 257, 1, 0, 0, 0, 18, 267, 1, 0, 0, 0, 20, 272, 1, 0, 0, 0, 22, + 276, 1, 0, 0, 0, 24, 279, 1, 0, 0, 0, 26, 283, 1, 0, 0, 0, 28, 289, 1, + 0, 0, 0, 30, 298, 1, 0, 0, 0, 32, 303, 1, 0, 0, 0, 34, 307, 1, 0, 0, + 0, 36, 313, 1, 0, 0, 0, 38, 317, 1, 0, 0, 0, 40, 322, 1, 0, 0, 0, 42, + 327, 1, 0, 0, 0, 44, 333, 1, 0, 0, 0, 46, 336, 1, 0, 0, 0, 48, 341, 1, + 0, 0, 0, 50, 347, 1, 0, 0, 0, 52, 352, 1, 0, 0, 0, 54, 358, 1, 0, 0, + 0, 56, 364, 1, 0, 0, 0, 58, 369, 1, 0, 0, 0, 60, 378, 1, 0, 0, 0, 62, + 382, 1, 0, 0, 0, 64, 387, 1, 0, 0, 0, 66, 393, 1, 0, 0, 0, 68, 398, 1, + 0, 0, 0, 70, 405, 1, 0, 0, 0, 72, 415, 1, 0, 0, 0, 74, 417, 1, 0, 0, + 0, 76, 419, 1, 0, 0, 0, 78, 424, 1, 0, 0, 0, 80, 428, 1, 0, 0, 0, 82, + 432, 1, 0, 0, 0, 84, 436, 1, 0, 0, 0, 86, 442, 1, 0, 0, 0, 88, 447, 1, + 0, 0, 0, 90, 452, 1, 0, 0, 0, 92, 454, 1, 0, 0, 0, 94, 458, 1, 0, 0, + 0, 96, 463, 1, 0, 0, 0, 98, 469, 1, 0, 0, 0, 100, 473, 1, 0, 0, 0, 102, + 478, 1, 0, 0, 0, 104, 484, 1, 0, 0, 0, 106, 492, 1, 0, 0, 0, 108, 499, + 1, 0, 0, 0, 110, 506, 1, 0, 0, 0, 112, 514, 1, 0, 0, 0, 114, 519, 1, + 0, 0, 0, 116, 524, 1, 0, 0, 0, 118, 531, 1, 0, 0, 0, 120, 538, 1, 0, + 0, 0, 122, 544, 1, 0, 0, 0, 124, 550, 1, 0, 0, 0, 126, 556, 1, 0, 0, + 0, 128, 558, 1, 0, 0, 0, 130, 561, 1, 0, 0, 0, 132, 564, 1, 0, 0, 0, + 134, 567, 1, 0, 0, 0, 136, 570, 1, 0, 0, 0, 138, 573, 1, 0, 0, 0, 140, + 575, 1, 0, 0, 0, 142, 577, 1, 0, 0, 0, 144, 579, 1, 0, 0, 0, 146, 581, + 1, 0, 0, 0, 148, 583, 1, 0, 0, 0, 150, 585, 1, 0, 0, 0, 152, 587, 1, + 0, 0, 0, 154, 589, 1, 0, 0, 0, 156, 592, 1, 0, 0, 0, 158, 601, 1, 0, + 0, 0, 160, 610, 1, 0, 0, 0, 162, 617, 1, 0, 0, 0, 164, 628, 1, 0, 0, + 0, 166, 630, 1, 0, 0, 0, 168, 634, 1, 0, 0, 0, 170, 641, 1, 0, 0, 0, + 172, 644, 1, 0, 0, 0, 174, 651, 1, 0, 0, 0, 176, 654, 1, 0, 0, 0, 178, + 658, 1, 0, 0, 0, 180, 660, 1, 0, 0, 0, 182, 662, 1, 0, 0, 0, 184, 666, + 1, 0, 0, 0, 186, 673, 1, 0, 0, 0, 188, 684, 1, 0, 0, 0, 190, 692, 1, + 0, 0, 0, 192, 700, 1, 0, 0, 0, 194, 706, 1, 0, 0, 0, 196, 715, 1, 0, + 0, 0, 198, 727, 1, 0, 0, 0, 200, 736, 1, 0, 0, 0, 202, 745, 1, 0, 0, + 0, 204, 754, 1, 0, 0, 0, 206, 765, 1, 0, 0, 0, 208, 773, 1, 0, 0, 0, + 210, 778, 1, 0, 0, 0, 212, 784, 1, 0, 0, 0, 214, 789, 1, 0, 0, 0, 216, + 791, 1, 0, 0, 0, 218, 796, 1, 0, 0, 0, 220, 801, 1, 0, 0, 0, 222, 805, + 1, 0, 0, 0, 224, 807, 1, 0, 0, 0, 226, 812, 1, 0, 0, 0, 228, 818, 1, + 0, 0, 0, 230, 823, 1, 0, 0, 0, 232, 828, 1, 0, 0, 0, 234, 236, 7, 0, + 0, 0, 235, 234, 1, 0, 0, 0, 236, 237, 1, 0, 0, 0, 237, 235, 1, 0, 0, + 0, 237, 238, 1, 0, 0, 0, 238, 239, 1, 0, 0, 0, 239, 240, 6, 0, 0, 0, + 240, 13, 1, 0, 0, 0, 241, 242, 5, 47, 0, 0, 242, 243, 5, 47, 0, 0, 243, + 247, 1, 0, 0, 0, 244, 246, 8, 1, 0, 0, 245, 244, 1, 0, 0, 0, 246, 249, + 1, 0, 0, 0, 247, 245, 1, 0, 0, 0, 247, 248, 1, 0, 0, 0, 248, 250, 1, + 0, 0, 0, 249, 247, 1, 0, 0, 0, 250, 251, 6, 1, 1, 0, 251, 15, 1, 0, 0, + 0, 252, 254, 5, 13, 0, 0, 253, 252, 1, 0, 0, 0, 253, 254, 1, 0, 0, 0, + 254, 255, 1, 0, 0, 0, 255, 258, 5, 10, 0, 0, 256, 258, 5, 13, 0, 0, 257, + 253, 1, 0, 0, 0, 257, 256, 1, 0, 0, 0, 258, 262, 1, 0, 0, 0, 259, 261, + 7, 0, 0, 0, 260, 259, 1, 0, 0, 0, 261, 264, 1, 0, 0, 0, 262, 260, 1, + 0, 0, 0, 262, 263, 1, 0, 0, 0, 263, 265, 1, 0, 0, 0, 264, 262, 1, 0, + 0, 0, 265, 266, 6, 2, 2, 0, 266, 17, 1, 0, 0, 0, 267, 269, 3, 20, 4, + 0, 268, 270, 3, 24, 6, 0, 269, 268, 1, 0, 0, 0, 269, 270, 1, 0, 0, 0, + 270, 19, 1, 0, 0, 0, 271, 273, 7, 2, 0, 0, 272, 271, 1, 0, 0, 0, 273, + 21, 1, 0, 0, 0, 274, 277, 7, 3, 0, 0, 275, 277, 3, 20, 4, 0, 276, 274, + 1, 0, 0, 0, 276, 275, 1, 0, 0, 0, 277, 23, 1, 0, 0, 0, 278, 280, 3, 22, + 5, 0, 279, 278, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, 281, 279, 1, 0, 0, + 0, 281, 282, 1, 0, 0, 0, 282, 25, 1, 0, 0, 0, 283, 284, 5, 45, 0, 0, + 284, 285, 5, 45, 0, 0, 285, 286, 5, 45, 0, 0, 286, 287, 1, 0, 0, 0, 287, + 288, 6, 7, 3, 0, 288, 27, 1, 0, 0, 0, 289, 293, 5, 58, 0, 0, 290, 292, + 7, 4, 0, 0, 291, 290, 1, 0, 0, 0, 292, 295, 1, 0, 0, 0, 293, 291, 1, + 0, 0, 0, 293, 294, 1, 0, 0, 0, 294, 296, 1, 0, 0, 0, 295, 293, 1, 0, + 0, 0, 296, 297, 6, 8, 4, 0, 297, 29, 1, 0, 0, 0, 298, 299, 5, 35, 0, + 0, 299, 300, 1, 0, 0, 0, 300, 301, 6, 9, 5, 0, 301, 31, 1, 0, 0, 0, 302, + 304, 8, 1, 0, 0, 303, 302, 1, 0, 0, 0, 304, 305, 1, 0, 0, 0, 305, 303, + 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 33, 1, 0, 0, 0, 307, 308, 3, 16, + 2, 0, 308, 309, 1, 0, 0, 0, 309, 310, 6, 11, 6, 0, 310, 311, 6, 11, 2, + 0, 311, 312, 6, 11, 7, 0, 312, 35, 1, 0, 0, 0, 313, 314, 3, 12, 0, 0, + 314, 315, 1, 0, 0, 0, 315, 316, 6, 12, 0, 0, 316, 37, 1, 0, 0, 0, 317, + 318, 3, 16, 2, 0, 318, 319, 1, 0, 0, 0, 319, 320, 6, 13, 6, 0, 320, 321, + 6, 13, 2, 0, 321, 39, 1, 0, 0, 0, 322, 323, 3, 14, 1, 0, 323, 324, 1, + 0, 0, 0, 324, 325, 6, 14, 8, 0, 325, 326, 6, 14, 1, 0, 326, 41, 1, 0, + 0, 0, 327, 328, 5, 61, 0, 0, 328, 329, 5, 61, 0, 0, 329, 330, 5, 61, + 0, 0, 330, 331, 1, 0, 0, 0, 331, 332, 6, 15, 7, 0, 332, 43, 1, 0, 0, + 0, 333, 334, 5, 45, 0, 0, 334, 335, 5, 62, 0, 0, 335, 45, 1, 0, 0, 0, + 336, 337, 5, 60, 0, 0, 337, 338, 5, 60, 0, 0, 338, 339, 1, 0, 0, 0, 339, + 340, 6, 17, 9, 0, 340, 47, 1, 0, 0, 0, 341, 342, 5, 35, 0, 0, 342, 343, + 1, 0, 0, 0, 343, 344, 6, 18, 10, 0, 344, 345, 6, 18, 11, 0, 345, 346, + 6, 18, 5, 0, 346, 49, 1, 0, 0, 0, 347, 348, 5, 123, 0, 0, 348, 349, 1, + 0, 0, 0, 349, 350, 6, 19, 12, 0, 350, 351, 6, 19, 13, 0, 351, 51, 1, + 0, 0, 0, 352, 353, 5, 92, 0, 0, 353, 354, 5, 91, 0, 0, 354, 355, 1, 0, + 0, 0, 355, 356, 6, 20, 14, 0, 356, 357, 6, 20, 12, 0, 357, 53, 1, 0, + 0, 0, 358, 359, 5, 92, 0, 0, 359, 360, 1, 0, 0, 0, 360, 361, 6, 21, 0, + 0, 361, 362, 6, 21, 12, 0, 362, 363, 6, 21, 15, 0, 363, 55, 1, 0, 0, + 0, 364, 365, 9, 0, 0, 0, 365, 366, 1, 0, 0, 0, 366, 367, 6, 22, 14, 0, + 367, 368, 6, 22, 12, 0, 368, 57, 1, 0, 0, 0, 369, 370, 3, 16, 2, 0, 370, + 371, 1, 0, 0, 0, 371, 372, 6, 23, 6, 0, 372, 373, 6, 23, 7, 0, 373, 59, + 1, 0, 0, 0, 374, 375, 5, 92, 0, 0, 375, 379, 5, 91, 0, 0, 376, 377, 5, + 92, 0, 0, 377, 379, 5, 93, 0, 0, 378, 374, 1, 0, 0, 0, 378, 376, 1, 0, + 0, 0, 379, 380, 1, 0, 0, 0, 380, 381, 6, 24, 14, 0, 381, 61, 1, 0, 0, + 0, 382, 383, 5, 92, 0, 0, 383, 384, 1, 0, 0, 0, 384, 385, 6, 25, 16, + 0, 385, 386, 6, 25, 15, 0, 386, 63, 1, 0, 0, 0, 387, 388, 3, 30, 9, 0, + 388, 389, 1, 0, 0, 0, 389, 390, 6, 26, 10, 0, 390, 391, 6, 26, 17, 0, + 391, 392, 6, 26, 5, 0, 392, 65, 1, 0, 0, 0, 393, 394, 5, 123, 0, 0, 394, + 395, 1, 0, 0, 0, 395, 396, 6, 27, 18, 0, 396, 397, 6, 27, 13, 0, 397, + 67, 1, 0, 0, 0, 398, 399, 5, 60, 0, 0, 399, 400, 5, 60, 0, 0, 400, 401, + 1, 0, 0, 0, 401, 402, 6, 28, 19, 0, 402, 403, 6, 28, 17, 0, 403, 404, + 6, 28, 9, 0, 404, 69, 1, 0, 0, 0, 405, 406, 3, 14, 1, 0, 406, 407, 1, + 0, 0, 0, 407, 408, 6, 29, 1, 0, 408, 71, 1, 0, 0, 0, 409, 411, 3, 74, + 31, 0, 410, 409, 1, 0, 0, 0, 411, 412, 1, 0, 0, 0, 412, 410, 1, 0, 0, + 0, 412, 413, 1, 0, 0, 0, 413, 416, 1, 0, 0, 0, 414, 416, 7, 5, 0, 0, + 415, 410, 1, 0, 0, 0, 415, 414, 1, 0, 0, 0, 416, 73, 1, 0, 0, 0, 417, + 418, 8, 6, 0, 0, 418, 75, 1, 0, 0, 0, 419, 420, 7, 7, 0, 0, 420, 421, + 1, 0, 0, 0, 421, 422, 6, 32, 14, 0, 422, 423, 6, 32, 7, 0, 423, 77, 1, + 0, 0, 0, 424, 425, 9, 0, 0, 0, 425, 426, 1, 0, 0, 0, 426, 427, 6, 33, + 7, 0, 427, 79, 1, 0, 0, 0, 428, 429, 3, 12, 0, 0, 429, 430, 1, 0, 0, + 0, 430, 431, 6, 34, 0, 0, 431, 81, 1, 0, 0, 0, 432, 433, 3, 14, 1, 0, + 433, 434, 1, 0, 0, 0, 434, 435, 6, 35, 1, 0, 435, 83, 1, 0, 0, 0, 436, + 437, 5, 60, 0, 0, 437, 438, 5, 60, 0, 0, 438, 439, 1, 0, 0, 0, 439, 440, + 6, 36, 19, 0, 440, 441, 6, 36, 9, 0, 441, 85, 1, 0, 0, 0, 442, 443, 5, + 35, 0, 0, 443, 444, 1, 0, 0, 0, 444, 445, 6, 37, 10, 0, 445, 446, 6, + 37, 5, 0, 446, 87, 1, 0, 0, 0, 447, 448, 3, 16, 2, 0, 448, 449, 1, 0, + 0, 0, 449, 450, 6, 38, 6, 0, 450, 451, 6, 38, 7, 0, 451, 89, 1, 0, 0, + 0, 452, 453, 9, 0, 0, 0, 453, 91, 1, 0, 0, 0, 454, 455, 3, 12, 0, 0, + 455, 456, 1, 0, 0, 0, 456, 457, 6, 40, 0, 0, 457, 93, 1, 0, 0, 0, 458, + 459, 3, 30, 9, 0, 459, 460, 1, 0, 0, 0, 460, 461, 6, 41, 10, 0, 461, + 95, 1, 0, 0, 0, 462, 464, 8, 8, 0, 0, 463, 462, 1, 0, 0, 0, 464, 465, + 1, 0, 0, 0, 465, 463, 1, 0, 0, 0, 465, 466, 1, 0, 0, 0, 466, 467, 1, + 0, 0, 0, 467, 468, 6, 42, 7, 0, 468, 97, 1, 0, 0, 0, 469, 470, 3, 12, + 0, 0, 470, 471, 1, 0, 0, 0, 471, 472, 6, 43, 0, 0, 472, 99, 1, 0, 0, + 0, 473, 474, 5, 116, 0, 0, 474, 475, 5, 114, 0, 0, 475, 476, 5, 117, + 0, 0, 476, 477, 5, 101, 0, 0, 477, 101, 1, 0, 0, 0, 478, 479, 5, 102, + 0, 0, 479, 480, 5, 97, 0, 0, 480, 481, 5, 108, 0, 0, 481, 482, 5, 115, + 0, 0, 482, 483, 5, 101, 0, 0, 483, 103, 1, 0, 0, 0, 484, 485, 5, 110, + 0, 0, 485, 486, 5, 117, 0, 0, 486, 487, 5, 108, 0, 0, 487, 488, 5, 108, + 0, 0, 488, 105, 1, 0, 0, 0, 489, 493, 5, 61, 0, 0, 490, 491, 5, 116, + 0, 0, 491, 493, 5, 111, 0, 0, 492, 489, 1, 0, 0, 0, 492, 490, 1, 0, 0, + 0, 493, 107, 1, 0, 0, 0, 494, 495, 5, 60, 0, 0, 495, 500, 5, 61, 0, 0, + 496, 497, 5, 108, 0, 0, 497, 498, 5, 116, 0, 0, 498, 500, 5, 101, 0, + 0, 499, 494, 1, 0, 0, 0, 499, 496, 1, 0, 0, 0, 500, 109, 1, 0, 0, 0, + 501, 502, 5, 62, 0, 0, 502, 507, 5, 61, 0, 0, 503, 504, 5, 103, 0, 0, + 504, 505, 5, 116, 0, 0, 505, 507, 5, 101, 0, 0, 506, 501, 1, 0, 0, 0, + 506, 503, 1, 0, 0, 0, 507, 111, 1, 0, 0, 0, 508, 509, 5, 61, 0, 0, 509, + 515, 5, 61, 0, 0, 510, 511, 5, 105, 0, 0, 511, 515, 5, 115, 0, 0, 512, + 513, 5, 101, 0, 0, 513, 515, 5, 113, 0, 0, 514, 508, 1, 0, 0, 0, 514, + 510, 1, 0, 0, 0, 514, 512, 1, 0, 0, 0, 515, 113, 1, 0, 0, 0, 516, 520, + 5, 60, 0, 0, 517, 518, 5, 108, 0, 0, 518, 520, 5, 116, 0, 0, 519, 516, + 1, 0, 0, 0, 519, 517, 1, 0, 0, 0, 520, 115, 1, 0, 0, 0, 521, 525, 5, + 62, 0, 0, 522, 523, 5, 103, 0, 0, 523, 525, 5, 116, 0, 0, 524, 521, 1, + 0, 0, 0, 524, 522, 1, 0, 0, 0, 525, 117, 1, 0, 0, 0, 526, 527, 5, 33, + 0, 0, 527, 532, 5, 61, 0, 0, 528, 529, 5, 110, 0, 0, 529, 530, 5, 101, + 0, 0, 530, 532, 5, 113, 0, 0, 531, 526, 1, 0, 0, 0, 531, 528, 1, 0, 0, + 0, 532, 119, 1, 0, 0, 0, 533, 534, 5, 97, 0, 0, 534, 535, 5, 110, 0, + 0, 535, 539, 5, 100, 0, 0, 536, 537, 5, 38, 0, 0, 537, 539, 5, 38, 0, + 0, 538, 533, 1, 0, 0, 0, 538, 536, 1, 0, 0, 0, 539, 121, 1, 0, 0, 0, + 540, 541, 5, 111, 0, 0, 541, 545, 5, 114, 0, 0, 542, 543, 5, 124, 0, + 0, 543, 545, 5, 124, 0, 0, 544, 540, 1, 0, 0, 0, 544, 542, 1, 0, 0, 0, + 545, 123, 1, 0, 0, 0, 546, 547, 5, 120, 0, 0, 547, 548, 5, 111, 0, 0, + 548, 551, 5, 114, 0, 0, 549, 551, 5, 94, 0, 0, 550, 546, 1, 0, 0, 0, + 550, 549, 1, 0, 0, 0, 551, 125, 1, 0, 0, 0, 552, 553, 5, 110, 0, 0, 553, + 554, 5, 111, 0, 0, 554, 557, 5, 116, 0, 0, 555, 557, 5, 33, 0, 0, 556, + 552, 1, 0, 0, 0, 556, 555, 1, 0, 0, 0, 557, 127, 1, 0, 0, 0, 558, 559, + 5, 43, 0, 0, 559, 560, 5, 61, 0, 0, 560, 129, 1, 0, 0, 0, 561, 562, 5, + 45, 0, 0, 562, 563, 5, 61, 0, 0, 563, 131, 1, 0, 0, 0, 564, 565, 5, 42, + 0, 0, 565, 566, 5, 61, 0, 0, 566, 133, 1, 0, 0, 0, 567, 568, 5, 37, 0, + 0, 568, 569, 5, 61, 0, 0, 569, 135, 1, 0, 0, 0, 570, 571, 5, 47, 0, 0, + 571, 572, 5, 61, 0, 0, 572, 137, 1, 0, 0, 0, 573, 574, 5, 43, 0, 0, 574, + 139, 1, 0, 0, 0, 575, 576, 5, 45, 0, 0, 576, 141, 1, 0, 0, 0, 577, 578, + 5, 42, 0, 0, 578, 143, 1, 0, 0, 0, 579, 580, 5, 47, 0, 0, 580, 145, 1, + 0, 0, 0, 581, 582, 5, 37, 0, 0, 582, 147, 1, 0, 0, 0, 583, 584, 5, 40, + 0, 0, 584, 149, 1, 0, 0, 0, 585, 586, 5, 41, 0, 0, 586, 151, 1, 0, 0, + 0, 587, 588, 5, 44, 0, 0, 588, 153, 1, 0, 0, 0, 589, 590, 5, 97, 0, 0, + 590, 591, 5, 115, 0, 0, 591, 155, 1, 0, 0, 0, 592, 593, 5, 115, 0, 0, + 593, 594, 5, 116, 0, 0, 594, 595, 5, 114, 0, 0, 595, 596, 5, 105, 0, + 0, 596, 597, 5, 110, 0, 0, 597, 598, 5, 103, 0, 0, 598, 599, 1, 0, 0, + 0, 599, 600, 6, 72, 20, 0, 600, 157, 1, 0, 0, 0, 601, 602, 5, 110, 0, + 0, 602, 603, 5, 117, 0, 0, 603, 604, 5, 109, 0, 0, 604, 605, 5, 98, 0, + 0, 605, 606, 5, 101, 0, 0, 606, 607, 5, 114, 0, 0, 607, 608, 1, 0, 0, + 0, 608, 609, 6, 73, 20, 0, 609, 159, 1, 0, 0, 0, 610, 611, 5, 98, 0, + 0, 611, 612, 5, 111, 0, 0, 612, 613, 5, 111, 0, 0, 613, 614, 5, 108, + 0, 0, 614, 615, 1, 0, 0, 0, 615, 616, 6, 74, 20, 0, 616, 161, 1, 0, 0, + 0, 617, 623, 5, 34, 0, 0, 618, 622, 8, 9, 0, 0, 619, 620, 5, 92, 0, 0, + 620, 622, 7, 10, 0, 0, 621, 618, 1, 0, 0, 0, 621, 619, 1, 0, 0, 0, 622, + 625, 1, 0, 0, 0, 623, 621, 1, 0, 0, 0, 623, 624, 1, 0, 0, 0, 624, 626, + 1, 0, 0, 0, 625, 623, 1, 0, 0, 0, 626, 627, 5, 34, 0, 0, 627, 163, 1, + 0, 0, 0, 628, 629, 3, 18, 3, 0, 629, 165, 1, 0, 0, 0, 630, 631, 5, 125, + 0, 0, 631, 632, 1, 0, 0, 0, 632, 633, 6, 77, 7, 0, 633, 167, 1, 0, 0, + 0, 634, 635, 5, 62, 0, 0, 635, 636, 5, 62, 0, 0, 636, 637, 1, 0, 0, 0, + 637, 638, 6, 78, 21, 0, 638, 639, 6, 78, 7, 0, 639, 640, 6, 78, 7, 0, + 640, 169, 1, 0, 0, 0, 641, 642, 5, 36, 0, 0, 642, 643, 3, 18, 3, 0, 643, + 171, 1, 0, 0, 0, 644, 645, 5, 46, 0, 0, 645, 173, 1, 0, 0, 0, 646, 652, + 3, 176, 82, 0, 647, 648, 3, 176, 82, 0, 648, 649, 5, 46, 0, 0, 649, 650, + 3, 176, 82, 0, 650, 652, 1, 0, 0, 0, 651, 646, 1, 0, 0, 0, 651, 647, + 1, 0, 0, 0, 652, 175, 1, 0, 0, 0, 653, 655, 3, 178, 83, 0, 654, 653, + 1, 0, 0, 0, 655, 656, 1, 0, 0, 0, 656, 654, 1, 0, 0, 0, 656, 657, 1, + 0, 0, 0, 657, 177, 1, 0, 0, 0, 658, 659, 7, 11, 0, 0, 659, 179, 1, 0, + 0, 0, 660, 661, 3, 16, 2, 0, 661, 181, 1, 0, 0, 0, 662, 663, 3, 12, 0, + 0, 663, 664, 1, 0, 0, 0, 664, 665, 6, 85, 0, 0, 665, 183, 1, 0, 0, 0, + 666, 667, 5, 105, 0, 0, 667, 668, 5, 102, 0, 0, 668, 669, 1, 0, 0, 0, + 669, 670, 7, 12, 0, 0, 670, 671, 1, 0, 0, 0, 671, 672, 6, 86, 13, 0, + 672, 185, 1, 0, 0, 0, 673, 674, 5, 101, 0, 0, 674, 675, 5, 108, 0, 0, + 675, 676, 5, 115, 0, 0, 676, 677, 5, 101, 0, 0, 677, 678, 5, 105, 0, + 0, 678, 679, 5, 102, 0, 0, 679, 680, 1, 0, 0, 0, 680, 681, 7, 12, 0, + 0, 681, 682, 1, 0, 0, 0, 682, 683, 6, 87, 13, 0, 683, 187, 1, 0, 0, 0, + 684, 685, 5, 101, 0, 0, 685, 686, 5, 108, 0, 0, 686, 687, 5, 115, 0, + 0, 687, 688, 5, 101, 0, 0, 688, 690, 1, 0, 0, 0, 689, 691, 7, 12, 0, + 0, 690, 689, 1, 0, 0, 0, 690, 691, 1, 0, 0, 0, 691, 189, 1, 0, 0, 0, + 692, 693, 5, 115, 0, 0, 693, 694, 5, 101, 0, 0, 694, 695, 5, 116, 0, + 0, 695, 696, 1, 0, 0, 0, 696, 697, 7, 12, 0, 0, 697, 698, 1, 0, 0, 0, + 698, 699, 6, 89, 13, 0, 699, 191, 1, 0, 0, 0, 700, 701, 5, 101, 0, 0, + 701, 702, 5, 110, 0, 0, 702, 703, 5, 100, 0, 0, 703, 704, 5, 105, 0, + 0, 704, 705, 5, 102, 0, 0, 705, 193, 1, 0, 0, 0, 706, 707, 5, 99, 0, + 0, 707, 708, 5, 97, 0, 0, 708, 709, 5, 108, 0, 0, 709, 710, 5, 108, 0, + 0, 710, 711, 1, 0, 0, 0, 711, 712, 7, 12, 0, 0, 712, 713, 1, 0, 0, 0, + 713, 714, 6, 91, 13, 0, 714, 195, 1, 0, 0, 0, 715, 716, 5, 100, 0, 0, + 716, 717, 5, 101, 0, 0, 717, 718, 5, 99, 0, 0, 718, 719, 5, 108, 0, 0, + 719, 720, 5, 97, 0, 0, 720, 721, 5, 114, 0, 0, 721, 722, 5, 101, 0, 0, + 722, 723, 1, 0, 0, 0, 723, 724, 7, 12, 0, 0, 724, 725, 1, 0, 0, 0, 725, + 726, 6, 92, 13, 0, 726, 197, 1, 0, 0, 0, 727, 728, 5, 106, 0, 0, 728, + 729, 5, 117, 0, 0, 729, 730, 5, 109, 0, 0, 730, 731, 5, 112, 0, 0, 731, + 732, 1, 0, 0, 0, 732, 733, 7, 12, 0, 0, 733, 734, 1, 0, 0, 0, 734, 735, + 6, 93, 22, 0, 735, 199, 1, 0, 0, 0, 736, 737, 5, 101, 0, 0, 737, 738, + 5, 110, 0, 0, 738, 739, 5, 117, 0, 0, 739, 740, 5, 109, 0, 0, 740, 741, + 1, 0, 0, 0, 741, 742, 7, 12, 0, 0, 742, 743, 1, 0, 0, 0, 743, 744, 6, + 94, 23, 0, 744, 201, 1, 0, 0, 0, 745, 746, 5, 99, 0, 0, 746, 747, 5, + 97, 0, 0, 747, 748, 5, 115, 0, 0, 748, 749, 5, 101, 0, 0, 749, 750, 1, + 0, 0, 0, 750, 751, 7, 12, 0, 0, 751, 752, 1, 0, 0, 0, 752, 753, 6, 95, + 23, 0, 753, 203, 1, 0, 0, 0, 754, 755, 5, 101, 0, 0, 755, 756, 5, 110, + 0, 0, 756, 757, 5, 100, 0, 0, 757, 758, 5, 101, 0, 0, 758, 759, 5, 110, + 0, 0, 759, 760, 5, 117, 0, 0, 760, 761, 5, 109, 0, 0, 761, 763, 1, 0, + 0, 0, 762, 764, 7, 12, 0, 0, 763, 762, 1, 0, 0, 0, 763, 764, 1, 0, 0, + 0, 764, 205, 1, 0, 0, 0, 765, 766, 5, 108, 0, 0, 766, 767, 5, 111, 0, + 0, 767, 768, 5, 99, 0, 0, 768, 769, 5, 97, 0, 0, 769, 770, 5, 108, 0, + 0, 770, 771, 1, 0, 0, 0, 771, 772, 7, 12, 0, 0, 772, 207, 1, 0, 0, 0, + 773, 774, 5, 62, 0, 0, 774, 775, 5, 62, 0, 0, 775, 776, 1, 0, 0, 0, 776, + 777, 6, 98, 7, 0, 777, 209, 1, 0, 0, 0, 778, 779, 5, 123, 0, 0, 779, + 780, 1, 0, 0, 0, 780, 781, 6, 99, 24, 0, 781, 782, 6, 99, 25, 0, 782, + 783, 6, 99, 13, 0, 783, 211, 1, 0, 0, 0, 784, 785, 9, 0, 0, 0, 785, 786, + 1, 0, 0, 0, 786, 787, 6, 100, 26, 0, 787, 788, 6, 100, 25, 0, 788, 213, + 1, 0, 0, 0, 789, 790, 3, 16, 2, 0, 790, 215, 1, 0, 0, 0, 791, 792, 5, + 62, 0, 0, 792, 793, 5, 62, 0, 0, 793, 794, 1, 0, 0, 0, 794, 795, 6, 102, + 7, 0, 795, 217, 1, 0, 0, 0, 796, 797, 5, 123, 0, 0, 797, 798, 1, 0, 0, + 0, 798, 799, 6, 103, 13, 0, 799, 219, 1, 0, 0, 0, 800, 802, 8, 13, 0, + 0, 801, 800, 1, 0, 0, 0, 802, 803, 1, 0, 0, 0, 803, 801, 1, 0, 0, 0, + 803, 804, 1, 0, 0, 0, 804, 221, 1, 0, 0, 0, 805, 806, 3, 16, 2, 0, 806, + 223, 1, 0, 0, 0, 807, 808, 3, 18, 3, 0, 808, 809, 1, 0, 0, 0, 809, 810, + 6, 106, 27, 0, 810, 811, 6, 106, 7, 0, 811, 225, 1, 0, 0, 0, 812, 813, + 5, 62, 0, 0, 813, 814, 5, 62, 0, 0, 814, 815, 1, 0, 0, 0, 815, 816, 6, + 107, 21, 0, 816, 817, 6, 107, 7, 0, 817, 227, 1, 0, 0, 0, 818, 819, 3, + 18, 3, 0, 819, 820, 1, 0, 0, 0, 820, 821, 6, 108, 27, 0, 821, 822, 6, + 108, 7, 0, 822, 229, 1, 0, 0, 0, 823, 824, 3, 50, 19, 0, 824, 825, 1, + 0, 0, 0, 825, 826, 6, 109, 18, 0, 826, 827, 6, 109, 28, 0, 827, 231, + 1, 0, 0, 0, 828, 829, 5, 62, 0, 0, 829, 830, 5, 62, 0, 0, 830, 831, 1, + 0, 0, 0, 831, 832, 6, 110, 21, 0, 832, 833, 6, 110, 7, 0, 833, 233, 1, + 0, 0, 0, 45, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 237, 247, 253, 257, + 262, 269, 272, 276, 281, 293, 305, 378, 412, 415, 465, 492, 499, 506, + 514, 519, 524, 531, 538, 544, 550, 556, 621, 623, 651, 656, 690, 763, + 803, 29, 0, 1, 0, 0, 3, 0, 0, 2, 0, 5, 2, 0, 5, 1, 0, 5, 6, 0, 7, 6, + 0, 4, 0, 0, 7, 5, 0, 5, 8, 0, 7, 10, 0, 5, 5, 0, 5, 3, 0, 5, 7, 0, 7, + 20, 0, 5, 4, 0, 6, 0, 0, 2, 5, 0, 7, 16, 0, 7, 15, 0, 7, 57, 0, 7, 76, + 0, 5, 11, 0, 5, 10, 0, 7, 79, 0, 2, 9, 0, 7, 80, 0, 7, 7, 0, 2, 7, 0 + ]; + } \ No newline at end of file diff --git a/crates/compiler/src/parser/generated/yarnspinnerparser.rs b/crates/compiler/src/parser/generated/yarnspinnerparser.rs index c213fb19e..a7d56a9ca 100644 --- a/crates/compiler/src/parser/generated/yarnspinnerparser.rs +++ b/crates/compiler/src/parser/generated/yarnspinnerparser.rs @@ -1,4 +1,4 @@ -// Generated from third-party\YarnSpinner\YarnSpinner.Compiler\YarnSpinnerParser.g4 by ANTLR 4.8 +// Generated from third-party/YarnSpinner/YarnSpinner.Compiler/YarnSpinnerParser.g4 by ANTLR 4.13.2 #![allow(dead_code)] #![allow(non_snake_case)] #![allow(non_upper_case_globals)] @@ -6,457 +6,285 @@ #![allow(unused_imports)] #![allow(unused_mut)] #![allow(unused_braces)] +use antlr4rust::PredictionContextCache; +use antlr4rust::parser::{Parser, BaseParser, ParserRecog, ParserNodeType}; +use antlr4rust::token_stream::TokenStream; +use antlr4rust::TokenSource; +use antlr4rust::parser_atn_simulator::ParserATNSimulator; +use antlr4rust::errors::*; +use antlr4rust::rule_context::{BaseRuleContext, CustomRuleContext, RuleContext}; +use antlr4rust::recognizer::{Recognizer,Actions}; +use antlr4rust::atn_deserializer::ATNDeserializer; +use antlr4rust::dfa::DFA; +use antlr4rust::atn::{ATN, INVALID_ALT}; +use antlr4rust::error_strategy::{ErrorStrategy, DefaultErrorStrategy}; +use antlr4rust::parser_rule_context::{BaseParserRuleContext, ParserRuleContext,cast,cast_mut}; +use antlr4rust::tree::*; +use antlr4rust::token::{TOKEN_EOF,OwningToken,Token}; +use antlr4rust::int_stream::EOF; +use antlr4rust::vocabulary::{Vocabulary,VocabularyImpl}; +use antlr4rust::token_factory::{CommonTokenFactory,TokenFactory, TokenAware}; use super::yarnspinnerparserlistener::*; use super::yarnspinnerparservisitor::*; -use antlr_rust::PredictionContextCache; -use antlr_rust::TokenSource; -use antlr_rust::atn::{ATN, INVALID_ALT}; -use antlr_rust::atn_deserializer::ATNDeserializer; -use antlr_rust::dfa::DFA; -use antlr_rust::error_strategy::{DefaultErrorStrategy, ErrorStrategy}; -use antlr_rust::errors::*; -use antlr_rust::int_stream::EOF; -use antlr_rust::parser::{BaseParser, Parser, ParserNodeType, ParserRecog}; -use antlr_rust::parser_atn_simulator::ParserATNSimulator; -use antlr_rust::parser_rule_context::{BaseParserRuleContext, ParserRuleContext, cast, cast_mut}; -use antlr_rust::recognizer::{Actions, Recognizer}; -use antlr_rust::rule_context::{BaseRuleContext, CustomRuleContext, RuleContext}; -use antlr_rust::token::{OwningToken, TOKEN_EOF, Token}; -use antlr_rust::token_factory::{CommonTokenFactory, TokenAware, TokenFactory}; -use antlr_rust::token_stream::TokenStream; -use antlr_rust::tree::*; -use antlr_rust::vocabulary::{Vocabulary, VocabularyImpl}; - -use antlr_rust::lazy_static; -use antlr_rust::{TidAble, TidExt}; - -use std::any::{Any, TypeId}; -use std::borrow::{Borrow, BorrowMut}; -use std::cell::RefCell; -use std::convert::TryFrom; + +use antlr4rust::lazy_static; +use antlr4rust::{TidAble,TidExt}; + use std::marker::PhantomData; -use std::ops::{Deref, DerefMut}; -use std::rc::Rc; use std::sync::Arc; - -pub const INDENT: isize = 1; -pub const DEDENT: isize = 2; -pub const BLANK_LINE_FOLLOWING_OPTION: isize = 3; -pub const WS: isize = 4; -pub const COMMENT: isize = 5; -pub const NEWLINE: isize = 6; -pub const ID: isize = 7; -pub const BODY_START: isize = 8; -pub const HEADER_DELIMITER: isize = 9; -pub const HASHTAG: isize = 10; -pub const REST_OF_LINE: isize = 11; -pub const BODY_WS: isize = 12; -pub const BODY_END: isize = 13; -pub const SHORTCUT_ARROW: isize = 14; -pub const COMMAND_START: isize = 15; -pub const EXPRESSION_START: isize = 16; -pub const ESCAPED_ANY: isize = 17; -pub const TEXT_ESCAPE: isize = 18; -pub const TEXT_COMMENT: isize = 19; -pub const TEXT: isize = 20; -pub const UNESCAPABLE_CHARACTER: isize = 21; -pub const TEXT_COMMANDHASHTAG_WS: isize = 22; -pub const TEXT_COMMANDHASHTAG_COMMENT: isize = 23; -pub const TEXT_COMMANDHASHTAG_ERROR: isize = 24; -pub const HASHTAG_WS: isize = 25; -pub const HASHTAG_TEXT: isize = 26; -pub const EXPR_WS: isize = 27; -pub const KEYWORD_TRUE: isize = 28; -pub const KEYWORD_FALSE: isize = 29; -pub const KEYWORD_NULL: isize = 30; -pub const OPERATOR_ASSIGNMENT: isize = 31; -pub const OPERATOR_LOGICAL_LESS_THAN_EQUALS: isize = 32; -pub const OPERATOR_LOGICAL_GREATER_THAN_EQUALS: isize = 33; -pub const OPERATOR_LOGICAL_EQUALS: isize = 34; -pub const OPERATOR_LOGICAL_LESS: isize = 35; -pub const OPERATOR_LOGICAL_GREATER: isize = 36; -pub const OPERATOR_LOGICAL_NOT_EQUALS: isize = 37; -pub const OPERATOR_LOGICAL_AND: isize = 38; -pub const OPERATOR_LOGICAL_OR: isize = 39; -pub const OPERATOR_LOGICAL_XOR: isize = 40; -pub const OPERATOR_LOGICAL_NOT: isize = 41; -pub const OPERATOR_MATHS_ADDITION_EQUALS: isize = 42; -pub const OPERATOR_MATHS_SUBTRACTION_EQUALS: isize = 43; -pub const OPERATOR_MATHS_MULTIPLICATION_EQUALS: isize = 44; -pub const OPERATOR_MATHS_MODULUS_EQUALS: isize = 45; -pub const OPERATOR_MATHS_DIVISION_EQUALS: isize = 46; -pub const OPERATOR_MATHS_ADDITION: isize = 47; -pub const OPERATOR_MATHS_SUBTRACTION: isize = 48; -pub const OPERATOR_MATHS_MULTIPLICATION: isize = 49; -pub const OPERATOR_MATHS_DIVISION: isize = 50; -pub const OPERATOR_MATHS_MODULUS: isize = 51; -pub const LPAREN: isize = 52; -pub const RPAREN: isize = 53; -pub const COMMA: isize = 54; -pub const EXPRESSION_AS: isize = 55; -pub const STRING: isize = 56; -pub const FUNC_ID: isize = 57; -pub const EXPRESSION_END: isize = 58; -pub const VAR_ID: isize = 59; -pub const DOT: isize = 60; -pub const NUMBER: isize = 61; -pub const COMMAND_NEWLINE: isize = 62; -pub const COMMAND_WS: isize = 63; -pub const COMMAND_IF: isize = 64; -pub const COMMAND_ELSEIF: isize = 65; -pub const COMMAND_ELSE: isize = 66; -pub const COMMAND_SET: isize = 67; -pub const COMMAND_ENDIF: isize = 68; -pub const COMMAND_CALL: isize = 69; -pub const COMMAND_DECLARE: isize = 70; -pub const COMMAND_JUMP: isize = 71; -pub const COMMAND_ENUM: isize = 72; -pub const COMMAND_CASE: isize = 73; -pub const COMMAND_ENDENUM: isize = 74; -pub const COMMAND_LOCAL: isize = 75; -pub const COMMAND_END: isize = 76; -pub const COMMAND_TEXT_NEWLINE: isize = 77; -pub const COMMAND_TEXT_END: isize = 78; -pub const COMMAND_EXPRESSION_START: isize = 79; -pub const COMMAND_TEXT: isize = 80; -pub const COMMAND_ID_NEWLINE: isize = 81; -pub const TYPE_STRING: isize = 82; -pub const TYPE_NUMBER: isize = 83; -pub const TYPE_BOOL: isize = 84; -pub const RULE_dialogue: usize = 0; -pub const RULE_file_hashtag: usize = 1; -pub const RULE_node: usize = 2; -pub const RULE_header: usize = 3; -pub const RULE_body: usize = 4; -pub const RULE_statement: usize = 5; -pub const RULE_line_statement: usize = 6; -pub const RULE_line_formatted_text: usize = 7; -pub const RULE_hashtag: usize = 8; -pub const RULE_line_condition: usize = 9; -pub const RULE_expression: usize = 10; -pub const RULE_value: usize = 11; -pub const RULE_variable: usize = 12; -pub const RULE_function_call: usize = 13; -pub const RULE_if_statement: usize = 14; -pub const RULE_if_clause: usize = 15; -pub const RULE_else_if_clause: usize = 16; -pub const RULE_else_clause: usize = 17; -pub const RULE_set_statement: usize = 18; -pub const RULE_call_statement: usize = 19; -pub const RULE_command_statement: usize = 20; -pub const RULE_command_formatted_text: usize = 21; -pub const RULE_shortcut_option_statement: usize = 22; -pub const RULE_shortcut_option: usize = 23; -pub const RULE_declare_statement: usize = 24; -pub const RULE_jump_statement: usize = 25; -pub const ruleNames: [&'static str; 26] = [ - "dialogue", - "file_hashtag", - "node", - "header", - "body", - "statement", - "line_statement", - "line_formatted_text", - "hashtag", - "line_condition", - "expression", - "value", - "variable", - "function_call", - "if_statement", - "if_clause", - "else_if_clause", - "else_clause", - "set_statement", - "call_statement", - "command_statement", - "command_formatted_text", - "shortcut_option_statement", - "shortcut_option", - "declare_statement", - "jump_statement", -]; - -pub const _LITERAL_NAMES: [Option<&'static str>; 85] = [ - None, - None, - None, - None, - None, - None, - None, - None, - Some("'---'"), - None, - Some("'#'"), - None, - None, - Some("'==='"), - Some("'->'"), - Some("'<<'"), - None, - None, - Some("'\\'"), - None, - None, - None, - None, - None, - None, - None, - None, - None, - Some("'true'"), - Some("'false'"), - Some("'null'"), - None, - None, - None, - None, - None, - None, - None, - None, - None, - None, - None, - Some("'+='"), - Some("'-='"), - Some("'*='"), - Some("'%='"), - Some("'/='"), - Some("'+'"), - Some("'-'"), - Some("'*'"), - Some("'/'"), - Some("'%'"), - Some("'('"), - Some("')'"), - Some("','"), - Some("'as'"), - None, - None, - Some("'}'"), - None, - Some("'.'"), - None, - None, - None, - None, - None, - None, - None, - Some("'endif'"), - None, - None, - None, - None, - None, - None, - None, - None, - None, - None, - Some("'{'"), - None, - None, - Some("'string'"), - Some("'number'"), - Some("'bool'"), -]; -pub const _SYMBOLIC_NAMES: [Option<&'static str>; 85] = [ - None, - Some("INDENT"), - Some("DEDENT"), - Some("BLANK_LINE_FOLLOWING_OPTION"), - Some("WS"), - Some("COMMENT"), - Some("NEWLINE"), - Some("ID"), - Some("BODY_START"), - Some("HEADER_DELIMITER"), - Some("HASHTAG"), - Some("REST_OF_LINE"), - Some("BODY_WS"), - Some("BODY_END"), - Some("SHORTCUT_ARROW"), - Some("COMMAND_START"), - Some("EXPRESSION_START"), - Some("ESCAPED_ANY"), - Some("TEXT_ESCAPE"), - Some("TEXT_COMMENT"), - Some("TEXT"), - Some("UNESCAPABLE_CHARACTER"), - Some("TEXT_COMMANDHASHTAG_WS"), - Some("TEXT_COMMANDHASHTAG_COMMENT"), - Some("TEXT_COMMANDHASHTAG_ERROR"), - Some("HASHTAG_WS"), - Some("HASHTAG_TEXT"), - Some("EXPR_WS"), - Some("KEYWORD_TRUE"), - Some("KEYWORD_FALSE"), - Some("KEYWORD_NULL"), - Some("OPERATOR_ASSIGNMENT"), - Some("OPERATOR_LOGICAL_LESS_THAN_EQUALS"), - Some("OPERATOR_LOGICAL_GREATER_THAN_EQUALS"), - Some("OPERATOR_LOGICAL_EQUALS"), - Some("OPERATOR_LOGICAL_LESS"), - Some("OPERATOR_LOGICAL_GREATER"), - Some("OPERATOR_LOGICAL_NOT_EQUALS"), - Some("OPERATOR_LOGICAL_AND"), - Some("OPERATOR_LOGICAL_OR"), - Some("OPERATOR_LOGICAL_XOR"), - Some("OPERATOR_LOGICAL_NOT"), - Some("OPERATOR_MATHS_ADDITION_EQUALS"), - Some("OPERATOR_MATHS_SUBTRACTION_EQUALS"), - Some("OPERATOR_MATHS_MULTIPLICATION_EQUALS"), - Some("OPERATOR_MATHS_MODULUS_EQUALS"), - Some("OPERATOR_MATHS_DIVISION_EQUALS"), - Some("OPERATOR_MATHS_ADDITION"), - Some("OPERATOR_MATHS_SUBTRACTION"), - Some("OPERATOR_MATHS_MULTIPLICATION"), - Some("OPERATOR_MATHS_DIVISION"), - Some("OPERATOR_MATHS_MODULUS"), - Some("LPAREN"), - Some("RPAREN"), - Some("COMMA"), - Some("EXPRESSION_AS"), - Some("STRING"), - Some("FUNC_ID"), - Some("EXPRESSION_END"), - Some("VAR_ID"), - Some("DOT"), - Some("NUMBER"), - Some("COMMAND_NEWLINE"), - Some("COMMAND_WS"), - Some("COMMAND_IF"), - Some("COMMAND_ELSEIF"), - Some("COMMAND_ELSE"), - Some("COMMAND_SET"), - Some("COMMAND_ENDIF"), - Some("COMMAND_CALL"), - Some("COMMAND_DECLARE"), - Some("COMMAND_JUMP"), - Some("COMMAND_ENUM"), - Some("COMMAND_CASE"), - Some("COMMAND_ENDENUM"), - Some("COMMAND_LOCAL"), - Some("COMMAND_END"), - Some("COMMAND_TEXT_NEWLINE"), - Some("COMMAND_TEXT_END"), - Some("COMMAND_EXPRESSION_START"), - Some("COMMAND_TEXT"), - Some("COMMAND_ID_NEWLINE"), - Some("TYPE_STRING"), - Some("TYPE_NUMBER"), - Some("TYPE_BOOL"), -]; -lazy_static! { - static ref _shared_context_cache: Arc = - Arc::new(PredictionContextCache::new()); - static ref VOCABULARY: Box = Box::new(VocabularyImpl::new( - _LITERAL_NAMES.iter(), - _SYMBOLIC_NAMES.iter(), - None - )); -} - -type BaseParserType<'input, I> = BaseParser< - 'input, - YarnSpinnerParserExt<'input>, - I, - YarnSpinnerParserContextType, - dyn YarnSpinnerParserListener<'input> + 'input, ->; +use std::rc::Rc; +use std::convert::TryFrom; +use std::cell::RefCell; +use std::ops::{DerefMut, Deref}; +use std::borrow::{Borrow,BorrowMut}; +use std::any::{Any,TypeId}; + + pub const YarnSpinnerParser_INDENT:i32=1; + pub const YarnSpinnerParser_DEDENT:i32=2; + pub const YarnSpinnerParser_BLANK_LINE_FOLLOWING_OPTION:i32=3; + pub const YarnSpinnerParser_WS:i32=4; + pub const YarnSpinnerParser_COMMENT:i32=5; + pub const YarnSpinnerParser_NEWLINE:i32=6; + pub const YarnSpinnerParser_ID:i32=7; + pub const YarnSpinnerParser_BODY_START:i32=8; + pub const YarnSpinnerParser_HEADER_DELIMITER:i32=9; + pub const YarnSpinnerParser_HASHTAG:i32=10; + pub const YarnSpinnerParser_REST_OF_LINE:i32=11; + pub const YarnSpinnerParser_BODY_WS:i32=12; + pub const YarnSpinnerParser_BODY_END:i32=13; + pub const YarnSpinnerParser_SHORTCUT_ARROW:i32=14; + pub const YarnSpinnerParser_COMMAND_START:i32=15; + pub const YarnSpinnerParser_EXPRESSION_START:i32=16; + pub const YarnSpinnerParser_ESCAPED_ANY:i32=17; + pub const YarnSpinnerParser_TEXT_ESCAPE:i32=18; + pub const YarnSpinnerParser_TEXT_COMMENT:i32=19; + pub const YarnSpinnerParser_TEXT:i32=20; + pub const YarnSpinnerParser_UNESCAPABLE_CHARACTER:i32=21; + pub const YarnSpinnerParser_TEXT_COMMANDHASHTAG_WS:i32=22; + pub const YarnSpinnerParser_TEXT_COMMANDHASHTAG_COMMENT:i32=23; + pub const YarnSpinnerParser_TEXT_COMMANDHASHTAG_ERROR:i32=24; + pub const YarnSpinnerParser_HASHTAG_WS:i32=25; + pub const YarnSpinnerParser_HASHTAG_TEXT:i32=26; + pub const YarnSpinnerParser_EXPR_WS:i32=27; + pub const YarnSpinnerParser_KEYWORD_TRUE:i32=28; + pub const YarnSpinnerParser_KEYWORD_FALSE:i32=29; + pub const YarnSpinnerParser_KEYWORD_NULL:i32=30; + pub const YarnSpinnerParser_OPERATOR_ASSIGNMENT:i32=31; + pub const YarnSpinnerParser_OPERATOR_LOGICAL_LESS_THAN_EQUALS:i32=32; + pub const YarnSpinnerParser_OPERATOR_LOGICAL_GREATER_THAN_EQUALS:i32=33; + pub const YarnSpinnerParser_OPERATOR_LOGICAL_EQUALS:i32=34; + pub const YarnSpinnerParser_OPERATOR_LOGICAL_LESS:i32=35; + pub const YarnSpinnerParser_OPERATOR_LOGICAL_GREATER:i32=36; + pub const YarnSpinnerParser_OPERATOR_LOGICAL_NOT_EQUALS:i32=37; + pub const YarnSpinnerParser_OPERATOR_LOGICAL_AND:i32=38; + pub const YarnSpinnerParser_OPERATOR_LOGICAL_OR:i32=39; + pub const YarnSpinnerParser_OPERATOR_LOGICAL_XOR:i32=40; + pub const YarnSpinnerParser_OPERATOR_LOGICAL_NOT:i32=41; + pub const YarnSpinnerParser_OPERATOR_MATHS_ADDITION_EQUALS:i32=42; + pub const YarnSpinnerParser_OPERATOR_MATHS_SUBTRACTION_EQUALS:i32=43; + pub const YarnSpinnerParser_OPERATOR_MATHS_MULTIPLICATION_EQUALS:i32=44; + pub const YarnSpinnerParser_OPERATOR_MATHS_MODULUS_EQUALS:i32=45; + pub const YarnSpinnerParser_OPERATOR_MATHS_DIVISION_EQUALS:i32=46; + pub const YarnSpinnerParser_OPERATOR_MATHS_ADDITION:i32=47; + pub const YarnSpinnerParser_OPERATOR_MATHS_SUBTRACTION:i32=48; + pub const YarnSpinnerParser_OPERATOR_MATHS_MULTIPLICATION:i32=49; + pub const YarnSpinnerParser_OPERATOR_MATHS_DIVISION:i32=50; + pub const YarnSpinnerParser_OPERATOR_MATHS_MODULUS:i32=51; + pub const YarnSpinnerParser_LPAREN:i32=52; + pub const YarnSpinnerParser_RPAREN:i32=53; + pub const YarnSpinnerParser_COMMA:i32=54; + pub const YarnSpinnerParser_EXPRESSION_AS:i32=55; + pub const YarnSpinnerParser_STRING:i32=56; + pub const YarnSpinnerParser_FUNC_ID:i32=57; + pub const YarnSpinnerParser_EXPRESSION_END:i32=58; + pub const YarnSpinnerParser_VAR_ID:i32=59; + pub const YarnSpinnerParser_DOT:i32=60; + pub const YarnSpinnerParser_NUMBER:i32=61; + pub const YarnSpinnerParser_COMMAND_NEWLINE:i32=62; + pub const YarnSpinnerParser_COMMAND_WS:i32=63; + pub const YarnSpinnerParser_COMMAND_IF:i32=64; + pub const YarnSpinnerParser_COMMAND_ELSEIF:i32=65; + pub const YarnSpinnerParser_COMMAND_ELSE:i32=66; + pub const YarnSpinnerParser_COMMAND_SET:i32=67; + pub const YarnSpinnerParser_COMMAND_ENDIF:i32=68; + pub const YarnSpinnerParser_COMMAND_CALL:i32=69; + pub const YarnSpinnerParser_COMMAND_DECLARE:i32=70; + pub const YarnSpinnerParser_COMMAND_JUMP:i32=71; + pub const YarnSpinnerParser_COMMAND_ENUM:i32=72; + pub const YarnSpinnerParser_COMMAND_CASE:i32=73; + pub const YarnSpinnerParser_COMMAND_ENDENUM:i32=74; + pub const YarnSpinnerParser_COMMAND_LOCAL:i32=75; + pub const YarnSpinnerParser_COMMAND_END:i32=76; + pub const YarnSpinnerParser_COMMAND_TEXT_NEWLINE:i32=77; + pub const YarnSpinnerParser_COMMAND_TEXT_END:i32=78; + pub const YarnSpinnerParser_COMMAND_EXPRESSION_START:i32=79; + pub const YarnSpinnerParser_COMMAND_TEXT:i32=80; + pub const YarnSpinnerParser_COMMAND_ID_NEWLINE:i32=81; + pub const YarnSpinnerParser_TYPE_STRING:i32=82; + pub const YarnSpinnerParser_TYPE_NUMBER:i32=83; + pub const YarnSpinnerParser_TYPE_BOOL:i32=84; + pub const YarnSpinnerParser_EOF:i32=EOF; + pub const RULE_dialogue:usize = 0; + pub const RULE_file_hashtag:usize = 1; + pub const RULE_node:usize = 2; + pub const RULE_header:usize = 3; + pub const RULE_body:usize = 4; + pub const RULE_statement:usize = 5; + pub const RULE_line_statement:usize = 6; + pub const RULE_line_formatted_text:usize = 7; + pub const RULE_hashtag:usize = 8; + pub const RULE_line_condition:usize = 9; + pub const RULE_expression:usize = 10; + pub const RULE_value:usize = 11; + pub const RULE_variable:usize = 12; + pub const RULE_function_call:usize = 13; + pub const RULE_if_statement:usize = 14; + pub const RULE_if_clause:usize = 15; + pub const RULE_else_if_clause:usize = 16; + pub const RULE_else_clause:usize = 17; + pub const RULE_set_statement:usize = 18; + pub const RULE_call_statement:usize = 19; + pub const RULE_command_statement:usize = 20; + pub const RULE_command_formatted_text:usize = 21; + pub const RULE_shortcut_option_statement:usize = 22; + pub const RULE_shortcut_option:usize = 23; + pub const RULE_declare_statement:usize = 24; + pub const RULE_jump_statement:usize = 25; + pub const ruleNames: [&'static str; 26] = [ + "dialogue", "file_hashtag", "node", "header", "body", "statement", "line_statement", + "line_formatted_text", "hashtag", "line_condition", "expression", "value", + "variable", "function_call", "if_statement", "if_clause", "else_if_clause", + "else_clause", "set_statement", "call_statement", "command_statement", + "command_formatted_text", "shortcut_option_statement", "shortcut_option", + "declare_statement", "jump_statement" + ]; + + + pub const _LITERAL_NAMES: [Option<&'static str>;85] = [ + None, None, None, None, None, None, None, None, Some("'---'"), None, Some("'#'"), + None, None, Some("'==='"), Some("'->'"), Some("'<<'"), None, None, Some("'\\'"), + None, None, None, None, None, None, None, None, None, Some("'true'"), + Some("'false'"), Some("'null'"), None, None, None, None, None, None, None, + None, None, None, None, Some("'+='"), Some("'-='"), Some("'*='"), Some("'%='"), + Some("'/='"), Some("'+'"), Some("'-'"), Some("'*'"), Some("'/'"), Some("'%'"), + Some("'('"), Some("')'"), Some("','"), Some("'as'"), None, None, Some("'}'"), + None, Some("'.'"), None, None, None, None, None, None, None, Some("'endif'"), + None, None, None, None, None, None, None, None, None, None, Some("'{'"), + None, None, Some("'string'"), Some("'number'"), Some("'bool'") + ]; + pub const _SYMBOLIC_NAMES: [Option<&'static str>;85] = [ + None, Some("INDENT"), Some("DEDENT"), Some("BLANK_LINE_FOLLOWING_OPTION"), + Some("WS"), Some("COMMENT"), Some("NEWLINE"), Some("ID"), Some("BODY_START"), + Some("HEADER_DELIMITER"), Some("HASHTAG"), Some("REST_OF_LINE"), Some("BODY_WS"), + Some("BODY_END"), Some("SHORTCUT_ARROW"), Some("COMMAND_START"), Some("EXPRESSION_START"), + Some("ESCAPED_ANY"), Some("TEXT_ESCAPE"), Some("TEXT_COMMENT"), Some("TEXT"), + Some("UNESCAPABLE_CHARACTER"), Some("TEXT_COMMANDHASHTAG_WS"), Some("TEXT_COMMANDHASHTAG_COMMENT"), + Some("TEXT_COMMANDHASHTAG_ERROR"), Some("HASHTAG_WS"), Some("HASHTAG_TEXT"), + Some("EXPR_WS"), Some("KEYWORD_TRUE"), Some("KEYWORD_FALSE"), Some("KEYWORD_NULL"), + Some("OPERATOR_ASSIGNMENT"), Some("OPERATOR_LOGICAL_LESS_THAN_EQUALS"), + Some("OPERATOR_LOGICAL_GREATER_THAN_EQUALS"), Some("OPERATOR_LOGICAL_EQUALS"), + Some("OPERATOR_LOGICAL_LESS"), Some("OPERATOR_LOGICAL_GREATER"), Some("OPERATOR_LOGICAL_NOT_EQUALS"), + Some("OPERATOR_LOGICAL_AND"), Some("OPERATOR_LOGICAL_OR"), Some("OPERATOR_LOGICAL_XOR"), + Some("OPERATOR_LOGICAL_NOT"), Some("OPERATOR_MATHS_ADDITION_EQUALS"), + Some("OPERATOR_MATHS_SUBTRACTION_EQUALS"), Some("OPERATOR_MATHS_MULTIPLICATION_EQUALS"), + Some("OPERATOR_MATHS_MODULUS_EQUALS"), Some("OPERATOR_MATHS_DIVISION_EQUALS"), + Some("OPERATOR_MATHS_ADDITION"), Some("OPERATOR_MATHS_SUBTRACTION"), Some("OPERATOR_MATHS_MULTIPLICATION"), + Some("OPERATOR_MATHS_DIVISION"), Some("OPERATOR_MATHS_MODULUS"), Some("LPAREN"), + Some("RPAREN"), Some("COMMA"), Some("EXPRESSION_AS"), Some("STRING"), + Some("FUNC_ID"), Some("EXPRESSION_END"), Some("VAR_ID"), Some("DOT"), + Some("NUMBER"), Some("COMMAND_NEWLINE"), Some("COMMAND_WS"), Some("COMMAND_IF"), + Some("COMMAND_ELSEIF"), Some("COMMAND_ELSE"), Some("COMMAND_SET"), Some("COMMAND_ENDIF"), + Some("COMMAND_CALL"), Some("COMMAND_DECLARE"), Some("COMMAND_JUMP"), Some("COMMAND_ENUM"), + Some("COMMAND_CASE"), Some("COMMAND_ENDENUM"), Some("COMMAND_LOCAL"), + Some("COMMAND_END"), Some("COMMAND_TEXT_NEWLINE"), Some("COMMAND_TEXT_END"), + Some("COMMAND_EXPRESSION_START"), Some("COMMAND_TEXT"), Some("COMMAND_ID_NEWLINE"), + Some("TYPE_STRING"), Some("TYPE_NUMBER"), Some("TYPE_BOOL") + ]; + lazy_static!{ + static ref _shared_context_cache: Arc = Arc::new(PredictionContextCache::new()); + static ref VOCABULARY: Box = Box::new(VocabularyImpl::new(_LITERAL_NAMES.iter(), _SYMBOLIC_NAMES.iter(), None)); + } + + +type BaseParserType<'input, I> = + BaseParser<'input,YarnSpinnerParserExt<'input>, I, YarnSpinnerParserContextType , dyn YarnSpinnerParserListener<'input> + 'input >; type TokenType<'input> = as TokenFactory<'input>>::Tok; pub type LocalTokenFactory<'input> = CommonTokenFactory; -pub type YarnSpinnerParserTreeWalker<'input, 'a> = ParseTreeWalker< - 'input, - 'a, - YarnSpinnerParserContextType, - dyn YarnSpinnerParserListener<'input> + 'a, ->; +pub type YarnSpinnerParserTreeWalker<'input,'a> = + ParseTreeWalker<'input, 'a, YarnSpinnerParserContextType , dyn YarnSpinnerParserListener<'input> + 'a>; /// Parser for YarnSpinnerParser grammar -pub struct YarnSpinnerParser<'input, I, H> +pub struct YarnSpinnerParser<'input, I> where - I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>, - H: ErrorStrategy<'input, BaseParserType<'input, I>>, + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, { - base: BaseParserType<'input, I>, - interpreter: Arc, - _shared_context_cache: Box, - pub err_handler: H, + base:BaseParserType<'input,I>, + interpreter:Arc, + _shared_context_cache: Box, + pub err_handler: Box > >, } -impl<'input, I, H> YarnSpinnerParser<'input, I, H> +impl<'input, I> YarnSpinnerParser<'input, I> where - I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>, - H: ErrorStrategy<'input, BaseParserType<'input, I>>, + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, { - pub fn get_serialized_atn() -> &'static str { - _serializedATN - } - - pub fn set_error_strategy(&mut self, strategy: H) { + pub fn set_error_strategy(&mut self, strategy: Box > >) { self.err_handler = strategy } - pub fn with_strategy(input: I, strategy: H) -> Self { - antlr_rust::recognizer::check_version("0", "3"); - let interpreter = Arc::new(ParserATNSimulator::new( - _ATN.clone(), - _decision_to_DFA.clone(), - _shared_context_cache.clone(), - )); - Self { - base: BaseParser::new_base_parser( - input, - Arc::clone(&interpreter), - YarnSpinnerParserExt { - _pd: Default::default(), - }, - ), - interpreter, + pub fn with_strategy(input: I, strategy: Box > >) -> Self { + antlr4rust::recognizer::check_version("0","5"); + let interpreter = Arc::new(ParserATNSimulator::new( + _ATN.clone(), + _decision_to_DFA.clone(), + _shared_context_cache.clone(), + )); + Self { + base: BaseParser::new_base_parser( + input, + Arc::clone(&interpreter), + YarnSpinnerParserExt{ + _pd: Default::default(), + } + ), + interpreter, _shared_context_cache: Box::new(PredictionContextCache::new()), err_handler: strategy, } } + } -type DynStrategy<'input, I> = Box> + 'input>; +type DynStrategy<'input,I> = Box> + 'input>; -impl<'input, I> YarnSpinnerParser<'input, I, DynStrategy<'input, I>> +impl<'input, I> YarnSpinnerParser<'input, I> where - I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>, + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, { - pub fn with_dyn_strategy(input: I) -> Self { - Self::with_strategy(input, Box::new(DefaultErrorStrategy::new())) + pub fn with_dyn_strategy(input: I) -> Self{ + Self::with_strategy(input,Box::new(DefaultErrorStrategy::new())) } } -impl<'input, I> - YarnSpinnerParser<'input, I, DefaultErrorStrategy<'input, YarnSpinnerParserContextType>> +impl<'input, I> YarnSpinnerParser<'input, I> where - I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>, + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, { - pub fn new(input: I) -> Self { - Self::with_strategy(input, DefaultErrorStrategy::new()) + pub fn new(input: I) -> Self{ + Self::with_strategy(input,Box::new(DefaultErrorStrategy::new())) } } /// Trait for monomorphized trait object that corresponds to the nodes of parse tree generated for YarnSpinnerParser pub trait YarnSpinnerParserContext<'input>: - for<'x> Listenable + 'x> - + for<'x> Visitable + 'x> - + ParserRuleContext<'input, TF = LocalTokenFactory<'input>, Ctx = YarnSpinnerParserContextType> -{ -} + for<'x> Listenable + 'x > + + for<'x> Visitable + 'x > + + ParserRuleContext<'input, TF=LocalTokenFactory<'input>, Ctx=YarnSpinnerParserContextType> +{} -antlr_rust::coerce_from! { 'input : YarnSpinnerParserContext<'input> } +antlr4rust::coerce_from!{ 'input : YarnSpinnerParserContext<'input> } impl<'input, 'x, T> VisitableDyn for dyn YarnSpinnerParserContext<'input> + 'input where @@ -467,6974 +295,5785 @@ where } } -impl<'input> YarnSpinnerParserContext<'input> - for TerminalNode<'input, YarnSpinnerParserContextType> -{ -} -impl<'input> YarnSpinnerParserContext<'input> for ErrorNode<'input, YarnSpinnerParserContextType> {} +impl<'input> YarnSpinnerParserContext<'input> for TerminalNode<'input,YarnSpinnerParserContextType> {} +impl<'input> YarnSpinnerParserContext<'input> for ErrorNode<'input,YarnSpinnerParserContextType> {} -antlr_rust::tid! { impl<'input> TidAble<'input> for dyn YarnSpinnerParserContext<'input> + 'input } +antlr4rust::tid! { impl<'input> TidAble<'input> for dyn YarnSpinnerParserContext<'input> + 'input } -antlr_rust::tid! { impl<'input> TidAble<'input> for dyn YarnSpinnerParserListener<'input> + 'input } +antlr4rust::tid! { impl<'input> TidAble<'input> for dyn YarnSpinnerParserListener<'input> + 'input } pub struct YarnSpinnerParserContextType; -antlr_rust::tid! {YarnSpinnerParserContextType} +antlr4rust::tid!{YarnSpinnerParserContextType} -impl<'input> ParserNodeType<'input> for YarnSpinnerParserContextType { - type TF = LocalTokenFactory<'input>; - type Type = dyn YarnSpinnerParserContext<'input> + 'input; +impl<'input> ParserNodeType<'input> for YarnSpinnerParserContextType{ + type TF = LocalTokenFactory<'input>; + type Type = dyn YarnSpinnerParserContext<'input> + 'input; } -impl<'input, I, H> Deref for YarnSpinnerParser<'input, I, H> +impl<'input, I> Deref for YarnSpinnerParser<'input, I> where - I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>, - H: ErrorStrategy<'input, BaseParserType<'input, I>>, + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, { - type Target = BaseParserType<'input, I>; + type Target = BaseParserType<'input,I>; fn deref(&self) -> &Self::Target { &self.base } } -impl<'input, I, H> DerefMut for YarnSpinnerParser<'input, I, H> +impl<'input, I> DerefMut for YarnSpinnerParser<'input, I> where - I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>, - H: ErrorStrategy<'input, BaseParserType<'input, I>>, + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.base } } -pub struct YarnSpinnerParserExt<'input> { - _pd: PhantomData<&'input str>, +pub struct YarnSpinnerParserExt<'input>{ + _pd: PhantomData<&'input str>, } -impl<'input> YarnSpinnerParserExt<'input> {} -antlr_rust::tid! { YarnSpinnerParserExt<'a> } - -impl<'input> TokenAware<'input> for YarnSpinnerParserExt<'input> { - type TF = LocalTokenFactory<'input>; +impl<'input> YarnSpinnerParserExt<'input>{ } +antlr4rust::tid! { YarnSpinnerParserExt<'a> } -impl<'input, I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>> - ParserRecog<'input, BaseParserType<'input, I>> for YarnSpinnerParserExt<'input> -{ +impl<'input> TokenAware<'input> for YarnSpinnerParserExt<'input>{ + type TF = LocalTokenFactory<'input>; } -impl<'input, I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>> - Actions<'input, BaseParserType<'input, I>> for YarnSpinnerParserExt<'input> -{ - fn get_grammar_file_name(&self) -> &str { - "YarnSpinnerParser.g4" - } +impl<'input,I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>> ParserRecog<'input, BaseParserType<'input,I>> for YarnSpinnerParserExt<'input>{} - fn get_rule_names(&self) -> &[&str] { - &ruleNames - } +impl<'input,I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>> Actions<'input, BaseParserType<'input,I>> for YarnSpinnerParserExt<'input>{ + fn get_grammar_file_name(&self) -> & str{ "YarnSpinnerParser.g4"} - fn get_vocabulary(&self) -> &dyn Vocabulary { - &**VOCABULARY - } - fn sempred( - _localctx: Option<&(dyn YarnSpinnerParserContext<'input> + 'input)>, - rule_index: isize, - pred_index: isize, - recog: &mut BaseParserType<'input, I>, - ) -> bool { - match rule_index { - 10 => YarnSpinnerParser::<'input, I, _>::expression_sempred( - _localctx.and_then(|x| x.downcast_ref()), - pred_index, - recog, - ), - _ => true, - } - } + fn get_rule_names(&self) -> &[& str] {&ruleNames} + + fn get_vocabulary(&self) -> &dyn Vocabulary { &**VOCABULARY } + fn sempred(_localctx: Option<&(dyn YarnSpinnerParserContext<'input> + 'input)>, rule_index: i32, pred_index: i32, + recog:&mut BaseParserType<'input,I> + )->bool{ + match rule_index { + 10 => YarnSpinnerParser::<'input,I>::expression_sempred(_localctx.and_then(|x|x.downcast_ref()), pred_index, recog), + _ => true + } + } } -impl<'input, I> - YarnSpinnerParser<'input, I, DefaultErrorStrategy<'input, YarnSpinnerParserContextType>> +impl<'input, I> YarnSpinnerParser<'input, I> where - I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>, -{ - fn expression_sempred( - _localctx: Option<&ExpressionContext<'input>>, - pred_index: isize, - recog: &mut ::Target, - ) -> bool { - match pred_index { - 0 => recog.precpred(None, 6), - 1 => recog.precpred(None, 5), - 2 => recog.precpred(None, 4), - 3 => recog.precpred(None, 3), - 4 => recog.precpred(None, 2), - _ => true, - } - } + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + fn expression_sempred(_localctx: Option<&ExpressionContext<'input>>, pred_index:i32, + recog:&mut ::Target + ) -> bool { + match pred_index { + 0=>{ + recog.precpred(None, 6) + } + 1=>{ + recog.precpred(None, 5) + } + 2=>{ + recog.precpred(None, 4) + } + 3=>{ + recog.precpred(None, 3) + } + 4=>{ + recog.precpred(None, 2) + } + _ => true + } + } } //------------------- dialogue ---------------- pub type DialogueContextAll<'input> = DialogueContext<'input>; -pub type DialogueContext<'input> = BaseParserRuleContext<'input, DialogueContextExt<'input>>; + +pub type DialogueContext<'input> = BaseParserRuleContext<'input,DialogueContextExt<'input>>; #[derive(Clone)] -pub struct DialogueContextExt<'input> { - ph: PhantomData<&'input str>, +pub struct DialogueContextExt<'input>{ +ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for DialogueContext<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for DialogueContext<'input>{} -impl<'input, 'a> Listenable + 'a> - for DialogueContext<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_dialogue(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_dialogue(self); - listener.exit_every_rule(self); - } +impl<'input,'a> Listenable + 'a> for DialogueContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_dialogue(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_dialogue(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input, 'a> Visitable + 'a> for DialogueContext<'input> { - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_dialogue(self); - } +impl<'input,'a> Visitable + 'a> for DialogueContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_dialogue(self); + } } -impl<'input> CustomRuleContext<'input> for DialogueContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_dialogue - } - //fn type_rule_index() -> usize where Self: Sized { RULE_dialogue } -} -antlr_rust::tid! {DialogueContextExt<'a>} - -impl<'input> DialogueContextExt<'input> { - fn new( - parent: Option + 'input>>, - invoking_state: isize, - ) -> Rc> { - Rc::new(BaseParserRuleContext::new_parser_ctx( - parent, - invoking_state, - DialogueContextExt { ph: PhantomData }, - )) - } +impl<'input> CustomRuleContext<'input> for DialogueContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_dialogue } + //fn type_rule_index() -> usize where Self: Sized { RULE_dialogue } +} +antlr4rust::tid!{DialogueContextExt<'a>} + +impl<'input> DialogueContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,DialogueContextExt{ + + ph:PhantomData + }), + ) + } +} + +pub trait DialogueContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ + +fn node_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +fn node(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) +} +fn file_hashtag_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +fn file_hashtag(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) } -pub trait DialogueContextAttrs<'input>: - YarnSpinnerParserContext<'input> + BorrowMut> -{ - fn node_all(&self) -> Vec>> - where - Self: Sized, - { - self.children_of_type() - } - fn node(&self, i: usize) -> Option>> - where - Self: Sized, - { - self.child_of_type(i) - } - fn file_hashtag_all(&self) -> Vec>> - where - Self: Sized, - { - self.children_of_type() - } - fn file_hashtag(&self, i: usize) -> Option>> - where - Self: Sized, - { - self.child_of_type(i) - } } -impl<'input> DialogueContextAttrs<'input> for DialogueContext<'input> {} +impl<'input> DialogueContextAttrs<'input> for DialogueContext<'input>{} -impl<'input, I, H> YarnSpinnerParser<'input, I, H> +impl<'input, I> YarnSpinnerParser<'input, I> where - I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>, - H: ErrorStrategy<'input, BaseParserType<'input, I>>, + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, { - pub fn dialogue(&mut self) -> Result>, ANTLRError> { - let mut recog = self; - let _parentctx = recog.ctx.take(); - let mut _localctx = DialogueContextExt::new(_parentctx.clone(), recog.base.get_state()); + pub fn dialogue(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = DialogueContextExt::new(_parentctx.clone(), recog.base.get_state()); recog.base.enter_rule(_localctx.clone(), 0, RULE_dialogue); let mut _localctx: Rc = _localctx; - let mut _la: isize = -1; - let result: Result<(), ANTLRError> = (|| { - //recog.base.enter_outer_alt(_localctx.clone(), 1); - recog.base.enter_outer_alt(None, 1); - { - { - recog.base.set_state(55); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - while _la == HASHTAG { - { - { - /*InvokeRule file_hashtag*/ - recog.base.set_state(52); - recog.file_hashtag()?; - } - } - recog.base.set_state(57); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - } - } - recog.base.set_state(59); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - loop { - { - { - /*InvokeRule node*/ - recog.base.set_state(58); - recog.node()?; - } - } - recog.base.set_state(61); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - if !(_la == ID) { - break; - } - } - } - Ok(()) - })(); - match result { - Ok(_) => {} - Err(e @ ANTLRError::FallThrough(_)) => return Err(e), - Err(ref re) => { - //_localctx.exception = re; - recog.err_handler.report_error(&mut recog.base, re); - recog.err_handler.recover(&mut recog.base, re)?; - } - } - recog.base.exit_rule(); - - Ok(_localctx) - } + let mut _la: i32 = -1; + let result: Result<(), ANTLRError> = (|| { + + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + { + recog.base.set_state(55); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + while _la==YarnSpinnerParser_HASHTAG { + { + { + /*InvokeRule file_hashtag*/ + recog.base.set_state(52); + recog.file_hashtag()?; + + } + } + recog.base.set_state(57); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + } + } + recog.base.set_state(59); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + loop { + { + { + /*InvokeRule node*/ + recog.base.set_state(58); + recog.node()?; + + } + } + recog.base.set_state(61); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + if !(_la==YarnSpinnerParser_ID) {break} + } + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) + } } //------------------- file_hashtag ---------------- pub type File_hashtagContextAll<'input> = File_hashtagContext<'input>; -pub type File_hashtagContext<'input> = - BaseParserRuleContext<'input, File_hashtagContextExt<'input>>; + +pub type File_hashtagContext<'input> = BaseParserRuleContext<'input,File_hashtagContextExt<'input>>; #[derive(Clone)] -pub struct File_hashtagContextExt<'input> { - pub text: Option>, - ph: PhantomData<&'input str>, +pub struct File_hashtagContextExt<'input>{ + pub text: Option>, +ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for File_hashtagContext<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for File_hashtagContext<'input>{} -impl<'input, 'a> Listenable + 'a> - for File_hashtagContext<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_file_hashtag(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_file_hashtag(self); - listener.exit_every_rule(self); - } +impl<'input,'a> Listenable + 'a> for File_hashtagContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_file_hashtag(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_file_hashtag(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input, 'a> Visitable + 'a> - for File_hashtagContext<'input> -{ - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_file_hashtag(self); - } +impl<'input,'a> Visitable + 'a> for File_hashtagContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_file_hashtag(self); + } } -impl<'input> CustomRuleContext<'input> for File_hashtagContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_file_hashtag - } - //fn type_rule_index() -> usize where Self: Sized { RULE_file_hashtag } -} -antlr_rust::tid! {File_hashtagContextExt<'a>} - -impl<'input> File_hashtagContextExt<'input> { - fn new( - parent: Option + 'input>>, - invoking_state: isize, - ) -> Rc> { - Rc::new(BaseParserRuleContext::new_parser_ctx( - parent, - invoking_state, - File_hashtagContextExt { - text: None, - ph: PhantomData, - }, - )) - } +impl<'input> CustomRuleContext<'input> for File_hashtagContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_file_hashtag } + //fn type_rule_index() -> usize where Self: Sized { RULE_file_hashtag } } +antlr4rust::tid!{File_hashtagContextExt<'a>} -pub trait File_hashtagContextAttrs<'input>: - YarnSpinnerParserContext<'input> + BorrowMut> -{ - /// Retrieves first TerminalNode corresponding to token HASHTAG - /// Returns `None` if there is no child corresponding to token HASHTAG - fn HASHTAG(&self) -> Option>> - where - Self: Sized, - { - self.get_token(HASHTAG, 0) - } - /// Retrieves first TerminalNode corresponding to token HASHTAG_TEXT - /// Returns `None` if there is no child corresponding to token HASHTAG_TEXT - fn HASHTAG_TEXT(&self) -> Option>> - where - Self: Sized, - { - self.get_token(HASHTAG_TEXT, 0) - } +impl<'input> File_hashtagContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,File_hashtagContextExt{ + text: None, + + ph:PhantomData + }), + ) + } } -impl<'input> File_hashtagContextAttrs<'input> for File_hashtagContext<'input> {} +pub trait File_hashtagContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ -impl<'input, I, H> YarnSpinnerParser<'input, I, H> +/// Retrieves first TerminalNode corresponding to token HASHTAG +/// Returns `None` if there is no child corresponding to token HASHTAG +fn HASHTAG(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_HASHTAG, 0) +} +/// Retrieves first TerminalNode corresponding to token HASHTAG_TEXT +/// Returns `None` if there is no child corresponding to token HASHTAG_TEXT +fn HASHTAG_TEXT(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_HASHTAG_TEXT, 0) +} + +} + +impl<'input> File_hashtagContextAttrs<'input> for File_hashtagContext<'input>{} + +impl<'input, I> YarnSpinnerParser<'input, I> where - I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>, - H: ErrorStrategy<'input, BaseParserType<'input, I>>, -{ - pub fn file_hashtag(&mut self) -> Result>, ANTLRError> { - let mut recog = self; - let _parentctx = recog.ctx.take(); - let mut _localctx = File_hashtagContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog - .base - .enter_rule(_localctx.clone(), 2, RULE_file_hashtag); + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + pub fn file_hashtag(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = File_hashtagContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 2, RULE_file_hashtag); let mut _localctx: Rc = _localctx; - let result: Result<(), ANTLRError> = (|| { - //recog.base.enter_outer_alt(_localctx.clone(), 1); - recog.base.enter_outer_alt(None, 1); - { - recog.base.set_state(63); - recog.base.match_token(HASHTAG, &mut recog.err_handler)?; - - recog.base.set_state(64); - let tmp = recog - .base - .match_token(HASHTAG_TEXT, &mut recog.err_handler)?; - cast_mut::<_, File_hashtagContext>(&mut _localctx).text = Some(tmp.clone()); - } - Ok(()) - })(); - match result { - Ok(_) => {} - Err(e @ ANTLRError::FallThrough(_)) => return Err(e), - Err(ref re) => { - //_localctx.exception = re; - recog.err_handler.report_error(&mut recog.base, re); - recog.err_handler.recover(&mut recog.base, re)?; - } - } - recog.base.exit_rule(); - - Ok(_localctx) - } + let result: Result<(), ANTLRError> = (|| { + + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(63); + recog.base.match_token(YarnSpinnerParser_HASHTAG,&mut recog.err_handler)?; + + recog.base.set_state(64); + let tmp = recog.base.match_token(YarnSpinnerParser_HASHTAG_TEXT,&mut recog.err_handler)?; + cast_mut::<_,File_hashtagContext >(&mut _localctx).text = Some(tmp.clone()); + + + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) + } } //------------------- node ---------------- pub type NodeContextAll<'input> = NodeContext<'input>; -pub type NodeContext<'input> = BaseParserRuleContext<'input, NodeContextExt<'input>>; + +pub type NodeContext<'input> = BaseParserRuleContext<'input,NodeContextExt<'input>>; #[derive(Clone)] -pub struct NodeContextExt<'input> { - ph: PhantomData<&'input str>, +pub struct NodeContextExt<'input>{ +ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for NodeContext<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for NodeContext<'input>{} -impl<'input, 'a> Listenable + 'a> for NodeContext<'input> { - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_node(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_node(self); - listener.exit_every_rule(self); - } +impl<'input,'a> Listenable + 'a> for NodeContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_node(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_node(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input, 'a> Visitable + 'a> for NodeContext<'input> { - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - YarnSpinnerParserVisitor::visit_node(visitor, self); - } +impl<'input,'a> Visitable + 'a> for NodeContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + YarnSpinnerParserVisitor::visit_node(visitor, self); + } } -impl<'input> CustomRuleContext<'input> for NodeContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_node - } - //fn type_rule_index() -> usize where Self: Sized { RULE_node } -} -antlr_rust::tid! {NodeContextExt<'a>} - -impl<'input> NodeContextExt<'input> { - fn new( - parent: Option + 'input>>, - invoking_state: isize, - ) -> Rc> { - Rc::new(BaseParserRuleContext::new_parser_ctx( - parent, - invoking_state, - NodeContextExt { ph: PhantomData }, - )) - } +impl<'input> CustomRuleContext<'input> for NodeContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_node } + //fn type_rule_index() -> usize where Self: Sized { RULE_node } +} +antlr4rust::tid!{NodeContextExt<'a>} + +impl<'input> NodeContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,NodeContextExt{ + + ph:PhantomData + }), + ) + } +} + +pub trait NodeContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ + +/// Retrieves first TerminalNode corresponding to token BODY_START +/// Returns `None` if there is no child corresponding to token BODY_START +fn BODY_START(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_BODY_START, 0) +} +fn body(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +/// Retrieves first TerminalNode corresponding to token BODY_END +/// Returns `None` if there is no child corresponding to token BODY_END +fn BODY_END(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_BODY_END, 0) +} +fn header_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +fn header(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) } -pub trait NodeContextAttrs<'input>: - YarnSpinnerParserContext<'input> + BorrowMut> -{ - /// Retrieves first TerminalNode corresponding to token BODY_START - /// Returns `None` if there is no child corresponding to token BODY_START - fn BODY_START(&self) -> Option>> - where - Self: Sized, - { - self.get_token(BODY_START, 0) - } - fn body(&self) -> Option>> - where - Self: Sized, - { - self.child_of_type(0) - } - /// Retrieves first TerminalNode corresponding to token BODY_END - /// Returns `None` if there is no child corresponding to token BODY_END - fn BODY_END(&self) -> Option>> - where - Self: Sized, - { - self.get_token(BODY_END, 0) - } - fn header_all(&self) -> Vec>> - where - Self: Sized, - { - self.children_of_type() - } - fn header(&self, i: usize) -> Option>> - where - Self: Sized, - { - self.child_of_type(i) - } } -impl<'input> NodeContextAttrs<'input> for NodeContext<'input> {} +impl<'input> NodeContextAttrs<'input> for NodeContext<'input>{} -impl<'input, I, H> YarnSpinnerParser<'input, I, H> +impl<'input, I> YarnSpinnerParser<'input, I> where - I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>, - H: ErrorStrategy<'input, BaseParserType<'input, I>>, + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, { - pub fn node(&mut self) -> Result>, ANTLRError> { - let mut recog = self; - let _parentctx = recog.ctx.take(); - let mut _localctx = NodeContextExt::new(_parentctx.clone(), recog.base.get_state()); + pub fn node(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = NodeContextExt::new(_parentctx.clone(), recog.base.get_state()); recog.base.enter_rule(_localctx.clone(), 4, RULE_node); let mut _localctx: Rc = _localctx; - let mut _la: isize = -1; - let result: Result<(), ANTLRError> = (|| { - //recog.base.enter_outer_alt(_localctx.clone(), 1); - recog.base.enter_outer_alt(None, 1); - { - recog.base.set_state(67); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - loop { - { - { - /*InvokeRule header*/ - recog.base.set_state(66); - recog.header()?; - } - } - recog.base.set_state(69); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - if !(_la == ID) { - break; - } - } - recog.base.set_state(71); - recog.base.match_token(BODY_START, &mut recog.err_handler)?; - - /*InvokeRule body*/ - recog.base.set_state(72); - recog.body()?; - - recog.base.set_state(73); - recog.base.match_token(BODY_END, &mut recog.err_handler)?; - } - Ok(()) - })(); - match result { - Ok(_) => {} - Err(e @ ANTLRError::FallThrough(_)) => return Err(e), - Err(ref re) => { - //_localctx.exception = re; - recog.err_handler.report_error(&mut recog.base, re); - recog.err_handler.recover(&mut recog.base, re)?; - } - } - recog.base.exit_rule(); - - Ok(_localctx) - } + let mut _la: i32 = -1; + let result: Result<(), ANTLRError> = (|| { + + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(67); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + loop { + { + { + /*InvokeRule header*/ + recog.base.set_state(66); + recog.header()?; + + } + } + recog.base.set_state(69); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + if !(_la==YarnSpinnerParser_ID) {break} + } + recog.base.set_state(71); + recog.base.match_token(YarnSpinnerParser_BODY_START,&mut recog.err_handler)?; + + /*InvokeRule body*/ + recog.base.set_state(72); + recog.body()?; + + recog.base.set_state(73); + recog.base.match_token(YarnSpinnerParser_BODY_END,&mut recog.err_handler)?; + + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) + } } //------------------- header ---------------- pub type HeaderContextAll<'input> = HeaderContext<'input>; -pub type HeaderContext<'input> = BaseParserRuleContext<'input, HeaderContextExt<'input>>; + +pub type HeaderContext<'input> = BaseParserRuleContext<'input,HeaderContextExt<'input>>; #[derive(Clone)] -pub struct HeaderContextExt<'input> { - pub header_key: Option>, - pub header_value: Option>, - ph: PhantomData<&'input str>, +pub struct HeaderContextExt<'input>{ + pub header_key: Option>, + pub header_value: Option>, +ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for HeaderContext<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for HeaderContext<'input>{} -impl<'input, 'a> Listenable + 'a> for HeaderContext<'input> { - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_header(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_header(self); - listener.exit_every_rule(self); - } +impl<'input,'a> Listenable + 'a> for HeaderContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_header(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_header(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input, 'a> Visitable + 'a> for HeaderContext<'input> { - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_header(self); - } +impl<'input,'a> Visitable + 'a> for HeaderContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_header(self); + } } -impl<'input> CustomRuleContext<'input> for HeaderContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_header - } - //fn type_rule_index() -> usize where Self: Sized { RULE_header } -} -antlr_rust::tid! {HeaderContextExt<'a>} - -impl<'input> HeaderContextExt<'input> { - fn new( - parent: Option + 'input>>, - invoking_state: isize, - ) -> Rc> { - Rc::new(BaseParserRuleContext::new_parser_ctx( - parent, - invoking_state, - HeaderContextExt { - header_key: None, - header_value: None, - ph: PhantomData, - }, - )) - } +impl<'input> CustomRuleContext<'input> for HeaderContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_header } + //fn type_rule_index() -> usize where Self: Sized { RULE_header } +} +antlr4rust::tid!{HeaderContextExt<'a>} + +impl<'input> HeaderContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,HeaderContextExt{ + header_key: None, header_value: None, + + ph:PhantomData + }), + ) + } +} + +pub trait HeaderContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ + +/// Retrieves first TerminalNode corresponding to token HEADER_DELIMITER +/// Returns `None` if there is no child corresponding to token HEADER_DELIMITER +fn HEADER_DELIMITER(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_HEADER_DELIMITER, 0) +} +/// Retrieves first TerminalNode corresponding to token ID +/// Returns `None` if there is no child corresponding to token ID +fn ID(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_ID, 0) +} +/// Retrieves first TerminalNode corresponding to token REST_OF_LINE +/// Returns `None` if there is no child corresponding to token REST_OF_LINE +fn REST_OF_LINE(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_REST_OF_LINE, 0) } -pub trait HeaderContextAttrs<'input>: - YarnSpinnerParserContext<'input> + BorrowMut> -{ - /// Retrieves first TerminalNode corresponding to token HEADER_DELIMITER - /// Returns `None` if there is no child corresponding to token HEADER_DELIMITER - fn HEADER_DELIMITER(&self) -> Option>> - where - Self: Sized, - { - self.get_token(HEADER_DELIMITER, 0) - } - /// Retrieves first TerminalNode corresponding to token ID - /// Returns `None` if there is no child corresponding to token ID - fn ID(&self) -> Option>> - where - Self: Sized, - { - self.get_token(ID, 0) - } - /// Retrieves first TerminalNode corresponding to token REST_OF_LINE - /// Returns `None` if there is no child corresponding to token REST_OF_LINE - fn REST_OF_LINE(&self) -> Option>> - where - Self: Sized, - { - self.get_token(REST_OF_LINE, 0) - } } -impl<'input> HeaderContextAttrs<'input> for HeaderContext<'input> {} +impl<'input> HeaderContextAttrs<'input> for HeaderContext<'input>{} -impl<'input, I, H> YarnSpinnerParser<'input, I, H> +impl<'input, I> YarnSpinnerParser<'input, I> where - I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>, - H: ErrorStrategy<'input, BaseParserType<'input, I>>, + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, { - pub fn header(&mut self) -> Result>, ANTLRError> { - let mut recog = self; - let _parentctx = recog.ctx.take(); - let mut _localctx = HeaderContextExt::new(_parentctx.clone(), recog.base.get_state()); + pub fn header(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = HeaderContextExt::new(_parentctx.clone(), recog.base.get_state()); recog.base.enter_rule(_localctx.clone(), 6, RULE_header); let mut _localctx: Rc = _localctx; - let mut _la: isize = -1; - let result: Result<(), ANTLRError> = (|| { - //recog.base.enter_outer_alt(_localctx.clone(), 1); - recog.base.enter_outer_alt(None, 1); - { - recog.base.set_state(75); - let tmp = recog.base.match_token(ID, &mut recog.err_handler)?; - cast_mut::<_, HeaderContext>(&mut _localctx).header_key = Some(tmp.clone()); - - recog.base.set_state(76); - recog - .base - .match_token(HEADER_DELIMITER, &mut recog.err_handler)?; - - recog.base.set_state(78); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - if _la == REST_OF_LINE { - { - recog.base.set_state(77); - let tmp = recog - .base - .match_token(REST_OF_LINE, &mut recog.err_handler)?; - cast_mut::<_, HeaderContext>(&mut _localctx).header_value = - Some(tmp.clone()); - } - } - } - Ok(()) - })(); - match result { - Ok(_) => {} - Err(e @ ANTLRError::FallThrough(_)) => return Err(e), - Err(ref re) => { - //_localctx.exception = re; - recog.err_handler.report_error(&mut recog.base, re); - recog.err_handler.recover(&mut recog.base, re)?; - } - } - recog.base.exit_rule(); - - Ok(_localctx) - } + let mut _la: i32 = -1; + let result: Result<(), ANTLRError> = (|| { + + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(75); + let tmp = recog.base.match_token(YarnSpinnerParser_ID,&mut recog.err_handler)?; + cast_mut::<_,HeaderContext >(&mut _localctx).header_key = Some(tmp.clone()); + + + recog.base.set_state(76); + recog.base.match_token(YarnSpinnerParser_HEADER_DELIMITER,&mut recog.err_handler)?; + + recog.base.set_state(78); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + if _la==YarnSpinnerParser_REST_OF_LINE { + { + recog.base.set_state(77); + let tmp = recog.base.match_token(YarnSpinnerParser_REST_OF_LINE,&mut recog.err_handler)?; + cast_mut::<_,HeaderContext >(&mut _localctx).header_value = Some(tmp.clone()); + + + } + } + + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) + } } //------------------- body ---------------- pub type BodyContextAll<'input> = BodyContext<'input>; -pub type BodyContext<'input> = BaseParserRuleContext<'input, BodyContextExt<'input>>; + +pub type BodyContext<'input> = BaseParserRuleContext<'input,BodyContextExt<'input>>; #[derive(Clone)] -pub struct BodyContextExt<'input> { - ph: PhantomData<&'input str>, +pub struct BodyContextExt<'input>{ +ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for BodyContext<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for BodyContext<'input>{} -impl<'input, 'a> Listenable + 'a> for BodyContext<'input> { - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_body(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_body(self); - listener.exit_every_rule(self); - } +impl<'input,'a> Listenable + 'a> for BodyContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_body(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_body(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input, 'a> Visitable + 'a> for BodyContext<'input> { - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_body(self); - } +impl<'input,'a> Visitable + 'a> for BodyContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_body(self); + } } -impl<'input> CustomRuleContext<'input> for BodyContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_body - } - //fn type_rule_index() -> usize where Self: Sized { RULE_body } -} -antlr_rust::tid! {BodyContextExt<'a>} - -impl<'input> BodyContextExt<'input> { - fn new( - parent: Option + 'input>>, - invoking_state: isize, - ) -> Rc> { - Rc::new(BaseParserRuleContext::new_parser_ctx( - parent, - invoking_state, - BodyContextExt { ph: PhantomData }, - )) - } +impl<'input> CustomRuleContext<'input> for BodyContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_body } + //fn type_rule_index() -> usize where Self: Sized { RULE_body } +} +antlr4rust::tid!{BodyContextExt<'a>} + +impl<'input> BodyContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,BodyContextExt{ + + ph:PhantomData + }), + ) + } +} + +pub trait BodyContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ + +fn statement_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +fn statement(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) } -pub trait BodyContextAttrs<'input>: - YarnSpinnerParserContext<'input> + BorrowMut> -{ - fn statement_all(&self) -> Vec>> - where - Self: Sized, - { - self.children_of_type() - } - fn statement(&self, i: usize) -> Option>> - where - Self: Sized, - { - self.child_of_type(i) - } } -impl<'input> BodyContextAttrs<'input> for BodyContext<'input> {} +impl<'input> BodyContextAttrs<'input> for BodyContext<'input>{} -impl<'input, I, H> YarnSpinnerParser<'input, I, H> +impl<'input, I> YarnSpinnerParser<'input, I> where - I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>, - H: ErrorStrategy<'input, BaseParserType<'input, I>>, + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, { - pub fn body(&mut self) -> Result>, ANTLRError> { - let mut recog = self; - let _parentctx = recog.ctx.take(); - let mut _localctx = BodyContextExt::new(_parentctx.clone(), recog.base.get_state()); + pub fn body(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = BodyContextExt::new(_parentctx.clone(), recog.base.get_state()); recog.base.enter_rule(_localctx.clone(), 8, RULE_body); let mut _localctx: Rc = _localctx; - let mut _la: isize = -1; - let result: Result<(), ANTLRError> = (|| { - //recog.base.enter_outer_alt(_localctx.clone(), 1); - recog.base.enter_outer_alt(None, 1); - { - recog.base.set_state(83); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - while (((_la) & !0x3f) == 0 - && ((1usize << _la) - & ((1usize << INDENT) - | (1usize << SHORTCUT_ARROW) - | (1usize << COMMAND_START) - | (1usize << EXPRESSION_START) - | (1usize << TEXT))) - != 0) - { - { - { - /*InvokeRule statement*/ - recog.base.set_state(80); - recog.statement()?; - } - } - recog.base.set_state(85); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - } - } - Ok(()) - })(); - match result { - Ok(_) => {} - Err(e @ ANTLRError::FallThrough(_)) => return Err(e), - Err(ref re) => { - //_localctx.exception = re; - recog.err_handler.report_error(&mut recog.base, re); - recog.err_handler.recover(&mut recog.base, re)?; - } - } - recog.base.exit_rule(); - - Ok(_localctx) - } + let mut _la: i32 = -1; + let result: Result<(), ANTLRError> = (|| { + + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(83); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + while (((_la) & !0x3f) == 0 && ((1usize << _la) & 1163266) != 0) { + { + { + /*InvokeRule statement*/ + recog.base.set_state(80); + recog.statement()?; + + } + } + recog.base.set_state(85); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + } + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) + } } //------------------- statement ---------------- pub type StatementContextAll<'input> = StatementContext<'input>; -pub type StatementContext<'input> = BaseParserRuleContext<'input, StatementContextExt<'input>>; + +pub type StatementContext<'input> = BaseParserRuleContext<'input,StatementContextExt<'input>>; #[derive(Clone)] -pub struct StatementContextExt<'input> { - ph: PhantomData<&'input str>, +pub struct StatementContextExt<'input>{ +ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for StatementContext<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for StatementContext<'input>{} -impl<'input, 'a> Listenable + 'a> - for StatementContext<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_statement(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_statement(self); - listener.exit_every_rule(self); - } +impl<'input,'a> Listenable + 'a> for StatementContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_statement(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_statement(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input, 'a> Visitable + 'a> for StatementContext<'input> { - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_statement(self); - } +impl<'input,'a> Visitable + 'a> for StatementContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_statement(self); + } } -impl<'input> CustomRuleContext<'input> for StatementContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_statement - } - //fn type_rule_index() -> usize where Self: Sized { RULE_statement } -} -antlr_rust::tid! {StatementContextExt<'a>} - -impl<'input> StatementContextExt<'input> { - fn new( - parent: Option + 'input>>, - invoking_state: isize, - ) -> Rc> { - Rc::new(BaseParserRuleContext::new_parser_ctx( - parent, - invoking_state, - StatementContextExt { ph: PhantomData }, - )) - } +impl<'input> CustomRuleContext<'input> for StatementContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_statement } + //fn type_rule_index() -> usize where Self: Sized { RULE_statement } } +antlr4rust::tid!{StatementContextExt<'a>} -pub trait StatementContextAttrs<'input>: - YarnSpinnerParserContext<'input> + BorrowMut> -{ - fn line_statement(&self) -> Option>> - where - Self: Sized, - { - self.child_of_type(0) - } - fn if_statement(&self) -> Option>> - where - Self: Sized, - { - self.child_of_type(0) - } - fn set_statement(&self) -> Option>> - where - Self: Sized, - { - self.child_of_type(0) - } - fn shortcut_option_statement(&self) -> Option>> - where - Self: Sized, - { - self.child_of_type(0) - } - fn call_statement(&self) -> Option>> - where - Self: Sized, - { - self.child_of_type(0) - } - fn command_statement(&self) -> Option>> - where - Self: Sized, - { - self.child_of_type(0) - } - fn declare_statement(&self) -> Option>> - where - Self: Sized, - { - self.child_of_type(0) - } - fn jump_statement(&self) -> Option>> - where - Self: Sized, - { - self.child_of_type(0) - } - /// Retrieves first TerminalNode corresponding to token INDENT - /// Returns `None` if there is no child corresponding to token INDENT - fn INDENT(&self) -> Option>> - where - Self: Sized, - { - self.get_token(INDENT, 0) - } - /// Retrieves first TerminalNode corresponding to token DEDENT - /// Returns `None` if there is no child corresponding to token DEDENT - fn DEDENT(&self) -> Option>> - where - Self: Sized, - { - self.get_token(DEDENT, 0) - } - fn statement_all(&self) -> Vec>> - where - Self: Sized, - { - self.children_of_type() - } - fn statement(&self, i: usize) -> Option>> - where - Self: Sized, - { - self.child_of_type(i) - } +impl<'input> StatementContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,StatementContextExt{ + + ph:PhantomData + }), + ) + } } -impl<'input> StatementContextAttrs<'input> for StatementContext<'input> {} +pub trait StatementContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ -impl<'input, I, H> YarnSpinnerParser<'input, I, H> +fn line_statement(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +fn if_statement(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +fn set_statement(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +fn shortcut_option_statement(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +fn call_statement(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +fn command_statement(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +fn declare_statement(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +fn jump_statement(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +/// Retrieves first TerminalNode corresponding to token INDENT +/// Returns `None` if there is no child corresponding to token INDENT +fn INDENT(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_INDENT, 0) +} +/// Retrieves first TerminalNode corresponding to token DEDENT +/// Returns `None` if there is no child corresponding to token DEDENT +fn DEDENT(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_DEDENT, 0) +} +fn statement_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +fn statement(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) +} + +} + +impl<'input> StatementContextAttrs<'input> for StatementContext<'input>{} + +impl<'input, I> YarnSpinnerParser<'input, I> where - I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>, - H: ErrorStrategy<'input, BaseParserType<'input, I>>, + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, { - pub fn statement(&mut self) -> Result>, ANTLRError> { - let mut recog = self; - let _parentctx = recog.ctx.take(); - let mut _localctx = StatementContextExt::new(_parentctx.clone(), recog.base.get_state()); + pub fn statement(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = StatementContextExt::new(_parentctx.clone(), recog.base.get_state()); recog.base.enter_rule(_localctx.clone(), 10, RULE_statement); let mut _localctx: Rc = _localctx; - let mut _la: isize = -1; - let result: Result<(), ANTLRError> = (|| { - recog.base.set_state(102); - recog.err_handler.sync(&mut recog.base)?; - match recog.interpreter.adaptive_predict(6, &mut recog.base)? { - 1 => { - //recog.base.enter_outer_alt(_localctx.clone(), 1); - recog.base.enter_outer_alt(None, 1); - { - /*InvokeRule line_statement*/ - recog.base.set_state(86); - recog.line_statement()?; - } - } - 2 => { - //recog.base.enter_outer_alt(_localctx.clone(), 2); - recog.base.enter_outer_alt(None, 2); - { - /*InvokeRule if_statement*/ - recog.base.set_state(87); - recog.if_statement()?; - } - } - 3 => { - //recog.base.enter_outer_alt(_localctx.clone(), 3); - recog.base.enter_outer_alt(None, 3); - { - /*InvokeRule set_statement*/ - recog.base.set_state(88); - recog.set_statement()?; - } - } - 4 => { - //recog.base.enter_outer_alt(_localctx.clone(), 4); - recog.base.enter_outer_alt(None, 4); - { - /*InvokeRule shortcut_option_statement*/ - recog.base.set_state(89); - recog.shortcut_option_statement()?; - } - } - 5 => { - //recog.base.enter_outer_alt(_localctx.clone(), 5); - recog.base.enter_outer_alt(None, 5); - { - /*InvokeRule call_statement*/ - recog.base.set_state(90); - recog.call_statement()?; - } - } - 6 => { - //recog.base.enter_outer_alt(_localctx.clone(), 6); - recog.base.enter_outer_alt(None, 6); - { - /*InvokeRule command_statement*/ - recog.base.set_state(91); - recog.command_statement()?; - } - } - 7 => { - //recog.base.enter_outer_alt(_localctx.clone(), 7); - recog.base.enter_outer_alt(None, 7); - { - /*InvokeRule declare_statement*/ - recog.base.set_state(92); - recog.declare_statement()?; - } - } - 8 => { - //recog.base.enter_outer_alt(_localctx.clone(), 8); - recog.base.enter_outer_alt(None, 8); - { - /*InvokeRule jump_statement*/ - recog.base.set_state(93); - recog.jump_statement()?; - } - } - 9 => { - //recog.base.enter_outer_alt(_localctx.clone(), 9); - recog.base.enter_outer_alt(None, 9); - { - recog.base.set_state(94); - recog.base.match_token(INDENT, &mut recog.err_handler)?; - - recog.base.set_state(98); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - while (((_la) & !0x3f) == 0 - && ((1usize << _la) - & ((1usize << INDENT) - | (1usize << SHORTCUT_ARROW) - | (1usize << COMMAND_START) - | (1usize << EXPRESSION_START) - | (1usize << TEXT))) - != 0) - { - { - { - /*InvokeRule statement*/ - recog.base.set_state(95); - recog.statement()?; - } - } - recog.base.set_state(100); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - } - recog.base.set_state(101); - recog.base.match_token(DEDENT, &mut recog.err_handler)?; - } - } - - _ => {} - } - Ok(()) - })(); - match result { - Ok(_) => {} - Err(e @ ANTLRError::FallThrough(_)) => return Err(e), - Err(ref re) => { - //_localctx.exception = re; - recog.err_handler.report_error(&mut recog.base, re); - recog.err_handler.recover(&mut recog.base, re)?; - } - } - recog.base.exit_rule(); - - Ok(_localctx) - } + let mut _la: i32 = -1; + let result: Result<(), ANTLRError> = (|| { + + recog.base.set_state(102); + recog.err_handler.sync(&mut recog.base)?; + match recog.interpreter.adaptive_predict(6,&mut recog.base)? { + 1 =>{ + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + /*InvokeRule line_statement*/ + recog.base.set_state(86); + recog.line_statement()?; + + } + } + , + 2 =>{ + //recog.base.enter_outer_alt(_localctx.clone(), 2)?; + recog.base.enter_outer_alt(None, 2)?; + { + /*InvokeRule if_statement*/ + recog.base.set_state(87); + recog.if_statement()?; + + } + } + , + 3 =>{ + //recog.base.enter_outer_alt(_localctx.clone(), 3)?; + recog.base.enter_outer_alt(None, 3)?; + { + /*InvokeRule set_statement*/ + recog.base.set_state(88); + recog.set_statement()?; + + } + } + , + 4 =>{ + //recog.base.enter_outer_alt(_localctx.clone(), 4)?; + recog.base.enter_outer_alt(None, 4)?; + { + /*InvokeRule shortcut_option_statement*/ + recog.base.set_state(89); + recog.shortcut_option_statement()?; + + } + } + , + 5 =>{ + //recog.base.enter_outer_alt(_localctx.clone(), 5)?; + recog.base.enter_outer_alt(None, 5)?; + { + /*InvokeRule call_statement*/ + recog.base.set_state(90); + recog.call_statement()?; + + } + } + , + 6 =>{ + //recog.base.enter_outer_alt(_localctx.clone(), 6)?; + recog.base.enter_outer_alt(None, 6)?; + { + /*InvokeRule command_statement*/ + recog.base.set_state(91); + recog.command_statement()?; + + } + } + , + 7 =>{ + //recog.base.enter_outer_alt(_localctx.clone(), 7)?; + recog.base.enter_outer_alt(None, 7)?; + { + /*InvokeRule declare_statement*/ + recog.base.set_state(92); + recog.declare_statement()?; + + } + } + , + 8 =>{ + //recog.base.enter_outer_alt(_localctx.clone(), 8)?; + recog.base.enter_outer_alt(None, 8)?; + { + /*InvokeRule jump_statement*/ + recog.base.set_state(93); + recog.jump_statement()?; + + } + } + , + 9 =>{ + //recog.base.enter_outer_alt(_localctx.clone(), 9)?; + recog.base.enter_outer_alt(None, 9)?; + { + recog.base.set_state(94); + recog.base.match_token(YarnSpinnerParser_INDENT,&mut recog.err_handler)?; + + recog.base.set_state(98); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + while (((_la) & !0x3f) == 0 && ((1usize << _la) & 1163266) != 0) { + { + { + /*InvokeRule statement*/ + recog.base.set_state(95); + recog.statement()?; + + } + } + recog.base.set_state(100); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + } + recog.base.set_state(101); + recog.base.match_token(YarnSpinnerParser_DEDENT,&mut recog.err_handler)?; + + } + } + + _ => {} + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) + } } //------------------- line_statement ---------------- pub type Line_statementContextAll<'input> = Line_statementContext<'input>; -pub type Line_statementContext<'input> = - BaseParserRuleContext<'input, Line_statementContextExt<'input>>; + +pub type Line_statementContext<'input> = BaseParserRuleContext<'input,Line_statementContextExt<'input>>; #[derive(Clone)] -pub struct Line_statementContextExt<'input> { - ph: PhantomData<&'input str>, +pub struct Line_statementContextExt<'input>{ +ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for Line_statementContext<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for Line_statementContext<'input>{} -impl<'input, 'a> Listenable + 'a> - for Line_statementContext<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_line_statement(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_line_statement(self); - listener.exit_every_rule(self); - } +impl<'input,'a> Listenable + 'a> for Line_statementContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_line_statement(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_line_statement(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input, 'a> Visitable + 'a> - for Line_statementContext<'input> -{ - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_line_statement(self); - } +impl<'input,'a> Visitable + 'a> for Line_statementContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_line_statement(self); + } } -impl<'input> CustomRuleContext<'input> for Line_statementContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_line_statement - } - //fn type_rule_index() -> usize where Self: Sized { RULE_line_statement } -} -antlr_rust::tid! {Line_statementContextExt<'a>} - -impl<'input> Line_statementContextExt<'input> { - fn new( - parent: Option + 'input>>, - invoking_state: isize, - ) -> Rc> { - Rc::new(BaseParserRuleContext::new_parser_ctx( - parent, - invoking_state, - Line_statementContextExt { ph: PhantomData }, - )) - } +impl<'input> CustomRuleContext<'input> for Line_statementContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_line_statement } + //fn type_rule_index() -> usize where Self: Sized { RULE_line_statement } +} +antlr4rust::tid!{Line_statementContextExt<'a>} + +impl<'input> Line_statementContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Line_statementContextExt{ + + ph:PhantomData + }), + ) + } +} + +pub trait Line_statementContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ + +fn line_formatted_text(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +/// Retrieves first TerminalNode corresponding to token NEWLINE +/// Returns `None` if there is no child corresponding to token NEWLINE +fn NEWLINE(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_NEWLINE, 0) +} +fn line_condition(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +fn hashtag_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +fn hashtag(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) } -pub trait Line_statementContextAttrs<'input>: - YarnSpinnerParserContext<'input> + BorrowMut> -{ - fn line_formatted_text(&self) -> Option>> - where - Self: Sized, - { - self.child_of_type(0) - } - /// Retrieves first TerminalNode corresponding to token NEWLINE - /// Returns `None` if there is no child corresponding to token NEWLINE - fn NEWLINE(&self) -> Option>> - where - Self: Sized, - { - self.get_token(NEWLINE, 0) - } - fn line_condition(&self) -> Option>> - where - Self: Sized, - { - self.child_of_type(0) - } - fn hashtag_all(&self) -> Vec>> - where - Self: Sized, - { - self.children_of_type() - } - fn hashtag(&self, i: usize) -> Option>> - where - Self: Sized, - { - self.child_of_type(i) - } } -impl<'input> Line_statementContextAttrs<'input> for Line_statementContext<'input> {} +impl<'input> Line_statementContextAttrs<'input> for Line_statementContext<'input>{} -impl<'input, I, H> YarnSpinnerParser<'input, I, H> +impl<'input, I> YarnSpinnerParser<'input, I> where - I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>, - H: ErrorStrategy<'input, BaseParserType<'input, I>>, -{ - pub fn line_statement(&mut self) -> Result>, ANTLRError> { - let mut recog = self; - let _parentctx = recog.ctx.take(); - let mut _localctx = - Line_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog - .base - .enter_rule(_localctx.clone(), 12, RULE_line_statement); + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + pub fn line_statement(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = Line_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 12, RULE_line_statement); let mut _localctx: Rc = _localctx; - let mut _la: isize = -1; - let result: Result<(), ANTLRError> = (|| { - //recog.base.enter_outer_alt(_localctx.clone(), 1); - recog.base.enter_outer_alt(None, 1); - { - /*InvokeRule line_formatted_text*/ - recog.base.set_state(104); - recog.line_formatted_text()?; - - recog.base.set_state(106); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - if _la == COMMAND_START { - { - /*InvokeRule line_condition*/ - recog.base.set_state(105); - recog.line_condition()?; - } - } - - recog.base.set_state(111); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - while _la == HASHTAG { - { - { - /*InvokeRule hashtag*/ - recog.base.set_state(108); - recog.hashtag()?; - } - } - recog.base.set_state(113); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - } - recog.base.set_state(114); - recog.base.match_token(NEWLINE, &mut recog.err_handler)?; - } - Ok(()) - })(); - match result { - Ok(_) => {} - Err(e @ ANTLRError::FallThrough(_)) => return Err(e), - Err(ref re) => { - //_localctx.exception = re; - recog.err_handler.report_error(&mut recog.base, re); - recog.err_handler.recover(&mut recog.base, re)?; - } - } - recog.base.exit_rule(); - - Ok(_localctx) - } + let mut _la: i32 = -1; + let result: Result<(), ANTLRError> = (|| { + + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + /*InvokeRule line_formatted_text*/ + recog.base.set_state(104); + recog.line_formatted_text()?; + + recog.base.set_state(106); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + if _la==YarnSpinnerParser_COMMAND_START { + { + /*InvokeRule line_condition*/ + recog.base.set_state(105); + recog.line_condition()?; + + } + } + + recog.base.set_state(111); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + while _la==YarnSpinnerParser_HASHTAG { + { + { + /*InvokeRule hashtag*/ + recog.base.set_state(108); + recog.hashtag()?; + + } + } + recog.base.set_state(113); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + } + recog.base.set_state(114); + recog.base.match_token(YarnSpinnerParser_NEWLINE,&mut recog.err_handler)?; + + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) + } } //------------------- line_formatted_text ---------------- pub type Line_formatted_textContextAll<'input> = Line_formatted_textContext<'input>; -pub type Line_formatted_textContext<'input> = - BaseParserRuleContext<'input, Line_formatted_textContextExt<'input>>; + +pub type Line_formatted_textContext<'input> = BaseParserRuleContext<'input,Line_formatted_textContextExt<'input>>; #[derive(Clone)] -pub struct Line_formatted_textContextExt<'input> { - ph: PhantomData<&'input str>, +pub struct Line_formatted_textContextExt<'input>{ +ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for Line_formatted_textContext<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for Line_formatted_textContext<'input>{} -impl<'input, 'a> Listenable + 'a> - for Line_formatted_textContext<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_line_formatted_text(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_line_formatted_text(self); - listener.exit_every_rule(self); - } +impl<'input,'a> Listenable + 'a> for Line_formatted_textContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_line_formatted_text(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_line_formatted_text(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input, 'a> Visitable + 'a> - for Line_formatted_textContext<'input> -{ - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_line_formatted_text(self); - } +impl<'input,'a> Visitable + 'a> for Line_formatted_textContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_line_formatted_text(self); + } } -impl<'input> CustomRuleContext<'input> for Line_formatted_textContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_line_formatted_text - } - //fn type_rule_index() -> usize where Self: Sized { RULE_line_formatted_text } -} -antlr_rust::tid! {Line_formatted_textContextExt<'a>} - -impl<'input> Line_formatted_textContextExt<'input> { - fn new( - parent: Option + 'input>>, - invoking_state: isize, - ) -> Rc> { - Rc::new(BaseParserRuleContext::new_parser_ctx( - parent, - invoking_state, - Line_formatted_textContextExt { ph: PhantomData }, - )) - } +impl<'input> CustomRuleContext<'input> for Line_formatted_textContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_line_formatted_text } + //fn type_rule_index() -> usize where Self: Sized { RULE_line_formatted_text } +} +antlr4rust::tid!{Line_formatted_textContextExt<'a>} + +impl<'input> Line_formatted_textContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Line_formatted_textContextExt{ + + ph:PhantomData + }), + ) + } +} + +pub trait Line_formatted_textContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ + +/// Retrieves all `TerminalNode`s corresponding to token EXPRESSION_START in current rule +fn EXPRESSION_START_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +/// Retrieves 'i's TerminalNode corresponding to token EXPRESSION_START, starting from 0. +/// Returns `None` if number of children corresponding to token EXPRESSION_START is less or equal than `i`. +fn EXPRESSION_START(&self, i: usize) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_EXPRESSION_START, i) +} +fn expression_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +fn expression(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) +} +/// Retrieves all `TerminalNode`s corresponding to token EXPRESSION_END in current rule +fn EXPRESSION_END_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +/// Retrieves 'i's TerminalNode corresponding to token EXPRESSION_END, starting from 0. +/// Returns `None` if number of children corresponding to token EXPRESSION_END is less or equal than `i`. +fn EXPRESSION_END(&self, i: usize) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_EXPRESSION_END, i) +} +/// Retrieves all `TerminalNode`s corresponding to token TEXT in current rule +fn TEXT_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +/// Retrieves 'i's TerminalNode corresponding to token TEXT, starting from 0. +/// Returns `None` if number of children corresponding to token TEXT is less or equal than `i`. +fn TEXT(&self, i: usize) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_TEXT, i) } -pub trait Line_formatted_textContextAttrs<'input>: - YarnSpinnerParserContext<'input> + BorrowMut> -{ - /// Retrieves all `TerminalNode`s corresponding to token EXPRESSION_START in current rule - fn EXPRESSION_START_all(&self) -> Vec>> - where - Self: Sized, - { - self.children_of_type() - } - /// Retrieves 'i's TerminalNode corresponding to token EXPRESSION_START, starting from 0. - /// Returns `None` if number of children corresponding to token EXPRESSION_START is less or equal than `i`. - fn EXPRESSION_START( - &self, - i: usize, - ) -> Option>> - where - Self: Sized, - { - self.get_token(EXPRESSION_START, i) - } - fn expression_all(&self) -> Vec>> - where - Self: Sized, - { - self.children_of_type() - } - fn expression(&self, i: usize) -> Option>> - where - Self: Sized, - { - self.child_of_type(i) - } - /// Retrieves all `TerminalNode`s corresponding to token EXPRESSION_END in current rule - fn EXPRESSION_END_all(&self) -> Vec>> - where - Self: Sized, - { - self.children_of_type() - } - /// Retrieves 'i's TerminalNode corresponding to token EXPRESSION_END, starting from 0. - /// Returns `None` if number of children corresponding to token EXPRESSION_END is less or equal than `i`. - fn EXPRESSION_END( - &self, - i: usize, - ) -> Option>> - where - Self: Sized, - { - self.get_token(EXPRESSION_END, i) - } - /// Retrieves all `TerminalNode`s corresponding to token TEXT in current rule - fn TEXT_all(&self) -> Vec>> - where - Self: Sized, - { - self.children_of_type() - } - /// Retrieves 'i's TerminalNode corresponding to token TEXT, starting from 0. - /// Returns `None` if number of children corresponding to token TEXT is less or equal than `i`. - fn TEXT(&self, i: usize) -> Option>> - where - Self: Sized, - { - self.get_token(TEXT, i) - } } -impl<'input> Line_formatted_textContextAttrs<'input> for Line_formatted_textContext<'input> {} +impl<'input> Line_formatted_textContextAttrs<'input> for Line_formatted_textContext<'input>{} -impl<'input, I, H> YarnSpinnerParser<'input, I, H> +impl<'input, I> YarnSpinnerParser<'input, I> where - I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>, - H: ErrorStrategy<'input, BaseParserType<'input, I>>, -{ - pub fn line_formatted_text( - &mut self, - ) -> Result>, ANTLRError> { - let mut recog = self; - let _parentctx = recog.ctx.take(); - let mut _localctx = - Line_formatted_textContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog - .base - .enter_rule(_localctx.clone(), 14, RULE_line_formatted_text); + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + pub fn line_formatted_text(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = Line_formatted_textContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 14, RULE_line_formatted_text); let mut _localctx: Rc = _localctx; - let mut _la: isize = -1; - let result: Result<(), ANTLRError> = (|| { - let mut _alt: isize; - //recog.base.enter_outer_alt(_localctx.clone(), 1); - recog.base.enter_outer_alt(None, 1); - { - recog.base.set_state(125); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - loop { - { - recog.base.set_state(125); - recog.err_handler.sync(&mut recog.base)?; - match recog.base.input.la(1) { - TEXT => { - recog.base.set_state(117); - recog.err_handler.sync(&mut recog.base)?; - _alt = 1; - loop { - match _alt { - x if x == 1 => { - recog.base.set_state(116); - recog.base.match_token(TEXT, &mut recog.err_handler)?; - } - - _ => Err(ANTLRError::NoAltError(NoViableAltError::new( - &mut recog.base, - )))?, - } - recog.base.set_state(119); - recog.err_handler.sync(&mut recog.base)?; - _alt = - recog.interpreter.adaptive_predict(9, &mut recog.base)?; - if _alt == 2 || _alt == INVALID_ALT { - break; - } - } - } - - EXPRESSION_START => { - { - recog.base.set_state(121); - recog - .base - .match_token(EXPRESSION_START, &mut recog.err_handler)?; - - /*InvokeRule expression*/ - recog.base.set_state(122); - recog.expression_rec(0)?; - - recog.base.set_state(123); - recog - .base - .match_token(EXPRESSION_END, &mut recog.err_handler)?; - } - } - - _ => Err(ANTLRError::NoAltError(NoViableAltError::new( - &mut recog.base, - )))?, - } - } - recog.base.set_state(127); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - if !(_la == EXPRESSION_START || _la == TEXT) { - break; - } - } - } - Ok(()) - })(); - match result { - Ok(_) => {} - Err(e @ ANTLRError::FallThrough(_)) => return Err(e), - Err(ref re) => { - //_localctx.exception = re; - recog.err_handler.report_error(&mut recog.base, re); - recog.err_handler.recover(&mut recog.base, re)?; - } - } - recog.base.exit_rule(); - - Ok(_localctx) - } + let mut _la: i32 = -1; + let result: Result<(), ANTLRError> = (|| { + + let mut _alt: i32; + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(125); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + loop { + { + recog.base.set_state(125); + recog.err_handler.sync(&mut recog.base)?; + match recog.base.input.la(1) { + YarnSpinnerParser_TEXT + => { + { + recog.base.set_state(117); + recog.err_handler.sync(&mut recog.base)?; + _alt = 1; + loop { + match _alt { + x if x == 1=> + { + { + recog.base.set_state(116); + recog.base.match_token(YarnSpinnerParser_TEXT,&mut recog.err_handler)?; + + } + } + + _ => Err(ANTLRError::NoAltError(NoViableAltError::new(&mut recog.base)))? + } + recog.base.set_state(119); + recog.err_handler.sync(&mut recog.base)?; + _alt = recog.interpreter.adaptive_predict(9,&mut recog.base)?; + if _alt==2 || _alt==INVALID_ALT { break } + } + } + } + + YarnSpinnerParser_EXPRESSION_START + => { + { + recog.base.set_state(121); + recog.base.match_token(YarnSpinnerParser_EXPRESSION_START,&mut recog.err_handler)?; + + /*InvokeRule expression*/ + recog.base.set_state(122); + recog.expression_rec(0)?; + + recog.base.set_state(123); + recog.base.match_token(YarnSpinnerParser_EXPRESSION_END,&mut recog.err_handler)?; + + } + } + + _ => Err(ANTLRError::NoAltError(NoViableAltError::new(&mut recog.base)))? + } + } + recog.base.set_state(127); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + if !(_la==YarnSpinnerParser_EXPRESSION_START || _la==YarnSpinnerParser_TEXT) {break} + } + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) + } } //------------------- hashtag ---------------- pub type HashtagContextAll<'input> = HashtagContext<'input>; -pub type HashtagContext<'input> = BaseParserRuleContext<'input, HashtagContextExt<'input>>; + +pub type HashtagContext<'input> = BaseParserRuleContext<'input,HashtagContextExt<'input>>; #[derive(Clone)] -pub struct HashtagContextExt<'input> { - pub text: Option>, - ph: PhantomData<&'input str>, +pub struct HashtagContextExt<'input>{ + pub text: Option>, +ph:PhantomData<&'input str> +} + +// Manually injected after generation. +impl<'input> HashtagContextExt<'input> { + pub fn new_with_text( + parent: Option + 'input>>, + invoking_state: i32, + text: impl Into>>, + ) -> Rc> { + Rc::new(BaseParserRuleContext::new_parser_ctx( + parent, + invoking_state, + HashtagContextExt { + text: text.into(), + ph: PhantomData, + }, + )) + } } -impl<'input> YarnSpinnerParserContext<'input> for HashtagContext<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for HashtagContext<'input>{} -impl<'input, 'a> Listenable + 'a> for HashtagContext<'input> { - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_hashtag(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_hashtag(self); - listener.exit_every_rule(self); - } +impl<'input,'a> Listenable + 'a> for HashtagContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_hashtag(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_hashtag(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input, 'a> Visitable + 'a> for HashtagContext<'input> { - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_hashtag(self); - } +impl<'input,'a> Visitable + 'a> for HashtagContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_hashtag(self); + } } -impl<'input> CustomRuleContext<'input> for HashtagContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_hashtag - } - //fn type_rule_index() -> usize where Self: Sized { RULE_hashtag } +impl<'input> CustomRuleContext<'input> for HashtagContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_hashtag } + //fn type_rule_index() -> usize where Self: Sized { RULE_hashtag } } -antlr_rust::tid! {HashtagContextExt<'a>} +antlr4rust::tid!{HashtagContextExt<'a>} -impl<'input> HashtagContextExt<'input> { - pub fn new_with_text( - parent: Option + 'input>>, - invoking_state: isize, - text: impl Into>>, - ) -> Rc> { - Rc::new(BaseParserRuleContext::new_parser_ctx( - parent, - invoking_state, - HashtagContextExt { - text: text.into(), - ph: PhantomData, - }, - )) - } +impl<'input> HashtagContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,HashtagContextExt{ + text: None, - fn new( - parent: Option + 'input>>, - invoking_state: isize, - ) -> Rc> { - Rc::new(BaseParserRuleContext::new_parser_ctx( - parent, - invoking_state, - HashtagContextExt { - text: None, - ph: PhantomData, - }, - )) - } + ph:PhantomData + }), + ) + } } -pub trait HashtagContextAttrs<'input>: - YarnSpinnerParserContext<'input> + BorrowMut> -{ - /// Retrieves first TerminalNode corresponding to token HASHTAG - /// Returns `None` if there is no child corresponding to token HASHTAG - fn HASHTAG(&self) -> Option>> - where - Self: Sized, - { - self.get_token(HASHTAG, 0) - } - /// Retrieves first TerminalNode corresponding to token HASHTAG_TEXT - /// Returns `None` if there is no child corresponding to token HASHTAG_TEXT - fn HASHTAG_TEXT(&self) -> Option>> - where - Self: Sized, - { - self.get_token(HASHTAG_TEXT, 0) - } -} +pub trait HashtagContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ -impl<'input> HashtagContextAttrs<'input> for HashtagContext<'input> {} +/// Retrieves first TerminalNode corresponding to token HASHTAG +/// Returns `None` if there is no child corresponding to token HASHTAG +fn HASHTAG(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_HASHTAG, 0) +} +/// Retrieves first TerminalNode corresponding to token HASHTAG_TEXT +/// Returns `None` if there is no child corresponding to token HASHTAG_TEXT +fn HASHTAG_TEXT(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_HASHTAG_TEXT, 0) +} + +} -impl<'input, I, H> YarnSpinnerParser<'input, I, H> +impl<'input> HashtagContextAttrs<'input> for HashtagContext<'input>{} + +impl<'input, I> YarnSpinnerParser<'input, I> where - I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>, - H: ErrorStrategy<'input, BaseParserType<'input, I>>, + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, { - pub fn hashtag(&mut self) -> Result>, ANTLRError> { - let mut recog = self; - let _parentctx = recog.ctx.take(); - let mut _localctx = HashtagContextExt::new(_parentctx.clone(), recog.base.get_state()); + pub fn hashtag(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = HashtagContextExt::new(_parentctx.clone(), recog.base.get_state()); recog.base.enter_rule(_localctx.clone(), 16, RULE_hashtag); let mut _localctx: Rc = _localctx; - let result: Result<(), ANTLRError> = (|| { - //recog.base.enter_outer_alt(_localctx.clone(), 1); - recog.base.enter_outer_alt(None, 1); - { - recog.base.set_state(129); - recog.base.match_token(HASHTAG, &mut recog.err_handler)?; - - recog.base.set_state(130); - let tmp = recog - .base - .match_token(HASHTAG_TEXT, &mut recog.err_handler)?; - cast_mut::<_, HashtagContext>(&mut _localctx).text = Some(tmp.clone()); - } - Ok(()) - })(); - match result { - Ok(_) => {} - Err(e @ ANTLRError::FallThrough(_)) => return Err(e), - Err(ref re) => { - //_localctx.exception = re; - recog.err_handler.report_error(&mut recog.base, re); - recog.err_handler.recover(&mut recog.base, re)?; - } - } - recog.base.exit_rule(); - - Ok(_localctx) - } + let result: Result<(), ANTLRError> = (|| { + + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(129); + recog.base.match_token(YarnSpinnerParser_HASHTAG,&mut recog.err_handler)?; + + recog.base.set_state(130); + let tmp = recog.base.match_token(YarnSpinnerParser_HASHTAG_TEXT,&mut recog.err_handler)?; + cast_mut::<_,HashtagContext >(&mut _localctx).text = Some(tmp.clone()); + + + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) + } } //------------------- line_condition ---------------- pub type Line_conditionContextAll<'input> = Line_conditionContext<'input>; -pub type Line_conditionContext<'input> = - BaseParserRuleContext<'input, Line_conditionContextExt<'input>>; + +pub type Line_conditionContext<'input> = BaseParserRuleContext<'input,Line_conditionContextExt<'input>>; #[derive(Clone)] -pub struct Line_conditionContextExt<'input> { - ph: PhantomData<&'input str>, +pub struct Line_conditionContextExt<'input>{ +ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for Line_conditionContext<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for Line_conditionContext<'input>{} -impl<'input, 'a> Listenable + 'a> - for Line_conditionContext<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_line_condition(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_line_condition(self); - listener.exit_every_rule(self); - } +impl<'input,'a> Listenable + 'a> for Line_conditionContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_line_condition(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_line_condition(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input, 'a> Visitable + 'a> - for Line_conditionContext<'input> -{ - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_line_condition(self); - } +impl<'input,'a> Visitable + 'a> for Line_conditionContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_line_condition(self); + } } -impl<'input> CustomRuleContext<'input> for Line_conditionContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_line_condition - } - //fn type_rule_index() -> usize where Self: Sized { RULE_line_condition } -} -antlr_rust::tid! {Line_conditionContextExt<'a>} - -impl<'input> Line_conditionContextExt<'input> { - fn new( - parent: Option + 'input>>, - invoking_state: isize, - ) -> Rc> { - Rc::new(BaseParserRuleContext::new_parser_ctx( - parent, - invoking_state, - Line_conditionContextExt { ph: PhantomData }, - )) - } +impl<'input> CustomRuleContext<'input> for Line_conditionContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_line_condition } + //fn type_rule_index() -> usize where Self: Sized { RULE_line_condition } } +antlr4rust::tid!{Line_conditionContextExt<'a>} -pub trait Line_conditionContextAttrs<'input>: - YarnSpinnerParserContext<'input> + BorrowMut> -{ - /// Retrieves first TerminalNode corresponding to token COMMAND_START - /// Returns `None` if there is no child corresponding to token COMMAND_START - fn COMMAND_START(&self) -> Option>> - where - Self: Sized, - { - self.get_token(COMMAND_START, 0) - } - /// Retrieves first TerminalNode corresponding to token COMMAND_IF - /// Returns `None` if there is no child corresponding to token COMMAND_IF - fn COMMAND_IF(&self) -> Option>> - where - Self: Sized, - { - self.get_token(COMMAND_IF, 0) - } - fn expression(&self) -> Option>> - where - Self: Sized, - { - self.child_of_type(0) - } - /// Retrieves first TerminalNode corresponding to token COMMAND_END - /// Returns `None` if there is no child corresponding to token COMMAND_END - fn COMMAND_END(&self) -> Option>> - where - Self: Sized, - { - self.get_token(COMMAND_END, 0) - } -} +impl<'input> Line_conditionContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Line_conditionContextExt{ -impl<'input> Line_conditionContextAttrs<'input> for Line_conditionContext<'input> {} + ph:PhantomData + }), + ) + } +} -impl<'input, I, H> YarnSpinnerParser<'input, I, H> -where - I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>, - H: ErrorStrategy<'input, BaseParserType<'input, I>>, -{ - pub fn line_condition(&mut self) -> Result>, ANTLRError> { - let mut recog = self; - let _parentctx = recog.ctx.take(); - let mut _localctx = - Line_conditionContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog - .base - .enter_rule(_localctx.clone(), 18, RULE_line_condition); - let mut _localctx: Rc = _localctx; - let result: Result<(), ANTLRError> = (|| { - //recog.base.enter_outer_alt(_localctx.clone(), 1); - recog.base.enter_outer_alt(None, 1); - { - recog.base.set_state(132); - recog - .base - .match_token(COMMAND_START, &mut recog.err_handler)?; - - recog.base.set_state(133); - recog.base.match_token(COMMAND_IF, &mut recog.err_handler)?; - - /*InvokeRule expression*/ - recog.base.set_state(134); - recog.expression_rec(0)?; - - recog.base.set_state(135); - recog - .base - .match_token(COMMAND_END, &mut recog.err_handler)?; - } - Ok(()) - })(); - match result { - Ok(_) => {} - Err(e @ ANTLRError::FallThrough(_)) => return Err(e), - Err(ref re) => { - //_localctx.exception = re; - recog.err_handler.report_error(&mut recog.base, re); - recog.err_handler.recover(&mut recog.base, re)?; - } - } - recog.base.exit_rule(); +pub trait Line_conditionContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ - Ok(_localctx) - } +/// Retrieves first TerminalNode corresponding to token COMMAND_START +/// Returns `None` if there is no child corresponding to token COMMAND_START +fn COMMAND_START(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_START, 0) } -//------------------- expression ---------------- -#[derive(Debug)] -pub enum ExpressionContextAll<'input> { - ExpParensContext(ExpParensContext<'input>), - ExpMultDivModContext(ExpMultDivModContext<'input>), - ExpComparisonContext(ExpComparisonContext<'input>), - ExpNegativeContext(ExpNegativeContext<'input>), - ExpAndOrXorContext(ExpAndOrXorContext<'input>), - ExpAddSubContext(ExpAddSubContext<'input>), - ExpNotContext(ExpNotContext<'input>), - ExpValueContext(ExpValueContext<'input>), - ExpEqualityContext(ExpEqualityContext<'input>), - Error(ExpressionContext<'input>), -} -antlr_rust::tid! {ExpressionContextAll<'a>} - -impl<'input> antlr_rust::parser_rule_context::DerefSeal for ExpressionContextAll<'input> {} - -impl<'input> YarnSpinnerParserContext<'input> for ExpressionContextAll<'input> {} - -impl<'input> Deref for ExpressionContextAll<'input> { - type Target = dyn ExpressionContextAttrs<'input> + 'input; - fn deref(&self) -> &Self::Target { - use ExpressionContextAll::*; - match self { - ExpParensContext(inner) => inner, - ExpMultDivModContext(inner) => inner, - ExpComparisonContext(inner) => inner, - ExpNegativeContext(inner) => inner, - ExpAndOrXorContext(inner) => inner, - ExpAddSubContext(inner) => inner, - ExpNotContext(inner) => inner, - ExpValueContext(inner) => inner, - ExpEqualityContext(inner) => inner, - Error(inner) => inner, - } - } +/// Retrieves first TerminalNode corresponding to token COMMAND_IF +/// Returns `None` if there is no child corresponding to token COMMAND_IF +fn COMMAND_IF(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_IF, 0) } -impl<'input, 'a> Visitable + 'a> - for ExpressionContextAll<'input> -{ - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - self.deref().accept(visitor) - } +fn expression(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) } -impl<'input, 'a> Listenable + 'a> - for ExpressionContextAll<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - self.deref().enter(listener) - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - self.deref().exit(listener) - } +/// Retrieves first TerminalNode corresponding to token COMMAND_END +/// Returns `None` if there is no child corresponding to token COMMAND_END +fn COMMAND_END(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_END, 0) +} + } -pub type ExpressionContext<'input> = BaseParserRuleContext<'input, ExpressionContextExt<'input>>; +impl<'input> Line_conditionContextAttrs<'input> for Line_conditionContext<'input>{} + +impl<'input, I> YarnSpinnerParser<'input, I> +where + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + pub fn line_condition(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = Line_conditionContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 18, RULE_line_condition); + let mut _localctx: Rc = _localctx; + let result: Result<(), ANTLRError> = (|| { + + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(132); + recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; + + recog.base.set_state(133); + recog.base.match_token(YarnSpinnerParser_COMMAND_IF,&mut recog.err_handler)?; + + /*InvokeRule expression*/ + recog.base.set_state(134); + recog.expression_rec(0)?; + + recog.base.set_state(135); + recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; + + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) + } +} +//------------------- expression ---------------- +#[derive(Debug)] +pub enum ExpressionContextAll<'input>{ + ExpParensContext(ExpParensContext<'input>), + ExpMultDivModContext(ExpMultDivModContext<'input>), + ExpComparisonContext(ExpComparisonContext<'input>), + ExpNegativeContext(ExpNegativeContext<'input>), + ExpAndOrXorContext(ExpAndOrXorContext<'input>), + ExpAddSubContext(ExpAddSubContext<'input>), + ExpNotContext(ExpNotContext<'input>), + ExpValueContext(ExpValueContext<'input>), + ExpEqualityContext(ExpEqualityContext<'input>), +Error(ExpressionContext<'input>) +} +antlr4rust::tid!{ExpressionContextAll<'a>} + +impl<'input> antlr4rust::parser_rule_context::DerefSeal for ExpressionContextAll<'input>{} + +impl<'input> YarnSpinnerParserContext<'input> for ExpressionContextAll<'input>{} + +impl<'input> Deref for ExpressionContextAll<'input>{ + type Target = dyn ExpressionContextAttrs<'input> + 'input; + fn deref(&self) -> &Self::Target{ + use ExpressionContextAll::*; + match self{ + ExpParensContext(inner) => inner, + ExpMultDivModContext(inner) => inner, + ExpComparisonContext(inner) => inner, + ExpNegativeContext(inner) => inner, + ExpAndOrXorContext(inner) => inner, + ExpAddSubContext(inner) => inner, + ExpNotContext(inner) => inner, + ExpValueContext(inner) => inner, + ExpEqualityContext(inner) => inner, +Error(inner) => inner + } + } +} +impl<'input,'a> Visitable + 'a> for ExpressionContextAll<'input>{ + fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { self.deref().accept(visitor) } +} +impl<'input,'a> Listenable + 'a> for ExpressionContextAll<'input>{ + fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { self.deref().enter(listener) } + fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { self.deref().exit(listener) } +} + + + +pub type ExpressionContext<'input> = BaseParserRuleContext<'input,ExpressionContextExt<'input>>; #[derive(Clone)] -pub struct ExpressionContextExt<'input> { - ph: PhantomData<&'input str>, +pub struct ExpressionContextExt<'input>{ +ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for ExpressionContext<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for ExpressionContext<'input>{} -impl<'input, 'a> Listenable + 'a> - for ExpressionContext<'input> -{ +impl<'input,'a> Listenable + 'a> for ExpressionContext<'input>{ } -impl<'input, 'a> Visitable + 'a> - for ExpressionContext<'input> -{ +impl<'input,'a> Visitable + 'a> for ExpressionContext<'input>{ } -impl<'input> CustomRuleContext<'input> for ExpressionContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_expression - } - //fn type_rule_index() -> usize where Self: Sized { RULE_expression } -} -antlr_rust::tid! {ExpressionContextExt<'a>} - -impl<'input> ExpressionContextExt<'input> { - fn new( - parent: Option + 'input>>, - invoking_state: isize, - ) -> Rc> { - Rc::new(ExpressionContextAll::Error( - BaseParserRuleContext::new_parser_ctx( - parent, - invoking_state, - ExpressionContextExt { ph: PhantomData }, - ), - )) - } +impl<'input> CustomRuleContext<'input> for ExpressionContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_expression } + //fn type_rule_index() -> usize where Self: Sized { RULE_expression } } +antlr4rust::tid!{ExpressionContextExt<'a>} -pub trait ExpressionContextAttrs<'input>: - YarnSpinnerParserContext<'input> + BorrowMut> -{ +impl<'input> ExpressionContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + ExpressionContextAll::Error( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,ExpressionContextExt{ + + ph:PhantomData + }), + ) + ) + } } -impl<'input> ExpressionContextAttrs<'input> for ExpressionContext<'input> {} +pub trait ExpressionContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ -pub type ExpParensContext<'input> = BaseParserRuleContext<'input, ExpParensContextExt<'input>>; -pub trait ExpParensContextAttrs<'input>: YarnSpinnerParserContext<'input> { - /// Retrieves first TerminalNode corresponding to token LPAREN - /// Returns `None` if there is no child corresponding to token LPAREN - fn LPAREN(&self) -> Option>> - where - Self: Sized, - { - self.get_token(LPAREN, 0) - } - fn expression(&self) -> Option>> - where - Self: Sized, - { - self.child_of_type(0) - } - /// Retrieves first TerminalNode corresponding to token RPAREN - /// Returns `None` if there is no child corresponding to token RPAREN - fn RPAREN(&self) -> Option>> - where - Self: Sized, - { - self.get_token(RPAREN, 0) - } } -impl<'input> ExpParensContextAttrs<'input> for ExpParensContext<'input> {} +impl<'input> ExpressionContextAttrs<'input> for ExpressionContext<'input>{} + +pub type ExpParensContext<'input> = BaseParserRuleContext<'input,ExpParensContextExt<'input>>; + +pub trait ExpParensContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + /// Retrieves first TerminalNode corresponding to token LPAREN + /// Returns `None` if there is no child corresponding to token LPAREN + fn LPAREN(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_LPAREN, 0) + } + fn expression(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) + } + /// Retrieves first TerminalNode corresponding to token RPAREN + /// Returns `None` if there is no child corresponding to token RPAREN + fn RPAREN(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_RPAREN, 0) + } +} + +impl<'input> ExpParensContextAttrs<'input> for ExpParensContext<'input>{} -pub struct ExpParensContextExt<'input> { - base: ExpressionContextExt<'input>, - ph: PhantomData<&'input str>, +pub struct ExpParensContextExt<'input>{ + base:ExpressionContextExt<'input>, + ph:PhantomData<&'input str> } -antlr_rust::tid! {ExpParensContextExt<'a>} +antlr4rust::tid!{ExpParensContextExt<'a>} -impl<'input> YarnSpinnerParserContext<'input> for ExpParensContext<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for ExpParensContext<'input>{} -impl<'input, 'a> Listenable + 'a> - for ExpParensContext<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_expParens(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_expParens(self); - listener.exit_every_rule(self); - } +impl<'input,'a> Listenable + 'a> for ExpParensContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_expParens(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_expParens(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input, 'a> Visitable + 'a> for ExpParensContext<'input> { - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_expParens(self); - } +impl<'input,'a> Visitable + 'a> for ExpParensContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_expParens(self); + } } -impl<'input> CustomRuleContext<'input> for ExpParensContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_expression - } - //fn type_rule_index() -> usize where Self: Sized { RULE_expression } +impl<'input> CustomRuleContext<'input> for ExpParensContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_expression } + //fn type_rule_index() -> usize where Self: Sized { RULE_expression } } -impl<'input> Borrow> for ExpParensContext<'input> { - fn borrow(&self) -> &ExpressionContextExt<'input> { - &self.base - } +impl<'input> Borrow> for ExpParensContext<'input>{ + fn borrow(&self) -> &ExpressionContextExt<'input> { &self.base } } -impl<'input> BorrowMut> for ExpParensContext<'input> { - fn borrow_mut(&mut self) -> &mut ExpressionContextExt<'input> { - &mut self.base - } +impl<'input> BorrowMut> for ExpParensContext<'input>{ + fn borrow_mut(&mut self) -> &mut ExpressionContextExt<'input> { &mut self.base } } impl<'input> ExpressionContextAttrs<'input> for ExpParensContext<'input> {} -impl<'input> ExpParensContextExt<'input> { - fn new(ctx: &dyn ExpressionContextAttrs<'input>) -> Rc> { - Rc::new(ExpressionContextAll::ExpParensContext( - BaseParserRuleContext::copy_from( - ctx, - ExpParensContextExt { - base: ctx.borrow().clone(), - ph: PhantomData, - }, - ), - )) - } +impl<'input> ExpParensContextExt<'input>{ + fn new(ctx: &dyn ExpressionContextAttrs<'input>) -> Rc> { + Rc::new( + ExpressionContextAll::ExpParensContext( + BaseParserRuleContext::copy_from(ctx,ExpParensContextExt{ + base: ctx.borrow().clone(), + ph:PhantomData + }) + ) + ) + } +} + +pub type ExpMultDivModContext<'input> = BaseParserRuleContext<'input,ExpMultDivModContextExt<'input>>; + +pub trait ExpMultDivModContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + fn expression_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() + } + fn expression(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) + } + /// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_MULTIPLICATION + /// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_MULTIPLICATION + fn OPERATOR_MATHS_MULTIPLICATION(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_MATHS_MULTIPLICATION, 0) + } + /// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_DIVISION + /// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_DIVISION + fn OPERATOR_MATHS_DIVISION(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_MATHS_DIVISION, 0) + } + /// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_MODULUS + /// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_MODULUS + fn OPERATOR_MATHS_MODULUS(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_MATHS_MODULUS, 0) + } +} + +impl<'input> ExpMultDivModContextAttrs<'input> for ExpMultDivModContext<'input>{} + +pub struct ExpMultDivModContextExt<'input>{ + base:ExpressionContextExt<'input>, + pub op: Option>, + ph:PhantomData<&'input str> +} + +antlr4rust::tid!{ExpMultDivModContextExt<'a>} + +impl<'input> YarnSpinnerParserContext<'input> for ExpMultDivModContext<'input>{} + +impl<'input,'a> Listenable + 'a> for ExpMultDivModContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_expMultDivMod(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_expMultDivMod(self); + listener.exit_every_rule(self)?; + Ok(()) + } +} + +impl<'input,'a> Visitable + 'a> for ExpMultDivModContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_expMultDivMod(self); + } +} + +impl<'input> CustomRuleContext<'input> for ExpMultDivModContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_expression } + //fn type_rule_index() -> usize where Self: Sized { RULE_expression } +} + +impl<'input> Borrow> for ExpMultDivModContext<'input>{ + fn borrow(&self) -> &ExpressionContextExt<'input> { &self.base } +} +impl<'input> BorrowMut> for ExpMultDivModContext<'input>{ + fn borrow_mut(&mut self) -> &mut ExpressionContextExt<'input> { &mut self.base } } -pub type ExpMultDivModContext<'input> = - BaseParserRuleContext<'input, ExpMultDivModContextExt<'input>>; +impl<'input> ExpressionContextAttrs<'input> for ExpMultDivModContext<'input> {} -pub trait ExpMultDivModContextAttrs<'input>: YarnSpinnerParserContext<'input> { - fn expression_all(&self) -> Vec>> - where - Self: Sized, - { - self.children_of_type() - } - fn expression(&self, i: usize) -> Option>> - where - Self: Sized, - { - self.child_of_type(i) - } - /// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_MULTIPLICATION - /// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_MULTIPLICATION - fn OPERATOR_MATHS_MULTIPLICATION( - &self, - ) -> Option>> - where - Self: Sized, - { - self.get_token(OPERATOR_MATHS_MULTIPLICATION, 0) - } - /// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_DIVISION - /// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_DIVISION - fn OPERATOR_MATHS_DIVISION( - &self, - ) -> Option>> - where - Self: Sized, - { - self.get_token(OPERATOR_MATHS_DIVISION, 0) - } - /// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_MODULUS - /// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_MODULUS - fn OPERATOR_MATHS_MODULUS( - &self, - ) -> Option>> - where - Self: Sized, - { - self.get_token(OPERATOR_MATHS_MODULUS, 0) - } +impl<'input> ExpMultDivModContextExt<'input>{ + fn new(ctx: &dyn ExpressionContextAttrs<'input>) -> Rc> { + Rc::new( + ExpressionContextAll::ExpMultDivModContext( + BaseParserRuleContext::copy_from(ctx,ExpMultDivModContextExt{ + op:None, + base: ctx.borrow().clone(), + ph:PhantomData + }) + ) + ) + } +} + +pub type ExpComparisonContext<'input> = BaseParserRuleContext<'input,ExpComparisonContextExt<'input>>; + +pub trait ExpComparisonContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + fn expression_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() + } + fn expression(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) + } + /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_LESS_THAN_EQUALS + /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_LESS_THAN_EQUALS + fn OPERATOR_LOGICAL_LESS_THAN_EQUALS(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_LOGICAL_LESS_THAN_EQUALS, 0) + } + /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_GREATER_THAN_EQUALS + /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_GREATER_THAN_EQUALS + fn OPERATOR_LOGICAL_GREATER_THAN_EQUALS(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_LOGICAL_GREATER_THAN_EQUALS, 0) + } + /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_LESS + /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_LESS + fn OPERATOR_LOGICAL_LESS(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_LOGICAL_LESS, 0) + } + /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_GREATER + /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_GREATER + fn OPERATOR_LOGICAL_GREATER(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_LOGICAL_GREATER, 0) + } +} + +impl<'input> ExpComparisonContextAttrs<'input> for ExpComparisonContext<'input>{} + +pub struct ExpComparisonContextExt<'input>{ + base:ExpressionContextExt<'input>, + pub op: Option>, + ph:PhantomData<&'input str> +} + +antlr4rust::tid!{ExpComparisonContextExt<'a>} + +impl<'input> YarnSpinnerParserContext<'input> for ExpComparisonContext<'input>{} + +impl<'input,'a> Listenable + 'a> for ExpComparisonContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_expComparison(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_expComparison(self); + listener.exit_every_rule(self)?; + Ok(()) + } +} + +impl<'input,'a> Visitable + 'a> for ExpComparisonContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_expComparison(self); + } +} + +impl<'input> CustomRuleContext<'input> for ExpComparisonContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_expression } + //fn type_rule_index() -> usize where Self: Sized { RULE_expression } +} + +impl<'input> Borrow> for ExpComparisonContext<'input>{ + fn borrow(&self) -> &ExpressionContextExt<'input> { &self.base } +} +impl<'input> BorrowMut> for ExpComparisonContext<'input>{ + fn borrow_mut(&mut self) -> &mut ExpressionContextExt<'input> { &mut self.base } } -impl<'input> ExpMultDivModContextAttrs<'input> for ExpMultDivModContext<'input> {} +impl<'input> ExpressionContextAttrs<'input> for ExpComparisonContext<'input> {} -pub struct ExpMultDivModContextExt<'input> { - base: ExpressionContextExt<'input>, - pub op: Option>, - ph: PhantomData<&'input str>, +impl<'input> ExpComparisonContextExt<'input>{ + fn new(ctx: &dyn ExpressionContextAttrs<'input>) -> Rc> { + Rc::new( + ExpressionContextAll::ExpComparisonContext( + BaseParserRuleContext::copy_from(ctx,ExpComparisonContextExt{ + op:None, + base: ctx.borrow().clone(), + ph:PhantomData + }) + ) + ) + } } -antlr_rust::tid! {ExpMultDivModContextExt<'a>} +pub type ExpNegativeContext<'input> = BaseParserRuleContext<'input,ExpNegativeContextExt<'input>>; -impl<'input> YarnSpinnerParserContext<'input> for ExpMultDivModContext<'input> {} +pub trait ExpNegativeContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + fn expression(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) + } + /// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_SUBTRACTION + /// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_SUBTRACTION + fn OPERATOR_MATHS_SUBTRACTION(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_MATHS_SUBTRACTION, 0) + } +} -impl<'input, 'a> Listenable + 'a> - for ExpMultDivModContext<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_expMultDivMod(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_expMultDivMod(self); - listener.exit_every_rule(self); - } +impl<'input> ExpNegativeContextAttrs<'input> for ExpNegativeContext<'input>{} + +pub struct ExpNegativeContextExt<'input>{ + base:ExpressionContextExt<'input>, + pub op: Option>, + ph:PhantomData<&'input str> } -impl<'input, 'a> Visitable + 'a> - for ExpMultDivModContext<'input> -{ - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_expMultDivMod(self); - } +antlr4rust::tid!{ExpNegativeContextExt<'a>} + +impl<'input> YarnSpinnerParserContext<'input> for ExpNegativeContext<'input>{} + +impl<'input,'a> Listenable + 'a> for ExpNegativeContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_expNegative(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_expNegative(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input> CustomRuleContext<'input> for ExpMultDivModContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_expression - } - //fn type_rule_index() -> usize where Self: Sized { RULE_expression } +impl<'input,'a> Visitable + 'a> for ExpNegativeContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_expNegative(self); + } } -impl<'input> Borrow> for ExpMultDivModContext<'input> { - fn borrow(&self) -> &ExpressionContextExt<'input> { - &self.base - } +impl<'input> CustomRuleContext<'input> for ExpNegativeContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_expression } + //fn type_rule_index() -> usize where Self: Sized { RULE_expression } } -impl<'input> BorrowMut> for ExpMultDivModContext<'input> { - fn borrow_mut(&mut self) -> &mut ExpressionContextExt<'input> { - &mut self.base - } + +impl<'input> Borrow> for ExpNegativeContext<'input>{ + fn borrow(&self) -> &ExpressionContextExt<'input> { &self.base } +} +impl<'input> BorrowMut> for ExpNegativeContext<'input>{ + fn borrow_mut(&mut self) -> &mut ExpressionContextExt<'input> { &mut self.base } } -impl<'input> ExpressionContextAttrs<'input> for ExpMultDivModContext<'input> {} +impl<'input> ExpressionContextAttrs<'input> for ExpNegativeContext<'input> {} -impl<'input> ExpMultDivModContextExt<'input> { - fn new(ctx: &dyn ExpressionContextAttrs<'input>) -> Rc> { - Rc::new(ExpressionContextAll::ExpMultDivModContext( - BaseParserRuleContext::copy_from( - ctx, - ExpMultDivModContextExt { - op: None, - base: ctx.borrow().clone(), - ph: PhantomData, - }, - ), - )) - } +impl<'input> ExpNegativeContextExt<'input>{ + fn new(ctx: &dyn ExpressionContextAttrs<'input>) -> Rc> { + Rc::new( + ExpressionContextAll::ExpNegativeContext( + BaseParserRuleContext::copy_from(ctx,ExpNegativeContextExt{ + op:None, + base: ctx.borrow().clone(), + ph:PhantomData + }) + ) + ) + } +} + +pub type ExpAndOrXorContext<'input> = BaseParserRuleContext<'input,ExpAndOrXorContextExt<'input>>; + +pub trait ExpAndOrXorContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + fn expression_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() + } + fn expression(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) + } + /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_AND + /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_AND + fn OPERATOR_LOGICAL_AND(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_LOGICAL_AND, 0) + } + /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_OR + /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_OR + fn OPERATOR_LOGICAL_OR(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_LOGICAL_OR, 0) + } + /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_XOR + /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_XOR + fn OPERATOR_LOGICAL_XOR(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_LOGICAL_XOR, 0) + } +} + +impl<'input> ExpAndOrXorContextAttrs<'input> for ExpAndOrXorContext<'input>{} + +pub struct ExpAndOrXorContextExt<'input>{ + base:ExpressionContextExt<'input>, + pub op: Option>, + ph:PhantomData<&'input str> +} + +antlr4rust::tid!{ExpAndOrXorContextExt<'a>} + +impl<'input> YarnSpinnerParserContext<'input> for ExpAndOrXorContext<'input>{} + +impl<'input,'a> Listenable + 'a> for ExpAndOrXorContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_expAndOrXor(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_expAndOrXor(self); + listener.exit_every_rule(self)?; + Ok(()) + } +} + +impl<'input,'a> Visitable + 'a> for ExpAndOrXorContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_expAndOrXor(self); + } +} + +impl<'input> CustomRuleContext<'input> for ExpAndOrXorContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_expression } + //fn type_rule_index() -> usize where Self: Sized { RULE_expression } +} + +impl<'input> Borrow> for ExpAndOrXorContext<'input>{ + fn borrow(&self) -> &ExpressionContextExt<'input> { &self.base } +} +impl<'input> BorrowMut> for ExpAndOrXorContext<'input>{ + fn borrow_mut(&mut self) -> &mut ExpressionContextExt<'input> { &mut self.base } +} + +impl<'input> ExpressionContextAttrs<'input> for ExpAndOrXorContext<'input> {} + +impl<'input> ExpAndOrXorContextExt<'input>{ + fn new(ctx: &dyn ExpressionContextAttrs<'input>) -> Rc> { + Rc::new( + ExpressionContextAll::ExpAndOrXorContext( + BaseParserRuleContext::copy_from(ctx,ExpAndOrXorContextExt{ + op:None, + base: ctx.borrow().clone(), + ph:PhantomData + }) + ) + ) + } } -pub type ExpComparisonContext<'input> = - BaseParserRuleContext<'input, ExpComparisonContextExt<'input>>; +pub type ExpAddSubContext<'input> = BaseParserRuleContext<'input,ExpAddSubContextExt<'input>>; -pub trait ExpComparisonContextAttrs<'input>: YarnSpinnerParserContext<'input> { - fn expression_all(&self) -> Vec>> - where - Self: Sized, - { - self.children_of_type() - } - fn expression(&self, i: usize) -> Option>> - where - Self: Sized, - { - self.child_of_type(i) - } - /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_LESS_THAN_EQUALS - /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_LESS_THAN_EQUALS - fn OPERATOR_LOGICAL_LESS_THAN_EQUALS( - &self, - ) -> Option>> - where - Self: Sized, - { - self.get_token(OPERATOR_LOGICAL_LESS_THAN_EQUALS, 0) - } - /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_GREATER_THAN_EQUALS - /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_GREATER_THAN_EQUALS - fn OPERATOR_LOGICAL_GREATER_THAN_EQUALS( - &self, - ) -> Option>> - where - Self: Sized, - { - self.get_token(OPERATOR_LOGICAL_GREATER_THAN_EQUALS, 0) - } - /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_LESS - /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_LESS - fn OPERATOR_LOGICAL_LESS( - &self, - ) -> Option>> - where - Self: Sized, - { - self.get_token(OPERATOR_LOGICAL_LESS, 0) - } - /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_GREATER - /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_GREATER - fn OPERATOR_LOGICAL_GREATER( - &self, - ) -> Option>> - where - Self: Sized, - { - self.get_token(OPERATOR_LOGICAL_GREATER, 0) - } +pub trait ExpAddSubContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + fn expression_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() + } + fn expression(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) + } + /// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_ADDITION + /// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_ADDITION + fn OPERATOR_MATHS_ADDITION(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_MATHS_ADDITION, 0) + } + /// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_SUBTRACTION + /// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_SUBTRACTION + fn OPERATOR_MATHS_SUBTRACTION(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_MATHS_SUBTRACTION, 0) + } } -impl<'input> ExpComparisonContextAttrs<'input> for ExpComparisonContext<'input> {} +impl<'input> ExpAddSubContextAttrs<'input> for ExpAddSubContext<'input>{} -pub struct ExpComparisonContextExt<'input> { - base: ExpressionContextExt<'input>, - pub op: Option>, - ph: PhantomData<&'input str>, +pub struct ExpAddSubContextExt<'input>{ + base:ExpressionContextExt<'input>, + pub op: Option>, + ph:PhantomData<&'input str> } -antlr_rust::tid! {ExpComparisonContextExt<'a>} +antlr4rust::tid!{ExpAddSubContextExt<'a>} -impl<'input> YarnSpinnerParserContext<'input> for ExpComparisonContext<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for ExpAddSubContext<'input>{} -impl<'input, 'a> Listenable + 'a> - for ExpComparisonContext<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_expComparison(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_expComparison(self); - listener.exit_every_rule(self); - } +impl<'input,'a> Listenable + 'a> for ExpAddSubContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_expAddSub(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_expAddSub(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input, 'a> Visitable + 'a> - for ExpComparisonContext<'input> -{ - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_expComparison(self); - } +impl<'input,'a> Visitable + 'a> for ExpAddSubContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_expAddSub(self); + } } -impl<'input> CustomRuleContext<'input> for ExpComparisonContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_expression - } - //fn type_rule_index() -> usize where Self: Sized { RULE_expression } +impl<'input> CustomRuleContext<'input> for ExpAddSubContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_expression } + //fn type_rule_index() -> usize where Self: Sized { RULE_expression } } -impl<'input> Borrow> for ExpComparisonContext<'input> { - fn borrow(&self) -> &ExpressionContextExt<'input> { - &self.base - } +impl<'input> Borrow> for ExpAddSubContext<'input>{ + fn borrow(&self) -> &ExpressionContextExt<'input> { &self.base } } -impl<'input> BorrowMut> for ExpComparisonContext<'input> { - fn borrow_mut(&mut self) -> &mut ExpressionContextExt<'input> { - &mut self.base - } +impl<'input> BorrowMut> for ExpAddSubContext<'input>{ + fn borrow_mut(&mut self) -> &mut ExpressionContextExt<'input> { &mut self.base } } -impl<'input> ExpressionContextAttrs<'input> for ExpComparisonContext<'input> {} +impl<'input> ExpressionContextAttrs<'input> for ExpAddSubContext<'input> {} -impl<'input> ExpComparisonContextExt<'input> { - fn new(ctx: &dyn ExpressionContextAttrs<'input>) -> Rc> { - Rc::new(ExpressionContextAll::ExpComparisonContext( - BaseParserRuleContext::copy_from( - ctx, - ExpComparisonContextExt { - op: None, - base: ctx.borrow().clone(), - ph: PhantomData, - }, - ), - )) - } +impl<'input> ExpAddSubContextExt<'input>{ + fn new(ctx: &dyn ExpressionContextAttrs<'input>) -> Rc> { + Rc::new( + ExpressionContextAll::ExpAddSubContext( + BaseParserRuleContext::copy_from(ctx,ExpAddSubContextExt{ + op:None, + base: ctx.borrow().clone(), + ph:PhantomData + }) + ) + ) + } } -pub type ExpNegativeContext<'input> = BaseParserRuleContext<'input, ExpNegativeContextExt<'input>>; +pub type ExpNotContext<'input> = BaseParserRuleContext<'input,ExpNotContextExt<'input>>; -pub trait ExpNegativeContextAttrs<'input>: YarnSpinnerParserContext<'input> { - fn expression(&self) -> Option>> - where - Self: Sized, - { - self.child_of_type(0) - } - /// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_SUBTRACTION - /// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_SUBTRACTION - fn OPERATOR_MATHS_SUBTRACTION( - &self, - ) -> Option>> - where - Self: Sized, - { - self.get_token(OPERATOR_MATHS_SUBTRACTION, 0) - } +pub trait ExpNotContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + fn expression(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) + } + /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_NOT + /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_NOT + fn OPERATOR_LOGICAL_NOT(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_LOGICAL_NOT, 0) + } } -impl<'input> ExpNegativeContextAttrs<'input> for ExpNegativeContext<'input> {} +impl<'input> ExpNotContextAttrs<'input> for ExpNotContext<'input>{} -pub struct ExpNegativeContextExt<'input> { - base: ExpressionContextExt<'input>, - pub op: Option>, - ph: PhantomData<&'input str>, +pub struct ExpNotContextExt<'input>{ + base:ExpressionContextExt<'input>, + pub op: Option>, + ph:PhantomData<&'input str> } -antlr_rust::tid! {ExpNegativeContextExt<'a>} +antlr4rust::tid!{ExpNotContextExt<'a>} -impl<'input> YarnSpinnerParserContext<'input> for ExpNegativeContext<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for ExpNotContext<'input>{} -impl<'input, 'a> Listenable + 'a> - for ExpNegativeContext<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_expNegative(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_expNegative(self); - listener.exit_every_rule(self); - } +impl<'input,'a> Listenable + 'a> for ExpNotContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_expNot(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_expNot(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input, 'a> Visitable + 'a> - for ExpNegativeContext<'input> -{ - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_expNegative(self); - } +impl<'input,'a> Visitable + 'a> for ExpNotContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_expNot(self); + } } -impl<'input> CustomRuleContext<'input> for ExpNegativeContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_expression - } - //fn type_rule_index() -> usize where Self: Sized { RULE_expression } +impl<'input> CustomRuleContext<'input> for ExpNotContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_expression } + //fn type_rule_index() -> usize where Self: Sized { RULE_expression } } -impl<'input> Borrow> for ExpNegativeContext<'input> { - fn borrow(&self) -> &ExpressionContextExt<'input> { - &self.base - } +impl<'input> Borrow> for ExpNotContext<'input>{ + fn borrow(&self) -> &ExpressionContextExt<'input> { &self.base } } -impl<'input> BorrowMut> for ExpNegativeContext<'input> { - fn borrow_mut(&mut self) -> &mut ExpressionContextExt<'input> { - &mut self.base - } +impl<'input> BorrowMut> for ExpNotContext<'input>{ + fn borrow_mut(&mut self) -> &mut ExpressionContextExt<'input> { &mut self.base } } -impl<'input> ExpressionContextAttrs<'input> for ExpNegativeContext<'input> {} +impl<'input> ExpressionContextAttrs<'input> for ExpNotContext<'input> {} -impl<'input> ExpNegativeContextExt<'input> { - fn new(ctx: &dyn ExpressionContextAttrs<'input>) -> Rc> { - Rc::new(ExpressionContextAll::ExpNegativeContext( - BaseParserRuleContext::copy_from( - ctx, - ExpNegativeContextExt { - op: None, - base: ctx.borrow().clone(), - ph: PhantomData, - }, - ), - )) - } +impl<'input> ExpNotContextExt<'input>{ + fn new(ctx: &dyn ExpressionContextAttrs<'input>) -> Rc> { + Rc::new( + ExpressionContextAll::ExpNotContext( + BaseParserRuleContext::copy_from(ctx,ExpNotContextExt{ + op:None, + base: ctx.borrow().clone(), + ph:PhantomData + }) + ) + ) + } } -pub type ExpAndOrXorContext<'input> = BaseParserRuleContext<'input, ExpAndOrXorContextExt<'input>>; +pub type ExpValueContext<'input> = BaseParserRuleContext<'input,ExpValueContextExt<'input>>; -pub trait ExpAndOrXorContextAttrs<'input>: YarnSpinnerParserContext<'input> { - fn expression_all(&self) -> Vec>> - where - Self: Sized, - { - self.children_of_type() - } - fn expression(&self, i: usize) -> Option>> - where - Self: Sized, - { - self.child_of_type(i) - } - /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_AND - /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_AND - fn OPERATOR_LOGICAL_AND(&self) -> Option>> - where - Self: Sized, - { - self.get_token(OPERATOR_LOGICAL_AND, 0) - } - /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_OR - /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_OR - fn OPERATOR_LOGICAL_OR(&self) -> Option>> - where - Self: Sized, - { - self.get_token(OPERATOR_LOGICAL_OR, 0) - } - /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_XOR - /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_XOR - fn OPERATOR_LOGICAL_XOR(&self) -> Option>> - where - Self: Sized, - { - self.get_token(OPERATOR_LOGICAL_XOR, 0) - } +pub trait ExpValueContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + fn value(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) + } } -impl<'input> ExpAndOrXorContextAttrs<'input> for ExpAndOrXorContext<'input> {} +impl<'input> ExpValueContextAttrs<'input> for ExpValueContext<'input>{} -pub struct ExpAndOrXorContextExt<'input> { - base: ExpressionContextExt<'input>, - pub op: Option>, - ph: PhantomData<&'input str>, +pub struct ExpValueContextExt<'input>{ + base:ExpressionContextExt<'input>, + ph:PhantomData<&'input str> } -antlr_rust::tid! {ExpAndOrXorContextExt<'a>} +antlr4rust::tid!{ExpValueContextExt<'a>} -impl<'input> YarnSpinnerParserContext<'input> for ExpAndOrXorContext<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for ExpValueContext<'input>{} -impl<'input, 'a> Listenable + 'a> - for ExpAndOrXorContext<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_expAndOrXor(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_expAndOrXor(self); - listener.exit_every_rule(self); - } +impl<'input,'a> Listenable + 'a> for ExpValueContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_expValue(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_expValue(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input, 'a> Visitable + 'a> - for ExpAndOrXorContext<'input> -{ - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_expAndOrXor(self); - } +impl<'input,'a> Visitable + 'a> for ExpValueContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_expValue(self); + } } -impl<'input> CustomRuleContext<'input> for ExpAndOrXorContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_expression - } - //fn type_rule_index() -> usize where Self: Sized { RULE_expression } +impl<'input> CustomRuleContext<'input> for ExpValueContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_expression } + //fn type_rule_index() -> usize where Self: Sized { RULE_expression } } -impl<'input> Borrow> for ExpAndOrXorContext<'input> { - fn borrow(&self) -> &ExpressionContextExt<'input> { - &self.base - } +impl<'input> Borrow> for ExpValueContext<'input>{ + fn borrow(&self) -> &ExpressionContextExt<'input> { &self.base } } -impl<'input> BorrowMut> for ExpAndOrXorContext<'input> { - fn borrow_mut(&mut self) -> &mut ExpressionContextExt<'input> { - &mut self.base - } +impl<'input> BorrowMut> for ExpValueContext<'input>{ + fn borrow_mut(&mut self) -> &mut ExpressionContextExt<'input> { &mut self.base } } -impl<'input> ExpressionContextAttrs<'input> for ExpAndOrXorContext<'input> {} +impl<'input> ExpressionContextAttrs<'input> for ExpValueContext<'input> {} -impl<'input> ExpAndOrXorContextExt<'input> { - fn new(ctx: &dyn ExpressionContextAttrs<'input>) -> Rc> { - Rc::new(ExpressionContextAll::ExpAndOrXorContext( - BaseParserRuleContext::copy_from( - ctx, - ExpAndOrXorContextExt { - op: None, - base: ctx.borrow().clone(), - ph: PhantomData, - }, - ), - )) - } +impl<'input> ExpValueContextExt<'input>{ + fn new(ctx: &dyn ExpressionContextAttrs<'input>) -> Rc> { + Rc::new( + ExpressionContextAll::ExpValueContext( + BaseParserRuleContext::copy_from(ctx,ExpValueContextExt{ + base: ctx.borrow().clone(), + ph:PhantomData + }) + ) + ) + } } -pub type ExpAddSubContext<'input> = BaseParserRuleContext<'input, ExpAddSubContextExt<'input>>; +pub type ExpEqualityContext<'input> = BaseParserRuleContext<'input,ExpEqualityContextExt<'input>>; -pub trait ExpAddSubContextAttrs<'input>: YarnSpinnerParserContext<'input> { - fn expression_all(&self) -> Vec>> - where - Self: Sized, - { - self.children_of_type() - } - fn expression(&self, i: usize) -> Option>> - where - Self: Sized, - { - self.child_of_type(i) - } - /// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_ADDITION - /// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_ADDITION - fn OPERATOR_MATHS_ADDITION( - &self, - ) -> Option>> - where - Self: Sized, - { - self.get_token(OPERATOR_MATHS_ADDITION, 0) - } - /// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_SUBTRACTION - /// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_SUBTRACTION - fn OPERATOR_MATHS_SUBTRACTION( - &self, - ) -> Option>> - where - Self: Sized, - { - self.get_token(OPERATOR_MATHS_SUBTRACTION, 0) - } +pub trait ExpEqualityContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + fn expression_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() + } + fn expression(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) + } + /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_EQUALS + /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_EQUALS + fn OPERATOR_LOGICAL_EQUALS(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_LOGICAL_EQUALS, 0) + } + /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_NOT_EQUALS + /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_NOT_EQUALS + fn OPERATOR_LOGICAL_NOT_EQUALS(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_LOGICAL_NOT_EQUALS, 0) + } } -impl<'input> ExpAddSubContextAttrs<'input> for ExpAddSubContext<'input> {} +impl<'input> ExpEqualityContextAttrs<'input> for ExpEqualityContext<'input>{} -pub struct ExpAddSubContextExt<'input> { - base: ExpressionContextExt<'input>, - pub op: Option>, - ph: PhantomData<&'input str>, +pub struct ExpEqualityContextExt<'input>{ + base:ExpressionContextExt<'input>, + pub op: Option>, + ph:PhantomData<&'input str> } -antlr_rust::tid! {ExpAddSubContextExt<'a>} +antlr4rust::tid!{ExpEqualityContextExt<'a>} -impl<'input> YarnSpinnerParserContext<'input> for ExpAddSubContext<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for ExpEqualityContext<'input>{} -impl<'input, 'a> Listenable + 'a> - for ExpAddSubContext<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_expAddSub(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_expAddSub(self); - listener.exit_every_rule(self); - } +impl<'input,'a> Listenable + 'a> for ExpEqualityContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_expEquality(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_expEquality(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input, 'a> Visitable + 'a> for ExpAddSubContext<'input> { - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_expAddSub(self); - } +impl<'input,'a> Visitable + 'a> for ExpEqualityContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_expEquality(self); + } } -impl<'input> CustomRuleContext<'input> for ExpAddSubContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_expression - } - //fn type_rule_index() -> usize where Self: Sized { RULE_expression } +impl<'input> CustomRuleContext<'input> for ExpEqualityContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_expression } + //fn type_rule_index() -> usize where Self: Sized { RULE_expression } } -impl<'input> Borrow> for ExpAddSubContext<'input> { - fn borrow(&self) -> &ExpressionContextExt<'input> { - &self.base - } +impl<'input> Borrow> for ExpEqualityContext<'input>{ + fn borrow(&self) -> &ExpressionContextExt<'input> { &self.base } } -impl<'input> BorrowMut> for ExpAddSubContext<'input> { - fn borrow_mut(&mut self) -> &mut ExpressionContextExt<'input> { - &mut self.base - } +impl<'input> BorrowMut> for ExpEqualityContext<'input>{ + fn borrow_mut(&mut self) -> &mut ExpressionContextExt<'input> { &mut self.base } } -impl<'input> ExpressionContextAttrs<'input> for ExpAddSubContext<'input> {} +impl<'input> ExpressionContextAttrs<'input> for ExpEqualityContext<'input> {} -impl<'input> ExpAddSubContextExt<'input> { - fn new(ctx: &dyn ExpressionContextAttrs<'input>) -> Rc> { - Rc::new(ExpressionContextAll::ExpAddSubContext( - BaseParserRuleContext::copy_from( - ctx, - ExpAddSubContextExt { - op: None, - base: ctx.borrow().clone(), - ph: PhantomData, - }, - ), - )) - } +impl<'input> ExpEqualityContextExt<'input>{ + fn new(ctx: &dyn ExpressionContextAttrs<'input>) -> Rc> { + Rc::new( + ExpressionContextAll::ExpEqualityContext( + BaseParserRuleContext::copy_from(ctx,ExpEqualityContextExt{ + op:None, + base: ctx.borrow().clone(), + ph:PhantomData + }) + ) + ) + } +} + +impl<'input, I> YarnSpinnerParser<'input, I> +where + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + pub fn expression(&mut self,) + -> Result>,ANTLRError> { + self.expression_rec(0) + } + + fn expression_rec(&mut self, _p: i32) + -> Result>,ANTLRError> { + let recog = self; + let _parentctx = recog.ctx.take(); + let _parentState = recog.base.get_state(); + let mut _localctx = ExpressionContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_recursion_rule(_localctx.clone(), 20, RULE_expression, _p); + let mut _localctx: Rc = _localctx; + let mut _prevctx = _localctx.clone(); + let _startState = 20; + let mut _la: i32 = -1; + let result: Result<(), ANTLRError> = (|| { + let mut _alt: i32; + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(147); + recog.err_handler.sync(&mut recog.base)?; + match recog.base.input.la(1) { + YarnSpinnerParser_LPAREN + => { + { + let mut tmp = ExpParensContextExt::new(&**_localctx); + recog.ctx = Some(tmp.clone()); + _localctx = tmp; + _prevctx = _localctx.clone(); + + recog.base.set_state(138); + recog.base.match_token(YarnSpinnerParser_LPAREN,&mut recog.err_handler)?; + + /*InvokeRule expression*/ + recog.base.set_state(139); + recog.expression_rec(0)?; + + recog.base.set_state(140); + recog.base.match_token(YarnSpinnerParser_RPAREN,&mut recog.err_handler)?; + + } + } + + YarnSpinnerParser_OPERATOR_MATHS_SUBTRACTION + => { + { + let mut tmp = ExpNegativeContextExt::new(&**_localctx); + recog.ctx = Some(tmp.clone()); + _localctx = tmp; + _prevctx = _localctx.clone(); + recog.base.set_state(142); + let tmp = recog.base.match_token(YarnSpinnerParser_OPERATOR_MATHS_SUBTRACTION,&mut recog.err_handler)?; + if let ExpressionContextAll::ExpNegativeContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ + ctx.op = Some(tmp.clone()); } else {unreachable!("cant cast");} + + /*InvokeRule expression*/ + recog.base.set_state(143); + recog.expression_rec(8)?; + + } + } + + YarnSpinnerParser_OPERATOR_LOGICAL_NOT + => { + { + let mut tmp = ExpNotContextExt::new(&**_localctx); + recog.ctx = Some(tmp.clone()); + _localctx = tmp; + _prevctx = _localctx.clone(); + recog.base.set_state(144); + let tmp = recog.base.match_token(YarnSpinnerParser_OPERATOR_LOGICAL_NOT,&mut recog.err_handler)?; + if let ExpressionContextAll::ExpNotContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ + ctx.op = Some(tmp.clone()); } else {unreachable!("cant cast");} + + /*InvokeRule expression*/ + recog.base.set_state(145); + recog.expression_rec(7)?; + + } + } + + YarnSpinnerParser_KEYWORD_TRUE |YarnSpinnerParser_KEYWORD_FALSE |YarnSpinnerParser_KEYWORD_NULL | + YarnSpinnerParser_STRING |YarnSpinnerParser_FUNC_ID |YarnSpinnerParser_VAR_ID | + YarnSpinnerParser_NUMBER + => { + { + let mut tmp = ExpValueContextExt::new(&**_localctx); + recog.ctx = Some(tmp.clone()); + _localctx = tmp; + _prevctx = _localctx.clone(); + /*InvokeRule value*/ + recog.base.set_state(146); + recog.value()?; + + } + } + + _ => Err(ANTLRError::NoAltError(NoViableAltError::new(&mut recog.base)))? + } + let tmp = recog.input.lt(-1).cloned(); + recog.ctx.as_ref().unwrap().set_stop(tmp); + recog.base.set_state(166); + recog.err_handler.sync(&mut recog.base)?; + _alt = recog.interpreter.adaptive_predict(14,&mut recog.base)?; + while { _alt!=2 && _alt!=INVALID_ALT } { + if _alt==1 { + recog.trigger_exit_rule_event()?; + _prevctx = _localctx.clone(); + { + recog.base.set_state(164); + recog.err_handler.sync(&mut recog.base)?; + match recog.interpreter.adaptive_predict(13,&mut recog.base)? { + 1 =>{ + { + /*recRuleLabeledAltStartAction*/ + let mut tmp = ExpMultDivModContextExt::new(&**ExpressionContextExt::new(_parentctx.clone(), _parentState)); + recog.push_new_recursion_context(tmp.clone(), _startState, RULE_expression)?; + _localctx = tmp; + recog.base.set_state(149); + if !({let _localctx = Some(_localctx.clone()); + recog.precpred(None, 6)}) { + Err(FailedPredicateError::new(&mut recog.base, Some("recog.precpred(None, 6)".to_owned()), None))?; + } + recog.base.set_state(150); + if let ExpressionContextAll::ExpMultDivModContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ + ctx.op = recog.base.input.lt(1).cloned(); } else {unreachable!("cant cast");} + _la = recog.base.input.la(1); + if { !(((((_la - 49)) & !0x3f) == 0 && ((1usize << (_la - 49)) & 7) != 0)) } { + let tmp = recog.err_handler.recover_inline(&mut recog.base)?; + if let ExpressionContextAll::ExpMultDivModContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ + ctx.op = Some(tmp.clone()); } else {unreachable!("cant cast");} + + } + else { + if recog.base.input.la(1)==TOKEN_EOF { recog.base.matched_eof = true }; + recog.err_handler.report_match(&mut recog.base); + recog.base.consume(&mut recog.err_handler); + } + /*InvokeRule expression*/ + recog.base.set_state(151); + recog.expression_rec(7)?; + + } + } + , + 2 =>{ + { + /*recRuleLabeledAltStartAction*/ + let mut tmp = ExpAddSubContextExt::new(&**ExpressionContextExt::new(_parentctx.clone(), _parentState)); + recog.push_new_recursion_context(tmp.clone(), _startState, RULE_expression)?; + _localctx = tmp; + recog.base.set_state(152); + if !({let _localctx = Some(_localctx.clone()); + recog.precpred(None, 5)}) { + Err(FailedPredicateError::new(&mut recog.base, Some("recog.precpred(None, 5)".to_owned()), None))?; + } + recog.base.set_state(153); + if let ExpressionContextAll::ExpAddSubContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ + ctx.op = recog.base.input.lt(1).cloned(); } else {unreachable!("cant cast");} + _la = recog.base.input.la(1); + if { !(_la==YarnSpinnerParser_OPERATOR_MATHS_ADDITION || _la==YarnSpinnerParser_OPERATOR_MATHS_SUBTRACTION) } { + let tmp = recog.err_handler.recover_inline(&mut recog.base)?; + if let ExpressionContextAll::ExpAddSubContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ + ctx.op = Some(tmp.clone()); } else {unreachable!("cant cast");} + + } + else { + if recog.base.input.la(1)==TOKEN_EOF { recog.base.matched_eof = true }; + recog.err_handler.report_match(&mut recog.base); + recog.base.consume(&mut recog.err_handler); + } + /*InvokeRule expression*/ + recog.base.set_state(154); + recog.expression_rec(6)?; + + } + } + , + 3 =>{ + { + /*recRuleLabeledAltStartAction*/ + let mut tmp = ExpComparisonContextExt::new(&**ExpressionContextExt::new(_parentctx.clone(), _parentState)); + recog.push_new_recursion_context(tmp.clone(), _startState, RULE_expression)?; + _localctx = tmp; + recog.base.set_state(155); + if !({let _localctx = Some(_localctx.clone()); + recog.precpred(None, 4)}) { + Err(FailedPredicateError::new(&mut recog.base, Some("recog.precpred(None, 4)".to_owned()), None))?; + } + recog.base.set_state(156); + if let ExpressionContextAll::ExpComparisonContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ + ctx.op = recog.base.input.lt(1).cloned(); } else {unreachable!("cant cast");} + _la = recog.base.input.la(1); + if { !(((((_la - 32)) & !0x3f) == 0 && ((1usize << (_la - 32)) & 27) != 0)) } { + let tmp = recog.err_handler.recover_inline(&mut recog.base)?; + if let ExpressionContextAll::ExpComparisonContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ + ctx.op = Some(tmp.clone()); } else {unreachable!("cant cast");} + + } + else { + if recog.base.input.la(1)==TOKEN_EOF { recog.base.matched_eof = true }; + recog.err_handler.report_match(&mut recog.base); + recog.base.consume(&mut recog.err_handler); + } + /*InvokeRule expression*/ + recog.base.set_state(157); + recog.expression_rec(5)?; + + } + } + , + 4 =>{ + { + /*recRuleLabeledAltStartAction*/ + let mut tmp = ExpEqualityContextExt::new(&**ExpressionContextExt::new(_parentctx.clone(), _parentState)); + recog.push_new_recursion_context(tmp.clone(), _startState, RULE_expression)?; + _localctx = tmp; + recog.base.set_state(158); + if !({let _localctx = Some(_localctx.clone()); + recog.precpred(None, 3)}) { + Err(FailedPredicateError::new(&mut recog.base, Some("recog.precpred(None, 3)".to_owned()), None))?; + } + recog.base.set_state(159); + if let ExpressionContextAll::ExpEqualityContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ + ctx.op = recog.base.input.lt(1).cloned(); } else {unreachable!("cant cast");} + _la = recog.base.input.la(1); + if { !(_la==YarnSpinnerParser_OPERATOR_LOGICAL_EQUALS || _la==YarnSpinnerParser_OPERATOR_LOGICAL_NOT_EQUALS) } { + let tmp = recog.err_handler.recover_inline(&mut recog.base)?; + if let ExpressionContextAll::ExpEqualityContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ + ctx.op = Some(tmp.clone()); } else {unreachable!("cant cast");} + + } + else { + if recog.base.input.la(1)==TOKEN_EOF { recog.base.matched_eof = true }; + recog.err_handler.report_match(&mut recog.base); + recog.base.consume(&mut recog.err_handler); + } + /*InvokeRule expression*/ + recog.base.set_state(160); + recog.expression_rec(4)?; + + } + } + , + 5 =>{ + { + /*recRuleLabeledAltStartAction*/ + let mut tmp = ExpAndOrXorContextExt::new(&**ExpressionContextExt::new(_parentctx.clone(), _parentState)); + recog.push_new_recursion_context(tmp.clone(), _startState, RULE_expression)?; + _localctx = tmp; + recog.base.set_state(161); + if !({let _localctx = Some(_localctx.clone()); + recog.precpred(None, 2)}) { + Err(FailedPredicateError::new(&mut recog.base, Some("recog.precpred(None, 2)".to_owned()), None))?; + } + recog.base.set_state(162); + if let ExpressionContextAll::ExpAndOrXorContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ + ctx.op = recog.base.input.lt(1).cloned(); } else {unreachable!("cant cast");} + _la = recog.base.input.la(1); + if { !(((((_la - 38)) & !0x3f) == 0 && ((1usize << (_la - 38)) & 7) != 0)) } { + let tmp = recog.err_handler.recover_inline(&mut recog.base)?; + if let ExpressionContextAll::ExpAndOrXorContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ + ctx.op = Some(tmp.clone()); } else {unreachable!("cant cast");} + + } + else { + if recog.base.input.la(1)==TOKEN_EOF { recog.base.matched_eof = true }; + recog.err_handler.report_match(&mut recog.base); + recog.base.consume(&mut recog.err_handler); + } + /*InvokeRule expression*/ + recog.base.set_state(163); + recog.expression_rec(3)?; + + } + } + + _ => {} + } + } + } + recog.base.set_state(168); + recog.err_handler.sync(&mut recog.base)?; + _alt = recog.interpreter.adaptive_predict(14,&mut recog.base)?; + } + } + Ok(()) + })(); + match result { + Ok(_) => {}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re)=>{ + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?;} + } + recog.base.unroll_recursion_context(_parentctx)?; + + Ok(_localctx) + } } - -pub type ExpNotContext<'input> = BaseParserRuleContext<'input, ExpNotContextExt<'input>>; - -pub trait ExpNotContextAttrs<'input>: YarnSpinnerParserContext<'input> { - fn expression(&self) -> Option>> - where - Self: Sized, - { - self.child_of_type(0) - } - /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_NOT - /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_NOT - fn OPERATOR_LOGICAL_NOT(&self) -> Option>> - where - Self: Sized, - { - self.get_token(OPERATOR_LOGICAL_NOT, 0) - } +//------------------- value ---------------- +#[derive(Debug)] +pub enum ValueContextAll<'input>{ + ValueNullContext(ValueNullContext<'input>), + ValueNumberContext(ValueNumberContext<'input>), + ValueTrueContext(ValueTrueContext<'input>), + ValueFalseContext(ValueFalseContext<'input>), + ValueFuncContext(ValueFuncContext<'input>), + ValueVarContext(ValueVarContext<'input>), + ValueStringContext(ValueStringContext<'input>), +Error(ValueContext<'input>) } +antlr4rust::tid!{ValueContextAll<'a>} + +impl<'input> antlr4rust::parser_rule_context::DerefSeal for ValueContextAll<'input>{} -impl<'input> ExpNotContextAttrs<'input> for ExpNotContext<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for ValueContextAll<'input>{} -pub struct ExpNotContextExt<'input> { - base: ExpressionContextExt<'input>, - pub op: Option>, - ph: PhantomData<&'input str>, +impl<'input> Deref for ValueContextAll<'input>{ + type Target = dyn ValueContextAttrs<'input> + 'input; + fn deref(&self) -> &Self::Target{ + use ValueContextAll::*; + match self{ + ValueNullContext(inner) => inner, + ValueNumberContext(inner) => inner, + ValueTrueContext(inner) => inner, + ValueFalseContext(inner) => inner, + ValueFuncContext(inner) => inner, + ValueVarContext(inner) => inner, + ValueStringContext(inner) => inner, +Error(inner) => inner + } + } +} +impl<'input,'a> Visitable + 'a> for ValueContextAll<'input>{ + fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { self.deref().accept(visitor) } +} +impl<'input,'a> Listenable + 'a> for ValueContextAll<'input>{ + fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { self.deref().enter(listener) } + fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { self.deref().exit(listener) } } -antlr_rust::tid! {ExpNotContextExt<'a>} -impl<'input> YarnSpinnerParserContext<'input> for ExpNotContext<'input> {} -impl<'input, 'a> Listenable + 'a> for ExpNotContext<'input> { - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_expNot(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_expNot(self); - listener.exit_every_rule(self); - } +pub type ValueContext<'input> = BaseParserRuleContext<'input,ValueContextExt<'input>>; + +#[derive(Clone)] +pub struct ValueContextExt<'input>{ +ph:PhantomData<&'input str> } -impl<'input, 'a> Visitable + 'a> for ExpNotContext<'input> { - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_expNot(self); - } +impl<'input> YarnSpinnerParserContext<'input> for ValueContext<'input>{} + +impl<'input,'a> Listenable + 'a> for ValueContext<'input>{ } -impl<'input> CustomRuleContext<'input> for ExpNotContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_expression - } - //fn type_rule_index() -> usize where Self: Sized { RULE_expression } +impl<'input,'a> Visitable + 'a> for ValueContext<'input>{ } -impl<'input> Borrow> for ExpNotContext<'input> { - fn borrow(&self) -> &ExpressionContextExt<'input> { - &self.base - } +impl<'input> CustomRuleContext<'input> for ValueContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_value } + //fn type_rule_index() -> usize where Self: Sized { RULE_value } } -impl<'input> BorrowMut> for ExpNotContext<'input> { - fn borrow_mut(&mut self) -> &mut ExpressionContextExt<'input> { - &mut self.base - } +antlr4rust::tid!{ValueContextExt<'a>} + +impl<'input> ValueContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + ValueContextAll::Error( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,ValueContextExt{ + + ph:PhantomData + }), + ) + ) + } } -impl<'input> ExpressionContextAttrs<'input> for ExpNotContext<'input> {} +pub trait ValueContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ + -impl<'input> ExpNotContextExt<'input> { - fn new(ctx: &dyn ExpressionContextAttrs<'input>) -> Rc> { - Rc::new(ExpressionContextAll::ExpNotContext( - BaseParserRuleContext::copy_from( - ctx, - ExpNotContextExt { - op: None, - base: ctx.borrow().clone(), - ph: PhantomData, - }, - ), - )) - } } -pub type ExpValueContext<'input> = BaseParserRuleContext<'input, ExpValueContextExt<'input>>; +impl<'input> ValueContextAttrs<'input> for ValueContext<'input>{} -pub trait ExpValueContextAttrs<'input>: YarnSpinnerParserContext<'input> { - fn value(&self) -> Option>> - where - Self: Sized, - { - self.child_of_type(0) - } +pub type ValueNullContext<'input> = BaseParserRuleContext<'input,ValueNullContextExt<'input>>; + +pub trait ValueNullContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + /// Retrieves first TerminalNode corresponding to token KEYWORD_NULL + /// Returns `None` if there is no child corresponding to token KEYWORD_NULL + fn KEYWORD_NULL(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_KEYWORD_NULL, 0) + } } -impl<'input> ExpValueContextAttrs<'input> for ExpValueContext<'input> {} +impl<'input> ValueNullContextAttrs<'input> for ValueNullContext<'input>{} -pub struct ExpValueContextExt<'input> { - base: ExpressionContextExt<'input>, - ph: PhantomData<&'input str>, +pub struct ValueNullContextExt<'input>{ + base:ValueContextExt<'input>, + ph:PhantomData<&'input str> } -antlr_rust::tid! {ExpValueContextExt<'a>} +antlr4rust::tid!{ValueNullContextExt<'a>} -impl<'input> YarnSpinnerParserContext<'input> for ExpValueContext<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for ValueNullContext<'input>{} -impl<'input, 'a> Listenable + 'a> - for ExpValueContext<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_expValue(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_expValue(self); - listener.exit_every_rule(self); - } +impl<'input,'a> Listenable + 'a> for ValueNullContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_valueNull(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_valueNull(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input, 'a> Visitable + 'a> for ExpValueContext<'input> { - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_expValue(self); - } +impl<'input,'a> Visitable + 'a> for ValueNullContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_valueNull(self); + } } -impl<'input> CustomRuleContext<'input> for ExpValueContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_expression - } - //fn type_rule_index() -> usize where Self: Sized { RULE_expression } +impl<'input> CustomRuleContext<'input> for ValueNullContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_value } + //fn type_rule_index() -> usize where Self: Sized { RULE_value } } -impl<'input> Borrow> for ExpValueContext<'input> { - fn borrow(&self) -> &ExpressionContextExt<'input> { - &self.base - } +impl<'input> Borrow> for ValueNullContext<'input>{ + fn borrow(&self) -> &ValueContextExt<'input> { &self.base } } -impl<'input> BorrowMut> for ExpValueContext<'input> { - fn borrow_mut(&mut self) -> &mut ExpressionContextExt<'input> { - &mut self.base - } +impl<'input> BorrowMut> for ValueNullContext<'input>{ + fn borrow_mut(&mut self) -> &mut ValueContextExt<'input> { &mut self.base } } -impl<'input> ExpressionContextAttrs<'input> for ExpValueContext<'input> {} +impl<'input> ValueContextAttrs<'input> for ValueNullContext<'input> {} -impl<'input> ExpValueContextExt<'input> { - fn new(ctx: &dyn ExpressionContextAttrs<'input>) -> Rc> { - Rc::new(ExpressionContextAll::ExpValueContext( - BaseParserRuleContext::copy_from( - ctx, - ExpValueContextExt { - base: ctx.borrow().clone(), - ph: PhantomData, - }, - ), - )) - } +impl<'input> ValueNullContextExt<'input>{ + fn new(ctx: &dyn ValueContextAttrs<'input>) -> Rc> { + Rc::new( + ValueContextAll::ValueNullContext( + BaseParserRuleContext::copy_from(ctx,ValueNullContextExt{ + base: ctx.borrow().clone(), + ph:PhantomData + }) + ) + ) + } } -pub type ExpEqualityContext<'input> = BaseParserRuleContext<'input, ExpEqualityContextExt<'input>>; +pub type ValueNumberContext<'input> = BaseParserRuleContext<'input,ValueNumberContextExt<'input>>; -pub trait ExpEqualityContextAttrs<'input>: YarnSpinnerParserContext<'input> { - fn expression_all(&self) -> Vec>> - where - Self: Sized, - { - self.children_of_type() - } - fn expression(&self, i: usize) -> Option>> - where - Self: Sized, - { - self.child_of_type(i) - } - /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_EQUALS - /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_EQUALS - fn OPERATOR_LOGICAL_EQUALS( - &self, - ) -> Option>> - where - Self: Sized, - { - self.get_token(OPERATOR_LOGICAL_EQUALS, 0) - } - /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_NOT_EQUALS - /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_NOT_EQUALS - fn OPERATOR_LOGICAL_NOT_EQUALS( - &self, - ) -> Option>> - where - Self: Sized, - { - self.get_token(OPERATOR_LOGICAL_NOT_EQUALS, 0) - } +pub trait ValueNumberContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + /// Retrieves first TerminalNode corresponding to token NUMBER + /// Returns `None` if there is no child corresponding to token NUMBER + fn NUMBER(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_NUMBER, 0) + } } -impl<'input> ExpEqualityContextAttrs<'input> for ExpEqualityContext<'input> {} +impl<'input> ValueNumberContextAttrs<'input> for ValueNumberContext<'input>{} -pub struct ExpEqualityContextExt<'input> { - base: ExpressionContextExt<'input>, - pub op: Option>, - ph: PhantomData<&'input str>, +pub struct ValueNumberContextExt<'input>{ + base:ValueContextExt<'input>, + ph:PhantomData<&'input str> } -antlr_rust::tid! {ExpEqualityContextExt<'a>} +antlr4rust::tid!{ValueNumberContextExt<'a>} -impl<'input> YarnSpinnerParserContext<'input> for ExpEqualityContext<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for ValueNumberContext<'input>{} -impl<'input, 'a> Listenable + 'a> - for ExpEqualityContext<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_expEquality(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_expEquality(self); - listener.exit_every_rule(self); - } +impl<'input,'a> Listenable + 'a> for ValueNumberContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_valueNumber(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_valueNumber(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input, 'a> Visitable + 'a> - for ExpEqualityContext<'input> -{ - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_expEquality(self); - } +impl<'input,'a> Visitable + 'a> for ValueNumberContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_valueNumber(self); + } } -impl<'input> CustomRuleContext<'input> for ExpEqualityContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_expression - } - //fn type_rule_index() -> usize where Self: Sized { RULE_expression } +impl<'input> CustomRuleContext<'input> for ValueNumberContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_value } + //fn type_rule_index() -> usize where Self: Sized { RULE_value } } -impl<'input> Borrow> for ExpEqualityContext<'input> { - fn borrow(&self) -> &ExpressionContextExt<'input> { - &self.base - } +impl<'input> Borrow> for ValueNumberContext<'input>{ + fn borrow(&self) -> &ValueContextExt<'input> { &self.base } } -impl<'input> BorrowMut> for ExpEqualityContext<'input> { - fn borrow_mut(&mut self) -> &mut ExpressionContextExt<'input> { - &mut self.base - } +impl<'input> BorrowMut> for ValueNumberContext<'input>{ + fn borrow_mut(&mut self) -> &mut ValueContextExt<'input> { &mut self.base } } -impl<'input> ExpressionContextAttrs<'input> for ExpEqualityContext<'input> {} +impl<'input> ValueContextAttrs<'input> for ValueNumberContext<'input> {} -impl<'input> ExpEqualityContextExt<'input> { - fn new(ctx: &dyn ExpressionContextAttrs<'input>) -> Rc> { - Rc::new(ExpressionContextAll::ExpEqualityContext( - BaseParserRuleContext::copy_from( - ctx, - ExpEqualityContextExt { - op: None, - base: ctx.borrow().clone(), - ph: PhantomData, - }, - ), - )) - } +impl<'input> ValueNumberContextExt<'input>{ + fn new(ctx: &dyn ValueContextAttrs<'input>) -> Rc> { + Rc::new( + ValueContextAll::ValueNumberContext( + BaseParserRuleContext::copy_from(ctx,ValueNumberContextExt{ + base: ctx.borrow().clone(), + ph:PhantomData + }) + ) + ) + } } -impl<'input, I, H> YarnSpinnerParser<'input, I, H> -where - I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>, - H: ErrorStrategy<'input, BaseParserType<'input, I>>, -{ - pub fn expression(&mut self) -> Result>, ANTLRError> { - self.expression_rec(0) - } - - fn expression_rec( - &mut self, - _p: isize, - ) -> Result>, ANTLRError> { - let recog = self; - let _parentctx = recog.ctx.take(); - let _parentState = recog.base.get_state(); - let mut _localctx = ExpressionContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog - .base - .enter_recursion_rule(_localctx.clone(), 20, RULE_expression, _p); - let mut _localctx: Rc = _localctx; - let mut _prevctx = _localctx.clone(); - let _startState = 20; - let mut _la: isize = -1; - let result: Result<(), ANTLRError> = (|| { - let mut _alt: isize; - //recog.base.enter_outer_alt(_localctx.clone(), 1); - recog.base.enter_outer_alt(None, 1); - { - recog.base.set_state(147); - recog.err_handler.sync(&mut recog.base)?; - match recog.base.input.la(1) { - LPAREN => { - { - let mut tmp = ExpParensContextExt::new(&**_localctx); - recog.ctx = Some(tmp.clone()); - _localctx = tmp; - _prevctx = _localctx.clone(); - - recog.base.set_state(138); - recog.base.match_token(LPAREN, &mut recog.err_handler)?; - - /*InvokeRule expression*/ - recog.base.set_state(139); - recog.expression_rec(0)?; - - recog.base.set_state(140); - recog.base.match_token(RPAREN, &mut recog.err_handler)?; - } - } - - OPERATOR_MATHS_SUBTRACTION => { - { - let mut tmp = ExpNegativeContextExt::new(&**_localctx); - recog.ctx = Some(tmp.clone()); - _localctx = tmp; - _prevctx = _localctx.clone(); - recog.base.set_state(142); - let tmp = recog - .base - .match_token(OPERATOR_MATHS_SUBTRACTION, &mut recog.err_handler)?; - if let ExpressionContextAll::ExpNegativeContext(ctx) = - cast_mut::<_, ExpressionContextAll>(&mut _localctx) - { - ctx.op = Some(tmp.clone()); - } else { - unreachable!("cant cast"); - } - - /*InvokeRule expression*/ - recog.base.set_state(143); - recog.expression_rec(8)?; - } - } - - OPERATOR_LOGICAL_NOT => { - { - let mut tmp = ExpNotContextExt::new(&**_localctx); - recog.ctx = Some(tmp.clone()); - _localctx = tmp; - _prevctx = _localctx.clone(); - recog.base.set_state(144); - let tmp = recog - .base - .match_token(OPERATOR_LOGICAL_NOT, &mut recog.err_handler)?; - if let ExpressionContextAll::ExpNotContext(ctx) = - cast_mut::<_, ExpressionContextAll>(&mut _localctx) - { - ctx.op = Some(tmp.clone()); - } else { - unreachable!("cant cast"); - } - - /*InvokeRule expression*/ - recog.base.set_state(145); - recog.expression_rec(7)?; - } - } - - KEYWORD_TRUE | KEYWORD_FALSE | KEYWORD_NULL | STRING | FUNC_ID | VAR_ID - | NUMBER => { - { - let mut tmp = ExpValueContextExt::new(&**_localctx); - recog.ctx = Some(tmp.clone()); - _localctx = tmp; - _prevctx = _localctx.clone(); - /*InvokeRule value*/ - recog.base.set_state(146); - recog.value()?; - } - } - - _ => Err(ANTLRError::NoAltError(NoViableAltError::new( - &mut recog.base, - )))?, - } - - let tmp = recog.input.lt(-1).cloned(); - recog.ctx.as_ref().unwrap().set_stop(tmp); - recog.base.set_state(166); - recog.err_handler.sync(&mut recog.base)?; - _alt = recog.interpreter.adaptive_predict(14, &mut recog.base)?; - while { _alt != 2 && _alt != INVALID_ALT } { - if _alt == 1 { - recog.trigger_exit_rule_event(); - _prevctx = _localctx.clone(); - { - recog.base.set_state(164); - recog.err_handler.sync(&mut recog.base)?; - match recog.interpreter.adaptive_predict(13, &mut recog.base)? { - 1 => { - { - /*recRuleLabeledAltStartAction*/ - let mut tmp = ExpMultDivModContextExt::new( - &**ExpressionContextExt::new( - _parentctx.clone(), - _parentState, - ), - ); - recog.push_new_recursion_context( - tmp.clone(), - _startState, - RULE_expression, - ); - _localctx = tmp; - recog.base.set_state(149); - if !({ recog.precpred(None, 6) }) { - Err(FailedPredicateError::new( - &mut recog.base, - Some("recog.precpred(None, 6)".to_owned()), - None, - ))?; - } - recog.base.set_state(150); - if let ExpressionContextAll::ExpMultDivModContext(ctx) = - cast_mut::<_, ExpressionContextAll>(&mut _localctx) - { - ctx.op = recog.base.input.lt(1).cloned(); - } else { - unreachable!("cant cast"); - } - _la = recog.base.input.la(1); - if { - !(((_la - 49) & !0x3f) == 0 - && ((1usize << (_la - 49)) - & ((1usize - << (OPERATOR_MATHS_MULTIPLICATION - 49)) - | (1usize - << (OPERATOR_MATHS_DIVISION - 49)) - | (1usize - << (OPERATOR_MATHS_MODULUS - 49)))) - != 0) - } { - let tmp = recog - .err_handler - .recover_inline(&mut recog.base)?; - if let ExpressionContextAll::ExpMultDivModContext(ctx) = - cast_mut::<_, ExpressionContextAll>(&mut _localctx) - { - ctx.op = Some(tmp.clone()); - } else { - unreachable!("cant cast"); - } - } else { - if recog.base.input.la(1) == TOKEN_EOF { - recog.base.matched_eof = true - }; - recog.err_handler.report_match(&mut recog.base); - recog.base.consume(&mut recog.err_handler); - } - /*InvokeRule expression*/ - recog.base.set_state(151); - recog.expression_rec(7)?; - } - } - 2 => { - { - /*recRuleLabeledAltStartAction*/ - let mut tmp = - ExpAddSubContextExt::new(&**ExpressionContextExt::new( - _parentctx.clone(), - _parentState, - )); - recog.push_new_recursion_context( - tmp.clone(), - _startState, - RULE_expression, - ); - _localctx = tmp; - recog.base.set_state(152); - if !({ recog.precpred(None, 5) }) { - Err(FailedPredicateError::new( - &mut recog.base, - Some("recog.precpred(None, 5)".to_owned()), - None, - ))?; - } - recog.base.set_state(153); - if let ExpressionContextAll::ExpAddSubContext(ctx) = - cast_mut::<_, ExpressionContextAll>(&mut _localctx) - { - ctx.op = recog.base.input.lt(1).cloned(); - } else { - unreachable!("cant cast"); - } - _la = recog.base.input.la(1); - if { - !(_la == OPERATOR_MATHS_ADDITION - || _la == OPERATOR_MATHS_SUBTRACTION) - } { - let tmp = recog - .err_handler - .recover_inline(&mut recog.base)?; - if let ExpressionContextAll::ExpAddSubContext(ctx) = - cast_mut::<_, ExpressionContextAll>(&mut _localctx) - { - ctx.op = Some(tmp.clone()); - } else { - unreachable!("cant cast"); - } - } else { - if recog.base.input.la(1) == TOKEN_EOF { - recog.base.matched_eof = true - }; - recog.err_handler.report_match(&mut recog.base); - recog.base.consume(&mut recog.err_handler); - } - /*InvokeRule expression*/ - recog.base.set_state(154); - recog.expression_rec(6)?; - } - } - 3 => { - { - /*recRuleLabeledAltStartAction*/ - let mut tmp = ExpComparisonContextExt::new( - &**ExpressionContextExt::new( - _parentctx.clone(), - _parentState, - ), - ); - recog.push_new_recursion_context( - tmp.clone(), - _startState, - RULE_expression, - ); - _localctx = tmp; - recog.base.set_state(155); - if !({ recog.precpred(None, 4) }) { - Err(FailedPredicateError::new( - &mut recog.base, - Some("recog.precpred(None, 4)".to_owned()), - None, - ))?; - } - recog.base.set_state(156); - if let ExpressionContextAll::ExpComparisonContext(ctx) = - cast_mut::<_, ExpressionContextAll>(&mut _localctx) - { - ctx.op = recog.base.input.lt(1).cloned(); - } else { - unreachable!("cant cast"); - } - _la = recog.base.input.la(1); - if { - !(((_la - 32) & !0x3f) == 0 - && ((1usize << (_la - 32)) - & ((1usize - << (OPERATOR_LOGICAL_LESS_THAN_EQUALS - - 32)) - | (1usize - << (OPERATOR_LOGICAL_GREATER_THAN_EQUALS - - 32)) - | (1usize - << (OPERATOR_LOGICAL_LESS - 32)) - | (1usize - << (OPERATOR_LOGICAL_GREATER - 32)))) - != 0) - } { - let tmp = recog - .err_handler - .recover_inline(&mut recog.base)?; - if let ExpressionContextAll::ExpComparisonContext(ctx) = - cast_mut::<_, ExpressionContextAll>(&mut _localctx) - { - ctx.op = Some(tmp.clone()); - } else { - unreachable!("cant cast"); - } - } else { - if recog.base.input.la(1) == TOKEN_EOF { - recog.base.matched_eof = true - }; - recog.err_handler.report_match(&mut recog.base); - recog.base.consume(&mut recog.err_handler); - } - /*InvokeRule expression*/ - recog.base.set_state(157); - recog.expression_rec(5)?; - } - } - 4 => { - { - /*recRuleLabeledAltStartAction*/ - let mut tmp = ExpEqualityContextExt::new( - &**ExpressionContextExt::new( - _parentctx.clone(), - _parentState, - ), - ); - recog.push_new_recursion_context( - tmp.clone(), - _startState, - RULE_expression, - ); - _localctx = tmp; - recog.base.set_state(158); - if !({ recog.precpred(None, 3) }) { - Err(FailedPredicateError::new( - &mut recog.base, - Some("recog.precpred(None, 3)".to_owned()), - None, - ))?; - } - recog.base.set_state(159); - if let ExpressionContextAll::ExpEqualityContext(ctx) = - cast_mut::<_, ExpressionContextAll>(&mut _localctx) - { - ctx.op = recog.base.input.lt(1).cloned(); - } else { - unreachable!("cant cast"); - } - _la = recog.base.input.la(1); - if { - !(_la == OPERATOR_LOGICAL_EQUALS - || _la == OPERATOR_LOGICAL_NOT_EQUALS) - } { - let tmp = recog - .err_handler - .recover_inline(&mut recog.base)?; - if let ExpressionContextAll::ExpEqualityContext(ctx) = - cast_mut::<_, ExpressionContextAll>(&mut _localctx) - { - ctx.op = Some(tmp.clone()); - } else { - unreachable!("cant cast"); - } - } else { - if recog.base.input.la(1) == TOKEN_EOF { - recog.base.matched_eof = true - }; - recog.err_handler.report_match(&mut recog.base); - recog.base.consume(&mut recog.err_handler); - } - /*InvokeRule expression*/ - recog.base.set_state(160); - recog.expression_rec(4)?; - } - } - 5 => { - { - /*recRuleLabeledAltStartAction*/ - let mut tmp = ExpAndOrXorContextExt::new( - &**ExpressionContextExt::new( - _parentctx.clone(), - _parentState, - ), - ); - recog.push_new_recursion_context( - tmp.clone(), - _startState, - RULE_expression, - ); - _localctx = tmp; - recog.base.set_state(161); - if !({ recog.precpred(None, 2) }) { - Err(FailedPredicateError::new( - &mut recog.base, - Some("recog.precpred(None, 2)".to_owned()), - None, - ))?; - } - recog.base.set_state(162); - if let ExpressionContextAll::ExpAndOrXorContext(ctx) = - cast_mut::<_, ExpressionContextAll>(&mut _localctx) - { - ctx.op = recog.base.input.lt(1).cloned(); - } else { - unreachable!("cant cast"); - } - _la = recog.base.input.la(1); - if { - !(((_la - 38) & !0x3f) == 0 - && ((1usize << (_la - 38)) - & ((1usize << (OPERATOR_LOGICAL_AND - 38)) - | (1usize << (OPERATOR_LOGICAL_OR - 38)) - | (1usize << (OPERATOR_LOGICAL_XOR - 38)))) - != 0) - } { - let tmp = recog - .err_handler - .recover_inline(&mut recog.base)?; - if let ExpressionContextAll::ExpAndOrXorContext(ctx) = - cast_mut::<_, ExpressionContextAll>(&mut _localctx) - { - ctx.op = Some(tmp.clone()); - } else { - unreachable!("cant cast"); - } - } else { - if recog.base.input.la(1) == TOKEN_EOF { - recog.base.matched_eof = true - }; - recog.err_handler.report_match(&mut recog.base); - recog.base.consume(&mut recog.err_handler); - } - /*InvokeRule expression*/ - recog.base.set_state(163); - recog.expression_rec(3)?; - } - } - - _ => {} - } - } - } - recog.base.set_state(168); - recog.err_handler.sync(&mut recog.base)?; - _alt = recog.interpreter.adaptive_predict(14, &mut recog.base)?; - } - } - Ok(()) - })(); - match result { - Ok(_) => {} - Err(e @ ANTLRError::FallThrough(_)) => return Err(e), - Err(ref re) => { - //_localctx.exception = re; - recog.err_handler.report_error(&mut recog.base, re); - recog.err_handler.recover(&mut recog.base, re)?; - } - } - recog.base.unroll_recursion_context(_parentctx); +pub type ValueTrueContext<'input> = BaseParserRuleContext<'input,ValueTrueContextExt<'input>>; - Ok(_localctx) - } +pub trait ValueTrueContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + /// Retrieves first TerminalNode corresponding to token KEYWORD_TRUE + /// Returns `None` if there is no child corresponding to token KEYWORD_TRUE + fn KEYWORD_TRUE(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_KEYWORD_TRUE, 0) + } } -//------------------- value ---------------- -#[derive(Debug)] -pub enum ValueContextAll<'input> { - ValueNullContext(ValueNullContext<'input>), - ValueNumberContext(ValueNumberContext<'input>), - ValueTrueContext(ValueTrueContext<'input>), - ValueFalseContext(ValueFalseContext<'input>), - ValueFuncContext(ValueFuncContext<'input>), - ValueVarContext(ValueVarContext<'input>), - ValueStringContext(ValueStringContext<'input>), - Error(ValueContext<'input>), + +impl<'input> ValueTrueContextAttrs<'input> for ValueTrueContext<'input>{} + +pub struct ValueTrueContextExt<'input>{ + base:ValueContextExt<'input>, + ph:PhantomData<&'input str> } -antlr_rust::tid! {ValueContextAll<'a>} -impl<'input> antlr_rust::parser_rule_context::DerefSeal for ValueContextAll<'input> {} +antlr4rust::tid!{ValueTrueContextExt<'a>} -impl<'input> YarnSpinnerParserContext<'input> for ValueContextAll<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for ValueTrueContext<'input>{} -impl<'input> Deref for ValueContextAll<'input> { - type Target = dyn ValueContextAttrs<'input> + 'input; - fn deref(&self) -> &Self::Target { - use ValueContextAll::*; - match self { - ValueNullContext(inner) => inner, - ValueNumberContext(inner) => inner, - ValueTrueContext(inner) => inner, - ValueFalseContext(inner) => inner, - ValueFuncContext(inner) => inner, - ValueVarContext(inner) => inner, - ValueStringContext(inner) => inner, - Error(inner) => inner, - } - } -} -impl<'input, 'a> Visitable + 'a> for ValueContextAll<'input> { - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - self.deref().accept(visitor) - } +impl<'input,'a> Listenable + 'a> for ValueTrueContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_valueTrue(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_valueTrue(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input, 'a> Listenable + 'a> - for ValueContextAll<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - self.deref().enter(listener) - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - self.deref().exit(listener) - } + +impl<'input,'a> Visitable + 'a> for ValueTrueContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_valueTrue(self); + } } -pub type ValueContext<'input> = BaseParserRuleContext<'input, ValueContextExt<'input>>; +impl<'input> CustomRuleContext<'input> for ValueTrueContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_value } + //fn type_rule_index() -> usize where Self: Sized { RULE_value } +} -#[derive(Clone)] -pub struct ValueContextExt<'input> { - ph: PhantomData<&'input str>, +impl<'input> Borrow> for ValueTrueContext<'input>{ + fn borrow(&self) -> &ValueContextExt<'input> { &self.base } +} +impl<'input> BorrowMut> for ValueTrueContext<'input>{ + fn borrow_mut(&mut self) -> &mut ValueContextExt<'input> { &mut self.base } } -impl<'input> YarnSpinnerParserContext<'input> for ValueContext<'input> {} +impl<'input> ValueContextAttrs<'input> for ValueTrueContext<'input> {} -impl<'input, 'a> Listenable + 'a> for ValueContext<'input> {} +impl<'input> ValueTrueContextExt<'input>{ + fn new(ctx: &dyn ValueContextAttrs<'input>) -> Rc> { + Rc::new( + ValueContextAll::ValueTrueContext( + BaseParserRuleContext::copy_from(ctx,ValueTrueContextExt{ + base: ctx.borrow().clone(), + ph:PhantomData + }) + ) + ) + } +} -impl<'input, 'a> Visitable + 'a> for ValueContext<'input> {} +pub type ValueFalseContext<'input> = BaseParserRuleContext<'input,ValueFalseContextExt<'input>>; -impl<'input> CustomRuleContext<'input> for ValueContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_value - } - //fn type_rule_index() -> usize where Self: Sized { RULE_value } -} -antlr_rust::tid! {ValueContextExt<'a>} - -impl<'input> ValueContextExt<'input> { - fn new( - parent: Option + 'input>>, - invoking_state: isize, - ) -> Rc> { - Rc::new(ValueContextAll::Error( - BaseParserRuleContext::new_parser_ctx( - parent, - invoking_state, - ValueContextExt { ph: PhantomData }, - ), - )) - } +pub trait ValueFalseContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + /// Retrieves first TerminalNode corresponding to token KEYWORD_FALSE + /// Returns `None` if there is no child corresponding to token KEYWORD_FALSE + fn KEYWORD_FALSE(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_KEYWORD_FALSE, 0) + } } -pub trait ValueContextAttrs<'input>: - YarnSpinnerParserContext<'input> + BorrowMut> -{ +impl<'input> ValueFalseContextAttrs<'input> for ValueFalseContext<'input>{} + +pub struct ValueFalseContextExt<'input>{ + base:ValueContextExt<'input>, + ph:PhantomData<&'input str> } -impl<'input> ValueContextAttrs<'input> for ValueContext<'input> {} +antlr4rust::tid!{ValueFalseContextExt<'a>} -pub type ValueNullContext<'input> = BaseParserRuleContext<'input, ValueNullContextExt<'input>>; +impl<'input> YarnSpinnerParserContext<'input> for ValueFalseContext<'input>{} -pub trait ValueNullContextAttrs<'input>: YarnSpinnerParserContext<'input> { - /// Retrieves first TerminalNode corresponding to token KEYWORD_NULL - /// Returns `None` if there is no child corresponding to token KEYWORD_NULL - fn KEYWORD_NULL(&self) -> Option>> - where - Self: Sized, - { - self.get_token(KEYWORD_NULL, 0) - } +impl<'input,'a> Listenable + 'a> for ValueFalseContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_valueFalse(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_valueFalse(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input> ValueNullContextAttrs<'input> for ValueNullContext<'input> {} +impl<'input,'a> Visitable + 'a> for ValueFalseContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_valueFalse(self); + } +} -pub struct ValueNullContextExt<'input> { - base: ValueContextExt<'input>, - ph: PhantomData<&'input str>, +impl<'input> CustomRuleContext<'input> for ValueFalseContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_value } + //fn type_rule_index() -> usize where Self: Sized { RULE_value } } -antlr_rust::tid! {ValueNullContextExt<'a>} - -impl<'input> YarnSpinnerParserContext<'input> for ValueNullContext<'input> {} - -impl<'input, 'a> Listenable + 'a> - for ValueNullContext<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_valueNull(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_valueNull(self); - listener.exit_every_rule(self); - } +impl<'input> Borrow> for ValueFalseContext<'input>{ + fn borrow(&self) -> &ValueContextExt<'input> { &self.base } } - -impl<'input, 'a> Visitable + 'a> for ValueNullContext<'input> { - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_valueNull(self); - } +impl<'input> BorrowMut> for ValueFalseContext<'input>{ + fn borrow_mut(&mut self) -> &mut ValueContextExt<'input> { &mut self.base } } -impl<'input> CustomRuleContext<'input> for ValueNullContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_value - } - //fn type_rule_index() -> usize where Self: Sized { RULE_value } -} - -impl<'input> Borrow> for ValueNullContext<'input> { - fn borrow(&self) -> &ValueContextExt<'input> { - &self.base - } -} -impl<'input> BorrowMut> for ValueNullContext<'input> { - fn borrow_mut(&mut self) -> &mut ValueContextExt<'input> { - &mut self.base - } -} - -impl<'input> ValueContextAttrs<'input> for ValueNullContext<'input> {} +impl<'input> ValueContextAttrs<'input> for ValueFalseContext<'input> {} -impl<'input> ValueNullContextExt<'input> { - fn new(ctx: &dyn ValueContextAttrs<'input>) -> Rc> { - Rc::new(ValueContextAll::ValueNullContext( - BaseParserRuleContext::copy_from( - ctx, - ValueNullContextExt { - base: ctx.borrow().clone(), - ph: PhantomData, - }, - ), - )) - } +impl<'input> ValueFalseContextExt<'input>{ + fn new(ctx: &dyn ValueContextAttrs<'input>) -> Rc> { + Rc::new( + ValueContextAll::ValueFalseContext( + BaseParserRuleContext::copy_from(ctx,ValueFalseContextExt{ + base: ctx.borrow().clone(), + ph:PhantomData + }) + ) + ) + } } -pub type ValueNumberContext<'input> = BaseParserRuleContext<'input, ValueNumberContextExt<'input>>; +pub type ValueFuncContext<'input> = BaseParserRuleContext<'input,ValueFuncContextExt<'input>>; -pub trait ValueNumberContextAttrs<'input>: YarnSpinnerParserContext<'input> { - /// Retrieves first TerminalNode corresponding to token NUMBER - /// Returns `None` if there is no child corresponding to token NUMBER - fn NUMBER(&self) -> Option>> - where - Self: Sized, - { - self.get_token(NUMBER, 0) - } +pub trait ValueFuncContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + fn function_call(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) + } } -impl<'input> ValueNumberContextAttrs<'input> for ValueNumberContext<'input> {} +impl<'input> ValueFuncContextAttrs<'input> for ValueFuncContext<'input>{} -pub struct ValueNumberContextExt<'input> { - base: ValueContextExt<'input>, - ph: PhantomData<&'input str>, +pub struct ValueFuncContextExt<'input>{ + base:ValueContextExt<'input>, + ph:PhantomData<&'input str> } -antlr_rust::tid! {ValueNumberContextExt<'a>} +antlr4rust::tid!{ValueFuncContextExt<'a>} -impl<'input> YarnSpinnerParserContext<'input> for ValueNumberContext<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for ValueFuncContext<'input>{} -impl<'input, 'a> Listenable + 'a> - for ValueNumberContext<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_valueNumber(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_valueNumber(self); - listener.exit_every_rule(self); - } +impl<'input,'a> Listenable + 'a> for ValueFuncContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_valueFunc(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_valueFunc(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input, 'a> Visitable + 'a> - for ValueNumberContext<'input> -{ - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_valueNumber(self); - } +impl<'input,'a> Visitable + 'a> for ValueFuncContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_valueFunc(self); + } } -impl<'input> CustomRuleContext<'input> for ValueNumberContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_value - } - //fn type_rule_index() -> usize where Self: Sized { RULE_value } +impl<'input> CustomRuleContext<'input> for ValueFuncContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_value } + //fn type_rule_index() -> usize where Self: Sized { RULE_value } } -impl<'input> Borrow> for ValueNumberContext<'input> { - fn borrow(&self) -> &ValueContextExt<'input> { - &self.base - } +impl<'input> Borrow> for ValueFuncContext<'input>{ + fn borrow(&self) -> &ValueContextExt<'input> { &self.base } } -impl<'input> BorrowMut> for ValueNumberContext<'input> { - fn borrow_mut(&mut self) -> &mut ValueContextExt<'input> { - &mut self.base - } +impl<'input> BorrowMut> for ValueFuncContext<'input>{ + fn borrow_mut(&mut self) -> &mut ValueContextExt<'input> { &mut self.base } } -impl<'input> ValueContextAttrs<'input> for ValueNumberContext<'input> {} +impl<'input> ValueContextAttrs<'input> for ValueFuncContext<'input> {} -impl<'input> ValueNumberContextExt<'input> { - fn new(ctx: &dyn ValueContextAttrs<'input>) -> Rc> { - Rc::new(ValueContextAll::ValueNumberContext( - BaseParserRuleContext::copy_from( - ctx, - ValueNumberContextExt { - base: ctx.borrow().clone(), - ph: PhantomData, - }, - ), - )) - } +impl<'input> ValueFuncContextExt<'input>{ + fn new(ctx: &dyn ValueContextAttrs<'input>) -> Rc> { + Rc::new( + ValueContextAll::ValueFuncContext( + BaseParserRuleContext::copy_from(ctx,ValueFuncContextExt{ + base: ctx.borrow().clone(), + ph:PhantomData + }) + ) + ) + } } -pub type ValueTrueContext<'input> = BaseParserRuleContext<'input, ValueTrueContextExt<'input>>; +pub type ValueVarContext<'input> = BaseParserRuleContext<'input,ValueVarContextExt<'input>>; -pub trait ValueTrueContextAttrs<'input>: YarnSpinnerParserContext<'input> { - /// Retrieves first TerminalNode corresponding to token KEYWORD_TRUE - /// Returns `None` if there is no child corresponding to token KEYWORD_TRUE - fn KEYWORD_TRUE(&self) -> Option>> - where - Self: Sized, - { - self.get_token(KEYWORD_TRUE, 0) - } +pub trait ValueVarContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + fn variable(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) + } } -impl<'input> ValueTrueContextAttrs<'input> for ValueTrueContext<'input> {} +impl<'input> ValueVarContextAttrs<'input> for ValueVarContext<'input>{} -pub struct ValueTrueContextExt<'input> { - base: ValueContextExt<'input>, - ph: PhantomData<&'input str>, +pub struct ValueVarContextExt<'input>{ + base:ValueContextExt<'input>, + ph:PhantomData<&'input str> } -antlr_rust::tid! {ValueTrueContextExt<'a>} +antlr4rust::tid!{ValueVarContextExt<'a>} -impl<'input> YarnSpinnerParserContext<'input> for ValueTrueContext<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for ValueVarContext<'input>{} -impl<'input, 'a> Listenable + 'a> - for ValueTrueContext<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_valueTrue(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_valueTrue(self); - listener.exit_every_rule(self); - } +impl<'input,'a> Listenable + 'a> for ValueVarContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_valueVar(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_valueVar(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input, 'a> Visitable + 'a> for ValueTrueContext<'input> { - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_valueTrue(self); - } +impl<'input,'a> Visitable + 'a> for ValueVarContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_valueVar(self); + } } -impl<'input> CustomRuleContext<'input> for ValueTrueContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_value - } - //fn type_rule_index() -> usize where Self: Sized { RULE_value } +impl<'input> CustomRuleContext<'input> for ValueVarContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_value } + //fn type_rule_index() -> usize where Self: Sized { RULE_value } } -impl<'input> Borrow> for ValueTrueContext<'input> { - fn borrow(&self) -> &ValueContextExt<'input> { - &self.base - } +impl<'input> Borrow> for ValueVarContext<'input>{ + fn borrow(&self) -> &ValueContextExt<'input> { &self.base } } -impl<'input> BorrowMut> for ValueTrueContext<'input> { - fn borrow_mut(&mut self) -> &mut ValueContextExt<'input> { - &mut self.base - } +impl<'input> BorrowMut> for ValueVarContext<'input>{ + fn borrow_mut(&mut self) -> &mut ValueContextExt<'input> { &mut self.base } } -impl<'input> ValueContextAttrs<'input> for ValueTrueContext<'input> {} +impl<'input> ValueContextAttrs<'input> for ValueVarContext<'input> {} -impl<'input> ValueTrueContextExt<'input> { - fn new(ctx: &dyn ValueContextAttrs<'input>) -> Rc> { - Rc::new(ValueContextAll::ValueTrueContext( - BaseParserRuleContext::copy_from( - ctx, - ValueTrueContextExt { - base: ctx.borrow().clone(), - ph: PhantomData, - }, - ), - )) - } +impl<'input> ValueVarContextExt<'input>{ + fn new(ctx: &dyn ValueContextAttrs<'input>) -> Rc> { + Rc::new( + ValueContextAll::ValueVarContext( + BaseParserRuleContext::copy_from(ctx,ValueVarContextExt{ + base: ctx.borrow().clone(), + ph:PhantomData + }) + ) + ) + } } -pub type ValueFalseContext<'input> = BaseParserRuleContext<'input, ValueFalseContextExt<'input>>; +pub type ValueStringContext<'input> = BaseParserRuleContext<'input,ValueStringContextExt<'input>>; -pub trait ValueFalseContextAttrs<'input>: YarnSpinnerParserContext<'input> { - /// Retrieves first TerminalNode corresponding to token KEYWORD_FALSE - /// Returns `None` if there is no child corresponding to token KEYWORD_FALSE - fn KEYWORD_FALSE(&self) -> Option>> - where - Self: Sized, - { - self.get_token(KEYWORD_FALSE, 0) - } +pub trait ValueStringContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + /// Retrieves first TerminalNode corresponding to token STRING + /// Returns `None` if there is no child corresponding to token STRING + fn STRING(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_STRING, 0) + } } -impl<'input> ValueFalseContextAttrs<'input> for ValueFalseContext<'input> {} +impl<'input> ValueStringContextAttrs<'input> for ValueStringContext<'input>{} -pub struct ValueFalseContextExt<'input> { - base: ValueContextExt<'input>, - ph: PhantomData<&'input str>, +pub struct ValueStringContextExt<'input>{ + base:ValueContextExt<'input>, + ph:PhantomData<&'input str> } -antlr_rust::tid! {ValueFalseContextExt<'a>} +antlr4rust::tid!{ValueStringContextExt<'a>} -impl<'input> YarnSpinnerParserContext<'input> for ValueFalseContext<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for ValueStringContext<'input>{} -impl<'input, 'a> Listenable + 'a> - for ValueFalseContext<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_valueFalse(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_valueFalse(self); - listener.exit_every_rule(self); - } +impl<'input,'a> Listenable + 'a> for ValueStringContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_valueString(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_valueString(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input, 'a> Visitable + 'a> - for ValueFalseContext<'input> -{ - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_valueFalse(self); - } +impl<'input,'a> Visitable + 'a> for ValueStringContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_valueString(self); + } } -impl<'input> CustomRuleContext<'input> for ValueFalseContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_value - } - //fn type_rule_index() -> usize where Self: Sized { RULE_value } +impl<'input> CustomRuleContext<'input> for ValueStringContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_value } + //fn type_rule_index() -> usize where Self: Sized { RULE_value } } -impl<'input> Borrow> for ValueFalseContext<'input> { - fn borrow(&self) -> &ValueContextExt<'input> { - &self.base - } -} -impl<'input> BorrowMut> for ValueFalseContext<'input> { - fn borrow_mut(&mut self) -> &mut ValueContextExt<'input> { - &mut self.base - } +impl<'input> Borrow> for ValueStringContext<'input>{ + fn borrow(&self) -> &ValueContextExt<'input> { &self.base } } - -impl<'input> ValueContextAttrs<'input> for ValueFalseContext<'input> {} - -impl<'input> ValueFalseContextExt<'input> { - fn new(ctx: &dyn ValueContextAttrs<'input>) -> Rc> { - Rc::new(ValueContextAll::ValueFalseContext( - BaseParserRuleContext::copy_from( - ctx, - ValueFalseContextExt { - base: ctx.borrow().clone(), - ph: PhantomData, - }, - ), - )) - } +impl<'input> BorrowMut> for ValueStringContext<'input>{ + fn borrow_mut(&mut self) -> &mut ValueContextExt<'input> { &mut self.base } } -pub type ValueFuncContext<'input> = BaseParserRuleContext<'input, ValueFuncContextExt<'input>>; +impl<'input> ValueContextAttrs<'input> for ValueStringContext<'input> {} -pub trait ValueFuncContextAttrs<'input>: YarnSpinnerParserContext<'input> { - fn function_call(&self) -> Option>> - where - Self: Sized, - { - self.child_of_type(0) - } +impl<'input> ValueStringContextExt<'input>{ + fn new(ctx: &dyn ValueContextAttrs<'input>) -> Rc> { + Rc::new( + ValueContextAll::ValueStringContext( + BaseParserRuleContext::copy_from(ctx,ValueStringContextExt{ + base: ctx.borrow().clone(), + ph:PhantomData + }) + ) + ) + } } -impl<'input> ValueFuncContextAttrs<'input> for ValueFuncContext<'input> {} - -pub struct ValueFuncContextExt<'input> { - base: ValueContextExt<'input>, - ph: PhantomData<&'input str>, +impl<'input, I> YarnSpinnerParser<'input, I> +where + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + pub fn value(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = ValueContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 22, RULE_value); + let mut _localctx: Rc = _localctx; + let result: Result<(), ANTLRError> = (|| { + + recog.base.set_state(176); + recog.err_handler.sync(&mut recog.base)?; + match recog.base.input.la(1) { + YarnSpinnerParser_NUMBER + => { + let tmp = ValueNumberContextExt::new(&**_localctx); + recog.base.enter_outer_alt(Some(tmp.clone()), 1)?; + _localctx = tmp; + { + recog.base.set_state(169); + recog.base.match_token(YarnSpinnerParser_NUMBER,&mut recog.err_handler)?; + + } + } + + YarnSpinnerParser_KEYWORD_TRUE + => { + let tmp = ValueTrueContextExt::new(&**_localctx); + recog.base.enter_outer_alt(Some(tmp.clone()), 2)?; + _localctx = tmp; + { + recog.base.set_state(170); + recog.base.match_token(YarnSpinnerParser_KEYWORD_TRUE,&mut recog.err_handler)?; + + } + } + + YarnSpinnerParser_KEYWORD_FALSE + => { + let tmp = ValueFalseContextExt::new(&**_localctx); + recog.base.enter_outer_alt(Some(tmp.clone()), 3)?; + _localctx = tmp; + { + recog.base.set_state(171); + recog.base.match_token(YarnSpinnerParser_KEYWORD_FALSE,&mut recog.err_handler)?; + + } + } + + YarnSpinnerParser_VAR_ID + => { + let tmp = ValueVarContextExt::new(&**_localctx); + recog.base.enter_outer_alt(Some(tmp.clone()), 4)?; + _localctx = tmp; + { + /*InvokeRule variable*/ + recog.base.set_state(172); + recog.variable()?; + + } + } + + YarnSpinnerParser_STRING + => { + let tmp = ValueStringContextExt::new(&**_localctx); + recog.base.enter_outer_alt(Some(tmp.clone()), 5)?; + _localctx = tmp; + { + recog.base.set_state(173); + recog.base.match_token(YarnSpinnerParser_STRING,&mut recog.err_handler)?; + + } + } + + YarnSpinnerParser_KEYWORD_NULL + => { + let tmp = ValueNullContextExt::new(&**_localctx); + recog.base.enter_outer_alt(Some(tmp.clone()), 6)?; + _localctx = tmp; + { + recog.base.set_state(174); + recog.base.match_token(YarnSpinnerParser_KEYWORD_NULL,&mut recog.err_handler)?; + + } + } + + YarnSpinnerParser_FUNC_ID + => { + let tmp = ValueFuncContextExt::new(&**_localctx); + recog.base.enter_outer_alt(Some(tmp.clone()), 7)?; + _localctx = tmp; + { + /*InvokeRule function_call*/ + recog.base.set_state(175); + recog.function_call()?; + + } + } + + _ => Err(ANTLRError::NoAltError(NoViableAltError::new(&mut recog.base)))? + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) + } } +//------------------- variable ---------------- +pub type VariableContextAll<'input> = VariableContext<'input>; -antlr_rust::tid! {ValueFuncContextExt<'a>} -impl<'input> YarnSpinnerParserContext<'input> for ValueFuncContext<'input> {} +pub type VariableContext<'input> = BaseParserRuleContext<'input,VariableContextExt<'input>>; -impl<'input, 'a> Listenable + 'a> - for ValueFuncContext<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_valueFunc(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_valueFunc(self); - listener.exit_every_rule(self); - } +#[derive(Clone)] +pub struct VariableContextExt<'input>{ +ph:PhantomData<&'input str> } -impl<'input, 'a> Visitable + 'a> for ValueFuncContext<'input> { - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_valueFunc(self); - } -} +impl<'input> YarnSpinnerParserContext<'input> for VariableContext<'input>{} -impl<'input> CustomRuleContext<'input> for ValueFuncContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_value - } - //fn type_rule_index() -> usize where Self: Sized { RULE_value } +impl<'input,'a> Listenable + 'a> for VariableContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_variable(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_variable(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input> Borrow> for ValueFuncContext<'input> { - fn borrow(&self) -> &ValueContextExt<'input> { - &self.base - } -} -impl<'input> BorrowMut> for ValueFuncContext<'input> { - fn borrow_mut(&mut self) -> &mut ValueContextExt<'input> { - &mut self.base - } +impl<'input,'a> Visitable + 'a> for VariableContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_variable(self); + } } -impl<'input> ValueContextAttrs<'input> for ValueFuncContext<'input> {} - -impl<'input> ValueFuncContextExt<'input> { - fn new(ctx: &dyn ValueContextAttrs<'input>) -> Rc> { - Rc::new(ValueContextAll::ValueFuncContext( - BaseParserRuleContext::copy_from( - ctx, - ValueFuncContextExt { - base: ctx.borrow().clone(), - ph: PhantomData, - }, - ), - )) - } +impl<'input> CustomRuleContext<'input> for VariableContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_variable } + //fn type_rule_index() -> usize where Self: Sized { RULE_variable } } +antlr4rust::tid!{VariableContextExt<'a>} -pub type ValueVarContext<'input> = BaseParserRuleContext<'input, ValueVarContextExt<'input>>; +impl<'input> VariableContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,VariableContextExt{ -pub trait ValueVarContextAttrs<'input>: YarnSpinnerParserContext<'input> { - fn variable(&self) -> Option>> - where - Self: Sized, - { - self.child_of_type(0) - } + ph:PhantomData + }), + ) + } } -impl<'input> ValueVarContextAttrs<'input> for ValueVarContext<'input> {} +pub trait VariableContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ -pub struct ValueVarContextExt<'input> { - base: ValueContextExt<'input>, - ph: PhantomData<&'input str>, +/// Retrieves first TerminalNode corresponding to token VAR_ID +/// Returns `None` if there is no child corresponding to token VAR_ID +fn VAR_ID(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_VAR_ID, 0) } -antlr_rust::tid! {ValueVarContextExt<'a>} +} -impl<'input> YarnSpinnerParserContext<'input> for ValueVarContext<'input> {} +impl<'input> VariableContextAttrs<'input> for VariableContext<'input>{} -impl<'input, 'a> Listenable + 'a> - for ValueVarContext<'input> +impl<'input, I> YarnSpinnerParser<'input, I> +where + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, { - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_valueVar(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_valueVar(self); - listener.exit_every_rule(self); - } + pub fn variable(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = VariableContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 24, RULE_variable); + let mut _localctx: Rc = _localctx; + let result: Result<(), ANTLRError> = (|| { + + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(178); + recog.base.match_token(YarnSpinnerParser_VAR_ID,&mut recog.err_handler)?; + + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) + } } +//------------------- function_call ---------------- +pub type Function_callContextAll<'input> = Function_callContext<'input>; -impl<'input, 'a> Visitable + 'a> for ValueVarContext<'input> { - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_valueVar(self); - } -} -impl<'input> CustomRuleContext<'input> for ValueVarContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_value - } - //fn type_rule_index() -> usize where Self: Sized { RULE_value } -} +pub type Function_callContext<'input> = BaseParserRuleContext<'input,Function_callContextExt<'input>>; -impl<'input> Borrow> for ValueVarContext<'input> { - fn borrow(&self) -> &ValueContextExt<'input> { - &self.base - } -} -impl<'input> BorrowMut> for ValueVarContext<'input> { - fn borrow_mut(&mut self) -> &mut ValueContextExt<'input> { - &mut self.base - } +#[derive(Clone)] +pub struct Function_callContextExt<'input>{ +ph:PhantomData<&'input str> } -impl<'input> ValueContextAttrs<'input> for ValueVarContext<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for Function_callContext<'input>{} -impl<'input> ValueVarContextExt<'input> { - fn new(ctx: &dyn ValueContextAttrs<'input>) -> Rc> { - Rc::new(ValueContextAll::ValueVarContext( - BaseParserRuleContext::copy_from( - ctx, - ValueVarContextExt { - base: ctx.borrow().clone(), - ph: PhantomData, - }, - ), - )) - } +impl<'input,'a> Listenable + 'a> for Function_callContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_function_call(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_function_call(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -pub type ValueStringContext<'input> = BaseParserRuleContext<'input, ValueStringContextExt<'input>>; +impl<'input,'a> Visitable + 'a> for Function_callContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_function_call(self); + } +} -pub trait ValueStringContextAttrs<'input>: YarnSpinnerParserContext<'input> { - /// Retrieves first TerminalNode corresponding to token STRING - /// Returns `None` if there is no child corresponding to token STRING - fn STRING(&self) -> Option>> - where - Self: Sized, - { - self.get_token(STRING, 0) - } +impl<'input> CustomRuleContext<'input> for Function_callContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_function_call } + //fn type_rule_index() -> usize where Self: Sized { RULE_function_call } } +antlr4rust::tid!{Function_callContextExt<'a>} -impl<'input> ValueStringContextAttrs<'input> for ValueStringContext<'input> {} +impl<'input> Function_callContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Function_callContextExt{ -pub struct ValueStringContextExt<'input> { - base: ValueContextExt<'input>, - ph: PhantomData<&'input str>, + ph:PhantomData + }), + ) + } } -antlr_rust::tid! {ValueStringContextExt<'a>} +pub trait Function_callContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ -impl<'input> YarnSpinnerParserContext<'input> for ValueStringContext<'input> {} - -impl<'input, 'a> Listenable + 'a> - for ValueStringContext<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_valueString(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_valueString(self); - listener.exit_every_rule(self); - } +/// Retrieves first TerminalNode corresponding to token FUNC_ID +/// Returns `None` if there is no child corresponding to token FUNC_ID +fn FUNC_ID(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_FUNC_ID, 0) } - -impl<'input, 'a> Visitable + 'a> - for ValueStringContext<'input> -{ - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_valueString(self); - } +/// Retrieves first TerminalNode corresponding to token LPAREN +/// Returns `None` if there is no child corresponding to token LPAREN +fn LPAREN(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_LPAREN, 0) } - -impl<'input> CustomRuleContext<'input> for ValueStringContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_value - } - //fn type_rule_index() -> usize where Self: Sized { RULE_value } +/// Retrieves first TerminalNode corresponding to token RPAREN +/// Returns `None` if there is no child corresponding to token RPAREN +fn RPAREN(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_RPAREN, 0) } - -impl<'input> Borrow> for ValueStringContext<'input> { - fn borrow(&self) -> &ValueContextExt<'input> { - &self.base - } +fn expression_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() } -impl<'input> BorrowMut> for ValueStringContext<'input> { - fn borrow_mut(&mut self) -> &mut ValueContextExt<'input> { - &mut self.base - } +fn expression(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) +} +/// Retrieves all `TerminalNode`s corresponding to token COMMA in current rule +fn COMMA_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +/// Retrieves 'i's TerminalNode corresponding to token COMMA, starting from 0. +/// Returns `None` if number of children corresponding to token COMMA is less or equal than `i`. +fn COMMA(&self, i: usize) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMA, i) } -impl<'input> ValueContextAttrs<'input> for ValueStringContext<'input> {} - -impl<'input> ValueStringContextExt<'input> { - fn new(ctx: &dyn ValueContextAttrs<'input>) -> Rc> { - Rc::new(ValueContextAll::ValueStringContext( - BaseParserRuleContext::copy_from( - ctx, - ValueStringContextExt { - base: ctx.borrow().clone(), - ph: PhantomData, - }, - ), - )) - } } -impl<'input, I, H> YarnSpinnerParser<'input, I, H> -where - I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>, - H: ErrorStrategy<'input, BaseParserType<'input, I>>, -{ - pub fn value(&mut self) -> Result>, ANTLRError> { - let mut recog = self; - let _parentctx = recog.ctx.take(); - let mut _localctx = ValueContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog.base.enter_rule(_localctx.clone(), 22, RULE_value); - let mut _localctx: Rc = _localctx; - let result: Result<(), ANTLRError> = (|| { - recog.base.set_state(176); - recog.err_handler.sync(&mut recog.base)?; - match recog.base.input.la(1) { - NUMBER => { - let tmp = ValueNumberContextExt::new(&**_localctx); - recog.base.enter_outer_alt(Some(tmp.clone()), 1); - _localctx = tmp; - { - recog.base.set_state(169); - recog.base.match_token(NUMBER, &mut recog.err_handler)?; - } - } - - KEYWORD_TRUE => { - let tmp = ValueTrueContextExt::new(&**_localctx); - recog.base.enter_outer_alt(Some(tmp.clone()), 2); - _localctx = tmp; - { - recog.base.set_state(170); - recog - .base - .match_token(KEYWORD_TRUE, &mut recog.err_handler)?; - } - } - - KEYWORD_FALSE => { - let tmp = ValueFalseContextExt::new(&**_localctx); - recog.base.enter_outer_alt(Some(tmp.clone()), 3); - _localctx = tmp; - { - recog.base.set_state(171); - recog - .base - .match_token(KEYWORD_FALSE, &mut recog.err_handler)?; - } - } - - VAR_ID => { - let tmp = ValueVarContextExt::new(&**_localctx); - recog.base.enter_outer_alt(Some(tmp.clone()), 4); - _localctx = tmp; - { - /*InvokeRule variable*/ - recog.base.set_state(172); - recog.variable()?; - } - } - - STRING => { - let tmp = ValueStringContextExt::new(&**_localctx); - recog.base.enter_outer_alt(Some(tmp.clone()), 5); - _localctx = tmp; - { - recog.base.set_state(173); - recog.base.match_token(STRING, &mut recog.err_handler)?; - } - } - - KEYWORD_NULL => { - let tmp = ValueNullContextExt::new(&**_localctx); - recog.base.enter_outer_alt(Some(tmp.clone()), 6); - _localctx = tmp; - { - recog.base.set_state(174); - recog - .base - .match_token(KEYWORD_NULL, &mut recog.err_handler)?; - } - } - - FUNC_ID => { - let tmp = ValueFuncContextExt::new(&**_localctx); - recog.base.enter_outer_alt(Some(tmp.clone()), 7); - _localctx = tmp; - { - /*InvokeRule function_call*/ - recog.base.set_state(175); - recog.function_call()?; - } - } - - _ => Err(ANTLRError::NoAltError(NoViableAltError::new( - &mut recog.base, - )))?, - } - Ok(()) - })(); - match result { - Ok(_) => {} - Err(e @ ANTLRError::FallThrough(_)) => return Err(e), - Err(ref re) => { - //_localctx.exception = re; - recog.err_handler.report_error(&mut recog.base, re); - recog.err_handler.recover(&mut recog.base, re)?; - } - } - recog.base.exit_rule(); +impl<'input> Function_callContextAttrs<'input> for Function_callContext<'input>{} - Ok(_localctx) - } +impl<'input, I> YarnSpinnerParser<'input, I> +where + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + pub fn function_call(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = Function_callContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 26, RULE_function_call); + let mut _localctx: Rc = _localctx; + let mut _la: i32 = -1; + let result: Result<(), ANTLRError> = (|| { + + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(180); + recog.base.match_token(YarnSpinnerParser_FUNC_ID,&mut recog.err_handler)?; + + recog.base.set_state(181); + recog.base.match_token(YarnSpinnerParser_LPAREN,&mut recog.err_handler)?; + + recog.base.set_state(183); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + if (((_la) & !0x3f) == 0 && ((1usize << _la) & 1879048192) != 0) || ((((_la - 41)) & !0x3f) == 0 && ((1usize << (_la - 41)) & 1411201) != 0) { + { + /*InvokeRule expression*/ + recog.base.set_state(182); + recog.expression_rec(0)?; + + } + } + + recog.base.set_state(189); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + while _la==YarnSpinnerParser_COMMA { + { + { + recog.base.set_state(185); + recog.base.match_token(YarnSpinnerParser_COMMA,&mut recog.err_handler)?; + + /*InvokeRule expression*/ + recog.base.set_state(186); + recog.expression_rec(0)?; + + } + } + recog.base.set_state(191); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + } + recog.base.set_state(192); + recog.base.match_token(YarnSpinnerParser_RPAREN,&mut recog.err_handler)?; + + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) + } } -//------------------- variable ---------------- -pub type VariableContextAll<'input> = VariableContext<'input>; +//------------------- if_statement ---------------- +pub type If_statementContextAll<'input> = If_statementContext<'input>; -pub type VariableContext<'input> = BaseParserRuleContext<'input, VariableContextExt<'input>>; + +pub type If_statementContext<'input> = BaseParserRuleContext<'input,If_statementContextExt<'input>>; #[derive(Clone)] -pub struct VariableContextExt<'input> { - ph: PhantomData<&'input str>, +pub struct If_statementContextExt<'input>{ +ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for VariableContext<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for If_statementContext<'input>{} -impl<'input, 'a> Listenable + 'a> - for VariableContext<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_variable(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_variable(self); - listener.exit_every_rule(self); - } +impl<'input,'a> Listenable + 'a> for If_statementContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_if_statement(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_if_statement(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input, 'a> Visitable + 'a> for VariableContext<'input> { - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_variable(self); - } +impl<'input,'a> Visitable + 'a> for If_statementContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_if_statement(self); + } } -impl<'input> CustomRuleContext<'input> for VariableContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_variable - } - //fn type_rule_index() -> usize where Self: Sized { RULE_variable } -} -antlr_rust::tid! {VariableContextExt<'a>} - -impl<'input> VariableContextExt<'input> { - fn new( - parent: Option + 'input>>, - invoking_state: isize, - ) -> Rc> { - Rc::new(BaseParserRuleContext::new_parser_ctx( - parent, - invoking_state, - VariableContextExt { ph: PhantomData }, - )) - } -} - -pub trait VariableContextAttrs<'input>: - YarnSpinnerParserContext<'input> + BorrowMut> -{ - /// Retrieves first TerminalNode corresponding to token VAR_ID - /// Returns `None` if there is no child corresponding to token VAR_ID - fn VAR_ID(&self) -> Option>> - where - Self: Sized, - { - self.get_token(VAR_ID, 0) - } +impl<'input> CustomRuleContext<'input> for If_statementContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_if_statement } + //fn type_rule_index() -> usize where Self: Sized { RULE_if_statement } } +antlr4rust::tid!{If_statementContextExt<'a>} -impl<'input> VariableContextAttrs<'input> for VariableContext<'input> {} - -impl<'input, I, H> YarnSpinnerParser<'input, I, H> -where - I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>, - H: ErrorStrategy<'input, BaseParserType<'input, I>>, -{ - pub fn variable(&mut self) -> Result>, ANTLRError> { - let mut recog = self; - let _parentctx = recog.ctx.take(); - let mut _localctx = VariableContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog.base.enter_rule(_localctx.clone(), 24, RULE_variable); - let mut _localctx: Rc = _localctx; - let result: Result<(), ANTLRError> = (|| { - //recog.base.enter_outer_alt(_localctx.clone(), 1); - recog.base.enter_outer_alt(None, 1); - { - recog.base.set_state(178); - recog.base.match_token(VAR_ID, &mut recog.err_handler)?; - } - Ok(()) - })(); - match result { - Ok(_) => {} - Err(e @ ANTLRError::FallThrough(_)) => return Err(e), - Err(ref re) => { - //_localctx.exception = re; - recog.err_handler.report_error(&mut recog.base, re); - recog.err_handler.recover(&mut recog.base, re)?; - } - } - recog.base.exit_rule(); +impl<'input> If_statementContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,If_statementContextExt{ - Ok(_localctx) - } + ph:PhantomData + }), + ) + } } -//------------------- function_call ---------------- -pub type Function_callContextAll<'input> = Function_callContext<'input>; -pub type Function_callContext<'input> = - BaseParserRuleContext<'input, Function_callContextExt<'input>>; +pub trait If_statementContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ -#[derive(Clone)] -pub struct Function_callContextExt<'input> { - ph: PhantomData<&'input str>, +fn if_clause(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) } - -impl<'input> YarnSpinnerParserContext<'input> for Function_callContext<'input> {} - -impl<'input, 'a> Listenable + 'a> - for Function_callContext<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_function_call(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_function_call(self); - listener.exit_every_rule(self); - } +/// Retrieves first TerminalNode corresponding to token COMMAND_START +/// Returns `None` if there is no child corresponding to token COMMAND_START +fn COMMAND_START(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_START, 0) } - -impl<'input, 'a> Visitable + 'a> - for Function_callContext<'input> -{ - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_function_call(self); - } +/// Retrieves first TerminalNode corresponding to token COMMAND_ENDIF +/// Returns `None` if there is no child corresponding to token COMMAND_ENDIF +fn COMMAND_ENDIF(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_ENDIF, 0) } - -impl<'input> CustomRuleContext<'input> for Function_callContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_function_call - } - //fn type_rule_index() -> usize where Self: Sized { RULE_function_call } -} -antlr_rust::tid! {Function_callContextExt<'a>} - -impl<'input> Function_callContextExt<'input> { - fn new( - parent: Option + 'input>>, - invoking_state: isize, - ) -> Rc> { - Rc::new(BaseParserRuleContext::new_parser_ctx( - parent, - invoking_state, - Function_callContextExt { ph: PhantomData }, - )) - } +/// Retrieves first TerminalNode corresponding to token COMMAND_END +/// Returns `None` if there is no child corresponding to token COMMAND_END +fn COMMAND_END(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_END, 0) +} +fn else_if_clause_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +fn else_if_clause(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) +} +fn else_clause(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) } -pub trait Function_callContextAttrs<'input>: - YarnSpinnerParserContext<'input> + BorrowMut> -{ - /// Retrieves first TerminalNode corresponding to token FUNC_ID - /// Returns `None` if there is no child corresponding to token FUNC_ID - fn FUNC_ID(&self) -> Option>> - where - Self: Sized, - { - self.get_token(FUNC_ID, 0) - } - /// Retrieves first TerminalNode corresponding to token LPAREN - /// Returns `None` if there is no child corresponding to token LPAREN - fn LPAREN(&self) -> Option>> - where - Self: Sized, - { - self.get_token(LPAREN, 0) - } - /// Retrieves first TerminalNode corresponding to token RPAREN - /// Returns `None` if there is no child corresponding to token RPAREN - fn RPAREN(&self) -> Option>> - where - Self: Sized, - { - self.get_token(RPAREN, 0) - } - fn expression_all(&self) -> Vec>> - where - Self: Sized, - { - self.children_of_type() - } - fn expression(&self, i: usize) -> Option>> - where - Self: Sized, - { - self.child_of_type(i) - } - /// Retrieves all `TerminalNode`s corresponding to token COMMA in current rule - fn COMMA_all(&self) -> Vec>> - where - Self: Sized, - { - self.children_of_type() - } - /// Retrieves 'i's TerminalNode corresponding to token COMMA, starting from 0. - /// Returns `None` if number of children corresponding to token COMMA is less or equal than `i`. - fn COMMA(&self, i: usize) -> Option>> - where - Self: Sized, - { - self.get_token(COMMA, i) - } } -impl<'input> Function_callContextAttrs<'input> for Function_callContext<'input> {} +impl<'input> If_statementContextAttrs<'input> for If_statementContext<'input>{} -impl<'input, I, H> YarnSpinnerParser<'input, I, H> +impl<'input, I> YarnSpinnerParser<'input, I> where - I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>, - H: ErrorStrategy<'input, BaseParserType<'input, I>>, -{ - pub fn function_call(&mut self) -> Result>, ANTLRError> { - let mut recog = self; - let _parentctx = recog.ctx.take(); - let mut _localctx = - Function_callContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog - .base - .enter_rule(_localctx.clone(), 26, RULE_function_call); - let mut _localctx: Rc = _localctx; - let mut _la: isize = -1; - let result: Result<(), ANTLRError> = (|| { - //recog.base.enter_outer_alt(_localctx.clone(), 1); - recog.base.enter_outer_alt(None, 1); - { - recog.base.set_state(180); - recog.base.match_token(FUNC_ID, &mut recog.err_handler)?; - - recog.base.set_state(181); - recog.base.match_token(LPAREN, &mut recog.err_handler)?; - - recog.base.set_state(183); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - if (((_la) & !0x3f) == 0 - && ((1usize << _la) - & ((1usize << KEYWORD_TRUE) - | (1usize << KEYWORD_FALSE) - | (1usize << KEYWORD_NULL))) - != 0) - || (((_la - 41) & !0x3f) == 0 - && ((1usize << (_la - 41)) - & ((1usize << (OPERATOR_LOGICAL_NOT - 41)) - | (1usize << (OPERATOR_MATHS_SUBTRACTION - 41)) - | (1usize << (LPAREN - 41)) - | (1usize << (STRING - 41)) - | (1usize << (FUNC_ID - 41)) - | (1usize << (VAR_ID - 41)) - | (1usize << (NUMBER - 41)))) - != 0) - { - { - /*InvokeRule expression*/ - recog.base.set_state(182); - recog.expression_rec(0)?; - } - } - - recog.base.set_state(189); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - while _la == COMMA { - { - { - recog.base.set_state(185); - recog.base.match_token(COMMA, &mut recog.err_handler)?; - - /*InvokeRule expression*/ - recog.base.set_state(186); - recog.expression_rec(0)?; - } - } - recog.base.set_state(191); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - } - recog.base.set_state(192); - recog.base.match_token(RPAREN, &mut recog.err_handler)?; - } - Ok(()) - })(); - match result { - Ok(_) => {} - Err(e @ ANTLRError::FallThrough(_)) => return Err(e), - Err(ref re) => { - //_localctx.exception = re; - recog.err_handler.report_error(&mut recog.base, re); - recog.err_handler.recover(&mut recog.base, re)?; - } - } - recog.base.exit_rule(); - - Ok(_localctx) - } + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + pub fn if_statement(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = If_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 28, RULE_if_statement); + let mut _localctx: Rc = _localctx; + let result: Result<(), ANTLRError> = (|| { + + let mut _alt: i32; + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + /*InvokeRule if_clause*/ + recog.base.set_state(194); + recog.if_clause()?; + + recog.base.set_state(198); + recog.err_handler.sync(&mut recog.base)?; + _alt = recog.interpreter.adaptive_predict(18,&mut recog.base)?; + while { _alt!=2 && _alt!=INVALID_ALT } { + if _alt==1 { + { + { + /*InvokeRule else_if_clause*/ + recog.base.set_state(195); + recog.else_if_clause()?; + + } + } + } + recog.base.set_state(200); + recog.err_handler.sync(&mut recog.base)?; + _alt = recog.interpreter.adaptive_predict(18,&mut recog.base)?; + } + recog.base.set_state(202); + recog.err_handler.sync(&mut recog.base)?; + match recog.interpreter.adaptive_predict(19,&mut recog.base)? { + x if x == 1=>{ + { + /*InvokeRule else_clause*/ + recog.base.set_state(201); + recog.else_clause()?; + + } + } + + _ => {} + } + recog.base.set_state(204); + recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; + + recog.base.set_state(205); + recog.base.match_token(YarnSpinnerParser_COMMAND_ENDIF,&mut recog.err_handler)?; + + recog.base.set_state(206); + recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; + + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) + } } -//------------------- if_statement ---------------- -pub type If_statementContextAll<'input> = If_statementContext<'input>; +//------------------- if_clause ---------------- +pub type If_clauseContextAll<'input> = If_clauseContext<'input>; + -pub type If_statementContext<'input> = - BaseParserRuleContext<'input, If_statementContextExt<'input>>; +pub type If_clauseContext<'input> = BaseParserRuleContext<'input,If_clauseContextExt<'input>>; #[derive(Clone)] -pub struct If_statementContextExt<'input> { - ph: PhantomData<&'input str>, +pub struct If_clauseContextExt<'input>{ +ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for If_statementContext<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for If_clauseContext<'input>{} -impl<'input, 'a> Listenable + 'a> - for If_statementContext<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_if_statement(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_if_statement(self); - listener.exit_every_rule(self); - } +impl<'input,'a> Listenable + 'a> for If_clauseContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_if_clause(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_if_clause(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input, 'a> Visitable + 'a> - for If_statementContext<'input> -{ - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_if_statement(self); - } +impl<'input,'a> Visitable + 'a> for If_clauseContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_if_clause(self); + } } -impl<'input> CustomRuleContext<'input> for If_statementContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_if_statement - } - //fn type_rule_index() -> usize where Self: Sized { RULE_if_statement } -} -antlr_rust::tid! {If_statementContextExt<'a>} - -impl<'input> If_statementContextExt<'input> { - fn new( - parent: Option + 'input>>, - invoking_state: isize, - ) -> Rc> { - Rc::new(BaseParserRuleContext::new_parser_ctx( - parent, - invoking_state, - If_statementContextExt { ph: PhantomData }, - )) - } +impl<'input> CustomRuleContext<'input> for If_clauseContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_if_clause } + //fn type_rule_index() -> usize where Self: Sized { RULE_if_clause } } +antlr4rust::tid!{If_clauseContextExt<'a>} -pub trait If_statementContextAttrs<'input>: - YarnSpinnerParserContext<'input> + BorrowMut> -{ - fn if_clause(&self) -> Option>> - where - Self: Sized, - { - self.child_of_type(0) - } - /// Retrieves first TerminalNode corresponding to token COMMAND_START - /// Returns `None` if there is no child corresponding to token COMMAND_START - fn COMMAND_START(&self) -> Option>> - where - Self: Sized, - { - self.get_token(COMMAND_START, 0) - } - /// Retrieves first TerminalNode corresponding to token COMMAND_ENDIF - /// Returns `None` if there is no child corresponding to token COMMAND_ENDIF - fn COMMAND_ENDIF(&self) -> Option>> - where - Self: Sized, - { - self.get_token(COMMAND_ENDIF, 0) - } - /// Retrieves first TerminalNode corresponding to token COMMAND_END - /// Returns `None` if there is no child corresponding to token COMMAND_END - fn COMMAND_END(&self) -> Option>> - where - Self: Sized, - { - self.get_token(COMMAND_END, 0) - } - fn else_if_clause_all(&self) -> Vec>> - where - Self: Sized, - { - self.children_of_type() - } - fn else_if_clause(&self, i: usize) -> Option>> - where - Self: Sized, - { - self.child_of_type(i) - } - fn else_clause(&self) -> Option>> - where - Self: Sized, - { - self.child_of_type(0) - } -} +impl<'input> If_clauseContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,If_clauseContextExt{ -impl<'input> If_statementContextAttrs<'input> for If_statementContext<'input> {} - -impl<'input, I, H> YarnSpinnerParser<'input, I, H> -where - I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>, - H: ErrorStrategy<'input, BaseParserType<'input, I>>, -{ - pub fn if_statement(&mut self) -> Result>, ANTLRError> { - let mut recog = self; - let _parentctx = recog.ctx.take(); - let mut _localctx = If_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog - .base - .enter_rule(_localctx.clone(), 28, RULE_if_statement); - let mut _localctx: Rc = _localctx; - let result: Result<(), ANTLRError> = (|| { - let mut _alt: isize; - //recog.base.enter_outer_alt(_localctx.clone(), 1); - recog.base.enter_outer_alt(None, 1); - { - /*InvokeRule if_clause*/ - recog.base.set_state(194); - recog.if_clause()?; - - recog.base.set_state(198); - recog.err_handler.sync(&mut recog.base)?; - _alt = recog.interpreter.adaptive_predict(18, &mut recog.base)?; - while { _alt != 2 && _alt != INVALID_ALT } { - if _alt == 1 { - { - { - /*InvokeRule else_if_clause*/ - recog.base.set_state(195); - recog.else_if_clause()?; - } - } - } - recog.base.set_state(200); - recog.err_handler.sync(&mut recog.base)?; - _alt = recog.interpreter.adaptive_predict(18, &mut recog.base)?; - } - recog.base.set_state(202); - recog.err_handler.sync(&mut recog.base)?; - match recog.interpreter.adaptive_predict(19, &mut recog.base)? { - x if x == 1 => { - { - /*InvokeRule else_clause*/ - recog.base.set_state(201); - recog.else_clause()?; - } - } - - _ => {} - } - recog.base.set_state(204); - recog - .base - .match_token(COMMAND_START, &mut recog.err_handler)?; - - recog.base.set_state(205); - recog - .base - .match_token(COMMAND_ENDIF, &mut recog.err_handler)?; - - recog.base.set_state(206); - recog - .base - .match_token(COMMAND_END, &mut recog.err_handler)?; - } - Ok(()) - })(); - match result { - Ok(_) => {} - Err(e @ ANTLRError::FallThrough(_)) => return Err(e), - Err(ref re) => { - //_localctx.exception = re; - recog.err_handler.report_error(&mut recog.base, re); - recog.err_handler.recover(&mut recog.base, re)?; - } - } - recog.base.exit_rule(); - - Ok(_localctx) - } + ph:PhantomData + }), + ) + } } -//------------------- if_clause ---------------- -pub type If_clauseContextAll<'input> = If_clauseContext<'input>; -pub type If_clauseContext<'input> = BaseParserRuleContext<'input, If_clauseContextExt<'input>>; +pub trait If_clauseContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ -#[derive(Clone)] -pub struct If_clauseContextExt<'input> { - ph: PhantomData<&'input str>, +/// Retrieves first TerminalNode corresponding to token COMMAND_START +/// Returns `None` if there is no child corresponding to token COMMAND_START +fn COMMAND_START(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_START, 0) } - -impl<'input> YarnSpinnerParserContext<'input> for If_clauseContext<'input> {} - -impl<'input, 'a> Listenable + 'a> - for If_clauseContext<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_if_clause(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_if_clause(self); - listener.exit_every_rule(self); - } +/// Retrieves first TerminalNode corresponding to token COMMAND_IF +/// Returns `None` if there is no child corresponding to token COMMAND_IF +fn COMMAND_IF(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_IF, 0) } - -impl<'input, 'a> Visitable + 'a> for If_clauseContext<'input> { - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_if_clause(self); - } +fn expression(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) } - -impl<'input> CustomRuleContext<'input> for If_clauseContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_if_clause - } - //fn type_rule_index() -> usize where Self: Sized { RULE_if_clause } -} -antlr_rust::tid! {If_clauseContextExt<'a>} - -impl<'input> If_clauseContextExt<'input> { - fn new( - parent: Option + 'input>>, - invoking_state: isize, - ) -> Rc> { - Rc::new(BaseParserRuleContext::new_parser_ctx( - parent, - invoking_state, - If_clauseContextExt { ph: PhantomData }, - )) - } +/// Retrieves first TerminalNode corresponding to token COMMAND_END +/// Returns `None` if there is no child corresponding to token COMMAND_END +fn COMMAND_END(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_END, 0) +} +fn statement_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +fn statement(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) } -pub trait If_clauseContextAttrs<'input>: - YarnSpinnerParserContext<'input> + BorrowMut> -{ - /// Retrieves first TerminalNode corresponding to token COMMAND_START - /// Returns `None` if there is no child corresponding to token COMMAND_START - fn COMMAND_START(&self) -> Option>> - where - Self: Sized, - { - self.get_token(COMMAND_START, 0) - } - /// Retrieves first TerminalNode corresponding to token COMMAND_IF - /// Returns `None` if there is no child corresponding to token COMMAND_IF - fn COMMAND_IF(&self) -> Option>> - where - Self: Sized, - { - self.get_token(COMMAND_IF, 0) - } - fn expression(&self) -> Option>> - where - Self: Sized, - { - self.child_of_type(0) - } - /// Retrieves first TerminalNode corresponding to token COMMAND_END - /// Returns `None` if there is no child corresponding to token COMMAND_END - fn COMMAND_END(&self) -> Option>> - where - Self: Sized, - { - self.get_token(COMMAND_END, 0) - } - fn statement_all(&self) -> Vec>> - where - Self: Sized, - { - self.children_of_type() - } - fn statement(&self, i: usize) -> Option>> - where - Self: Sized, - { - self.child_of_type(i) - } } -impl<'input> If_clauseContextAttrs<'input> for If_clauseContext<'input> {} +impl<'input> If_clauseContextAttrs<'input> for If_clauseContext<'input>{} -impl<'input, I, H> YarnSpinnerParser<'input, I, H> +impl<'input, I> YarnSpinnerParser<'input, I> where - I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>, - H: ErrorStrategy<'input, BaseParserType<'input, I>>, + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, { - pub fn if_clause(&mut self) -> Result>, ANTLRError> { - let mut recog = self; - let _parentctx = recog.ctx.take(); - let mut _localctx = If_clauseContextExt::new(_parentctx.clone(), recog.base.get_state()); + pub fn if_clause(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = If_clauseContextExt::new(_parentctx.clone(), recog.base.get_state()); recog.base.enter_rule(_localctx.clone(), 30, RULE_if_clause); let mut _localctx: Rc = _localctx; - let result: Result<(), ANTLRError> = (|| { - let mut _alt: isize; - //recog.base.enter_outer_alt(_localctx.clone(), 1); - recog.base.enter_outer_alt(None, 1); - { - recog.base.set_state(208); - recog - .base - .match_token(COMMAND_START, &mut recog.err_handler)?; - - recog.base.set_state(209); - recog.base.match_token(COMMAND_IF, &mut recog.err_handler)?; - - /*InvokeRule expression*/ - recog.base.set_state(210); - recog.expression_rec(0)?; - - recog.base.set_state(211); - recog - .base - .match_token(COMMAND_END, &mut recog.err_handler)?; - - recog.base.set_state(215); - recog.err_handler.sync(&mut recog.base)?; - _alt = recog.interpreter.adaptive_predict(20, &mut recog.base)?; - while { _alt != 2 && _alt != INVALID_ALT } { - if _alt == 1 { - { - { - /*InvokeRule statement*/ - recog.base.set_state(212); - recog.statement()?; - } - } - } - recog.base.set_state(217); - recog.err_handler.sync(&mut recog.base)?; - _alt = recog.interpreter.adaptive_predict(20, &mut recog.base)?; - } - } - Ok(()) - })(); - match result { - Ok(_) => {} - Err(e @ ANTLRError::FallThrough(_)) => return Err(e), - Err(ref re) => { - //_localctx.exception = re; - recog.err_handler.report_error(&mut recog.base, re); - recog.err_handler.recover(&mut recog.base, re)?; - } - } - recog.base.exit_rule(); - - Ok(_localctx) - } + let result: Result<(), ANTLRError> = (|| { + + let mut _alt: i32; + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(208); + recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; + + recog.base.set_state(209); + recog.base.match_token(YarnSpinnerParser_COMMAND_IF,&mut recog.err_handler)?; + + /*InvokeRule expression*/ + recog.base.set_state(210); + recog.expression_rec(0)?; + + recog.base.set_state(211); + recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; + + recog.base.set_state(215); + recog.err_handler.sync(&mut recog.base)?; + _alt = recog.interpreter.adaptive_predict(20,&mut recog.base)?; + while { _alt!=2 && _alt!=INVALID_ALT } { + if _alt==1 { + { + { + /*InvokeRule statement*/ + recog.base.set_state(212); + recog.statement()?; + + } + } + } + recog.base.set_state(217); + recog.err_handler.sync(&mut recog.base)?; + _alt = recog.interpreter.adaptive_predict(20,&mut recog.base)?; + } + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) + } } //------------------- else_if_clause ---------------- pub type Else_if_clauseContextAll<'input> = Else_if_clauseContext<'input>; -pub type Else_if_clauseContext<'input> = - BaseParserRuleContext<'input, Else_if_clauseContextExt<'input>>; + +pub type Else_if_clauseContext<'input> = BaseParserRuleContext<'input,Else_if_clauseContextExt<'input>>; #[derive(Clone)] -pub struct Else_if_clauseContextExt<'input> { - ph: PhantomData<&'input str>, +pub struct Else_if_clauseContextExt<'input>{ +ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for Else_if_clauseContext<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for Else_if_clauseContext<'input>{} -impl<'input, 'a> Listenable + 'a> - for Else_if_clauseContext<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_else_if_clause(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_else_if_clause(self); - listener.exit_every_rule(self); - } +impl<'input,'a> Listenable + 'a> for Else_if_clauseContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_else_if_clause(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_else_if_clause(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input, 'a> Visitable + 'a> - for Else_if_clauseContext<'input> -{ - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_else_if_clause(self); - } +impl<'input,'a> Visitable + 'a> for Else_if_clauseContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_else_if_clause(self); + } } -impl<'input> CustomRuleContext<'input> for Else_if_clauseContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_else_if_clause - } - //fn type_rule_index() -> usize where Self: Sized { RULE_else_if_clause } -} -antlr_rust::tid! {Else_if_clauseContextExt<'a>} - -impl<'input> Else_if_clauseContextExt<'input> { - fn new( - parent: Option + 'input>>, - invoking_state: isize, - ) -> Rc> { - Rc::new(BaseParserRuleContext::new_parser_ctx( - parent, - invoking_state, - Else_if_clauseContextExt { ph: PhantomData }, - )) - } +impl<'input> CustomRuleContext<'input> for Else_if_clauseContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_else_if_clause } + //fn type_rule_index() -> usize where Self: Sized { RULE_else_if_clause } } +antlr4rust::tid!{Else_if_clauseContextExt<'a>} -pub trait Else_if_clauseContextAttrs<'input>: - YarnSpinnerParserContext<'input> + BorrowMut> -{ - /// Retrieves first TerminalNode corresponding to token COMMAND_START - /// Returns `None` if there is no child corresponding to token COMMAND_START - fn COMMAND_START(&self) -> Option>> - where - Self: Sized, - { - self.get_token(COMMAND_START, 0) - } - /// Retrieves first TerminalNode corresponding to token COMMAND_ELSEIF - /// Returns `None` if there is no child corresponding to token COMMAND_ELSEIF - fn COMMAND_ELSEIF(&self) -> Option>> - where - Self: Sized, - { - self.get_token(COMMAND_ELSEIF, 0) - } - fn expression(&self) -> Option>> - where - Self: Sized, - { - self.child_of_type(0) - } - /// Retrieves first TerminalNode corresponding to token COMMAND_END - /// Returns `None` if there is no child corresponding to token COMMAND_END - fn COMMAND_END(&self) -> Option>> - where - Self: Sized, - { - self.get_token(COMMAND_END, 0) - } - fn statement_all(&self) -> Vec>> - where - Self: Sized, - { - self.children_of_type() - } - fn statement(&self, i: usize) -> Option>> - where - Self: Sized, - { - self.child_of_type(i) - } +impl<'input> Else_if_clauseContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Else_if_clauseContextExt{ + + ph:PhantomData + }), + ) + } } -impl<'input> Else_if_clauseContextAttrs<'input> for Else_if_clauseContext<'input> {} +pub trait Else_if_clauseContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ -impl<'input, I, H> YarnSpinnerParser<'input, I, H> +/// Retrieves first TerminalNode corresponding to token COMMAND_START +/// Returns `None` if there is no child corresponding to token COMMAND_START +fn COMMAND_START(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_START, 0) +} +/// Retrieves first TerminalNode corresponding to token COMMAND_ELSEIF +/// Returns `None` if there is no child corresponding to token COMMAND_ELSEIF +fn COMMAND_ELSEIF(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_ELSEIF, 0) +} +fn expression(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +/// Retrieves first TerminalNode corresponding to token COMMAND_END +/// Returns `None` if there is no child corresponding to token COMMAND_END +fn COMMAND_END(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_END, 0) +} +fn statement_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +fn statement(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) +} + +} + +impl<'input> Else_if_clauseContextAttrs<'input> for Else_if_clauseContext<'input>{} + +impl<'input, I> YarnSpinnerParser<'input, I> where - I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>, - H: ErrorStrategy<'input, BaseParserType<'input, I>>, -{ - pub fn else_if_clause(&mut self) -> Result>, ANTLRError> { - let mut recog = self; - let _parentctx = recog.ctx.take(); - let mut _localctx = - Else_if_clauseContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog - .base - .enter_rule(_localctx.clone(), 32, RULE_else_if_clause); + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + pub fn else_if_clause(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = Else_if_clauseContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 32, RULE_else_if_clause); let mut _localctx: Rc = _localctx; - let result: Result<(), ANTLRError> = (|| { - let mut _alt: isize; - //recog.base.enter_outer_alt(_localctx.clone(), 1); - recog.base.enter_outer_alt(None, 1); - { - recog.base.set_state(218); - recog - .base - .match_token(COMMAND_START, &mut recog.err_handler)?; - - recog.base.set_state(219); - recog - .base - .match_token(COMMAND_ELSEIF, &mut recog.err_handler)?; - - /*InvokeRule expression*/ - recog.base.set_state(220); - recog.expression_rec(0)?; - - recog.base.set_state(221); - recog - .base - .match_token(COMMAND_END, &mut recog.err_handler)?; - - recog.base.set_state(225); - recog.err_handler.sync(&mut recog.base)?; - _alt = recog.interpreter.adaptive_predict(21, &mut recog.base)?; - while { _alt != 2 && _alt != INVALID_ALT } { - if _alt == 1 { - { - { - /*InvokeRule statement*/ - recog.base.set_state(222); - recog.statement()?; - } - } - } - recog.base.set_state(227); - recog.err_handler.sync(&mut recog.base)?; - _alt = recog.interpreter.adaptive_predict(21, &mut recog.base)?; - } - } - Ok(()) - })(); - match result { - Ok(_) => {} - Err(e @ ANTLRError::FallThrough(_)) => return Err(e), - Err(ref re) => { - //_localctx.exception = re; - recog.err_handler.report_error(&mut recog.base, re); - recog.err_handler.recover(&mut recog.base, re)?; - } - } - recog.base.exit_rule(); - - Ok(_localctx) - } + let result: Result<(), ANTLRError> = (|| { + + let mut _alt: i32; + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(218); + recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; + + recog.base.set_state(219); + recog.base.match_token(YarnSpinnerParser_COMMAND_ELSEIF,&mut recog.err_handler)?; + + /*InvokeRule expression*/ + recog.base.set_state(220); + recog.expression_rec(0)?; + + recog.base.set_state(221); + recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; + + recog.base.set_state(225); + recog.err_handler.sync(&mut recog.base)?; + _alt = recog.interpreter.adaptive_predict(21,&mut recog.base)?; + while { _alt!=2 && _alt!=INVALID_ALT } { + if _alt==1 { + { + { + /*InvokeRule statement*/ + recog.base.set_state(222); + recog.statement()?; + + } + } + } + recog.base.set_state(227); + recog.err_handler.sync(&mut recog.base)?; + _alt = recog.interpreter.adaptive_predict(21,&mut recog.base)?; + } + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) + } } //------------------- else_clause ---------------- pub type Else_clauseContextAll<'input> = Else_clauseContext<'input>; -pub type Else_clauseContext<'input> = BaseParserRuleContext<'input, Else_clauseContextExt<'input>>; + +pub type Else_clauseContext<'input> = BaseParserRuleContext<'input,Else_clauseContextExt<'input>>; #[derive(Clone)] -pub struct Else_clauseContextExt<'input> { - ph: PhantomData<&'input str>, +pub struct Else_clauseContextExt<'input>{ +ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for Else_clauseContext<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for Else_clauseContext<'input>{} -impl<'input, 'a> Listenable + 'a> - for Else_clauseContext<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_else_clause(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_else_clause(self); - listener.exit_every_rule(self); - } +impl<'input,'a> Listenable + 'a> for Else_clauseContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_else_clause(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_else_clause(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input, 'a> Visitable + 'a> - for Else_clauseContext<'input> -{ - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_else_clause(self); - } +impl<'input,'a> Visitable + 'a> for Else_clauseContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_else_clause(self); + } } -impl<'input> CustomRuleContext<'input> for Else_clauseContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_else_clause - } - //fn type_rule_index() -> usize where Self: Sized { RULE_else_clause } -} -antlr_rust::tid! {Else_clauseContextExt<'a>} - -impl<'input> Else_clauseContextExt<'input> { - fn new( - parent: Option + 'input>>, - invoking_state: isize, - ) -> Rc> { - Rc::new(BaseParserRuleContext::new_parser_ctx( - parent, - invoking_state, - Else_clauseContextExt { ph: PhantomData }, - )) - } +impl<'input> CustomRuleContext<'input> for Else_clauseContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_else_clause } + //fn type_rule_index() -> usize where Self: Sized { RULE_else_clause } } +antlr4rust::tid!{Else_clauseContextExt<'a>} -pub trait Else_clauseContextAttrs<'input>: - YarnSpinnerParserContext<'input> + BorrowMut> -{ - /// Retrieves first TerminalNode corresponding to token COMMAND_START - /// Returns `None` if there is no child corresponding to token COMMAND_START - fn COMMAND_START(&self) -> Option>> - where - Self: Sized, - { - self.get_token(COMMAND_START, 0) - } - /// Retrieves first TerminalNode corresponding to token COMMAND_ELSE - /// Returns `None` if there is no child corresponding to token COMMAND_ELSE - fn COMMAND_ELSE(&self) -> Option>> - where - Self: Sized, - { - self.get_token(COMMAND_ELSE, 0) - } - /// Retrieves first TerminalNode corresponding to token COMMAND_END - /// Returns `None` if there is no child corresponding to token COMMAND_END - fn COMMAND_END(&self) -> Option>> - where - Self: Sized, - { - self.get_token(COMMAND_END, 0) - } - fn statement_all(&self) -> Vec>> - where - Self: Sized, - { - self.children_of_type() - } - fn statement(&self, i: usize) -> Option>> - where - Self: Sized, - { - self.child_of_type(i) - } +impl<'input> Else_clauseContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Else_clauseContextExt{ + + ph:PhantomData + }), + ) + } +} + +pub trait Else_clauseContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ + +/// Retrieves first TerminalNode corresponding to token COMMAND_START +/// Returns `None` if there is no child corresponding to token COMMAND_START +fn COMMAND_START(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_START, 0) +} +/// Retrieves first TerminalNode corresponding to token COMMAND_ELSE +/// Returns `None` if there is no child corresponding to token COMMAND_ELSE +fn COMMAND_ELSE(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_ELSE, 0) +} +/// Retrieves first TerminalNode corresponding to token COMMAND_END +/// Returns `None` if there is no child corresponding to token COMMAND_END +fn COMMAND_END(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_END, 0) +} +fn statement_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +fn statement(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) } -impl<'input> Else_clauseContextAttrs<'input> for Else_clauseContext<'input> {} +} -impl<'input, I, H> YarnSpinnerParser<'input, I, H> +impl<'input> Else_clauseContextAttrs<'input> for Else_clauseContext<'input>{} + +impl<'input, I> YarnSpinnerParser<'input, I> where - I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>, - H: ErrorStrategy<'input, BaseParserType<'input, I>>, -{ - pub fn else_clause(&mut self) -> Result>, ANTLRError> { - let mut recog = self; - let _parentctx = recog.ctx.take(); - let mut _localctx = Else_clauseContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog - .base - .enter_rule(_localctx.clone(), 34, RULE_else_clause); + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + pub fn else_clause(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = Else_clauseContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 34, RULE_else_clause); let mut _localctx: Rc = _localctx; - let result: Result<(), ANTLRError> = (|| { - let mut _alt: isize; - //recog.base.enter_outer_alt(_localctx.clone(), 1); - recog.base.enter_outer_alt(None, 1); - { - recog.base.set_state(228); - recog - .base - .match_token(COMMAND_START, &mut recog.err_handler)?; - - recog.base.set_state(229); - recog - .base - .match_token(COMMAND_ELSE, &mut recog.err_handler)?; - - recog.base.set_state(230); - recog - .base - .match_token(COMMAND_END, &mut recog.err_handler)?; - - recog.base.set_state(234); - recog.err_handler.sync(&mut recog.base)?; - _alt = recog.interpreter.adaptive_predict(22, &mut recog.base)?; - while { _alt != 2 && _alt != INVALID_ALT } { - if _alt == 1 { - { - { - /*InvokeRule statement*/ - recog.base.set_state(231); - recog.statement()?; - } - } - } - recog.base.set_state(236); - recog.err_handler.sync(&mut recog.base)?; - _alt = recog.interpreter.adaptive_predict(22, &mut recog.base)?; - } - } - Ok(()) - })(); - match result { - Ok(_) => {} - Err(e @ ANTLRError::FallThrough(_)) => return Err(e), - Err(ref re) => { - //_localctx.exception = re; - recog.err_handler.report_error(&mut recog.base, re); - recog.err_handler.recover(&mut recog.base, re)?; - } - } - recog.base.exit_rule(); - - Ok(_localctx) - } + let result: Result<(), ANTLRError> = (|| { + + let mut _alt: i32; + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(228); + recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; + + recog.base.set_state(229); + recog.base.match_token(YarnSpinnerParser_COMMAND_ELSE,&mut recog.err_handler)?; + + recog.base.set_state(230); + recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; + + recog.base.set_state(234); + recog.err_handler.sync(&mut recog.base)?; + _alt = recog.interpreter.adaptive_predict(22,&mut recog.base)?; + while { _alt!=2 && _alt!=INVALID_ALT } { + if _alt==1 { + { + { + /*InvokeRule statement*/ + recog.base.set_state(231); + recog.statement()?; + + } + } + } + recog.base.set_state(236); + recog.err_handler.sync(&mut recog.base)?; + _alt = recog.interpreter.adaptive_predict(22,&mut recog.base)?; + } + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) + } } //------------------- set_statement ---------------- pub type Set_statementContextAll<'input> = Set_statementContext<'input>; -pub type Set_statementContext<'input> = - BaseParserRuleContext<'input, Set_statementContextExt<'input>>; + +pub type Set_statementContext<'input> = BaseParserRuleContext<'input,Set_statementContextExt<'input>>; #[derive(Clone)] -pub struct Set_statementContextExt<'input> { - pub op: Option>, - ph: PhantomData<&'input str>, +pub struct Set_statementContextExt<'input>{ + pub op: Option>, +ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for Set_statementContext<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for Set_statementContext<'input>{} -impl<'input, 'a> Listenable + 'a> - for Set_statementContext<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_set_statement(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_set_statement(self); - listener.exit_every_rule(self); - } +impl<'input,'a> Listenable + 'a> for Set_statementContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_set_statement(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_set_statement(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input, 'a> Visitable + 'a> - for Set_statementContext<'input> -{ - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_set_statement(self); - } +impl<'input,'a> Visitable + 'a> for Set_statementContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_set_statement(self); + } } -impl<'input> CustomRuleContext<'input> for Set_statementContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_set_statement - } - //fn type_rule_index() -> usize where Self: Sized { RULE_set_statement } -} -antlr_rust::tid! {Set_statementContextExt<'a>} - -impl<'input> Set_statementContextExt<'input> { - fn new( - parent: Option + 'input>>, - invoking_state: isize, - ) -> Rc> { - Rc::new(BaseParserRuleContext::new_parser_ctx( - parent, - invoking_state, - Set_statementContextExt { - op: None, - ph: PhantomData, - }, - )) - } +impl<'input> CustomRuleContext<'input> for Set_statementContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_set_statement } + //fn type_rule_index() -> usize where Self: Sized { RULE_set_statement } } +antlr4rust::tid!{Set_statementContextExt<'a>} -pub trait Set_statementContextAttrs<'input>: - YarnSpinnerParserContext<'input> + BorrowMut> -{ - /// Retrieves first TerminalNode corresponding to token COMMAND_START - /// Returns `None` if there is no child corresponding to token COMMAND_START - fn COMMAND_START(&self) -> Option>> - where - Self: Sized, - { - self.get_token(COMMAND_START, 0) - } - /// Retrieves first TerminalNode corresponding to token COMMAND_SET - /// Returns `None` if there is no child corresponding to token COMMAND_SET - fn COMMAND_SET(&self) -> Option>> - where - Self: Sized, - { - self.get_token(COMMAND_SET, 0) - } - fn variable(&self) -> Option>> - where - Self: Sized, - { - self.child_of_type(0) - } - fn expression(&self) -> Option>> - where - Self: Sized, - { - self.child_of_type(0) - } - /// Retrieves first TerminalNode corresponding to token COMMAND_END - /// Returns `None` if there is no child corresponding to token COMMAND_END - fn COMMAND_END(&self) -> Option>> - where - Self: Sized, - { - self.get_token(COMMAND_END, 0) - } - /// Retrieves first TerminalNode corresponding to token OPERATOR_ASSIGNMENT - /// Returns `None` if there is no child corresponding to token OPERATOR_ASSIGNMENT - fn OPERATOR_ASSIGNMENT(&self) -> Option>> - where - Self: Sized, - { - self.get_token(OPERATOR_ASSIGNMENT, 0) - } - /// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_MULTIPLICATION_EQUALS - /// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_MULTIPLICATION_EQUALS - fn OPERATOR_MATHS_MULTIPLICATION_EQUALS( - &self, - ) -> Option>> - where - Self: Sized, - { - self.get_token(OPERATOR_MATHS_MULTIPLICATION_EQUALS, 0) - } - /// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_DIVISION_EQUALS - /// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_DIVISION_EQUALS - fn OPERATOR_MATHS_DIVISION_EQUALS( - &self, - ) -> Option>> - where - Self: Sized, - { - self.get_token(OPERATOR_MATHS_DIVISION_EQUALS, 0) - } - /// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_MODULUS_EQUALS - /// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_MODULUS_EQUALS - fn OPERATOR_MATHS_MODULUS_EQUALS( - &self, - ) -> Option>> - where - Self: Sized, - { - self.get_token(OPERATOR_MATHS_MODULUS_EQUALS, 0) - } - /// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_ADDITION_EQUALS - /// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_ADDITION_EQUALS - fn OPERATOR_MATHS_ADDITION_EQUALS( - &self, - ) -> Option>> - where - Self: Sized, - { - self.get_token(OPERATOR_MATHS_ADDITION_EQUALS, 0) - } - /// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_SUBTRACTION_EQUALS - /// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_SUBTRACTION_EQUALS - fn OPERATOR_MATHS_SUBTRACTION_EQUALS( - &self, - ) -> Option>> - where - Self: Sized, - { - self.get_token(OPERATOR_MATHS_SUBTRACTION_EQUALS, 0) - } +impl<'input> Set_statementContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Set_statementContextExt{ + op: None, + + ph:PhantomData + }), + ) + } +} + +pub trait Set_statementContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ + +/// Retrieves first TerminalNode corresponding to token COMMAND_START +/// Returns `None` if there is no child corresponding to token COMMAND_START +fn COMMAND_START(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_START, 0) +} +/// Retrieves first TerminalNode corresponding to token COMMAND_SET +/// Returns `None` if there is no child corresponding to token COMMAND_SET +fn COMMAND_SET(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_SET, 0) +} +fn variable(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +fn expression(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +/// Retrieves first TerminalNode corresponding to token COMMAND_END +/// Returns `None` if there is no child corresponding to token COMMAND_END +fn COMMAND_END(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_END, 0) +} +/// Retrieves first TerminalNode corresponding to token OPERATOR_ASSIGNMENT +/// Returns `None` if there is no child corresponding to token OPERATOR_ASSIGNMENT +fn OPERATOR_ASSIGNMENT(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_ASSIGNMENT, 0) +} +/// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_MULTIPLICATION_EQUALS +/// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_MULTIPLICATION_EQUALS +fn OPERATOR_MATHS_MULTIPLICATION_EQUALS(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_MATHS_MULTIPLICATION_EQUALS, 0) +} +/// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_DIVISION_EQUALS +/// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_DIVISION_EQUALS +fn OPERATOR_MATHS_DIVISION_EQUALS(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_MATHS_DIVISION_EQUALS, 0) +} +/// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_MODULUS_EQUALS +/// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_MODULUS_EQUALS +fn OPERATOR_MATHS_MODULUS_EQUALS(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_MATHS_MODULUS_EQUALS, 0) +} +/// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_ADDITION_EQUALS +/// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_ADDITION_EQUALS +fn OPERATOR_MATHS_ADDITION_EQUALS(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_MATHS_ADDITION_EQUALS, 0) +} +/// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_SUBTRACTION_EQUALS +/// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_SUBTRACTION_EQUALS +fn OPERATOR_MATHS_SUBTRACTION_EQUALS(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_MATHS_SUBTRACTION_EQUALS, 0) } -impl<'input> Set_statementContextAttrs<'input> for Set_statementContext<'input> {} +} + +impl<'input> Set_statementContextAttrs<'input> for Set_statementContext<'input>{} -impl<'input, I, H> YarnSpinnerParser<'input, I, H> +impl<'input, I> YarnSpinnerParser<'input, I> where - I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>, - H: ErrorStrategy<'input, BaseParserType<'input, I>>, -{ - pub fn set_statement(&mut self) -> Result>, ANTLRError> { - let mut recog = self; - let _parentctx = recog.ctx.take(); - let mut _localctx = - Set_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog - .base - .enter_rule(_localctx.clone(), 36, RULE_set_statement); + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + pub fn set_statement(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = Set_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 36, RULE_set_statement); let mut _localctx: Rc = _localctx; - let mut _la: isize = -1; - let result: Result<(), ANTLRError> = (|| { - //recog.base.enter_outer_alt(_localctx.clone(), 1); - recog.base.enter_outer_alt(None, 1); - { - recog.base.set_state(237); - recog - .base - .match_token(COMMAND_START, &mut recog.err_handler)?; - - recog.base.set_state(238); - recog - .base - .match_token(COMMAND_SET, &mut recog.err_handler)?; - - /*InvokeRule variable*/ - recog.base.set_state(239); - recog.variable()?; - - recog.base.set_state(240); - cast_mut::<_, Set_statementContext>(&mut _localctx).op = - recog.base.input.lt(1).cloned(); - - _la = recog.base.input.la(1); - if { - !(((_la - 31) & !0x3f) == 0 - && ((1usize << (_la - 31)) - & ((1usize << (OPERATOR_ASSIGNMENT - 31)) - | (1usize << (OPERATOR_MATHS_ADDITION_EQUALS - 31)) - | (1usize << (OPERATOR_MATHS_SUBTRACTION_EQUALS - 31)) - | (1usize << (OPERATOR_MATHS_MULTIPLICATION_EQUALS - 31)) - | (1usize << (OPERATOR_MATHS_MODULUS_EQUALS - 31)) - | (1usize << (OPERATOR_MATHS_DIVISION_EQUALS - 31)))) - != 0) - } { - let tmp = recog.err_handler.recover_inline(&mut recog.base)?; - cast_mut::<_, Set_statementContext>(&mut _localctx).op = Some(tmp.clone()); - } else { - if recog.base.input.la(1) == TOKEN_EOF { - recog.base.matched_eof = true - }; - recog.err_handler.report_match(&mut recog.base); - recog.base.consume(&mut recog.err_handler); - } - /*InvokeRule expression*/ - recog.base.set_state(241); - recog.expression_rec(0)?; - - recog.base.set_state(242); - recog - .base - .match_token(COMMAND_END, &mut recog.err_handler)?; - } - Ok(()) - })(); - match result { - Ok(_) => {} - Err(e @ ANTLRError::FallThrough(_)) => return Err(e), - Err(ref re) => { - //_localctx.exception = re; - recog.err_handler.report_error(&mut recog.base, re); - recog.err_handler.recover(&mut recog.base, re)?; - } - } - recog.base.exit_rule(); - - Ok(_localctx) - } + let mut _la: i32 = -1; + let result: Result<(), ANTLRError> = (|| { + + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(237); + recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; + + recog.base.set_state(238); + recog.base.match_token(YarnSpinnerParser_COMMAND_SET,&mut recog.err_handler)?; + + /*InvokeRule variable*/ + recog.base.set_state(239); + recog.variable()?; + + recog.base.set_state(240); + cast_mut::<_,Set_statementContext >(&mut _localctx).op = recog.base.input.lt(1).cloned(); + + _la = recog.base.input.la(1); + if { !(((((_la - 31)) & !0x3f) == 0 && ((1usize << (_la - 31)) & 63489) != 0)) } { + let tmp = recog.err_handler.recover_inline(&mut recog.base)?; + cast_mut::<_,Set_statementContext >(&mut _localctx).op = Some(tmp.clone()); + + + } + else { + if recog.base.input.la(1)==TOKEN_EOF { recog.base.matched_eof = true }; + recog.err_handler.report_match(&mut recog.base); + recog.base.consume(&mut recog.err_handler); + } + /*InvokeRule expression*/ + recog.base.set_state(241); + recog.expression_rec(0)?; + + recog.base.set_state(242); + recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; + + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) + } } //------------------- call_statement ---------------- pub type Call_statementContextAll<'input> = Call_statementContext<'input>; -pub type Call_statementContext<'input> = - BaseParserRuleContext<'input, Call_statementContextExt<'input>>; + +pub type Call_statementContext<'input> = BaseParserRuleContext<'input,Call_statementContextExt<'input>>; #[derive(Clone)] -pub struct Call_statementContextExt<'input> { - ph: PhantomData<&'input str>, +pub struct Call_statementContextExt<'input>{ +ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for Call_statementContext<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for Call_statementContext<'input>{} -impl<'input, 'a> Listenable + 'a> - for Call_statementContext<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_call_statement(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_call_statement(self); - listener.exit_every_rule(self); - } +impl<'input,'a> Listenable + 'a> for Call_statementContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_call_statement(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_call_statement(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input, 'a> Visitable + 'a> - for Call_statementContext<'input> -{ - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_call_statement(self); - } +impl<'input,'a> Visitable + 'a> for Call_statementContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_call_statement(self); + } } -impl<'input> CustomRuleContext<'input> for Call_statementContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_call_statement - } - //fn type_rule_index() -> usize where Self: Sized { RULE_call_statement } -} -antlr_rust::tid! {Call_statementContextExt<'a>} - -impl<'input> Call_statementContextExt<'input> { - fn new( - parent: Option + 'input>>, - invoking_state: isize, - ) -> Rc> { - Rc::new(BaseParserRuleContext::new_parser_ctx( - parent, - invoking_state, - Call_statementContextExt { ph: PhantomData }, - )) - } +impl<'input> CustomRuleContext<'input> for Call_statementContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_call_statement } + //fn type_rule_index() -> usize where Self: Sized { RULE_call_statement } +} +antlr4rust::tid!{Call_statementContextExt<'a>} + +impl<'input> Call_statementContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Call_statementContextExt{ + + ph:PhantomData + }), + ) + } +} + +pub trait Call_statementContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ + +/// Retrieves first TerminalNode corresponding to token COMMAND_START +/// Returns `None` if there is no child corresponding to token COMMAND_START +fn COMMAND_START(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_START, 0) +} +/// Retrieves first TerminalNode corresponding to token COMMAND_CALL +/// Returns `None` if there is no child corresponding to token COMMAND_CALL +fn COMMAND_CALL(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_CALL, 0) +} +fn function_call(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +/// Retrieves first TerminalNode corresponding to token COMMAND_END +/// Returns `None` if there is no child corresponding to token COMMAND_END +fn COMMAND_END(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_END, 0) } -pub trait Call_statementContextAttrs<'input>: - YarnSpinnerParserContext<'input> + BorrowMut> -{ - /// Retrieves first TerminalNode corresponding to token COMMAND_START - /// Returns `None` if there is no child corresponding to token COMMAND_START - fn COMMAND_START(&self) -> Option>> - where - Self: Sized, - { - self.get_token(COMMAND_START, 0) - } - /// Retrieves first TerminalNode corresponding to token COMMAND_CALL - /// Returns `None` if there is no child corresponding to token COMMAND_CALL - fn COMMAND_CALL(&self) -> Option>> - where - Self: Sized, - { - self.get_token(COMMAND_CALL, 0) - } - fn function_call(&self) -> Option>> - where - Self: Sized, - { - self.child_of_type(0) - } - /// Retrieves first TerminalNode corresponding to token COMMAND_END - /// Returns `None` if there is no child corresponding to token COMMAND_END - fn COMMAND_END(&self) -> Option>> - where - Self: Sized, - { - self.get_token(COMMAND_END, 0) - } } -impl<'input> Call_statementContextAttrs<'input> for Call_statementContext<'input> {} +impl<'input> Call_statementContextAttrs<'input> for Call_statementContext<'input>{} -impl<'input, I, H> YarnSpinnerParser<'input, I, H> +impl<'input, I> YarnSpinnerParser<'input, I> where - I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>, - H: ErrorStrategy<'input, BaseParserType<'input, I>>, -{ - pub fn call_statement(&mut self) -> Result>, ANTLRError> { - let mut recog = self; - let _parentctx = recog.ctx.take(); - let mut _localctx = - Call_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog - .base - .enter_rule(_localctx.clone(), 38, RULE_call_statement); + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + pub fn call_statement(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = Call_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 38, RULE_call_statement); let mut _localctx: Rc = _localctx; - let result: Result<(), ANTLRError> = (|| { - //recog.base.enter_outer_alt(_localctx.clone(), 1); - recog.base.enter_outer_alt(None, 1); - { - recog.base.set_state(244); - recog - .base - .match_token(COMMAND_START, &mut recog.err_handler)?; - - recog.base.set_state(245); - recog - .base - .match_token(COMMAND_CALL, &mut recog.err_handler)?; - - /*InvokeRule function_call*/ - recog.base.set_state(246); - recog.function_call()?; - - recog.base.set_state(247); - recog - .base - .match_token(COMMAND_END, &mut recog.err_handler)?; - } - Ok(()) - })(); - match result { - Ok(_) => {} - Err(e @ ANTLRError::FallThrough(_)) => return Err(e), - Err(ref re) => { - //_localctx.exception = re; - recog.err_handler.report_error(&mut recog.base, re); - recog.err_handler.recover(&mut recog.base, re)?; - } - } - recog.base.exit_rule(); - - Ok(_localctx) - } + let result: Result<(), ANTLRError> = (|| { + + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(244); + recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; + + recog.base.set_state(245); + recog.base.match_token(YarnSpinnerParser_COMMAND_CALL,&mut recog.err_handler)?; + + /*InvokeRule function_call*/ + recog.base.set_state(246); + recog.function_call()?; + + recog.base.set_state(247); + recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; + + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) + } } //------------------- command_statement ---------------- pub type Command_statementContextAll<'input> = Command_statementContext<'input>; -pub type Command_statementContext<'input> = - BaseParserRuleContext<'input, Command_statementContextExt<'input>>; + +pub type Command_statementContext<'input> = BaseParserRuleContext<'input,Command_statementContextExt<'input>>; #[derive(Clone)] -pub struct Command_statementContextExt<'input> { - ph: PhantomData<&'input str>, +pub struct Command_statementContextExt<'input>{ +ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for Command_statementContext<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for Command_statementContext<'input>{} -impl<'input, 'a> Listenable + 'a> - for Command_statementContext<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_command_statement(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_command_statement(self); - listener.exit_every_rule(self); - } +impl<'input,'a> Listenable + 'a> for Command_statementContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_command_statement(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_command_statement(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input, 'a> Visitable + 'a> - for Command_statementContext<'input> -{ - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_command_statement(self); - } +impl<'input,'a> Visitable + 'a> for Command_statementContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_command_statement(self); + } } -impl<'input> CustomRuleContext<'input> for Command_statementContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_command_statement - } - //fn type_rule_index() -> usize where Self: Sized { RULE_command_statement } -} -antlr_rust::tid! {Command_statementContextExt<'a>} - -impl<'input> Command_statementContextExt<'input> { - fn new( - parent: Option + 'input>>, - invoking_state: isize, - ) -> Rc> { - Rc::new(BaseParserRuleContext::new_parser_ctx( - parent, - invoking_state, - Command_statementContextExt { ph: PhantomData }, - )) - } +impl<'input> CustomRuleContext<'input> for Command_statementContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_command_statement } + //fn type_rule_index() -> usize where Self: Sized { RULE_command_statement } +} +antlr4rust::tid!{Command_statementContextExt<'a>} + +impl<'input> Command_statementContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Command_statementContextExt{ + + ph:PhantomData + }), + ) + } +} + +pub trait Command_statementContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ + +/// Retrieves first TerminalNode corresponding to token COMMAND_START +/// Returns `None` if there is no child corresponding to token COMMAND_START +fn COMMAND_START(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_START, 0) +} +fn command_formatted_text(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +/// Retrieves first TerminalNode corresponding to token COMMAND_TEXT_END +/// Returns `None` if there is no child corresponding to token COMMAND_TEXT_END +fn COMMAND_TEXT_END(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_TEXT_END, 0) +} +fn hashtag_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +fn hashtag(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) } -pub trait Command_statementContextAttrs<'input>: - YarnSpinnerParserContext<'input> + BorrowMut> -{ - /// Retrieves first TerminalNode corresponding to token COMMAND_START - /// Returns `None` if there is no child corresponding to token COMMAND_START - fn COMMAND_START(&self) -> Option>> - where - Self: Sized, - { - self.get_token(COMMAND_START, 0) - } - fn command_formatted_text(&self) -> Option>> - where - Self: Sized, - { - self.child_of_type(0) - } - /// Retrieves first TerminalNode corresponding to token COMMAND_TEXT_END - /// Returns `None` if there is no child corresponding to token COMMAND_TEXT_END - fn COMMAND_TEXT_END(&self) -> Option>> - where - Self: Sized, - { - self.get_token(COMMAND_TEXT_END, 0) - } - fn hashtag_all(&self) -> Vec>> - where - Self: Sized, - { - self.children_of_type() - } - fn hashtag(&self, i: usize) -> Option>> - where - Self: Sized, - { - self.child_of_type(i) - } } -impl<'input> Command_statementContextAttrs<'input> for Command_statementContext<'input> {} +impl<'input> Command_statementContextAttrs<'input> for Command_statementContext<'input>{} -impl<'input, I, H> YarnSpinnerParser<'input, I, H> +impl<'input, I> YarnSpinnerParser<'input, I> where - I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>, - H: ErrorStrategy<'input, BaseParserType<'input, I>>, -{ - pub fn command_statement( - &mut self, - ) -> Result>, ANTLRError> { - let mut recog = self; - let _parentctx = recog.ctx.take(); - let mut _localctx = - Command_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog - .base - .enter_rule(_localctx.clone(), 40, RULE_command_statement); + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + pub fn command_statement(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = Command_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 40, RULE_command_statement); let mut _localctx: Rc = _localctx; - let mut _la: isize = -1; - let result: Result<(), ANTLRError> = (|| { - //recog.base.enter_outer_alt(_localctx.clone(), 1); - recog.base.enter_outer_alt(None, 1); - { - recog.base.set_state(249); - recog - .base - .match_token(COMMAND_START, &mut recog.err_handler)?; - - /*InvokeRule command_formatted_text*/ - recog.base.set_state(250); - recog.command_formatted_text()?; - - recog.base.set_state(251); - recog - .base - .match_token(COMMAND_TEXT_END, &mut recog.err_handler)?; - - { - recog.base.set_state(255); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - while _la == HASHTAG { - { - { - /*InvokeRule hashtag*/ - recog.base.set_state(252); - recog.hashtag()?; - } - } - recog.base.set_state(257); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - } - } - } - Ok(()) - })(); - match result { - Ok(_) => {} - Err(e @ ANTLRError::FallThrough(_)) => return Err(e), - Err(ref re) => { - //_localctx.exception = re; - recog.err_handler.report_error(&mut recog.base, re); - recog.err_handler.recover(&mut recog.base, re)?; - } - } - recog.base.exit_rule(); - - Ok(_localctx) - } + let mut _la: i32 = -1; + let result: Result<(), ANTLRError> = (|| { + + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(249); + recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; + + /*InvokeRule command_formatted_text*/ + recog.base.set_state(250); + recog.command_formatted_text()?; + + recog.base.set_state(251); + recog.base.match_token(YarnSpinnerParser_COMMAND_TEXT_END,&mut recog.err_handler)?; + + { + recog.base.set_state(255); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + while _la==YarnSpinnerParser_HASHTAG { + { + { + /*InvokeRule hashtag*/ + recog.base.set_state(252); + recog.hashtag()?; + + } + } + recog.base.set_state(257); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + } + } + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) + } } //------------------- command_formatted_text ---------------- pub type Command_formatted_textContextAll<'input> = Command_formatted_textContext<'input>; -pub type Command_formatted_textContext<'input> = - BaseParserRuleContext<'input, Command_formatted_textContextExt<'input>>; + +pub type Command_formatted_textContext<'input> = BaseParserRuleContext<'input,Command_formatted_textContextExt<'input>>; #[derive(Clone)] -pub struct Command_formatted_textContextExt<'input> { - ph: PhantomData<&'input str>, +pub struct Command_formatted_textContextExt<'input>{ +ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for Command_formatted_textContext<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for Command_formatted_textContext<'input>{} -impl<'input, 'a> Listenable + 'a> - for Command_formatted_textContext<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_command_formatted_text(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_command_formatted_text(self); - listener.exit_every_rule(self); - } +impl<'input,'a> Listenable + 'a> for Command_formatted_textContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_command_formatted_text(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_command_formatted_text(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input, 'a> Visitable + 'a> - for Command_formatted_textContext<'input> -{ - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_command_formatted_text(self); - } +impl<'input,'a> Visitable + 'a> for Command_formatted_textContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_command_formatted_text(self); + } } -impl<'input> CustomRuleContext<'input> for Command_formatted_textContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_command_formatted_text - } - //fn type_rule_index() -> usize where Self: Sized { RULE_command_formatted_text } -} -antlr_rust::tid! {Command_formatted_textContextExt<'a>} - -impl<'input> Command_formatted_textContextExt<'input> { - fn new( - parent: Option + 'input>>, - invoking_state: isize, - ) -> Rc> { - Rc::new(BaseParserRuleContext::new_parser_ctx( - parent, - invoking_state, - Command_formatted_textContextExt { ph: PhantomData }, - )) - } +impl<'input> CustomRuleContext<'input> for Command_formatted_textContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_command_formatted_text } + //fn type_rule_index() -> usize where Self: Sized { RULE_command_formatted_text } } +antlr4rust::tid!{Command_formatted_textContextExt<'a>} -pub trait Command_formatted_textContextAttrs<'input>: - YarnSpinnerParserContext<'input> + BorrowMut> -{ - /// Retrieves all `TerminalNode`s corresponding to token COMMAND_TEXT in current rule - fn COMMAND_TEXT_all(&self) -> Vec>> - where - Self: Sized, - { - self.children_of_type() - } - /// Retrieves 'i's TerminalNode corresponding to token COMMAND_TEXT, starting from 0. - /// Returns `None` if number of children corresponding to token COMMAND_TEXT is less or equal than `i`. - fn COMMAND_TEXT( - &self, - i: usize, - ) -> Option>> - where - Self: Sized, - { - self.get_token(COMMAND_TEXT, i) - } - /// Retrieves all `TerminalNode`s corresponding to token COMMAND_EXPRESSION_START in current rule - fn COMMAND_EXPRESSION_START_all( - &self, - ) -> Vec>> - where - Self: Sized, - { - self.children_of_type() - } - /// Retrieves 'i's TerminalNode corresponding to token COMMAND_EXPRESSION_START, starting from 0. - /// Returns `None` if number of children corresponding to token COMMAND_EXPRESSION_START is less or equal than `i`. - fn COMMAND_EXPRESSION_START( - &self, - i: usize, - ) -> Option>> - where - Self: Sized, - { - self.get_token(COMMAND_EXPRESSION_START, i) - } - fn expression_all(&self) -> Vec>> - where - Self: Sized, - { - self.children_of_type() - } - fn expression(&self, i: usize) -> Option>> - where - Self: Sized, - { - self.child_of_type(i) - } - /// Retrieves all `TerminalNode`s corresponding to token EXPRESSION_END in current rule - fn EXPRESSION_END_all(&self) -> Vec>> - where - Self: Sized, - { - self.children_of_type() - } - /// Retrieves 'i's TerminalNode corresponding to token EXPRESSION_END, starting from 0. - /// Returns `None` if number of children corresponding to token EXPRESSION_END is less or equal than `i`. - fn EXPRESSION_END( - &self, - i: usize, - ) -> Option>> - where - Self: Sized, - { - self.get_token(EXPRESSION_END, i) - } +impl<'input> Command_formatted_textContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Command_formatted_textContextExt{ + + ph:PhantomData + }), + ) + } +} + +pub trait Command_formatted_textContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ + +/// Retrieves all `TerminalNode`s corresponding to token COMMAND_TEXT in current rule +fn COMMAND_TEXT_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +/// Retrieves 'i's TerminalNode corresponding to token COMMAND_TEXT, starting from 0. +/// Returns `None` if number of children corresponding to token COMMAND_TEXT is less or equal than `i`. +fn COMMAND_TEXT(&self, i: usize) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_TEXT, i) +} +/// Retrieves all `TerminalNode`s corresponding to token COMMAND_EXPRESSION_START in current rule +fn COMMAND_EXPRESSION_START_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +/// Retrieves 'i's TerminalNode corresponding to token COMMAND_EXPRESSION_START, starting from 0. +/// Returns `None` if number of children corresponding to token COMMAND_EXPRESSION_START is less or equal than `i`. +fn COMMAND_EXPRESSION_START(&self, i: usize) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_EXPRESSION_START, i) +} +fn expression_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +fn expression(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) +} +/// Retrieves all `TerminalNode`s corresponding to token EXPRESSION_END in current rule +fn EXPRESSION_END_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +/// Retrieves 'i's TerminalNode corresponding to token EXPRESSION_END, starting from 0. +/// Returns `None` if number of children corresponding to token EXPRESSION_END is less or equal than `i`. +fn EXPRESSION_END(&self, i: usize) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_EXPRESSION_END, i) } -impl<'input> Command_formatted_textContextAttrs<'input> for Command_formatted_textContext<'input> {} +} + +impl<'input> Command_formatted_textContextAttrs<'input> for Command_formatted_textContext<'input>{} -impl<'input, I, H> YarnSpinnerParser<'input, I, H> +impl<'input, I> YarnSpinnerParser<'input, I> where - I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>, - H: ErrorStrategy<'input, BaseParserType<'input, I>>, -{ - pub fn command_formatted_text( - &mut self, - ) -> Result>, ANTLRError> { - let mut recog = self; - let _parentctx = recog.ctx.take(); - let mut _localctx = - Command_formatted_textContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog - .base - .enter_rule(_localctx.clone(), 42, RULE_command_formatted_text); + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + pub fn command_formatted_text(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = Command_formatted_textContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 42, RULE_command_formatted_text); let mut _localctx: Rc = _localctx; - let mut _la: isize = -1; - let result: Result<(), ANTLRError> = (|| { - //recog.base.enter_outer_alt(_localctx.clone(), 1); - recog.base.enter_outer_alt(None, 1); - { - recog.base.set_state(265); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - while _la == COMMAND_EXPRESSION_START || _la == COMMAND_TEXT { - { - recog.base.set_state(263); - recog.err_handler.sync(&mut recog.base)?; - match recog.base.input.la(1) { - COMMAND_TEXT => { - recog.base.set_state(258); - recog - .base - .match_token(COMMAND_TEXT, &mut recog.err_handler)?; - } - - COMMAND_EXPRESSION_START => { - { - recog.base.set_state(259); - recog.base.match_token( - COMMAND_EXPRESSION_START, - &mut recog.err_handler, - )?; - - /*InvokeRule expression*/ - recog.base.set_state(260); - recog.expression_rec(0)?; - - recog.base.set_state(261); - recog - .base - .match_token(EXPRESSION_END, &mut recog.err_handler)?; - } - } - - _ => Err(ANTLRError::NoAltError(NoViableAltError::new( - &mut recog.base, - )))?, - } - } - recog.base.set_state(267); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - } - } - Ok(()) - })(); - match result { - Ok(_) => {} - Err(e @ ANTLRError::FallThrough(_)) => return Err(e), - Err(ref re) => { - //_localctx.exception = re; - recog.err_handler.report_error(&mut recog.base, re); - recog.err_handler.recover(&mut recog.base, re)?; - } - } - recog.base.exit_rule(); - - Ok(_localctx) - } + let mut _la: i32 = -1; + let result: Result<(), ANTLRError> = (|| { + + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(265); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + while _la==YarnSpinnerParser_COMMAND_EXPRESSION_START || _la==YarnSpinnerParser_COMMAND_TEXT { + { + recog.base.set_state(263); + recog.err_handler.sync(&mut recog.base)?; + match recog.base.input.la(1) { + YarnSpinnerParser_COMMAND_TEXT + => { + { + recog.base.set_state(258); + recog.base.match_token(YarnSpinnerParser_COMMAND_TEXT,&mut recog.err_handler)?; + + } + } + + YarnSpinnerParser_COMMAND_EXPRESSION_START + => { + { + recog.base.set_state(259); + recog.base.match_token(YarnSpinnerParser_COMMAND_EXPRESSION_START,&mut recog.err_handler)?; + + /*InvokeRule expression*/ + recog.base.set_state(260); + recog.expression_rec(0)?; + + recog.base.set_state(261); + recog.base.match_token(YarnSpinnerParser_EXPRESSION_END,&mut recog.err_handler)?; + + } + } + + _ => Err(ANTLRError::NoAltError(NoViableAltError::new(&mut recog.base)))? + } + } + recog.base.set_state(267); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + } + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) + } } //------------------- shortcut_option_statement ---------------- pub type Shortcut_option_statementContextAll<'input> = Shortcut_option_statementContext<'input>; -pub type Shortcut_option_statementContext<'input> = - BaseParserRuleContext<'input, Shortcut_option_statementContextExt<'input>>; + +pub type Shortcut_option_statementContext<'input> = BaseParserRuleContext<'input,Shortcut_option_statementContextExt<'input>>; #[derive(Clone)] -pub struct Shortcut_option_statementContextExt<'input> { - ph: PhantomData<&'input str>, +pub struct Shortcut_option_statementContextExt<'input>{ +ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for Shortcut_option_statementContext<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for Shortcut_option_statementContext<'input>{} -impl<'input, 'a> Listenable + 'a> - for Shortcut_option_statementContext<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_shortcut_option_statement(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_shortcut_option_statement(self); - listener.exit_every_rule(self); - } +impl<'input,'a> Listenable + 'a> for Shortcut_option_statementContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_shortcut_option_statement(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_shortcut_option_statement(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input, 'a> Visitable + 'a> - for Shortcut_option_statementContext<'input> -{ - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_shortcut_option_statement(self); - } +impl<'input,'a> Visitable + 'a> for Shortcut_option_statementContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_shortcut_option_statement(self); + } } -impl<'input> CustomRuleContext<'input> for Shortcut_option_statementContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_shortcut_option_statement - } - //fn type_rule_index() -> usize where Self: Sized { RULE_shortcut_option_statement } -} -antlr_rust::tid! {Shortcut_option_statementContextExt<'a>} - -impl<'input> Shortcut_option_statementContextExt<'input> { - fn new( - parent: Option + 'input>>, - invoking_state: isize, - ) -> Rc> { - Rc::new(BaseParserRuleContext::new_parser_ctx( - parent, - invoking_state, - Shortcut_option_statementContextExt { ph: PhantomData }, - )) - } +impl<'input> CustomRuleContext<'input> for Shortcut_option_statementContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_shortcut_option_statement } + //fn type_rule_index() -> usize where Self: Sized { RULE_shortcut_option_statement } } +antlr4rust::tid!{Shortcut_option_statementContextExt<'a>} -pub trait Shortcut_option_statementContextAttrs<'input>: - YarnSpinnerParserContext<'input> + BorrowMut> -{ - fn shortcut_option_all(&self) -> Vec>> - where - Self: Sized, - { - self.children_of_type() - } - fn shortcut_option(&self, i: usize) -> Option>> - where - Self: Sized, - { - self.child_of_type(i) - } - /// Retrieves first TerminalNode corresponding to token BLANK_LINE_FOLLOWING_OPTION - /// Returns `None` if there is no child corresponding to token BLANK_LINE_FOLLOWING_OPTION - fn BLANK_LINE_FOLLOWING_OPTION( - &self, - ) -> Option>> - where - Self: Sized, - { - self.get_token(BLANK_LINE_FOLLOWING_OPTION, 0) - } +impl<'input> Shortcut_option_statementContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Shortcut_option_statementContextExt{ + + ph:PhantomData + }), + ) + } +} + +pub trait Shortcut_option_statementContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ + +fn shortcut_option_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +fn shortcut_option(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) +} +/// Retrieves first TerminalNode corresponding to token BLANK_LINE_FOLLOWING_OPTION +/// Returns `None` if there is no child corresponding to token BLANK_LINE_FOLLOWING_OPTION +fn BLANK_LINE_FOLLOWING_OPTION(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_BLANK_LINE_FOLLOWING_OPTION, 0) } -impl<'input> Shortcut_option_statementContextAttrs<'input> - for Shortcut_option_statementContext<'input> -{ } -impl<'input, I, H> YarnSpinnerParser<'input, I, H> +impl<'input> Shortcut_option_statementContextAttrs<'input> for Shortcut_option_statementContext<'input>{} + +impl<'input, I> YarnSpinnerParser<'input, I> where - I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>, - H: ErrorStrategy<'input, BaseParserType<'input, I>>, -{ - pub fn shortcut_option_statement( - &mut self, - ) -> Result>, ANTLRError> { - let mut recog = self; - let _parentctx = recog.ctx.take(); - let mut _localctx = - Shortcut_option_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog - .base - .enter_rule(_localctx.clone(), 44, RULE_shortcut_option_statement); + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + pub fn shortcut_option_statement(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = Shortcut_option_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 44, RULE_shortcut_option_statement); let mut _localctx: Rc = _localctx; - let mut _la: isize = -1; - let result: Result<(), ANTLRError> = (|| { - let mut _alt: isize; - //recog.base.enter_outer_alt(_localctx.clone(), 1); - recog.base.enter_outer_alt(None, 1); - { - recog.base.set_state(271); - recog.err_handler.sync(&mut recog.base)?; - _alt = recog.interpreter.adaptive_predict(26, &mut recog.base)?; - while { _alt != 2 && _alt != INVALID_ALT } { - if _alt == 1 { - { - { - /*InvokeRule shortcut_option*/ - recog.base.set_state(268); - recog.shortcut_option()?; - } - } - } - recog.base.set_state(273); - recog.err_handler.sync(&mut recog.base)?; - _alt = recog.interpreter.adaptive_predict(26, &mut recog.base)?; - } - { - /*InvokeRule shortcut_option*/ - recog.base.set_state(274); - recog.shortcut_option()?; - - recog.base.set_state(276); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - if _la == BLANK_LINE_FOLLOWING_OPTION { - { - recog.base.set_state(275); - recog - .base - .match_token(BLANK_LINE_FOLLOWING_OPTION, &mut recog.err_handler)?; - } - } - } - } - Ok(()) - })(); - match result { - Ok(_) => {} - Err(e @ ANTLRError::FallThrough(_)) => return Err(e), - Err(ref re) => { - //_localctx.exception = re; - recog.err_handler.report_error(&mut recog.base, re); - recog.err_handler.recover(&mut recog.base, re)?; - } - } - recog.base.exit_rule(); - - Ok(_localctx) - } + let mut _la: i32 = -1; + let result: Result<(), ANTLRError> = (|| { + + let mut _alt: i32; + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(271); + recog.err_handler.sync(&mut recog.base)?; + _alt = recog.interpreter.adaptive_predict(26,&mut recog.base)?; + while { _alt!=2 && _alt!=INVALID_ALT } { + if _alt==1 { + { + { + /*InvokeRule shortcut_option*/ + recog.base.set_state(268); + recog.shortcut_option()?; + + } + } + } + recog.base.set_state(273); + recog.err_handler.sync(&mut recog.base)?; + _alt = recog.interpreter.adaptive_predict(26,&mut recog.base)?; + } + { + /*InvokeRule shortcut_option*/ + recog.base.set_state(274); + recog.shortcut_option()?; + + recog.base.set_state(276); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + if _la==YarnSpinnerParser_BLANK_LINE_FOLLOWING_OPTION { + { + recog.base.set_state(275); + recog.base.match_token(YarnSpinnerParser_BLANK_LINE_FOLLOWING_OPTION,&mut recog.err_handler)?; + + } + } + + } + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) + } } //------------------- shortcut_option ---------------- pub type Shortcut_optionContextAll<'input> = Shortcut_optionContext<'input>; -pub type Shortcut_optionContext<'input> = - BaseParserRuleContext<'input, Shortcut_optionContextExt<'input>>; + +pub type Shortcut_optionContext<'input> = BaseParserRuleContext<'input,Shortcut_optionContextExt<'input>>; #[derive(Clone)] -pub struct Shortcut_optionContextExt<'input> { - ph: PhantomData<&'input str>, +pub struct Shortcut_optionContextExt<'input>{ +ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for Shortcut_optionContext<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for Shortcut_optionContext<'input>{} -impl<'input, 'a> Listenable + 'a> - for Shortcut_optionContext<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_shortcut_option(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_shortcut_option(self); - listener.exit_every_rule(self); - } +impl<'input,'a> Listenable + 'a> for Shortcut_optionContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_shortcut_option(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_shortcut_option(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input, 'a> Visitable + 'a> - for Shortcut_optionContext<'input> -{ - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_shortcut_option(self); - } +impl<'input,'a> Visitable + 'a> for Shortcut_optionContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_shortcut_option(self); + } } -impl<'input> CustomRuleContext<'input> for Shortcut_optionContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_shortcut_option - } - //fn type_rule_index() -> usize where Self: Sized { RULE_shortcut_option } -} -antlr_rust::tid! {Shortcut_optionContextExt<'a>} - -impl<'input> Shortcut_optionContextExt<'input> { - fn new( - parent: Option + 'input>>, - invoking_state: isize, - ) -> Rc> { - Rc::new(BaseParserRuleContext::new_parser_ctx( - parent, - invoking_state, - Shortcut_optionContextExt { ph: PhantomData }, - )) - } +impl<'input> CustomRuleContext<'input> for Shortcut_optionContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_shortcut_option } + //fn type_rule_index() -> usize where Self: Sized { RULE_shortcut_option } +} +antlr4rust::tid!{Shortcut_optionContextExt<'a>} + +impl<'input> Shortcut_optionContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Shortcut_optionContextExt{ + + ph:PhantomData + }), + ) + } +} + +pub trait Shortcut_optionContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ + +/// Retrieves first TerminalNode corresponding to token SHORTCUT_ARROW +/// Returns `None` if there is no child corresponding to token SHORTCUT_ARROW +fn SHORTCUT_ARROW(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_SHORTCUT_ARROW, 0) +} +fn line_statement(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +/// Retrieves first TerminalNode corresponding to token INDENT +/// Returns `None` if there is no child corresponding to token INDENT +fn INDENT(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_INDENT, 0) +} +/// Retrieves first TerminalNode corresponding to token DEDENT +/// Returns `None` if there is no child corresponding to token DEDENT +fn DEDENT(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_DEDENT, 0) +} +fn statement_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +fn statement(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) } -pub trait Shortcut_optionContextAttrs<'input>: - YarnSpinnerParserContext<'input> + BorrowMut> -{ - /// Retrieves first TerminalNode corresponding to token SHORTCUT_ARROW - /// Returns `None` if there is no child corresponding to token SHORTCUT_ARROW - fn SHORTCUT_ARROW(&self) -> Option>> - where - Self: Sized, - { - self.get_token(SHORTCUT_ARROW, 0) - } - fn line_statement(&self) -> Option>> - where - Self: Sized, - { - self.child_of_type(0) - } - /// Retrieves first TerminalNode corresponding to token INDENT - /// Returns `None` if there is no child corresponding to token INDENT - fn INDENT(&self) -> Option>> - where - Self: Sized, - { - self.get_token(INDENT, 0) - } - /// Retrieves first TerminalNode corresponding to token DEDENT - /// Returns `None` if there is no child corresponding to token DEDENT - fn DEDENT(&self) -> Option>> - where - Self: Sized, - { - self.get_token(DEDENT, 0) - } - fn statement_all(&self) -> Vec>> - where - Self: Sized, - { - self.children_of_type() - } - fn statement(&self, i: usize) -> Option>> - where - Self: Sized, - { - self.child_of_type(i) - } } -impl<'input> Shortcut_optionContextAttrs<'input> for Shortcut_optionContext<'input> {} +impl<'input> Shortcut_optionContextAttrs<'input> for Shortcut_optionContext<'input>{} -impl<'input, I, H> YarnSpinnerParser<'input, I, H> +impl<'input, I> YarnSpinnerParser<'input, I> where - I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>, - H: ErrorStrategy<'input, BaseParserType<'input, I>>, -{ - pub fn shortcut_option(&mut self) -> Result>, ANTLRError> { - let mut recog = self; - let _parentctx = recog.ctx.take(); - let mut _localctx = - Shortcut_optionContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog - .base - .enter_rule(_localctx.clone(), 46, RULE_shortcut_option); + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + pub fn shortcut_option(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = Shortcut_optionContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 46, RULE_shortcut_option); let mut _localctx: Rc = _localctx; - let mut _la: isize = -1; - let result: Result<(), ANTLRError> = (|| { - //recog.base.enter_outer_alt(_localctx.clone(), 1); - recog.base.enter_outer_alt(None, 1); - { - recog.base.set_state(278); - recog - .base - .match_token(SHORTCUT_ARROW, &mut recog.err_handler)?; - - /*InvokeRule line_statement*/ - recog.base.set_state(279); - recog.line_statement()?; - - recog.base.set_state(288); - recog.err_handler.sync(&mut recog.base)?; - match recog.interpreter.adaptive_predict(29, &mut recog.base)? { - x if x == 1 => { - { - recog.base.set_state(280); - recog.base.match_token(INDENT, &mut recog.err_handler)?; - - recog.base.set_state(284); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - while (((_la) & !0x3f) == 0 - && ((1usize << _la) - & ((1usize << INDENT) - | (1usize << SHORTCUT_ARROW) - | (1usize << COMMAND_START) - | (1usize << EXPRESSION_START) - | (1usize << TEXT))) - != 0) - { - { - { - /*InvokeRule statement*/ - recog.base.set_state(281); - recog.statement()?; - } - } - recog.base.set_state(286); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - } - recog.base.set_state(287); - recog.base.match_token(DEDENT, &mut recog.err_handler)?; - } - } - - _ => {} - } - } - Ok(()) - })(); - match result { - Ok(_) => {} - Err(e @ ANTLRError::FallThrough(_)) => return Err(e), - Err(ref re) => { - //_localctx.exception = re; - recog.err_handler.report_error(&mut recog.base, re); - recog.err_handler.recover(&mut recog.base, re)?; - } - } - recog.base.exit_rule(); - - Ok(_localctx) - } + let mut _la: i32 = -1; + let result: Result<(), ANTLRError> = (|| { + + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(278); + recog.base.match_token(YarnSpinnerParser_SHORTCUT_ARROW,&mut recog.err_handler)?; + + /*InvokeRule line_statement*/ + recog.base.set_state(279); + recog.line_statement()?; + + recog.base.set_state(288); + recog.err_handler.sync(&mut recog.base)?; + match recog.interpreter.adaptive_predict(29,&mut recog.base)? { + x if x == 1=>{ + { + recog.base.set_state(280); + recog.base.match_token(YarnSpinnerParser_INDENT,&mut recog.err_handler)?; + + recog.base.set_state(284); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + while (((_la) & !0x3f) == 0 && ((1usize << _la) & 1163266) != 0) { + { + { + /*InvokeRule statement*/ + recog.base.set_state(281); + recog.statement()?; + + } + } + recog.base.set_state(286); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + } + recog.base.set_state(287); + recog.base.match_token(YarnSpinnerParser_DEDENT,&mut recog.err_handler)?; + + } + } + + _ => {} + } + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) + } } //------------------- declare_statement ---------------- pub type Declare_statementContextAll<'input> = Declare_statementContext<'input>; -pub type Declare_statementContext<'input> = - BaseParserRuleContext<'input, Declare_statementContextExt<'input>>; + +pub type Declare_statementContext<'input> = BaseParserRuleContext<'input,Declare_statementContextExt<'input>>; #[derive(Clone)] -pub struct Declare_statementContextExt<'input> { - pub declaration_type: Option>, - ph: PhantomData<&'input str>, +pub struct Declare_statementContextExt<'input>{ + pub type_: Option>, +ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for Declare_statementContext<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for Declare_statementContext<'input>{} -impl<'input, 'a> Listenable + 'a> - for Declare_statementContext<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_declare_statement(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_declare_statement(self); - listener.exit_every_rule(self); - } +impl<'input,'a> Listenable + 'a> for Declare_statementContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_declare_statement(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_declare_statement(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input, 'a> Visitable + 'a> - for Declare_statementContext<'input> -{ - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_declare_statement(self); - } +impl<'input,'a> Visitable + 'a> for Declare_statementContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_declare_statement(self); + } } -impl<'input> CustomRuleContext<'input> for Declare_statementContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_declare_statement - } - //fn type_rule_index() -> usize where Self: Sized { RULE_declare_statement } -} -antlr_rust::tid! {Declare_statementContextExt<'a>} - -impl<'input> Declare_statementContextExt<'input> { - fn new( - parent: Option + 'input>>, - invoking_state: isize, - ) -> Rc> { - Rc::new(BaseParserRuleContext::new_parser_ctx( - parent, - invoking_state, - Declare_statementContextExt { - declaration_type: None, - ph: PhantomData, - }, - )) - } +impl<'input> CustomRuleContext<'input> for Declare_statementContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_declare_statement } + //fn type_rule_index() -> usize where Self: Sized { RULE_declare_statement } } +antlr4rust::tid!{Declare_statementContextExt<'a>} -pub trait Declare_statementContextAttrs<'input>: - YarnSpinnerParserContext<'input> + BorrowMut> -{ - /// Retrieves first TerminalNode corresponding to token COMMAND_START - /// Returns `None` if there is no child corresponding to token COMMAND_START - fn COMMAND_START(&self) -> Option>> - where - Self: Sized, - { - self.get_token(COMMAND_START, 0) - } - /// Retrieves first TerminalNode corresponding to token COMMAND_DECLARE - /// Returns `None` if there is no child corresponding to token COMMAND_DECLARE - fn COMMAND_DECLARE(&self) -> Option>> - where - Self: Sized, - { - self.get_token(COMMAND_DECLARE, 0) - } - fn variable(&self) -> Option>> - where - Self: Sized, - { - self.child_of_type(0) - } - /// Retrieves first TerminalNode corresponding to token OPERATOR_ASSIGNMENT - /// Returns `None` if there is no child corresponding to token OPERATOR_ASSIGNMENT - fn OPERATOR_ASSIGNMENT(&self) -> Option>> - where - Self: Sized, - { - self.get_token(OPERATOR_ASSIGNMENT, 0) - } - fn value(&self) -> Option>> - where - Self: Sized, - { - self.child_of_type(0) - } - /// Retrieves first TerminalNode corresponding to token COMMAND_END - /// Returns `None` if there is no child corresponding to token COMMAND_END - fn COMMAND_END(&self) -> Option>> - where - Self: Sized, - { - self.get_token(COMMAND_END, 0) - } - /// Retrieves first TerminalNode corresponding to token EXPRESSION_AS - /// Returns `None` if there is no child corresponding to token EXPRESSION_AS - fn EXPRESSION_AS(&self) -> Option>> - where - Self: Sized, - { - self.get_token(EXPRESSION_AS, 0) - } - /// Retrieves first TerminalNode corresponding to token FUNC_ID - /// Returns `None` if there is no child corresponding to token FUNC_ID - fn FUNC_ID(&self) -> Option>> - where - Self: Sized, - { - self.get_token(FUNC_ID, 0) - } +impl<'input> Declare_statementContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Declare_statementContextExt{ + type_: None, + + ph:PhantomData + }), + ) + } +} + +pub trait Declare_statementContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ + +/// Retrieves first TerminalNode corresponding to token COMMAND_START +/// Returns `None` if there is no child corresponding to token COMMAND_START +fn COMMAND_START(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_START, 0) +} +/// Retrieves first TerminalNode corresponding to token COMMAND_DECLARE +/// Returns `None` if there is no child corresponding to token COMMAND_DECLARE +fn COMMAND_DECLARE(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_DECLARE, 0) +} +fn variable(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +/// Retrieves first TerminalNode corresponding to token OPERATOR_ASSIGNMENT +/// Returns `None` if there is no child corresponding to token OPERATOR_ASSIGNMENT +fn OPERATOR_ASSIGNMENT(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_ASSIGNMENT, 0) +} +fn value(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +/// Retrieves first TerminalNode corresponding to token COMMAND_END +/// Returns `None` if there is no child corresponding to token COMMAND_END +fn COMMAND_END(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_END, 0) +} +/// Retrieves first TerminalNode corresponding to token EXPRESSION_AS +/// Returns `None` if there is no child corresponding to token EXPRESSION_AS +fn EXPRESSION_AS(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_EXPRESSION_AS, 0) +} +/// Retrieves first TerminalNode corresponding to token FUNC_ID +/// Returns `None` if there is no child corresponding to token FUNC_ID +fn FUNC_ID(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_FUNC_ID, 0) } -impl<'input> Declare_statementContextAttrs<'input> for Declare_statementContext<'input> {} +} + +impl<'input> Declare_statementContextAttrs<'input> for Declare_statementContext<'input>{} -impl<'input, I, H> YarnSpinnerParser<'input, I, H> +impl<'input, I> YarnSpinnerParser<'input, I> where - I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>, - H: ErrorStrategy<'input, BaseParserType<'input, I>>, -{ - pub fn declare_statement( - &mut self, - ) -> Result>, ANTLRError> { - let mut recog = self; - let _parentctx = recog.ctx.take(); - let mut _localctx = - Declare_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog - .base - .enter_rule(_localctx.clone(), 48, RULE_declare_statement); + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + pub fn declare_statement(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = Declare_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 48, RULE_declare_statement); let mut _localctx: Rc = _localctx; - let mut _la: isize = -1; - let result: Result<(), ANTLRError> = (|| { - //recog.base.enter_outer_alt(_localctx.clone(), 1); - recog.base.enter_outer_alt(None, 1); - { - recog.base.set_state(290); - recog - .base - .match_token(COMMAND_START, &mut recog.err_handler)?; - - recog.base.set_state(291); - recog - .base - .match_token(COMMAND_DECLARE, &mut recog.err_handler)?; - - /*InvokeRule variable*/ - recog.base.set_state(292); - recog.variable()?; - - recog.base.set_state(293); - recog - .base - .match_token(OPERATOR_ASSIGNMENT, &mut recog.err_handler)?; - - /*InvokeRule value*/ - recog.base.set_state(294); - recog.value()?; - - recog.base.set_state(297); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - if _la == EXPRESSION_AS { - { - recog.base.set_state(295); - recog - .base - .match_token(EXPRESSION_AS, &mut recog.err_handler)?; - - recog.base.set_state(296); - let tmp = recog.base.match_token(FUNC_ID, &mut recog.err_handler)?; - cast_mut::<_, Declare_statementContext>(&mut _localctx).declaration_type = - Some(tmp.clone()); - } - } - - recog.base.set_state(299); - recog - .base - .match_token(COMMAND_END, &mut recog.err_handler)?; - } - Ok(()) - })(); - match result { - Ok(_) => {} - Err(e @ ANTLRError::FallThrough(_)) => return Err(e), - Err(ref re) => { - //_localctx.exception = re; - recog.err_handler.report_error(&mut recog.base, re); - recog.err_handler.recover(&mut recog.base, re)?; - } - } - recog.base.exit_rule(); - - Ok(_localctx) - } + let mut _la: i32 = -1; + let result: Result<(), ANTLRError> = (|| { + + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(290); + recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; + + recog.base.set_state(291); + recog.base.match_token(YarnSpinnerParser_COMMAND_DECLARE,&mut recog.err_handler)?; + + /*InvokeRule variable*/ + recog.base.set_state(292); + recog.variable()?; + + recog.base.set_state(293); + recog.base.match_token(YarnSpinnerParser_OPERATOR_ASSIGNMENT,&mut recog.err_handler)?; + + /*InvokeRule value*/ + recog.base.set_state(294); + recog.value()?; + + recog.base.set_state(297); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + if _la==YarnSpinnerParser_EXPRESSION_AS { + { + recog.base.set_state(295); + recog.base.match_token(YarnSpinnerParser_EXPRESSION_AS,&mut recog.err_handler)?; + + recog.base.set_state(296); + let tmp = recog.base.match_token(YarnSpinnerParser_FUNC_ID,&mut recog.err_handler)?; + cast_mut::<_,Declare_statementContext >(&mut _localctx).type_ = Some(tmp.clone()); + + + } + } + + recog.base.set_state(299); + recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; + + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) + } } //------------------- jump_statement ---------------- #[derive(Debug)] -pub enum Jump_statementContextAll<'input> { - JumpToNodeNameContext(JumpToNodeNameContext<'input>), - JumpToExpressionContext(JumpToExpressionContext<'input>), - Error(Jump_statementContext<'input>), +pub enum Jump_statementContextAll<'input>{ + JumpToNodeNameContext(JumpToNodeNameContext<'input>), + JumpToExpressionContext(JumpToExpressionContext<'input>), +Error(Jump_statementContext<'input>) } -antlr_rust::tid! {Jump_statementContextAll<'a>} +antlr4rust::tid!{Jump_statementContextAll<'a>} -impl<'input> antlr_rust::parser_rule_context::DerefSeal for Jump_statementContextAll<'input> {} +impl<'input> antlr4rust::parser_rule_context::DerefSeal for Jump_statementContextAll<'input>{} -impl<'input> YarnSpinnerParserContext<'input> for Jump_statementContextAll<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for Jump_statementContextAll<'input>{} -impl<'input> Deref for Jump_statementContextAll<'input> { - type Target = dyn Jump_statementContextAttrs<'input> + 'input; - fn deref(&self) -> &Self::Target { - use Jump_statementContextAll::*; - match self { - JumpToNodeNameContext(inner) => inner, - JumpToExpressionContext(inner) => inner, - Error(inner) => inner, - } - } +impl<'input> Deref for Jump_statementContextAll<'input>{ + type Target = dyn Jump_statementContextAttrs<'input> + 'input; + fn deref(&self) -> &Self::Target{ + use Jump_statementContextAll::*; + match self{ + JumpToNodeNameContext(inner) => inner, + JumpToExpressionContext(inner) => inner, +Error(inner) => inner + } + } } -impl<'input, 'a> Visitable + 'a> - for Jump_statementContextAll<'input> -{ - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - self.deref().accept(visitor) - } +impl<'input,'a> Visitable + 'a> for Jump_statementContextAll<'input>{ + fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { self.deref().accept(visitor) } } -impl<'input, 'a> Listenable + 'a> - for Jump_statementContextAll<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - self.deref().enter(listener) - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - self.deref().exit(listener) - } +impl<'input,'a> Listenable + 'a> for Jump_statementContextAll<'input>{ + fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { self.deref().enter(listener) } + fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { self.deref().exit(listener) } } -pub type Jump_statementContext<'input> = - BaseParserRuleContext<'input, Jump_statementContextExt<'input>>; -#[derive(Clone)] -pub struct Jump_statementContextExt<'input> { - ph: PhantomData<&'input str>, -} -impl<'input> YarnSpinnerParserContext<'input> for Jump_statementContext<'input> {} +pub type Jump_statementContext<'input> = BaseParserRuleContext<'input,Jump_statementContextExt<'input>>; -impl<'input, 'a> Listenable + 'a> - for Jump_statementContext<'input> -{ +#[derive(Clone)] +pub struct Jump_statementContextExt<'input>{ +ph:PhantomData<&'input str> } -impl<'input, 'a> Visitable + 'a> - for Jump_statementContext<'input> -{ -} +impl<'input> YarnSpinnerParserContext<'input> for Jump_statementContext<'input>{} -impl<'input> CustomRuleContext<'input> for Jump_statementContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_jump_statement - } - //fn type_rule_index() -> usize where Self: Sized { RULE_jump_statement } -} -antlr_rust::tid! {Jump_statementContextExt<'a>} - -impl<'input> Jump_statementContextExt<'input> { - fn new( - parent: Option + 'input>>, - invoking_state: isize, - ) -> Rc> { - Rc::new(Jump_statementContextAll::Error( - BaseParserRuleContext::new_parser_ctx( - parent, - invoking_state, - Jump_statementContextExt { ph: PhantomData }, - ), - )) - } +impl<'input,'a> Listenable + 'a> for Jump_statementContext<'input>{ } -pub trait Jump_statementContextAttrs<'input>: - YarnSpinnerParserContext<'input> + BorrowMut> -{ +impl<'input,'a> Visitable + 'a> for Jump_statementContext<'input>{ } -impl<'input> Jump_statementContextAttrs<'input> for Jump_statementContext<'input> {} - -pub type JumpToNodeNameContext<'input> = - BaseParserRuleContext<'input, JumpToNodeNameContextExt<'input>>; - -pub trait JumpToNodeNameContextAttrs<'input>: YarnSpinnerParserContext<'input> { - /// Retrieves first TerminalNode corresponding to token COMMAND_START - /// Returns `None` if there is no child corresponding to token COMMAND_START - fn COMMAND_START(&self) -> Option>> - where - Self: Sized, - { - self.get_token(COMMAND_START, 0) - } - /// Retrieves first TerminalNode corresponding to token COMMAND_JUMP - /// Returns `None` if there is no child corresponding to token COMMAND_JUMP - fn COMMAND_JUMP(&self) -> Option>> - where - Self: Sized, - { - self.get_token(COMMAND_JUMP, 0) - } - /// Retrieves first TerminalNode corresponding to token COMMAND_END - /// Returns `None` if there is no child corresponding to token COMMAND_END - fn COMMAND_END(&self) -> Option>> - where - Self: Sized, - { - self.get_token(COMMAND_END, 0) - } - /// Retrieves first TerminalNode corresponding to token ID - /// Returns `None` if there is no child corresponding to token ID - fn ID(&self) -> Option>> - where - Self: Sized, - { - self.get_token(ID, 0) - } +impl<'input> CustomRuleContext<'input> for Jump_statementContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_jump_statement } + //fn type_rule_index() -> usize where Self: Sized { RULE_jump_statement } } +antlr4rust::tid!{Jump_statementContextExt<'a>} -impl<'input> JumpToNodeNameContextAttrs<'input> for JumpToNodeNameContext<'input> {} +impl<'input> Jump_statementContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + Jump_statementContextAll::Error( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Jump_statementContextExt{ -pub struct JumpToNodeNameContextExt<'input> { - base: Jump_statementContextExt<'input>, - pub destination: Option>, - ph: PhantomData<&'input str>, + ph:PhantomData + }), + ) + ) + } } -antlr_rust::tid! {JumpToNodeNameContextExt<'a>} +pub trait Jump_statementContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ -impl<'input> YarnSpinnerParserContext<'input> for JumpToNodeNameContext<'input> {} -impl<'input, 'a> Listenable + 'a> - for JumpToNodeNameContext<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_jumpToNodeName(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_jumpToNodeName(self); - listener.exit_every_rule(self); - } } -impl<'input, 'a> Visitable + 'a> - for JumpToNodeNameContext<'input> -{ - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_jumpToNodeName(self); - } -} +impl<'input> Jump_statementContextAttrs<'input> for Jump_statementContext<'input>{} -impl<'input> CustomRuleContext<'input> for JumpToNodeNameContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_jump_statement - } - //fn type_rule_index() -> usize where Self: Sized { RULE_jump_statement } -} +pub type JumpToNodeNameContext<'input> = BaseParserRuleContext<'input,JumpToNodeNameContextExt<'input>>; -impl<'input> Borrow> for JumpToNodeNameContext<'input> { - fn borrow(&self) -> &Jump_statementContextExt<'input> { - &self.base - } -} -impl<'input> BorrowMut> for JumpToNodeNameContext<'input> { - fn borrow_mut(&mut self) -> &mut Jump_statementContextExt<'input> { - &mut self.base - } +pub trait JumpToNodeNameContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + /// Retrieves first TerminalNode corresponding to token COMMAND_START + /// Returns `None` if there is no child corresponding to token COMMAND_START + fn COMMAND_START(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_START, 0) + } + /// Retrieves first TerminalNode corresponding to token COMMAND_JUMP + /// Returns `None` if there is no child corresponding to token COMMAND_JUMP + fn COMMAND_JUMP(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_JUMP, 0) + } + /// Retrieves first TerminalNode corresponding to token COMMAND_END + /// Returns `None` if there is no child corresponding to token COMMAND_END + fn COMMAND_END(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_END, 0) + } + /// Retrieves first TerminalNode corresponding to token ID + /// Returns `None` if there is no child corresponding to token ID + fn ID(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_ID, 0) + } } -impl<'input> Jump_statementContextAttrs<'input> for JumpToNodeNameContext<'input> {} +impl<'input> JumpToNodeNameContextAttrs<'input> for JumpToNodeNameContext<'input>{} -impl<'input> JumpToNodeNameContextExt<'input> { - fn new(ctx: &dyn Jump_statementContextAttrs<'input>) -> Rc> { - Rc::new(Jump_statementContextAll::JumpToNodeNameContext( - BaseParserRuleContext::copy_from( - ctx, - JumpToNodeNameContextExt { - destination: None, - base: ctx.borrow().clone(), - ph: PhantomData, - }, - ), - )) - } +pub struct JumpToNodeNameContextExt<'input>{ + base:Jump_statementContextExt<'input>, + pub destination: Option>, + ph:PhantomData<&'input str> } -pub type JumpToExpressionContext<'input> = - BaseParserRuleContext<'input, JumpToExpressionContextExt<'input>>; +antlr4rust::tid!{JumpToNodeNameContextExt<'a>} -pub trait JumpToExpressionContextAttrs<'input>: YarnSpinnerParserContext<'input> { - /// Retrieves first TerminalNode corresponding to token COMMAND_START - /// Returns `None` if there is no child corresponding to token COMMAND_START - fn COMMAND_START(&self) -> Option>> - where - Self: Sized, - { - self.get_token(COMMAND_START, 0) - } - /// Retrieves first TerminalNode corresponding to token COMMAND_JUMP - /// Returns `None` if there is no child corresponding to token COMMAND_JUMP - fn COMMAND_JUMP(&self) -> Option>> - where - Self: Sized, - { - self.get_token(COMMAND_JUMP, 0) - } - /// Retrieves first TerminalNode corresponding to token EXPRESSION_START - /// Returns `None` if there is no child corresponding to token EXPRESSION_START - fn EXPRESSION_START(&self) -> Option>> - where - Self: Sized, - { - self.get_token(EXPRESSION_START, 0) - } - fn expression(&self) -> Option>> - where - Self: Sized, - { - self.child_of_type(0) - } - /// Retrieves first TerminalNode corresponding to token EXPRESSION_END - /// Returns `None` if there is no child corresponding to token EXPRESSION_END - fn EXPRESSION_END(&self) -> Option>> - where - Self: Sized, - { - self.get_token(EXPRESSION_END, 0) - } - /// Retrieves first TerminalNode corresponding to token COMMAND_END - /// Returns `None` if there is no child corresponding to token COMMAND_END - fn COMMAND_END(&self) -> Option>> - where - Self: Sized, - { - self.get_token(COMMAND_END, 0) - } -} - -impl<'input> JumpToExpressionContextAttrs<'input> for JumpToExpressionContext<'input> {} +impl<'input> YarnSpinnerParserContext<'input> for JumpToNodeNameContext<'input>{} -pub struct JumpToExpressionContextExt<'input> { - base: Jump_statementContextExt<'input>, - ph: PhantomData<&'input str>, +impl<'input,'a> Listenable + 'a> for JumpToNodeNameContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_jumpToNodeName(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_jumpToNodeName(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -antlr_rust::tid! {JumpToExpressionContextExt<'a>} - -impl<'input> YarnSpinnerParserContext<'input> for JumpToExpressionContext<'input> {} - -impl<'input, 'a> Listenable + 'a> - for JumpToExpressionContext<'input> -{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.enter_every_rule(self); - listener.enter_jumpToExpression(self); - } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) { - listener.exit_jumpToExpression(self); - listener.exit_every_rule(self); - } +impl<'input,'a> Visitable + 'a> for JumpToNodeNameContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_jumpToNodeName(self); + } } -impl<'input, 'a> Visitable + 'a> - for JumpToExpressionContext<'input> -{ - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_jumpToExpression(self); - } +impl<'input> CustomRuleContext<'input> for JumpToNodeNameContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_jump_statement } + //fn type_rule_index() -> usize where Self: Sized { RULE_jump_statement } } -impl<'input> CustomRuleContext<'input> for JumpToExpressionContextExt<'input> { - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { - RULE_jump_statement - } - //fn type_rule_index() -> usize where Self: Sized { RULE_jump_statement } +impl<'input> Borrow> for JumpToNodeNameContext<'input>{ + fn borrow(&self) -> &Jump_statementContextExt<'input> { &self.base } } - -impl<'input> Borrow> for JumpToExpressionContext<'input> { - fn borrow(&self) -> &Jump_statementContextExt<'input> { - &self.base - } +impl<'input> BorrowMut> for JumpToNodeNameContext<'input>{ + fn borrow_mut(&mut self) -> &mut Jump_statementContextExt<'input> { &mut self.base } } -impl<'input> BorrowMut> for JumpToExpressionContext<'input> { - fn borrow_mut(&mut self) -> &mut Jump_statementContextExt<'input> { - &mut self.base - } + +impl<'input> Jump_statementContextAttrs<'input> for JumpToNodeNameContext<'input> {} + +impl<'input> JumpToNodeNameContextExt<'input>{ + fn new(ctx: &dyn Jump_statementContextAttrs<'input>) -> Rc> { + Rc::new( + Jump_statementContextAll::JumpToNodeNameContext( + BaseParserRuleContext::copy_from(ctx,JumpToNodeNameContextExt{ + destination:None, + base: ctx.borrow().clone(), + ph:PhantomData + }) + ) + ) + } +} + +pub type JumpToExpressionContext<'input> = BaseParserRuleContext<'input,JumpToExpressionContextExt<'input>>; + +pub trait JumpToExpressionContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + /// Retrieves first TerminalNode corresponding to token COMMAND_START + /// Returns `None` if there is no child corresponding to token COMMAND_START + fn COMMAND_START(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_START, 0) + } + /// Retrieves first TerminalNode corresponding to token COMMAND_JUMP + /// Returns `None` if there is no child corresponding to token COMMAND_JUMP + fn COMMAND_JUMP(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_JUMP, 0) + } + /// Retrieves first TerminalNode corresponding to token EXPRESSION_START + /// Returns `None` if there is no child corresponding to token EXPRESSION_START + fn EXPRESSION_START(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_EXPRESSION_START, 0) + } + fn expression(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) + } + /// Retrieves first TerminalNode corresponding to token EXPRESSION_END + /// Returns `None` if there is no child corresponding to token EXPRESSION_END + fn EXPRESSION_END(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_EXPRESSION_END, 0) + } + /// Retrieves first TerminalNode corresponding to token COMMAND_END + /// Returns `None` if there is no child corresponding to token COMMAND_END + fn COMMAND_END(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_END, 0) + } +} + +impl<'input> JumpToExpressionContextAttrs<'input> for JumpToExpressionContext<'input>{} + +pub struct JumpToExpressionContextExt<'input>{ + base:Jump_statementContextExt<'input>, + ph:PhantomData<&'input str> +} + +antlr4rust::tid!{JumpToExpressionContextExt<'a>} + +impl<'input> YarnSpinnerParserContext<'input> for JumpToExpressionContext<'input>{} + +impl<'input,'a> Listenable + 'a> for JumpToExpressionContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_jumpToExpression(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_jumpToExpression(self); + listener.exit_every_rule(self)?; + Ok(()) + } +} + +impl<'input,'a> Visitable + 'a> for JumpToExpressionContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_jumpToExpression(self); + } +} + +impl<'input> CustomRuleContext<'input> for JumpToExpressionContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_jump_statement } + //fn type_rule_index() -> usize where Self: Sized { RULE_jump_statement } +} + +impl<'input> Borrow> for JumpToExpressionContext<'input>{ + fn borrow(&self) -> &Jump_statementContextExt<'input> { &self.base } +} +impl<'input> BorrowMut> for JumpToExpressionContext<'input>{ + fn borrow_mut(&mut self) -> &mut Jump_statementContextExt<'input> { &mut self.base } } impl<'input> Jump_statementContextAttrs<'input> for JumpToExpressionContext<'input> {} -impl<'input> JumpToExpressionContextExt<'input> { - fn new(ctx: &dyn Jump_statementContextAttrs<'input>) -> Rc> { - Rc::new(Jump_statementContextAll::JumpToExpressionContext( - BaseParserRuleContext::copy_from( - ctx, - JumpToExpressionContextExt { - base: ctx.borrow().clone(), - ph: PhantomData, - }, - ), - )) - } +impl<'input> JumpToExpressionContextExt<'input>{ + fn new(ctx: &dyn Jump_statementContextAttrs<'input>) -> Rc> { + Rc::new( + Jump_statementContextAll::JumpToExpressionContext( + BaseParserRuleContext::copy_from(ctx,JumpToExpressionContextExt{ + base: ctx.borrow().clone(), + ph:PhantomData + }) + ) + ) + } } -impl<'input, I, H> YarnSpinnerParser<'input, I, H> +impl<'input, I> YarnSpinnerParser<'input, I> where - I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>, - H: ErrorStrategy<'input, BaseParserType<'input, I>>, -{ - pub fn jump_statement(&mut self) -> Result>, ANTLRError> { - let mut recog = self; - let _parentctx = recog.ctx.take(); - let mut _localctx = - Jump_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog - .base - .enter_rule(_localctx.clone(), 50, RULE_jump_statement); + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + pub fn jump_statement(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = Jump_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 50, RULE_jump_statement); let mut _localctx: Rc = _localctx; - let result: Result<(), ANTLRError> = (|| { - recog.base.set_state(312); - recog.err_handler.sync(&mut recog.base)?; - match recog.interpreter.adaptive_predict(31, &mut recog.base)? { - 1 => { - let tmp = JumpToNodeNameContextExt::new(&**_localctx); - recog.base.enter_outer_alt(Some(tmp.clone()), 1); - _localctx = tmp; - { - recog.base.set_state(301); - recog - .base - .match_token(COMMAND_START, &mut recog.err_handler)?; - - recog.base.set_state(302); - recog - .base - .match_token(COMMAND_JUMP, &mut recog.err_handler)?; - - recog.base.set_state(303); - let tmp = recog.base.match_token(ID, &mut recog.err_handler)?; - if let Jump_statementContextAll::JumpToNodeNameContext(ctx) = - cast_mut::<_, Jump_statementContextAll>(&mut _localctx) - { - ctx.destination = Some(tmp.clone()); - } else { - unreachable!("cant cast"); - } - - recog.base.set_state(304); - recog - .base - .match_token(COMMAND_END, &mut recog.err_handler)?; - } - } - 2 => { - let tmp = JumpToExpressionContextExt::new(&**_localctx); - recog.base.enter_outer_alt(Some(tmp.clone()), 2); - _localctx = tmp; - { - recog.base.set_state(305); - recog - .base - .match_token(COMMAND_START, &mut recog.err_handler)?; - - recog.base.set_state(306); - recog - .base - .match_token(COMMAND_JUMP, &mut recog.err_handler)?; - - recog.base.set_state(307); - recog - .base - .match_token(EXPRESSION_START, &mut recog.err_handler)?; - - /*InvokeRule expression*/ - recog.base.set_state(308); - recog.expression_rec(0)?; - - recog.base.set_state(309); - recog - .base - .match_token(EXPRESSION_END, &mut recog.err_handler)?; - - recog.base.set_state(310); - recog - .base - .match_token(COMMAND_END, &mut recog.err_handler)?; - } - } - - _ => {} - } - Ok(()) - })(); - match result { - Ok(_) => {} - Err(e @ ANTLRError::FallThrough(_)) => return Err(e), - Err(ref re) => { - //_localctx.exception = re; - recog.err_handler.report_error(&mut recog.base, re); - recog.err_handler.recover(&mut recog.base, re)?; - } - } - recog.base.exit_rule(); - - Ok(_localctx) - } -} - -lazy_static! { + let result: Result<(), ANTLRError> = (|| { + + recog.base.set_state(312); + recog.err_handler.sync(&mut recog.base)?; + match recog.interpreter.adaptive_predict(31,&mut recog.base)? { + 1 =>{ + let tmp = JumpToNodeNameContextExt::new(&**_localctx); + recog.base.enter_outer_alt(Some(tmp.clone()), 1)?; + _localctx = tmp; + { + recog.base.set_state(301); + recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; + + recog.base.set_state(302); + recog.base.match_token(YarnSpinnerParser_COMMAND_JUMP,&mut recog.err_handler)?; + + recog.base.set_state(303); + let tmp = recog.base.match_token(YarnSpinnerParser_ID,&mut recog.err_handler)?; + if let Jump_statementContextAll::JumpToNodeNameContext(ctx) = cast_mut::<_,Jump_statementContextAll >(&mut _localctx){ + ctx.destination = Some(tmp.clone()); } else {unreachable!("cant cast");} + + recog.base.set_state(304); + recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; + + } + } + , + 2 =>{ + let tmp = JumpToExpressionContextExt::new(&**_localctx); + recog.base.enter_outer_alt(Some(tmp.clone()), 2)?; + _localctx = tmp; + { + recog.base.set_state(305); + recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; + + recog.base.set_state(306); + recog.base.match_token(YarnSpinnerParser_COMMAND_JUMP,&mut recog.err_handler)?; + + recog.base.set_state(307); + recog.base.match_token(YarnSpinnerParser_EXPRESSION_START,&mut recog.err_handler)?; + + /*InvokeRule expression*/ + recog.base.set_state(308); + recog.expression_rec(0)?; + + recog.base.set_state(309); + recog.base.match_token(YarnSpinnerParser_EXPRESSION_END,&mut recog.err_handler)?; + + recog.base.set_state(310); + recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; + + } + } + + _ => {} + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) + } +} + lazy_static!{ static ref _ATN: Arc = - Arc::new(ATNDeserializer::new(None).deserialize(_serializedATN.chars())); - static ref _decision_to_DFA: Arc>> = { + Arc::new(ATNDeserializer::new(None).deserialize(&mut _serializedATN.iter())); + static ref _decision_to_DFA: Arc>> = { let mut dfa = Vec::new(); - let size = _ATN.decision_to_state.len(); + let size = _ATN.decision_to_state.len() as i32; for i in 0..size { - dfa.push(DFA::new(_ATN.clone(), _ATN.get_decision_state(i), i as isize).into()) + dfa.push(DFA::new( + _ATN.clone(), + _ATN.get_decision_state(i), + i, + ).into()) } Arc::new(dfa) }; + static ref _serializedATN: Vec = vec![ + 4, 1, 84, 315, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, + 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, + 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, + 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, + 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, + 7, 25, 1, 0, 5, 0, 54, 8, 0, 10, 0, 12, 0, 57, 9, 0, 1, 0, 4, 0, 60, 8, + 0, 11, 0, 12, 0, 61, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 68, 8, 2, 11, 2, 12, + 2, 69, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 3, 3, 79, 8, 3, 1, 4, + 5, 4, 82, 8, 4, 10, 4, 12, 4, 85, 9, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, + 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 97, 8, 5, 10, 5, 12, 5, 100, 9, 5, + 1, 5, 3, 5, 103, 8, 5, 1, 6, 1, 6, 3, 6, 107, 8, 6, 1, 6, 5, 6, 110, 8, + 6, 10, 6, 12, 6, 113, 9, 6, 1, 6, 1, 6, 1, 7, 4, 7, 118, 8, 7, 11, 7, + 12, 7, 119, 1, 7, 1, 7, 1, 7, 1, 7, 4, 7, 126, 8, 7, 11, 7, 12, 7, 127, + 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, + 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 148, 8, 10, 1, 10, + 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, + 1, 10, 1, 10, 1, 10, 1, 10, 5, 10, 165, 8, 10, 10, 10, 12, 10, 168, 9, + 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 177, 8, 11, + 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 3, 13, 184, 8, 13, 1, 13, 1, 13, 5, + 13, 188, 8, 13, 10, 13, 12, 13, 191, 9, 13, 1, 13, 1, 13, 1, 14, 1, 14, + 5, 14, 197, 8, 14, 10, 14, 12, 14, 200, 9, 14, 1, 14, 3, 14, 203, 8, 14, + 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, + 214, 8, 15, 10, 15, 12, 15, 217, 9, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, + 16, 5, 16, 224, 8, 16, 10, 16, 12, 16, 227, 9, 16, 1, 17, 1, 17, 1, 17, + 1, 17, 5, 17, 233, 8, 17, 10, 17, 12, 17, 236, 9, 17, 1, 18, 1, 18, 1, + 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, + 20, 1, 20, 1, 20, 1, 20, 5, 20, 254, 8, 20, 10, 20, 12, 20, 257, 9, 20, + 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 5, 21, 264, 8, 21, 10, 21, 12, 21, + 267, 9, 21, 1, 22, 5, 22, 270, 8, 22, 10, 22, 12, 22, 273, 9, 22, 1, 22, + 1, 22, 3, 22, 277, 8, 22, 1, 23, 1, 23, 1, 23, 1, 23, 5, 23, 283, 8, 23, + 10, 23, 12, 23, 286, 9, 23, 1, 23, 3, 23, 289, 8, 23, 1, 24, 1, 24, 1, + 24, 1, 24, 1, 24, 1, 24, 1, 24, 3, 24, 298, 8, 24, 1, 24, 1, 24, 1, 25, + 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, + 3, 25, 313, 8, 25, 1, 25, 0, 1, 20, 26, 0, 2, 4, 6, 8, 10, 12, 14, 16, + 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 0, + 6, 1, 0, 49, 51, 1, 0, 47, 48, 2, 0, 32, 33, 35, 36, 2, 0, 34, 34, 37, + 37, 1, 0, 38, 40, 2, 0, 31, 31, 42, 46, 337, 0, 55, 1, 0, 0, 0, 2, 63, + 1, 0, 0, 0, 4, 67, 1, 0, 0, 0, 6, 75, 1, 0, 0, 0, 8, 83, 1, 0, 0, 0, 10, + 102, 1, 0, 0, 0, 12, 104, 1, 0, 0, 0, 14, 125, 1, 0, 0, 0, 16, 129, 1, + 0, 0, 0, 18, 132, 1, 0, 0, 0, 20, 147, 1, 0, 0, 0, 22, 176, 1, 0, 0, 0, + 24, 178, 1, 0, 0, 0, 26, 180, 1, 0, 0, 0, 28, 194, 1, 0, 0, 0, 30, 208, + 1, 0, 0, 0, 32, 218, 1, 0, 0, 0, 34, 228, 1, 0, 0, 0, 36, 237, 1, 0, 0, + 0, 38, 244, 1, 0, 0, 0, 40, 249, 1, 0, 0, 0, 42, 265, 1, 0, 0, 0, 44, + 271, 1, 0, 0, 0, 46, 278, 1, 0, 0, 0, 48, 290, 1, 0, 0, 0, 50, 312, 1, + 0, 0, 0, 52, 54, 3, 2, 1, 0, 53, 52, 1, 0, 0, 0, 54, 57, 1, 0, 0, 0, 55, + 53, 1, 0, 0, 0, 55, 56, 1, 0, 0, 0, 56, 59, 1, 0, 0, 0, 57, 55, 1, 0, + 0, 0, 58, 60, 3, 4, 2, 0, 59, 58, 1, 0, 0, 0, 60, 61, 1, 0, 0, 0, 61, + 59, 1, 0, 0, 0, 61, 62, 1, 0, 0, 0, 62, 1, 1, 0, 0, 0, 63, 64, 5, 10, + 0, 0, 64, 65, 5, 26, 0, 0, 65, 3, 1, 0, 0, 0, 66, 68, 3, 6, 3, 0, 67, + 66, 1, 0, 0, 0, 68, 69, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 69, 70, 1, 0, + 0, 0, 70, 71, 1, 0, 0, 0, 71, 72, 5, 8, 0, 0, 72, 73, 3, 8, 4, 0, 73, + 74, 5, 13, 0, 0, 74, 5, 1, 0, 0, 0, 75, 76, 5, 7, 0, 0, 76, 78, 5, 9, + 0, 0, 77, 79, 5, 11, 0, 0, 78, 77, 1, 0, 0, 0, 78, 79, 1, 0, 0, 0, 79, + 7, 1, 0, 0, 0, 80, 82, 3, 10, 5, 0, 81, 80, 1, 0, 0, 0, 82, 85, 1, 0, + 0, 0, 83, 81, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 9, 1, 0, 0, 0, 85, 83, + 1, 0, 0, 0, 86, 103, 3, 12, 6, 0, 87, 103, 3, 28, 14, 0, 88, 103, 3, 36, + 18, 0, 89, 103, 3, 44, 22, 0, 90, 103, 3, 38, 19, 0, 91, 103, 3, 40, 20, + 0, 92, 103, 3, 48, 24, 0, 93, 103, 3, 50, 25, 0, 94, 98, 5, 1, 0, 0, 95, + 97, 3, 10, 5, 0, 96, 95, 1, 0, 0, 0, 97, 100, 1, 0, 0, 0, 98, 96, 1, 0, + 0, 0, 98, 99, 1, 0, 0, 0, 99, 101, 1, 0, 0, 0, 100, 98, 1, 0, 0, 0, 101, + 103, 5, 2, 0, 0, 102, 86, 1, 0, 0, 0, 102, 87, 1, 0, 0, 0, 102, 88, 1, + 0, 0, 0, 102, 89, 1, 0, 0, 0, 102, 90, 1, 0, 0, 0, 102, 91, 1, 0, 0, 0, + 102, 92, 1, 0, 0, 0, 102, 93, 1, 0, 0, 0, 102, 94, 1, 0, 0, 0, 103, 11, + 1, 0, 0, 0, 104, 106, 3, 14, 7, 0, 105, 107, 3, 18, 9, 0, 106, 105, 1, + 0, 0, 0, 106, 107, 1, 0, 0, 0, 107, 111, 1, 0, 0, 0, 108, 110, 3, 16, + 8, 0, 109, 108, 1, 0, 0, 0, 110, 113, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, + 111, 112, 1, 0, 0, 0, 112, 114, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, + 115, 5, 6, 0, 0, 115, 13, 1, 0, 0, 0, 116, 118, 5, 20, 0, 0, 117, 116, + 1, 0, 0, 0, 118, 119, 1, 0, 0, 0, 119, 117, 1, 0, 0, 0, 119, 120, 1, 0, + 0, 0, 120, 126, 1, 0, 0, 0, 121, 122, 5, 16, 0, 0, 122, 123, 3, 20, 10, + 0, 123, 124, 5, 58, 0, 0, 124, 126, 1, 0, 0, 0, 125, 117, 1, 0, 0, 0, + 125, 121, 1, 0, 0, 0, 126, 127, 1, 0, 0, 0, 127, 125, 1, 0, 0, 0, 127, + 128, 1, 0, 0, 0, 128, 15, 1, 0, 0, 0, 129, 130, 5, 10, 0, 0, 130, 131, + 5, 26, 0, 0, 131, 17, 1, 0, 0, 0, 132, 133, 5, 15, 0, 0, 133, 134, 5, + 64, 0, 0, 134, 135, 3, 20, 10, 0, 135, 136, 5, 76, 0, 0, 136, 19, 1, 0, + 0, 0, 137, 138, 6, 10, -1, 0, 138, 139, 5, 52, 0, 0, 139, 140, 3, 20, + 10, 0, 140, 141, 5, 53, 0, 0, 141, 148, 1, 0, 0, 0, 142, 143, 5, 48, 0, + 0, 143, 148, 3, 20, 10, 8, 144, 145, 5, 41, 0, 0, 145, 148, 3, 20, 10, + 7, 146, 148, 3, 22, 11, 0, 147, 137, 1, 0, 0, 0, 147, 142, 1, 0, 0, 0, + 147, 144, 1, 0, 0, 0, 147, 146, 1, 0, 0, 0, 148, 166, 1, 0, 0, 0, 149, + 150, 10, 6, 0, 0, 150, 151, 7, 0, 0, 0, 151, 165, 3, 20, 10, 7, 152, 153, + 10, 5, 0, 0, 153, 154, 7, 1, 0, 0, 154, 165, 3, 20, 10, 6, 155, 156, 10, + 4, 0, 0, 156, 157, 7, 2, 0, 0, 157, 165, 3, 20, 10, 5, 158, 159, 10, 3, + 0, 0, 159, 160, 7, 3, 0, 0, 160, 165, 3, 20, 10, 4, 161, 162, 10, 2, 0, + 0, 162, 163, 7, 4, 0, 0, 163, 165, 3, 20, 10, 3, 164, 149, 1, 0, 0, 0, + 164, 152, 1, 0, 0, 0, 164, 155, 1, 0, 0, 0, 164, 158, 1, 0, 0, 0, 164, + 161, 1, 0, 0, 0, 165, 168, 1, 0, 0, 0, 166, 164, 1, 0, 0, 0, 166, 167, + 1, 0, 0, 0, 167, 21, 1, 0, 0, 0, 168, 166, 1, 0, 0, 0, 169, 177, 5, 61, + 0, 0, 170, 177, 5, 28, 0, 0, 171, 177, 5, 29, 0, 0, 172, 177, 3, 24, 12, + 0, 173, 177, 5, 56, 0, 0, 174, 177, 5, 30, 0, 0, 175, 177, 3, 26, 13, + 0, 176, 169, 1, 0, 0, 0, 176, 170, 1, 0, 0, 0, 176, 171, 1, 0, 0, 0, 176, + 172, 1, 0, 0, 0, 176, 173, 1, 0, 0, 0, 176, 174, 1, 0, 0, 0, 176, 175, + 1, 0, 0, 0, 177, 23, 1, 0, 0, 0, 178, 179, 5, 59, 0, 0, 179, 25, 1, 0, + 0, 0, 180, 181, 5, 57, 0, 0, 181, 183, 5, 52, 0, 0, 182, 184, 3, 20, 10, + 0, 183, 182, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 189, 1, 0, 0, 0, 185, + 186, 5, 54, 0, 0, 186, 188, 3, 20, 10, 0, 187, 185, 1, 0, 0, 0, 188, 191, + 1, 0, 0, 0, 189, 187, 1, 0, 0, 0, 189, 190, 1, 0, 0, 0, 190, 192, 1, 0, + 0, 0, 191, 189, 1, 0, 0, 0, 192, 193, 5, 53, 0, 0, 193, 27, 1, 0, 0, 0, + 194, 198, 3, 30, 15, 0, 195, 197, 3, 32, 16, 0, 196, 195, 1, 0, 0, 0, + 197, 200, 1, 0, 0, 0, 198, 196, 1, 0, 0, 0, 198, 199, 1, 0, 0, 0, 199, + 202, 1, 0, 0, 0, 200, 198, 1, 0, 0, 0, 201, 203, 3, 34, 17, 0, 202, 201, + 1, 0, 0, 0, 202, 203, 1, 0, 0, 0, 203, 204, 1, 0, 0, 0, 204, 205, 5, 15, + 0, 0, 205, 206, 5, 68, 0, 0, 206, 207, 5, 76, 0, 0, 207, 29, 1, 0, 0, + 0, 208, 209, 5, 15, 0, 0, 209, 210, 5, 64, 0, 0, 210, 211, 3, 20, 10, + 0, 211, 215, 5, 76, 0, 0, 212, 214, 3, 10, 5, 0, 213, 212, 1, 0, 0, 0, + 214, 217, 1, 0, 0, 0, 215, 213, 1, 0, 0, 0, 215, 216, 1, 0, 0, 0, 216, + 31, 1, 0, 0, 0, 217, 215, 1, 0, 0, 0, 218, 219, 5, 15, 0, 0, 219, 220, + 5, 65, 0, 0, 220, 221, 3, 20, 10, 0, 221, 225, 5, 76, 0, 0, 222, 224, + 3, 10, 5, 0, 223, 222, 1, 0, 0, 0, 224, 227, 1, 0, 0, 0, 225, 223, 1, + 0, 0, 0, 225, 226, 1, 0, 0, 0, 226, 33, 1, 0, 0, 0, 227, 225, 1, 0, 0, + 0, 228, 229, 5, 15, 0, 0, 229, 230, 5, 66, 0, 0, 230, 234, 5, 76, 0, 0, + 231, 233, 3, 10, 5, 0, 232, 231, 1, 0, 0, 0, 233, 236, 1, 0, 0, 0, 234, + 232, 1, 0, 0, 0, 234, 235, 1, 0, 0, 0, 235, 35, 1, 0, 0, 0, 236, 234, + 1, 0, 0, 0, 237, 238, 5, 15, 0, 0, 238, 239, 5, 67, 0, 0, 239, 240, 3, + 24, 12, 0, 240, 241, 7, 5, 0, 0, 241, 242, 3, 20, 10, 0, 242, 243, 5, + 76, 0, 0, 243, 37, 1, 0, 0, 0, 244, 245, 5, 15, 0, 0, 245, 246, 5, 69, + 0, 0, 246, 247, 3, 26, 13, 0, 247, 248, 5, 76, 0, 0, 248, 39, 1, 0, 0, + 0, 249, 250, 5, 15, 0, 0, 250, 251, 3, 42, 21, 0, 251, 255, 5, 78, 0, + 0, 252, 254, 3, 16, 8, 0, 253, 252, 1, 0, 0, 0, 254, 257, 1, 0, 0, 0, + 255, 253, 1, 0, 0, 0, 255, 256, 1, 0, 0, 0, 256, 41, 1, 0, 0, 0, 257, + 255, 1, 0, 0, 0, 258, 264, 5, 80, 0, 0, 259, 260, 5, 79, 0, 0, 260, 261, + 3, 20, 10, 0, 261, 262, 5, 58, 0, 0, 262, 264, 1, 0, 0, 0, 263, 258, 1, + 0, 0, 0, 263, 259, 1, 0, 0, 0, 264, 267, 1, 0, 0, 0, 265, 263, 1, 0, 0, + 0, 265, 266, 1, 0, 0, 0, 266, 43, 1, 0, 0, 0, 267, 265, 1, 0, 0, 0, 268, + 270, 3, 46, 23, 0, 269, 268, 1, 0, 0, 0, 270, 273, 1, 0, 0, 0, 271, 269, + 1, 0, 0, 0, 271, 272, 1, 0, 0, 0, 272, 274, 1, 0, 0, 0, 273, 271, 1, 0, + 0, 0, 274, 276, 3, 46, 23, 0, 275, 277, 5, 3, 0, 0, 276, 275, 1, 0, 0, + 0, 276, 277, 1, 0, 0, 0, 277, 45, 1, 0, 0, 0, 278, 279, 5, 14, 0, 0, 279, + 288, 3, 12, 6, 0, 280, 284, 5, 1, 0, 0, 281, 283, 3, 10, 5, 0, 282, 281, + 1, 0, 0, 0, 283, 286, 1, 0, 0, 0, 284, 282, 1, 0, 0, 0, 284, 285, 1, 0, + 0, 0, 285, 287, 1, 0, 0, 0, 286, 284, 1, 0, 0, 0, 287, 289, 5, 2, 0, 0, + 288, 280, 1, 0, 0, 0, 288, 289, 1, 0, 0, 0, 289, 47, 1, 0, 0, 0, 290, + 291, 5, 15, 0, 0, 291, 292, 5, 70, 0, 0, 292, 293, 3, 24, 12, 0, 293, + 294, 5, 31, 0, 0, 294, 297, 3, 22, 11, 0, 295, 296, 5, 55, 0, 0, 296, + 298, 5, 57, 0, 0, 297, 295, 1, 0, 0, 0, 297, 298, 1, 0, 0, 0, 298, 299, + 1, 0, 0, 0, 299, 300, 5, 76, 0, 0, 300, 49, 1, 0, 0, 0, 301, 302, 5, 15, + 0, 0, 302, 303, 5, 71, 0, 0, 303, 304, 5, 7, 0, 0, 304, 313, 5, 76, 0, + 0, 305, 306, 5, 15, 0, 0, 306, 307, 5, 71, 0, 0, 307, 308, 5, 16, 0, 0, + 308, 309, 3, 20, 10, 0, 309, 310, 5, 58, 0, 0, 310, 311, 5, 76, 0, 0, + 311, 313, 1, 0, 0, 0, 312, 301, 1, 0, 0, 0, 312, 305, 1, 0, 0, 0, 313, + 51, 1, 0, 0, 0, 32, 55, 61, 69, 78, 83, 98, 102, 106, 111, 119, 125, 127, + 147, 164, 166, 176, 183, 189, 198, 202, 215, 225, 234, 255, 263, 265, + 271, 276, 284, 288, 297, 312 + ]; } - -const _serializedATN: &'static str = "\x03\u{608b}\u{a72a}\u{8133}\u{b9ed}\u{417c}\u{3be7}\u{7786}\u{5964}\x03\ - \x56\u{13d}\x04\x02\x09\x02\x04\x03\x09\x03\x04\x04\x09\x04\x04\x05\x09\ - \x05\x04\x06\x09\x06\x04\x07\x09\x07\x04\x08\x09\x08\x04\x09\x09\x09\x04\ - \x0a\x09\x0a\x04\x0b\x09\x0b\x04\x0c\x09\x0c\x04\x0d\x09\x0d\x04\x0e\x09\ - \x0e\x04\x0f\x09\x0f\x04\x10\x09\x10\x04\x11\x09\x11\x04\x12\x09\x12\x04\ - \x13\x09\x13\x04\x14\x09\x14\x04\x15\x09\x15\x04\x16\x09\x16\x04\x17\x09\ - \x17\x04\x18\x09\x18\x04\x19\x09\x19\x04\x1a\x09\x1a\x04\x1b\x09\x1b\x03\ - \x02\x07\x02\x38\x0a\x02\x0c\x02\x0e\x02\x3b\x0b\x02\x03\x02\x06\x02\x3e\ - \x0a\x02\x0d\x02\x0e\x02\x3f\x03\x03\x03\x03\x03\x03\x03\x04\x06\x04\x46\ - \x0a\x04\x0d\x04\x0e\x04\x47\x03\x04\x03\x04\x03\x04\x03\x04\x03\x05\x03\ - \x05\x03\x05\x05\x05\x51\x0a\x05\x03\x06\x07\x06\x54\x0a\x06\x0c\x06\x0e\ - \x06\x57\x0b\x06\x03\x07\x03\x07\x03\x07\x03\x07\x03\x07\x03\x07\x03\x07\ - \x03\x07\x03\x07\x03\x07\x07\x07\x63\x0a\x07\x0c\x07\x0e\x07\x66\x0b\x07\ - \x03\x07\x05\x07\x69\x0a\x07\x03\x08\x03\x08\x05\x08\x6d\x0a\x08\x03\x08\ - \x07\x08\x70\x0a\x08\x0c\x08\x0e\x08\x73\x0b\x08\x03\x08\x03\x08\x03\x09\ - \x06\x09\x78\x0a\x09\x0d\x09\x0e\x09\x79\x03\x09\x03\x09\x03\x09\x03\x09\ - \x06\x09\u{80}\x0a\x09\x0d\x09\x0e\x09\u{81}\x03\x0a\x03\x0a\x03\x0a\x03\ - \x0b\x03\x0b\x03\x0b\x03\x0b\x03\x0b\x03\x0c\x03\x0c\x03\x0c\x03\x0c\x03\ - \x0c\x03\x0c\x03\x0c\x03\x0c\x03\x0c\x03\x0c\x05\x0c\u{96}\x0a\x0c\x03\x0c\ - \x03\x0c\x03\x0c\x03\x0c\x03\x0c\x03\x0c\x03\x0c\x03\x0c\x03\x0c\x03\x0c\ - \x03\x0c\x03\x0c\x03\x0c\x03\x0c\x03\x0c\x07\x0c\u{a7}\x0a\x0c\x0c\x0c\x0e\ - \x0c\u{aa}\x0b\x0c\x03\x0d\x03\x0d\x03\x0d\x03\x0d\x03\x0d\x03\x0d\x03\x0d\ - \x05\x0d\u{b3}\x0a\x0d\x03\x0e\x03\x0e\x03\x0f\x03\x0f\x03\x0f\x05\x0f\u{ba}\ - \x0a\x0f\x03\x0f\x03\x0f\x07\x0f\u{be}\x0a\x0f\x0c\x0f\x0e\x0f\u{c1}\x0b\ - \x0f\x03\x0f\x03\x0f\x03\x10\x03\x10\x07\x10\u{c7}\x0a\x10\x0c\x10\x0e\x10\ - \u{ca}\x0b\x10\x03\x10\x05\x10\u{cd}\x0a\x10\x03\x10\x03\x10\x03\x10\x03\ - \x10\x03\x11\x03\x11\x03\x11\x03\x11\x03\x11\x07\x11\u{d8}\x0a\x11\x0c\x11\ - \x0e\x11\u{db}\x0b\x11\x03\x12\x03\x12\x03\x12\x03\x12\x03\x12\x07\x12\u{e2}\ - \x0a\x12\x0c\x12\x0e\x12\u{e5}\x0b\x12\x03\x13\x03\x13\x03\x13\x03\x13\x07\ - \x13\u{eb}\x0a\x13\x0c\x13\x0e\x13\u{ee}\x0b\x13\x03\x14\x03\x14\x03\x14\ - \x03\x14\x03\x14\x03\x14\x03\x14\x03\x15\x03\x15\x03\x15\x03\x15\x03\x15\ - \x03\x16\x03\x16\x03\x16\x03\x16\x07\x16\u{100}\x0a\x16\x0c\x16\x0e\x16\ - \u{103}\x0b\x16\x03\x17\x03\x17\x03\x17\x03\x17\x03\x17\x07\x17\u{10a}\x0a\ - \x17\x0c\x17\x0e\x17\u{10d}\x0b\x17\x03\x18\x07\x18\u{110}\x0a\x18\x0c\x18\ - \x0e\x18\u{113}\x0b\x18\x03\x18\x03\x18\x05\x18\u{117}\x0a\x18\x03\x19\x03\ - \x19\x03\x19\x03\x19\x07\x19\u{11d}\x0a\x19\x0c\x19\x0e\x19\u{120}\x0b\x19\ - \x03\x19\x05\x19\u{123}\x0a\x19\x03\x1a\x03\x1a\x03\x1a\x03\x1a\x03\x1a\ - \x03\x1a\x03\x1a\x05\x1a\u{12c}\x0a\x1a\x03\x1a\x03\x1a\x03\x1b\x03\x1b\ - \x03\x1b\x03\x1b\x03\x1b\x03\x1b\x03\x1b\x03\x1b\x03\x1b\x03\x1b\x03\x1b\ - \x05\x1b\u{13b}\x0a\x1b\x03\x1b\x02\x03\x16\x1c\x02\x04\x06\x08\x0a\x0c\ - \x0e\x10\x12\x14\x16\x18\x1a\x1c\x1e\x20\x22\x24\x26\x28\x2a\x2c\x2e\x30\ - \x32\x34\x02\x08\x03\x02\x33\x35\x03\x02\x31\x32\x04\x02\x22\x23\x25\x26\ - \x04\x02\x24\x24\x27\x27\x03\x02\x28\x2a\x04\x02\x21\x21\x2c\x30\x02\u{153}\ - \x02\x39\x03\x02\x02\x02\x04\x41\x03\x02\x02\x02\x06\x45\x03\x02\x02\x02\ - \x08\x4d\x03\x02\x02\x02\x0a\x55\x03\x02\x02\x02\x0c\x68\x03\x02\x02\x02\ - \x0e\x6a\x03\x02\x02\x02\x10\x7f\x03\x02\x02\x02\x12\u{83}\x03\x02\x02\x02\ - \x14\u{86}\x03\x02\x02\x02\x16\u{95}\x03\x02\x02\x02\x18\u{b2}\x03\x02\x02\ - \x02\x1a\u{b4}\x03\x02\x02\x02\x1c\u{b6}\x03\x02\x02\x02\x1e\u{c4}\x03\x02\ - \x02\x02\x20\u{d2}\x03\x02\x02\x02\x22\u{dc}\x03\x02\x02\x02\x24\u{e6}\x03\ - \x02\x02\x02\x26\u{ef}\x03\x02\x02\x02\x28\u{f6}\x03\x02\x02\x02\x2a\u{fb}\ - \x03\x02\x02\x02\x2c\u{10b}\x03\x02\x02\x02\x2e\u{111}\x03\x02\x02\x02\x30\ - \u{118}\x03\x02\x02\x02\x32\u{124}\x03\x02\x02\x02\x34\u{13a}\x03\x02\x02\ - \x02\x36\x38\x05\x04\x03\x02\x37\x36\x03\x02\x02\x02\x38\x3b\x03\x02\x02\ - \x02\x39\x37\x03\x02\x02\x02\x39\x3a\x03\x02\x02\x02\x3a\x3d\x03\x02\x02\ - \x02\x3b\x39\x03\x02\x02\x02\x3c\x3e\x05\x06\x04\x02\x3d\x3c\x03\x02\x02\ - \x02\x3e\x3f\x03\x02\x02\x02\x3f\x3d\x03\x02\x02\x02\x3f\x40\x03\x02\x02\ - \x02\x40\x03\x03\x02\x02\x02\x41\x42\x07\x0c\x02\x02\x42\x43\x07\x1c\x02\ - \x02\x43\x05\x03\x02\x02\x02\x44\x46\x05\x08\x05\x02\x45\x44\x03\x02\x02\ - \x02\x46\x47\x03\x02\x02\x02\x47\x45\x03\x02\x02\x02\x47\x48\x03\x02\x02\ - \x02\x48\x49\x03\x02\x02\x02\x49\x4a\x07\x0a\x02\x02\x4a\x4b\x05\x0a\x06\ - \x02\x4b\x4c\x07\x0f\x02\x02\x4c\x07\x03\x02\x02\x02\x4d\x4e\x07\x09\x02\ - \x02\x4e\x50\x07\x0b\x02\x02\x4f\x51\x07\x0d\x02\x02\x50\x4f\x03\x02\x02\ - \x02\x50\x51\x03\x02\x02\x02\x51\x09\x03\x02\x02\x02\x52\x54\x05\x0c\x07\ - \x02\x53\x52\x03\x02\x02\x02\x54\x57\x03\x02\x02\x02\x55\x53\x03\x02\x02\ - \x02\x55\x56\x03\x02\x02\x02\x56\x0b\x03\x02\x02\x02\x57\x55\x03\x02\x02\ - \x02\x58\x69\x05\x0e\x08\x02\x59\x69\x05\x1e\x10\x02\x5a\x69\x05\x26\x14\ - \x02\x5b\x69\x05\x2e\x18\x02\x5c\x69\x05\x28\x15\x02\x5d\x69\x05\x2a\x16\ - \x02\x5e\x69\x05\x32\x1a\x02\x5f\x69\x05\x34\x1b\x02\x60\x64\x07\x03\x02\ - \x02\x61\x63\x05\x0c\x07\x02\x62\x61\x03\x02\x02\x02\x63\x66\x03\x02\x02\ - \x02\x64\x62\x03\x02\x02\x02\x64\x65\x03\x02\x02\x02\x65\x67\x03\x02\x02\ - \x02\x66\x64\x03\x02\x02\x02\x67\x69\x07\x04\x02\x02\x68\x58\x03\x02\x02\ - \x02\x68\x59\x03\x02\x02\x02\x68\x5a\x03\x02\x02\x02\x68\x5b\x03\x02\x02\ - \x02\x68\x5c\x03\x02\x02\x02\x68\x5d\x03\x02\x02\x02\x68\x5e\x03\x02\x02\ - \x02\x68\x5f\x03\x02\x02\x02\x68\x60\x03\x02\x02\x02\x69\x0d\x03\x02\x02\ - \x02\x6a\x6c\x05\x10\x09\x02\x6b\x6d\x05\x14\x0b\x02\x6c\x6b\x03\x02\x02\ - \x02\x6c\x6d\x03\x02\x02\x02\x6d\x71\x03\x02\x02\x02\x6e\x70\x05\x12\x0a\ - \x02\x6f\x6e\x03\x02\x02\x02\x70\x73\x03\x02\x02\x02\x71\x6f\x03\x02\x02\ - \x02\x71\x72\x03\x02\x02\x02\x72\x74\x03\x02\x02\x02\x73\x71\x03\x02\x02\ - \x02\x74\x75\x07\x08\x02\x02\x75\x0f\x03\x02\x02\x02\x76\x78\x07\x16\x02\ - \x02\x77\x76\x03\x02\x02\x02\x78\x79\x03\x02\x02\x02\x79\x77\x03\x02\x02\ - \x02\x79\x7a\x03\x02\x02\x02\x7a\u{80}\x03\x02\x02\x02\x7b\x7c\x07\x12\x02\ - \x02\x7c\x7d\x05\x16\x0c\x02\x7d\x7e\x07\x3c\x02\x02\x7e\u{80}\x03\x02\x02\ - \x02\x7f\x77\x03\x02\x02\x02\x7f\x7b\x03\x02\x02\x02\u{80}\u{81}\x03\x02\ - \x02\x02\u{81}\x7f\x03\x02\x02\x02\u{81}\u{82}\x03\x02\x02\x02\u{82}\x11\ - \x03\x02\x02\x02\u{83}\u{84}\x07\x0c\x02\x02\u{84}\u{85}\x07\x1c\x02\x02\ - \u{85}\x13\x03\x02\x02\x02\u{86}\u{87}\x07\x11\x02\x02\u{87}\u{88}\x07\x42\ - \x02\x02\u{88}\u{89}\x05\x16\x0c\x02\u{89}\u{8a}\x07\x4e\x02\x02\u{8a}\x15\ - \x03\x02\x02\x02\u{8b}\u{8c}\x08\x0c\x01\x02\u{8c}\u{8d}\x07\x36\x02\x02\ - \u{8d}\u{8e}\x05\x16\x0c\x02\u{8e}\u{8f}\x07\x37\x02\x02\u{8f}\u{96}\x03\ - \x02\x02\x02\u{90}\u{91}\x07\x32\x02\x02\u{91}\u{96}\x05\x16\x0c\x0a\u{92}\ - \u{93}\x07\x2b\x02\x02\u{93}\u{96}\x05\x16\x0c\x09\u{94}\u{96}\x05\x18\x0d\ - \x02\u{95}\u{8b}\x03\x02\x02\x02\u{95}\u{90}\x03\x02\x02\x02\u{95}\u{92}\ - \x03\x02\x02\x02\u{95}\u{94}\x03\x02\x02\x02\u{96}\u{a8}\x03\x02\x02\x02\ - \u{97}\u{98}\x0c\x08\x02\x02\u{98}\u{99}\x09\x02\x02\x02\u{99}\u{a7}\x05\ - \x16\x0c\x09\u{9a}\u{9b}\x0c\x07\x02\x02\u{9b}\u{9c}\x09\x03\x02\x02\u{9c}\ - \u{a7}\x05\x16\x0c\x08\u{9d}\u{9e}\x0c\x06\x02\x02\u{9e}\u{9f}\x09\x04\x02\ - \x02\u{9f}\u{a7}\x05\x16\x0c\x07\u{a0}\u{a1}\x0c\x05\x02\x02\u{a1}\u{a2}\ - \x09\x05\x02\x02\u{a2}\u{a7}\x05\x16\x0c\x06\u{a3}\u{a4}\x0c\x04\x02\x02\ - \u{a4}\u{a5}\x09\x06\x02\x02\u{a5}\u{a7}\x05\x16\x0c\x05\u{a6}\u{97}\x03\ - \x02\x02\x02\u{a6}\u{9a}\x03\x02\x02\x02\u{a6}\u{9d}\x03\x02\x02\x02\u{a6}\ - \u{a0}\x03\x02\x02\x02\u{a6}\u{a3}\x03\x02\x02\x02\u{a7}\u{aa}\x03\x02\x02\ - \x02\u{a8}\u{a6}\x03\x02\x02\x02\u{a8}\u{a9}\x03\x02\x02\x02\u{a9}\x17\x03\ - \x02\x02\x02\u{aa}\u{a8}\x03\x02\x02\x02\u{ab}\u{b3}\x07\x3f\x02\x02\u{ac}\ - \u{b3}\x07\x1e\x02\x02\u{ad}\u{b3}\x07\x1f\x02\x02\u{ae}\u{b3}\x05\x1a\x0e\ - \x02\u{af}\u{b3}\x07\x3a\x02\x02\u{b0}\u{b3}\x07\x20\x02\x02\u{b1}\u{b3}\ - \x05\x1c\x0f\x02\u{b2}\u{ab}\x03\x02\x02\x02\u{b2}\u{ac}\x03\x02\x02\x02\ - \u{b2}\u{ad}\x03\x02\x02\x02\u{b2}\u{ae}\x03\x02\x02\x02\u{b2}\u{af}\x03\ - \x02\x02\x02\u{b2}\u{b0}\x03\x02\x02\x02\u{b2}\u{b1}\x03\x02\x02\x02\u{b3}\ - \x19\x03\x02\x02\x02\u{b4}\u{b5}\x07\x3d\x02\x02\u{b5}\x1b\x03\x02\x02\x02\ - \u{b6}\u{b7}\x07\x3b\x02\x02\u{b7}\u{b9}\x07\x36\x02\x02\u{b8}\u{ba}\x05\ - \x16\x0c\x02\u{b9}\u{b8}\x03\x02\x02\x02\u{b9}\u{ba}\x03\x02\x02\x02\u{ba}\ - \u{bf}\x03\x02\x02\x02\u{bb}\u{bc}\x07\x38\x02\x02\u{bc}\u{be}\x05\x16\x0c\ - \x02\u{bd}\u{bb}\x03\x02\x02\x02\u{be}\u{c1}\x03\x02\x02\x02\u{bf}\u{bd}\ - \x03\x02\x02\x02\u{bf}\u{c0}\x03\x02\x02\x02\u{c0}\u{c2}\x03\x02\x02\x02\ - \u{c1}\u{bf}\x03\x02\x02\x02\u{c2}\u{c3}\x07\x37\x02\x02\u{c3}\x1d\x03\x02\ - \x02\x02\u{c4}\u{c8}\x05\x20\x11\x02\u{c5}\u{c7}\x05\x22\x12\x02\u{c6}\u{c5}\ - \x03\x02\x02\x02\u{c7}\u{ca}\x03\x02\x02\x02\u{c8}\u{c6}\x03\x02\x02\x02\ - \u{c8}\u{c9}\x03\x02\x02\x02\u{c9}\u{cc}\x03\x02\x02\x02\u{ca}\u{c8}\x03\ - \x02\x02\x02\u{cb}\u{cd}\x05\x24\x13\x02\u{cc}\u{cb}\x03\x02\x02\x02\u{cc}\ - \u{cd}\x03\x02\x02\x02\u{cd}\u{ce}\x03\x02\x02\x02\u{ce}\u{cf}\x07\x11\x02\ - \x02\u{cf}\u{d0}\x07\x46\x02\x02\u{d0}\u{d1}\x07\x4e\x02\x02\u{d1}\x1f\x03\ - \x02\x02\x02\u{d2}\u{d3}\x07\x11\x02\x02\u{d3}\u{d4}\x07\x42\x02\x02\u{d4}\ - \u{d5}\x05\x16\x0c\x02\u{d5}\u{d9}\x07\x4e\x02\x02\u{d6}\u{d8}\x05\x0c\x07\ - \x02\u{d7}\u{d6}\x03\x02\x02\x02\u{d8}\u{db}\x03\x02\x02\x02\u{d9}\u{d7}\ - \x03\x02\x02\x02\u{d9}\u{da}\x03\x02\x02\x02\u{da}\x21\x03\x02\x02\x02\u{db}\ - \u{d9}\x03\x02\x02\x02\u{dc}\u{dd}\x07\x11\x02\x02\u{dd}\u{de}\x07\x43\x02\ - \x02\u{de}\u{df}\x05\x16\x0c\x02\u{df}\u{e3}\x07\x4e\x02\x02\u{e0}\u{e2}\ - \x05\x0c\x07\x02\u{e1}\u{e0}\x03\x02\x02\x02\u{e2}\u{e5}\x03\x02\x02\x02\ - \u{e3}\u{e1}\x03\x02\x02\x02\u{e3}\u{e4}\x03\x02\x02\x02\u{e4}\x23\x03\x02\ - \x02\x02\u{e5}\u{e3}\x03\x02\x02\x02\u{e6}\u{e7}\x07\x11\x02\x02\u{e7}\u{e8}\ - \x07\x44\x02\x02\u{e8}\u{ec}\x07\x4e\x02\x02\u{e9}\u{eb}\x05\x0c\x07\x02\ - \u{ea}\u{e9}\x03\x02\x02\x02\u{eb}\u{ee}\x03\x02\x02\x02\u{ec}\u{ea}\x03\ - \x02\x02\x02\u{ec}\u{ed}\x03\x02\x02\x02\u{ed}\x25\x03\x02\x02\x02\u{ee}\ - \u{ec}\x03\x02\x02\x02\u{ef}\u{f0}\x07\x11\x02\x02\u{f0}\u{f1}\x07\x45\x02\ - \x02\u{f1}\u{f2}\x05\x1a\x0e\x02\u{f2}\u{f3}\x09\x07\x02\x02\u{f3}\u{f4}\ - \x05\x16\x0c\x02\u{f4}\u{f5}\x07\x4e\x02\x02\u{f5}\x27\x03\x02\x02\x02\u{f6}\ - \u{f7}\x07\x11\x02\x02\u{f7}\u{f8}\x07\x47\x02\x02\u{f8}\u{f9}\x05\x1c\x0f\ - \x02\u{f9}\u{fa}\x07\x4e\x02\x02\u{fa}\x29\x03\x02\x02\x02\u{fb}\u{fc}\x07\ - \x11\x02\x02\u{fc}\u{fd}\x05\x2c\x17\x02\u{fd}\u{101}\x07\x50\x02\x02\u{fe}\ - \u{100}\x05\x12\x0a\x02\u{ff}\u{fe}\x03\x02\x02\x02\u{100}\u{103}\x03\x02\ - \x02\x02\u{101}\u{ff}\x03\x02\x02\x02\u{101}\u{102}\x03\x02\x02\x02\u{102}\ - \x2b\x03\x02\x02\x02\u{103}\u{101}\x03\x02\x02\x02\u{104}\u{10a}\x07\x52\ - \x02\x02\u{105}\u{106}\x07\x51\x02\x02\u{106}\u{107}\x05\x16\x0c\x02\u{107}\ - \u{108}\x07\x3c\x02\x02\u{108}\u{10a}\x03\x02\x02\x02\u{109}\u{104}\x03\ - \x02\x02\x02\u{109}\u{105}\x03\x02\x02\x02\u{10a}\u{10d}\x03\x02\x02\x02\ - \u{10b}\u{109}\x03\x02\x02\x02\u{10b}\u{10c}\x03\x02\x02\x02\u{10c}\x2d\ - \x03\x02\x02\x02\u{10d}\u{10b}\x03\x02\x02\x02\u{10e}\u{110}\x05\x30\x19\ - \x02\u{10f}\u{10e}\x03\x02\x02\x02\u{110}\u{113}\x03\x02\x02\x02\u{111}\ - \u{10f}\x03\x02\x02\x02\u{111}\u{112}\x03\x02\x02\x02\u{112}\u{114}\x03\ - \x02\x02\x02\u{113}\u{111}\x03\x02\x02\x02\u{114}\u{116}\x05\x30\x19\x02\ - \u{115}\u{117}\x07\x05\x02\x02\u{116}\u{115}\x03\x02\x02\x02\u{116}\u{117}\ - \x03\x02\x02\x02\u{117}\x2f\x03\x02\x02\x02\u{118}\u{119}\x07\x10\x02\x02\ - \u{119}\u{122}\x05\x0e\x08\x02\u{11a}\u{11e}\x07\x03\x02\x02\u{11b}\u{11d}\ - \x05\x0c\x07\x02\u{11c}\u{11b}\x03\x02\x02\x02\u{11d}\u{120}\x03\x02\x02\ - \x02\u{11e}\u{11c}\x03\x02\x02\x02\u{11e}\u{11f}\x03\x02\x02\x02\u{11f}\ - \u{121}\x03\x02\x02\x02\u{120}\u{11e}\x03\x02\x02\x02\u{121}\u{123}\x07\ - \x04\x02\x02\u{122}\u{11a}\x03\x02\x02\x02\u{122}\u{123}\x03\x02\x02\x02\ - \u{123}\x31\x03\x02\x02\x02\u{124}\u{125}\x07\x11\x02\x02\u{125}\u{126}\ - \x07\x48\x02\x02\u{126}\u{127}\x05\x1a\x0e\x02\u{127}\u{128}\x07\x21\x02\ - \x02\u{128}\u{12b}\x05\x18\x0d\x02\u{129}\u{12a}\x07\x39\x02\x02\u{12a}\ - \u{12c}\x07\x3b\x02\x02\u{12b}\u{129}\x03\x02\x02\x02\u{12b}\u{12c}\x03\ - \x02\x02\x02\u{12c}\u{12d}\x03\x02\x02\x02\u{12d}\u{12e}\x07\x4e\x02\x02\ - \u{12e}\x33\x03\x02\x02\x02\u{12f}\u{130}\x07\x11\x02\x02\u{130}\u{131}\ - \x07\x49\x02\x02\u{131}\u{132}\x07\x09\x02\x02\u{132}\u{13b}\x07\x4e\x02\ - \x02\u{133}\u{134}\x07\x11\x02\x02\u{134}\u{135}\x07\x49\x02\x02\u{135}\ - \u{136}\x07\x12\x02\x02\u{136}\u{137}\x05\x16\x0c\x02\u{137}\u{138}\x07\ - \x3c\x02\x02\u{138}\u{139}\x07\x4e\x02\x02\u{139}\u{13b}\x03\x02\x02\x02\ - \u{13a}\u{12f}\x03\x02\x02\x02\u{13a}\u{133}\x03\x02\x02\x02\u{13b}\x35\ - \x03\x02\x02\x02\x22\x39\x3f\x47\x50\x55\x64\x68\x6c\x71\x79\x7f\u{81}\u{95}\ - \u{a6}\u{a8}\u{b2}\u{b9}\u{bf}\u{c8}\u{cc}\u{d9}\u{e3}\u{ec}\u{101}\u{109}\ - \u{10b}\u{111}\u{116}\u{11e}\u{122}\u{12b}\u{13a}"; diff --git a/crates/compiler/src/parser/generated/yarnspinnerparserlistener.rs b/crates/compiler/src/parser/generated/yarnspinnerparserlistener.rs index 02ccf1599..52f12acae 100644 --- a/crates/compiler/src/parser/generated/yarnspinnerparserlistener.rs +++ b/crates/compiler/src/parser/generated/yarnspinnerparserlistener.rs @@ -1,6 +1,6 @@ #![allow(nonstandard_style)] -// Generated from third-party\YarnSpinner\YarnSpinner.Compiler\YarnSpinnerParser.g4 by ANTLR 4.8 -use antlr_rust::tree::ParseTreeListener; +// Generated from third-party/YarnSpinner/YarnSpinner.Compiler/YarnSpinnerParser.g4 by ANTLR 4.13.2 +use antlr4rust::tree::ParseTreeListener; use super::yarnspinnerparser::*; pub trait YarnSpinnerParserListener<'input> : ParseTreeListener<'input,YarnSpinnerParserContextType>{ @@ -453,6 +453,6 @@ fn exit_jumpToExpression(&mut self, _ctx: &JumpToExpressionContext<'input>) { } } -antlr_rust::coerce_from!{ 'input : YarnSpinnerParserListener<'input> } +antlr4rust::coerce_from!{ 'input : YarnSpinnerParserListener<'input> } diff --git a/crates/compiler/src/parser/generated/yarnspinnerparservisitor.rs b/crates/compiler/src/parser/generated/yarnspinnerparservisitor.rs index 2825d4a57..60acd169f 100644 --- a/crates/compiler/src/parser/generated/yarnspinnerparservisitor.rs +++ b/crates/compiler/src/parser/generated/yarnspinnerparservisitor.rs @@ -1,6 +1,6 @@ #![allow(nonstandard_style)] -// Generated from third-party\YarnSpinner\YarnSpinner.Compiler\YarnSpinnerParser.g4 by ANTLR 4.8 -use antlr_rust::tree::{ParseTreeVisitor,ParseTreeVisitorCompat}; +// Generated from third-party/YarnSpinner/YarnSpinner.Compiler/YarnSpinnerParser.g4 by ANTLR 4.13.2 +use antlr4rust::tree::{ParseTreeVisitor,ParseTreeVisitorCompat}; use super::yarnspinnerparser::*; /** diff --git a/crates/compiler/src/parser/indent_aware_lexer.rs b/crates/compiler/src/parser/indent_aware_lexer.rs index 9c44549e8..772e2f0ab 100644 --- a/crates/compiler/src/parser/indent_aware_lexer.rs +++ b/crates/compiler/src/parser/indent_aware_lexer.rs @@ -11,8 +11,8 @@ use super::generated::yarnspinnerlexer::{ use crate::collections::*; use crate::listeners::Diagnostic; use crate::prelude::{DiagnosticSeverity, TokenExt, create_common_token}; -use antlr_rust::token::CommonToken; -use antlr_rust::{ +use antlr4rust::token::CommonToken; +use antlr4rust::{ Lexer, TokenSource, char_stream::CharStream, token::{TOKEN_DEFAULT_CHANNEL, Token}, @@ -27,7 +27,7 @@ use yarnspinner_core::prelude::*; #[allow(dead_code)] type YarnSpinnerLexer = (); -antlr_rust::tid! { impl<'input, Input> TidAble<'input> for IndentAwareYarnSpinnerLexer<'input, Input> where Input:CharStream> } +antlr4rust::tid! { impl<'input, Input> TidAble<'input> for IndentAwareYarnSpinnerLexer<'input, Input> where Input:CharStream> } /// A Lexer subclass that detects newlines and generates indent and dedent tokens accordingly. /// @@ -93,7 +93,7 @@ impl<'input, Input: CharStream>> TokenSource<'input> self.pending_tokens.dequeue().unwrap() } else if self.base.input().size() == 0 { self.hit_eof = true; - create_common_token(antlr_rust::token::TOKEN_EOF, "") + create_common_token(antlr4rust::token::TOKEN_EOF, "") } else { // Get the next token, which will enqueue one or more new // tokens into the pending tokens queue. @@ -105,7 +105,7 @@ impl<'input, Input: CharStream>> TokenSource<'input> } } - fn get_input_stream(&mut self) -> Option<&mut dyn antlr_rust::int_stream::IntStream> { + fn get_input_stream(&mut self) -> Option<&mut dyn antlr4rust::int_stream::IntStream> { self.base.get_input_stream() } @@ -116,6 +116,10 @@ impl<'input, Input: CharStream>> TokenSource<'input> fn get_token_factory(&self) -> &'input Self::TF { self.base.get_token_factory() } + + fn get_dfa_string(&self) -> String { + self.base.get_dfa_string() + } } /// Copied from generated/yarnspinnerlexer.rs @@ -149,7 +153,7 @@ where yarnspinnerlexer::NEWLINE => self.handle_newline_token(current.clone()), // Insert dedents before the end of the file, and then // enqueues the EOF. - antlr_rust::token::TOKEN_EOF => self.handle_eof_token(current.clone()), + antlr4rust::token::TOKEN_EOF => self.handle_eof_token(current.clone()), yarnspinnerlexer::SHORTCUT_ARROW => { self.pending_tokens.enqueue(current.clone()); self.line_contains_shortcut = true; @@ -178,7 +182,7 @@ where fn handle_newline_token( &mut self, - current_token: Box>>, + current_token: Box>>, ) { // We're about to go to a new line. Look ahead to see how indented it is. @@ -271,7 +275,7 @@ where fn handle_eof_token( &mut self, - current_token: Box>>, + current_token: Box>>, ) { // We're at the end of the file. Emit as many dedents as we currently have on the stack. while let Some(_indent) = self.unbalanced_indents.pop() { @@ -290,7 +294,7 @@ where /// following it by counting the spaces and tabs after it. fn get_length_of_newline_token( &mut self, - current_token: &antlr_rust::token::GenericToken>, + current_token: &antlr4rust::token::GenericToken>, ) -> isize { if current_token.token_type != yarnspinnerlexer::NEWLINE { panic!("Current token must NOT be newline") @@ -330,7 +334,7 @@ where /// Inserts a new token with the given text and type, as though it /// had appeared in the input stream. - fn insert_token(&mut self, text: impl Into, token_type: isize) { + fn insert_token(&mut self, text: impl Into, token_type: i32) { // https://www.antlr.org/api/Java/org/antlr/v4/runtime/Lexer.html#_tokenStartCharIndex let start_index = self.base.token_start_char_index + self.base.get_text().len() as isize; @@ -446,7 +450,7 @@ mod tests { //! ``` use super::*; use crate::prelude::generated::yarnspinnerlexer::YarnSpinnerLexer as GeneratedYarnSpinnerLexer; - use antlr_rust::{ + use antlr4rust::{ InputStream, common_token_stream::CommonTokenStream, int_stream::IntStream, token::TOKEN_EOF, }; diff --git a/crates/compiler/src/parser_rule_context_ext.rs b/crates/compiler/src/parser_rule_context_ext.rs index b501e183a..544e8754b 100644 --- a/crates/compiler/src/parser_rule_context_ext.rs +++ b/crates/compiler/src/parser_rule_context_ext.rs @@ -1,9 +1,9 @@ //! Adapted from use crate::prelude::*; -use antlr_rust::parser_rule_context::ParserRuleContext; -use antlr_rust::token::Token; -use antlr_rust::token_stream::TokenStream; +use antlr4rust::parser_rule_context::ParserRuleContext; +use antlr4rust::token::Token; +use antlr4rust::token_stream::TokenStream; use std::iter; pub(crate) trait ParserRuleContextExt<'input>: ParserRuleContext<'input> { diff --git a/crates/compiler/src/token_ext.rs b/crates/compiler/src/token_ext.rs index 593491b2e..5e7b07666 100644 --- a/crates/compiler/src/token_ext.rs +++ b/crates/compiler/src/token_ext.rs @@ -1,4 +1,4 @@ -use antlr_rust::token::Token; +use antlr4rust::token::Token; pub(crate) trait TokenExt: Token { fn get_line_as_usize(&self) -> usize { diff --git a/crates/compiler/src/visitors/code_generation_visitor.rs b/crates/compiler/src/visitors/code_generation_visitor.rs index c8cf392f2..59bad8057 100644 --- a/crates/compiler/src/visitors/code_generation_visitor.rs +++ b/crates/compiler/src/visitors/code_generation_visitor.rs @@ -5,9 +5,9 @@ use crate::prelude::generated::yarnspinnerlexer; use crate::prelude::generated::yarnspinnerparser::*; use crate::prelude::generated::yarnspinnerparservisitor::YarnSpinnerParserVisitorCompat; use crate::prelude::*; -use antlr_rust::parser_rule_context::ParserRuleContext; -use antlr_rust::token::Token; -use antlr_rust::tree::{ParseTree, ParseTreeVisitorCompat, Tree}; +use antlr4rust::parser_rule_context::ParserRuleContext; +use antlr4rust::token::Token; +use antlr4rust::tree::{ParseTree, ParseTreeVisitorCompat, Tree}; use std::ops::Deref; use std::rc::Rc; use yarnspinner_core::prelude::OpCode; @@ -31,7 +31,7 @@ impl<'a, 'input: 'a> CodeGenerationVisitor<'a, 'input> { _dummy: Default::default(), } } - pub(crate) fn token_to_operator(token: isize) -> Option { + pub(crate) fn token_to_operator(token: i32) -> Option { // operators for the standard expressions match token { yarnspinnerlexer::OPERATOR_LOGICAL_LESS_THAN_EQUALS => { diff --git a/crates/compiler/src/visitors/constant_value_visitor.rs b/crates/compiler/src/visitors/constant_value_visitor.rs index bea5e1806..1d9a9d40b 100644 --- a/crates/compiler/src/visitors/constant_value_visitor.rs +++ b/crates/compiler/src/visitors/constant_value_visitor.rs @@ -3,8 +3,8 @@ use crate::prelude::generated::yarnspinnerparser::*; use crate::prelude::generated::yarnspinnerparservisitor::YarnSpinnerParserVisitorCompat; use crate::prelude::*; -use antlr_rust::parser::ParserNodeType; -use antlr_rust::tree::{ParseTree, ParseTreeVisitorCompat, VisitChildren}; +use antlr4rust::parser::ParserNodeType; +use antlr4rust::tree::{ParseTree, ParseTreeVisitorCompat, VisitChildren}; use std::mem; use std::ops::{Deref, DerefMut}; use yarnspinner_core::prelude::*; diff --git a/crates/compiler/src/visitors/declaration_visitor.rs b/crates/compiler/src/visitors/declaration_visitor.rs index 07c25452a..403e4dfa3 100644 --- a/crates/compiler/src/visitors/declaration_visitor.rs +++ b/crates/compiler/src/visitors/declaration_visitor.rs @@ -4,8 +4,8 @@ use crate::prelude::generated::yarnspinnerparser::*; use crate::prelude::generated::yarnspinnerparservisitor::YarnSpinnerParserVisitorCompat; use crate::prelude::*; use crate::visitors::constant_value_visitor::ConstantValueVisitor; -use antlr_rust::token::Token; -use antlr_rust::tree::{ParseTree, ParseTreeVisitorCompat}; +use antlr4rust::token::Token; +use antlr4rust::tree::{ParseTree, ParseTreeVisitorCompat}; use regex::Regex; use yarnspinner_core::prelude::*; use yarnspinner_core::types::*; @@ -151,7 +151,7 @@ impl<'input> YarnSpinnerParserVisitorCompat<'input> for DeclarationVisitor<'inpu .extend_from_slice(&constant_value_visitor.diagnostics); // Did the source code name an explicit type? - if let Some(declaration_type) = ctx.declaration_type.as_ref() { + if let Some(declaration_type) = ctx.type_.as_ref() { let explicit_type = match keyword_to_type(declaration_type.get_text()) { Some(builtin_type) => builtin_type, diff --git a/crates/compiler/src/visitors/hashable_interval.rs b/crates/compiler/src/visitors/hashable_interval.rs index 89df8c41b..4237c06fb 100644 --- a/crates/compiler/src/visitors/hashable_interval.rs +++ b/crates/compiler/src/visitors/hashable_interval.rs @@ -1,6 +1,7 @@ use crate::parser::generated::yarnspinnerparser::YarnSpinnerParserContext; -use antlr_rust::interval_set::Interval; -use antlr_rust::parser_rule_context::ParserRuleContext; +use antlr4rust::interval_set::Interval; +use antlr4rust::parser_rule_context::ParserRuleContext; +use antlr4rust::token::Token; use std::cmp::Ordering; use std::collections::HashMap; use std::hash::{Hash, Hasher}; @@ -97,7 +98,10 @@ impl DerefMut for KnownTypes { pub(crate) trait GetHashableInterval<'input>: ParserRuleContext<'input> { fn get_hashable_interval(&self) -> HashableInterval { - let interval = self.get_source_interval(); + let interval = Interval { + a: self.start().get_token_index() as i32, + b: self.stop().get_token_index() as i32, + }; HashableInterval(interval) } } diff --git a/crates/compiler/src/visitors/last_line_before_options_visitor.rs b/crates/compiler/src/visitors/last_line_before_options_visitor.rs index d9305272a..2273f19af 100644 --- a/crates/compiler/src/visitors/last_line_before_options_visitor.rs +++ b/crates/compiler/src/visitors/last_line_before_options_visitor.rs @@ -3,7 +3,7 @@ use crate::prelude::generated::yarnspinnerparser::*; use crate::prelude::generated::yarnspinnerparservisitor::YarnSpinnerParserVisitorCompat; use crate::prelude::*; -use antlr_rust::tree::ParseTreeVisitorCompat; +use antlr4rust::tree::ParseTreeVisitorCompat; use std::rc::Rc; #[derive(Debug, Clone, Default)] diff --git a/crates/compiler/src/visitors/node_tracking_visitor.rs b/crates/compiler/src/visitors/node_tracking_visitor.rs index 60e89052f..841b52829 100644 --- a/crates/compiler/src/visitors/node_tracking_visitor.rs +++ b/crates/compiler/src/visitors/node_tracking_visitor.rs @@ -1,8 +1,9 @@ -use crate::parser::generated::yarnspinnerparser::{self, *}; +use crate::parser::generated::yarnspinnerparser::*; +use crate::prelude::generated::yarnspinnerlexer; use crate::prelude::generated::yarnspinnerparservisitor::YarnSpinnerParserVisitorCompat; -use antlr_rust::parser_rule_context::ParserRuleContext; -use antlr_rust::token::Token; -use antlr_rust::tree::{ParseTree, ParseTreeVisitorCompat}; +use antlr4rust::parser_rule_context::ParserRuleContext; +use antlr4rust::token::Token; +use antlr4rust::tree::{ParseTree, ParseTreeVisitorCompat}; use std::collections::HashSet; #[derive(Clone, Default)] @@ -67,7 +68,7 @@ impl<'input> YarnSpinnerParserVisitorCompat<'input> for NodeTrackingVisitor { } fn visit_valueString(&mut self, ctx: &ValueStringContext<'input>) -> Self::Return { - ctx.get_token(yarnspinnerparser::STRING, 0) + ctx.get_token(yarnspinnerlexer::STRING, 0) .unwrap() .get_text() .trim_matches('"') @@ -77,7 +78,7 @@ impl<'input> YarnSpinnerParserVisitorCompat<'input> for NodeTrackingVisitor { fn visit_function_call(&mut self, ctx: &Function_callContext<'input>) -> Self::Return { let function_name = ctx - .get_token(yarnspinnerparser::FUNC_ID, 0) + .get_token(yarnspinnerlexer::FUNC_ID, 0) .unwrap() .get_text(); @@ -101,8 +102,8 @@ mod tests { use super::*; use crate::prelude::generated::yarnspinnerparser::YarnSpinnerParser; use crate::prelude::*; - use antlr_rust::InputStream; - use antlr_rust::common_token_stream::CommonTokenStream; + use antlr4rust::InputStream; + use antlr4rust::common_token_stream::CommonTokenStream; #[test] fn finds_title_and_tracking_headers() { diff --git a/crates/compiler/src/visitors/string_table_generator_visitor.rs b/crates/compiler/src/visitors/string_table_generator_visitor.rs index c0d7ef7fb..d41ed3661 100644 --- a/crates/compiler/src/visitors/string_table_generator_visitor.rs +++ b/crates/compiler/src/visitors/string_table_generator_visitor.rs @@ -1,9 +1,9 @@ //! Adapted from use crate::prelude::generated::{yarnspinnerparser::*, yarnspinnerparservisitor::*}; use crate::prelude::*; -use antlr_rust::parser_rule_context::ParserRuleContext; -use antlr_rust::token::Token; -use antlr_rust::tree::{ParseTree, ParseTreeVisitorCompat, Tree}; +use antlr4rust::parser_rule_context::ParserRuleContext; +use antlr4rust::token::Token; +use antlr4rust::tree::{ParseTree, ParseTreeVisitorCompat, Tree}; use std::rc::Rc; #[derive(Clone)] @@ -183,8 +183,8 @@ pub(crate) fn get_hashtag_texts(hashtags: &[Rc]) -> Vec #[cfg(test)] mod tests { use super::*; - use antlr_rust::InputStream; - use antlr_rust::common_token_stream::CommonTokenStream; + use antlr4rust::InputStream; + use antlr4rust::common_token_stream::CommonTokenStream; use yarnspinner_core::prelude::Position; #[test] diff --git a/crates/compiler/src/visitors/type_check_visitor.rs b/crates/compiler/src/visitors/type_check_visitor.rs index fa35de710..4b453ee1f 100644 --- a/crates/compiler/src/visitors/type_check_visitor.rs +++ b/crates/compiler/src/visitors/type_check_visitor.rs @@ -6,9 +6,9 @@ use crate::prelude::generated::yarnspinnerparser::*; use crate::prelude::generated::yarnspinnerparservisitor::YarnSpinnerParserVisitorCompat; use crate::prelude::*; use crate::visitors::{CodeGenerationVisitor, KnownTypes}; -use antlr_rust::parser_rule_context::ParserRuleContext; -use antlr_rust::token::Token; -use antlr_rust::tree::{ParseTree, ParseTreeVisitorCompat}; +use antlr4rust::parser_rule_context::ParserRuleContext; +use antlr4rust::token::Token; +use antlr4rust::tree::{ParseTree, ParseTreeVisitorCompat}; use check_operation::*; use std::path::Path; use yarnspinner_core::prelude::*; diff --git a/crates/compiler/src/visitors/type_check_visitor/check_operation.rs b/crates/compiler/src/visitors/type_check_visitor/check_operation.rs index c715d387c..aff2460ed 100644 --- a/crates/compiler/src/visitors/type_check_visitor/check_operation.rs +++ b/crates/compiler/src/visitors/type_check_visitor/check_operation.rs @@ -5,10 +5,10 @@ use crate::visitors::type_check_visitor::{ DefaultValue, format_cannot_determine_variable_type_error, get_filename, }; use crate::visitors::*; -use antlr_rust::rule_context::CustomRuleContext; -use antlr_rust::token::Token; -use antlr_rust::token_factory::TokenFactory; -use antlr_rust::tree::{ParseTree, ParseTreeVisitorCompat}; +use antlr4rust::rule_context::CustomRuleContext; +use antlr4rust::token::Token; +use antlr4rust::token_factory::TokenFactory; +use antlr4rust::tree::{ParseTree, ParseTreeVisitorCompat}; use better_any::TidExt; use std::cmp::Ordering; use std::ops::Deref; From 623b7e0d32084b3c5900c3affc7258ffeb0c8b17 Mon Sep 17 00:00:00 2001 From: fwilliams42 Date: Tue, 2 Jun 2026 14:19:00 +1000 Subject: [PATCH 03/15] update generation readme --- crates/compiler/src/parser/generated/readme.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/compiler/src/parser/generated/readme.md b/crates/compiler/src/parser/generated/readme.md index d9948501b..da0de5a93 100644 --- a/crates/compiler/src/parser/generated/readme.md +++ b/crates/compiler/src/parser/generated/readme.md @@ -4,12 +4,12 @@ All files in this directory were autogenerated by ANTLR with minimal manual adju ## Autogeneration -- Download [this custom ANTLR](https://github.com/rrevenantt/antlr4rust/releases/tag/antlr4-4.8-2-Rust0.3.0-beta) +- Download [this custom ANTLR](https://github.com/antlr4rust/antlr4/releases/tag/v0.5.0) provided by antlr4rust. - `cd` into the root of this repo: `cd path/to/yarnspinner` - Download the third-party submodules: `git submodule update --init --recursive` - Run the following command: -> `java -jar "path/to/antlr4-4.8-2-SNAPSHOT-complete.jar" -Dlanguage=Rust third-party/YarnSpinner/YarnSpinner.Compiler/*.g4 -visitor -Xexact-output-dir -o crates/compiler/src/parser/generated` +> `java -jar "path/to/antlr4-4.13.3-SNAPSHOT-complete.jar" -Dlanguage=Rust third-party/YarnSpinner/YarnSpinner.Compiler/*.g4 -visitor -Xexact-output-dir -o crates/compiler/src/parser/generated` ## Manual Adjustments @@ -21,4 +21,3 @@ All files in this directory were autogenerated by ANTLR with minimal manual adju * Replace `antlr_rust::tree::VisitChildren::visit_node(visitor, self);` by `YarnSpinnerParserVisitor::visit_node(visitor, self);`. The issue there is that `node` already means something in the ANTLR world, thus there is an ambiguity when calling `visit_node`, which antlr4rust resolved the wrong way here, resulting in an infinite recursion * Add the `new_with_text` function to allow creating a context with a specific text, which is possible in the C# version of ANTLR. -* Rename `type` field to `declaration_type` of `Declare_statementContextExt`. From a101cc68f022bea1fef31b1706aec22671913109 Mon Sep 17 00:00:00 2001 From: Galdormin Date: Wed, 1 Apr 2026 18:17:40 +0200 Subject: [PATCH 04/15] checkout YarnSpinner v3.0.0 + cargo update --- third-party/YarnSpinner | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third-party/YarnSpinner b/third-party/YarnSpinner index 838761ad5..946db0be7 160000 --- a/third-party/YarnSpinner +++ b/third-party/YarnSpinner @@ -1 +1 @@ -Subproject commit 838761ad55d8d08be3b46e6f2bea2d017208e445 +Subproject commit 946db0be77b5064b88a280cb71ce457e4f0e159c From 7b3421fc3c5f8f56d3992a4872122ae0d3ff0d86 Mon Sep 17 00:00:00 2001 From: Galdormin Date: Wed, 1 Apr 2026 22:54:11 +0200 Subject: [PATCH 05/15] migrate Project.cs + tests + move Project to serde only --- crates/compiler/src/lib.rs | 4 +- crates/compiler/src/project.rs | 249 ++++++++++++++++-- .../yarnspinner/tests/project_file_tests.rs | 20 +- 3 files changed, 246 insertions(+), 27 deletions(-) diff --git a/crates/compiler/src/lib.rs b/crates/compiler/src/lib.rs index 8d64c4636..f8cada15e 100644 --- a/crates/compiler/src/lib.rs +++ b/crates/compiler/src/lib.rs @@ -17,6 +17,7 @@ pub(crate) mod listeners; mod output; mod parser; pub(crate) mod parser_rule_context_ext; +#[cfg(feature = "serde")] pub mod project; mod string_table_manager; pub(crate) mod token_ext; @@ -26,6 +27,8 @@ pub use crate::compiler::Result; pub mod prelude { //! Everything you need to get started with the Yarn Spinner compiler. + #[cfg(feature = "serde")] + pub use crate::project::*; pub(crate) use crate::{ compiler::antlr_rust_ext::*, compiler::run_compilation::*, compiler::utils::*, file_parse_result::*, parser::*, parser_rule_context_ext::*, string_table_manager::*, @@ -35,7 +38,6 @@ pub mod prelude { compiler::{CompilationType, Compiler, File}, listeners::{Diagnostic, DiagnosticSeverity, DiagnosticVec}, output::*, - project::*, }; pub(crate) use yarnspinner_core::prelude::*; pub(crate) use yarnspinner_internal_shared::prelude::*; diff --git a/crates/compiler/src/project.rs b/crates/compiler/src/project.rs index 7cc036084..0b3d5578a 100644 --- a/crates/compiler/src/project.rs +++ b/crates/compiler/src/project.rs @@ -4,18 +4,28 @@ use std::path::Path; use std::{collections::HashMap, path::PathBuf}; use globset::{Glob, GlobSet, GlobSetBuilder}; -#[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; +use serde_json::Value as JsonValue; use walkdir::WalkDir; +/// A placeholder string that represents the location of the workspace root in paths. +pub const WORKSPACE_ROOT_PLACEHOLDER: &str = "${workspaceRoot}"; + +const ALLOW_PREVIEW_FEATURES_KEY: &str = "allowPreviewFeatures"; + +/// A version number representing Yarn Spinner 2 +pub const YARNSPINNER_PROJECT_VERSION_2: u32 = 2; + +/// A version number representing Yarn Spinner 3 +pub const YARNSPINNER_PROJECT_VERSION_3: u32 = 3; + /// Current version of the .yarnproject -pub const CURRENT_PROJECT_FILE_VERSION: u32 = 2; +pub const CURRENT_PROJECT_FILE_VERSION: u32 = YARNSPINNER_PROJECT_VERSION_3; /// Yarn Projects represent instructions on where to find Yarn scripts and /// associated assets, and how they should be compiled. -#[derive(Debug, Clone)] -#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] -#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct Project { /// Gets or sets the file version of the project. /// @@ -26,15 +36,15 @@ pub struct Project { /// /// This value is not stored when the file is saved, but is instead /// determined when the file is loaded by [`self::load_from_file()`] - #[cfg_attr(feature = "serde", serde(skip))] + #[serde(skip)] pub path: Option, + /// The location of the root of the workspace in which this project is located. + pub workspace_root_path: Option, + /// Gets or sets the collection of file search patterns used to locate /// Yarn files that form this project. - #[cfg_attr( - feature = "serde", - serde(rename = "sourceFiles", default = "default_source_files") - )] + #[serde(rename = "sourceFiles", default = "default_source_files")] pub source_file_patterns: Vec, /// Gets or sets the collection of file search patterns that should be @@ -46,13 +56,13 @@ pub struct Project { /// /// Note: Unlike what is done in the C# version, you need to use the [`globset`] syntax to exclude a file. /// `**/Ship.yarn`` to exclude all files named *Ship.yarn*. - #[cfg_attr(feature = "serde", serde(rename = "excludeFiles", default))] + #[serde(rename = "excludeFiles", default)] pub exclude_file_patterns: Vec, /// Gets or sets the collection of [`LocalizationInfo`] /// objects that store information about where localized data for this /// project is found. - #[cfg_attr(feature = "serde", serde(default))] + #[serde(default)] pub localisation: HashMap, /// Gets or sets the base language of the project, as an IETF BCP-47 @@ -66,15 +76,20 @@ pub struct Project { /// /// Definitions files are used by editing tools to provide type /// information and other externally-defined data used by the Yarn scripts. - #[cfg_attr(feature = "serde", serde(default))] + #[serde(default)] pub definitions: Option, /// Gets or sets a dictionary containing instructions that control how /// the Yarn Spinner compiler should compile a project. /// /// Note: Unsure about the type of options. No documentation in v2.5.0. - #[cfg_attr(feature = "serde", serde(default))] - pub compiler_options: HashMap, + #[serde(default)] + pub compiler_options: HashMap, + + /// Contains any data parsed from the source file that was not matched + /// to a property on this type. + #[serde(flatten)] + pub extension_data: HashMap, } fn default_source_files() -> Vec { @@ -83,14 +98,13 @@ fn default_source_files() -> Vec { /// Stores the locations of where localized assets and a localized /// string table for a Yarn Project may be found. -#[derive(Debug, Clone, PartialEq)] -#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct LocalizationInfo { /// Gets or sets the location at which localized assets may be found. - #[cfg_attr(feature = "serde", serde(default))] + #[serde(default)] pub assets: Option, /// Gets or sets the location at which the localized string table may be found. - #[cfg_attr(feature = "serde", serde(default))] + #[serde(default)] pub strings: Option, } @@ -99,12 +113,14 @@ impl Default for Project { Self { project_file_version: CURRENT_PROJECT_FILE_VERSION, path: Default::default(), + workspace_root_path: Default::default(), source_file_patterns: default_source_files(), exclude_file_patterns: Default::default(), localisation: Default::default(), base_language: Default::default(), definitions: Default::default(), compiler_options: Default::default(), + extension_data: Default::default(), } } } @@ -122,34 +138,43 @@ impl Project { self } + /// Replaces the workspace root path used by the [`Project`] + pub fn with_workspace_root_path(mut self, workspace_root_path: PathBuf) -> Self { + self.workspace_root_path = Some(workspace_root_path.into()); + self + } + /// Loads and parses a [`Project`] from a file on disk. - #[cfg(feature = "serde")] pub fn load_from_file>(path: P) -> Result { let text = std::fs::read_to_string(&path).map_err(|e| format!("Cannot open project file: {e}"))?; - let mut project: Project = + let mut project = Self::load_from_string(text)?; + project.path = Some(path.as_ref().to_path_buf()); + Ok(project) + } + + /// Parse a [`Project`] from a string + pub fn load_from_string(text: String) -> Result { + let project: Project = serde_json::from_str(&text).map_err(|e| format!("Invalid JSON: {e}"))?; - if project.project_file_version != CURRENT_PROJECT_FILE_VERSION { + if project.project_file_version > CURRENT_PROJECT_FILE_VERSION { return Err(format!( "Incorrect project file version (expected {}, got {})", CURRENT_PROJECT_FILE_VERSION, project.project_file_version )); } - project.path = Some(path.as_ref().to_path_buf()); Ok(project) } /// Gets a string containing JSON-formatted text that represents this [`Project`] - #[cfg(feature = "serde")] pub fn to_json(&self) -> String { serde_json::to_string_pretty(self).unwrap() } /// Saves a [`Project`] as JSON-formatted text to a file on disk - #[cfg(feature = "serde")] pub fn save_to_file>(&self, path: P) -> Result<(), String> { std::fs::write(path, self.to_json()).map_err(|e| format!("Cannot write project file: {e}")) } @@ -205,21 +230,94 @@ impl Project { let source_matcher = self.build_source_globset(); let exclude_matcher = self.build_exclude_globset(); + // This is an explicit, absolute path to a Yarn file (which the globbing matcher won't pick up) + // manually add it to the list of paths that this project references + let absolute_files = self.source_file_patterns.iter().filter_map(|pattern| { + PathBuf::try_from(pattern.clone()).ok().and_then(|path| { + if path.is_absolute() && path.extension().is_some_and(|ext| ext == "yarn") { + Some(path) + } else { + None + } + }) + }); + WalkDir::new(&root) .into_iter() .filter_map(Result::ok) .map(|e| e.path().to_path_buf()) .filter(|path| source_matcher.is_match(path) && !exclude_matcher.is_match(path)) + .chain(absolute_files) .collect() } /// Gets the path to the Definitions file, relative to this project's location. + #[deprecated(since = "0.9.0", note = "please use `definitions_files` instead")] pub fn definitions_path(&self) -> Option { let root = self.search_directory()?; let defs = self.definitions.as_ref()?; Some(root.join(defs)) } + /// Gets the absolute paths to the project's Definitions files. + pub fn definitions_files(&self) -> Vec { + let pattern = match self.definitions_files_pattern() { + Some(p) => p, + None => return vec![], + }; + + let path = Path::new(&pattern); + + let base_dir = if path.is_absolute() { + if path.is_file() { + // The path is to an absolute path that exists on disk; return it as-is + return vec![path.to_path_buf()]; + } + // The path is absolute but doesn't exist; it may be a + // pattern. Split the pattern into an absolute path and + // the pattern, and attempt to match from there. + glob_base_dir(path) + } else { + // The path is not absolute, so we can use the matcher + // directly to find paths, starting from our + match self.search_directory() { + Some(dir) => dir, + // We don't know where to start searching from. + None => return vec![], + } + }; + + let matcher = match Glob::new(&pattern) { + Ok(g) => g.compile_matcher(), + Err(_) => return vec![], + }; + + WalkDir::new(&base_dir) + .into_iter() + .filter_map(|e| e.ok()) + .filter(|e| e.file_type().is_file()) + .filter(|e| matcher.is_match(e.path())) + .map(|e| e.into_path()) + .collect() + } + + fn definitions_files_pattern(&self) -> Option { + let definitions = self.definitions.as_ref()?; + + if definitions.contains(WORKSPACE_ROOT_PLACEHOLDER) { + let root = self.workspace_root_path.as_ref()?; + if root.is_dir() { + Some(definitions.replace(WORKSPACE_ROOT_PLACEHOLDER, &root.to_string_lossy())) + } else { + None + } + } else if let Some(search_dir) = &self.search_directory() { + Some(search_dir.join(definitions).to_string_lossy().into_owned()) + } else { + None + } + } + /// Gets a value indicating whether the given path is a path /// that is included in this project. pub fn is_matching_path>(&self, path: P) -> bool { @@ -233,4 +331,105 @@ impl Project { let exclude_matcher = self.build_exclude_globset(); source_matcher.is_match(&full_path) && !exclude_matcher.is_match(&full_path) } + + /// Gets a value indicating whether this Project is an 'implicit' + /// project (that is, it does not currently represent a file that exists + /// on disk.) + /// + /// An implicit project is created by tools like the Yarn Spinner + /// Language Server when opening a folder that contains Yarn files but + /// no Yarn Project file. + #[allow(dead_code)] // Seems not used in V3.0, but may be in the future. + pub(crate) fn is_implicit(&self) -> bool { + self.path.as_ref().is_some_and(|path| path.exists()) + } + + fn get_compiler_options_flag(&self, key: impl AsRef) -> bool { + self.compiler_options + .get(key.as_ref()) + .and_then(|value| match value { + JsonValue::Bool(b) => Some(*b), + _ => None, + }) + .unwrap_or_default() + } + + fn set_compiler_options_flag(&mut self, key: impl AsRef, value: bool) { + self.compiler_options + .insert(key.as_ref().to_owned(), JsonValue::Bool(value)); + } + + /// Gets a value indicating whether compiler features that are + /// not intended for production use are allowed. + pub fn allow_language_preview_features(&self) -> bool { + self.get_compiler_options_flag(ALLOW_PREVIEW_FEATURES_KEY) + } + + /// Sets a value indicating whether compiler features that are + /// not intended for production use are allowed. + pub fn set_allow_language_preview_features(&mut self, value: bool) { + self.set_compiler_options_flag(ALLOW_PREVIEW_FEATURES_KEY, value); + } + + /// Gets a value indicating whether the argument is a valid + /// Yarn Spinner version number. + pub fn is_valid_version_number(version: u32) -> bool { + version == YARNSPINNER_PROJECT_VERSION_2 || version == YARNSPINNER_PROJECT_VERSION_3 + } +} + +/// Returns the deepest directory path before the first glob wildcard. +/// e.g. `/home/user/projects/**/*.yarn` -> `/home/user/projects` +fn glob_base_dir(pattern: &Path) -> PathBuf { + let mut base = PathBuf::new(); + for component in pattern.components() { + let s = component.as_os_str().to_string_lossy(); + if s.contains('*') { + break; + } + base.push(component); + } + base +} + +#[cfg(test)] +mod tests { + use super::*; + use std::path::{Path, PathBuf}; + + #[test] + fn absolute_path_with_double_star() { + let result = glob_base_dir(Path::new("/home/user/projects/**/*.yarn")); + assert_eq!(result, PathBuf::from("/home/user/projects")); + } + + #[test] + fn absolute_path_with_star_in_filename() { + let result = glob_base_dir(Path::new("/home/user/*.yarn")); + assert_eq!(result, PathBuf::from("/home/user")); + } + + #[test] + fn absolute_path_no_glob() { + let result = glob_base_dir(Path::new("/home/user/projects/file.yarn")); + assert_eq!(result, PathBuf::from("/home/user/projects/file.yarn")); + } + + #[test] + fn glob_at_root() { + let result = glob_base_dir(Path::new("/*.yarn")); + assert_eq!(result, PathBuf::from("/")); + } + + #[test] + fn relative_path_with_glob() { + let result = glob_base_dir(Path::new("src/**/*.yarn")); + assert_eq!(result, PathBuf::from("src")); + } + + #[test] + fn only_glob() { + let result = glob_base_dir(Path::new("**/*.yarn")); + assert_eq!(result, PathBuf::from("")); + } } diff --git a/crates/yarnspinner/tests/project_file_tests.rs b/crates/yarnspinner/tests/project_file_tests.rs index cb379cfa3..c68bb218d 100644 --- a/crates/yarnspinner/tests/project_file_tests.rs +++ b/crates/yarnspinner/tests/project_file_tests.rs @@ -15,7 +15,7 @@ fn test_project_file_can_be_loaded() { let project = Project::load_from_file(path.clone()).unwrap(); // Then - assert_eq!(project.project_file_version, 2); + assert_eq!(project.project_file_version, 3); assert_eq!(project.path, Some(path)); assert_eq!(project.source_file_patterns, vec!["**/*.yarn"]); @@ -157,3 +157,21 @@ fn test_projects_can_be_modified_and_saved() { assert_eq!(project.definitions, loaded_project.definitions); assert_eq!(project.compiler_options, loaded_project.compiler_options); } + +#[test] +fn test_project_files_can_all_preview_features() { + let project_source = " +{ + \"projectFileVersion\": 2, + \"sourceFiles\": [\"**/*.yarn\"], + \"baseLanguage\": \"en\", + \"compilerOptions\": { + \"allowPreviewFeatures\": true + } +} + "; + + let project = Project::load_from_string(project_source.into()).unwrap(); + + assert!(project.allow_language_preview_features()); +} From 7bdd0d88a7480c91a770dd193f38ccd90276fe25 Mon Sep 17 00:00:00 2001 From: Finix Date: Sun, 19 Jul 2026 19:35:28 +0200 Subject: [PATCH 06/15] migrate to antlr4rust Also regenerate generated files in `core/src/generated`. This does not (yet) change the code generator nor the logic inside of run_instruction in the vm. --- Cargo.lock | 839 +- crates/codegen/src/bin/generate_proto.rs | 2 +- crates/codegen/src/lib.rs | 2 + .../src/compiler/add_tags_to_lines.rs | 2 +- crates/compiler/src/compiler/utils.rs | 3 +- crates/compiler/src/error_strategy.rs | 16 +- .../src/listeners/compiler_listener.rs | 46 +- .../src/listeners/compiler_listener/emit.rs | 62 - crates/compiler/src/parser/generated.rs | 10 + .../parser/generated/YarnSpinnerLexer.interp | 50 +- .../parser/generated/YarnSpinnerLexer.tokens | 235 +- .../parser/generated/YarnSpinnerParser.interp | 44 +- .../parser/generated/YarnSpinnerParser.tokens | 235 +- .../compiler/src/parser/generated/readme.md | 4 +- .../src/parser/generated/yarnspinnerlexer.rs | 1423 ++- .../src/parser/generated/yarnspinnerparser.rs | 9072 +++++++++++------ .../yarnspinnerparserbaselistener.rs | 707 ++ .../generated/yarnspinnerparserbasevisitor.rs | 301 + .../generated/yarnspinnerparserlistener.rs | 204 +- .../generated/yarnspinnerparservisitor.rs | 369 +- .../src/visitors/code_generation_visitor.rs | 33 +- .../src/visitors/constant_value_visitor.rs | 14 +- .../src/visitors/declaration_visitor.rs | 14 +- .../src/visitors/node_tracking_visitor.rs | 6 +- .../src/visitors/type_check_visitor.rs | 19 +- crates/core/src/generated/ext.rs | 132 +- crates/core/src/generated/yarn.rs | 493 +- crates/core/src/lib.rs | 2 +- .../unused_variable_checker.rs | 11 +- .../default_analysers/variable_lister.rs | 7 +- crates/runtime/src/dialogue.rs | 2 +- crates/runtime/src/virtual_machine.rs | 56 +- crates/runtime/src/virtual_machine/state.rs | 12 +- crates/yarnspinner/tests/language_tests.rs | 2 +- third-party/YarnSpinnerLexer.g4 | 390 + third-party/YarnSpinnerParser.g4 | 212 + third-party/YarnSpinnerTestPlan.g4 | 65 + third-party/yarn_spinner.proto | 338 + 38 files changed, 10917 insertions(+), 4517 deletions(-) delete mode 100644 crates/compiler/src/listeners/compiler_listener/emit.rs create mode 100644 crates/compiler/src/parser/generated/yarnspinnerparserbaselistener.rs create mode 100644 crates/compiler/src/parser/generated/yarnspinnerparserbasevisitor.rs create mode 100644 third-party/YarnSpinnerLexer.g4 create mode 100644 third-party/YarnSpinnerParser.g4 create mode 100644 third-party/YarnSpinnerTestPlan.g4 create mode 100644 third-party/yarn_spinner.proto diff --git a/Cargo.lock b/Cargo.lock index 112a5dd9b..532d05e8a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -137,23 +137,22 @@ dependencies = [ [[package]] name = "android-activity" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef6978589202a00cd7e118380c448a08b6ed394c3a8df3a430d0898e3a42d046" +checksum = "0f2a1bb052857d5dd49572219344a7332b31b76405648eabac5bc68978251bcd" dependencies = [ "android-properties", "bitflags 2.11.0", "cc", - "cesu8", - "jni", - "jni-sys", + "jni 0.22.4", "libc", "log", "ndk 0.9.0", "ndk-context", "ndk-sys 0.6.0+11769913", "num_enum", - "thiserror 1.0.69", + "simd_cesu8", + "thiserror 2.0.18", ] [[package]] @@ -179,9 +178,9 @@ dependencies = [ [[package]] name = "annotate-snippets" -version = "0.12.12" +version = "0.12.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c86cd1c51b95d71dde52bca69ed225008f6ff4c8cc825b08042aa1ef823e1980" +checksum = "74fc7650eedcb2fee505aad48491529e408f0e854c2d9f63eb86c1361b9b3f93" dependencies = [ "anstyle", "memchr", @@ -190,9 +189,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" [[package]] name = "antlr4rust" @@ -261,7 +260,7 @@ checksum = "f548ad2c4031f2902e3edc1f29c29e835829437de49562d8eb5dc5584d3a1043" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -313,6 +312,24 @@ dependencies = [ "futures-lite", ] +[[package]] +name = "async-io" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "456b8a8feb6f42d237746d4b3e9a178494627745c3c56c6ea55d92ba50d026fc" +dependencies = [ + "autocfg", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite", + "parking", + "polling", + "rustix 1.1.4", + "slab", + "windows-sys 0.61.2", +] + [[package]] name = "async-lock" version = "3.4.2" @@ -381,18 +398,18 @@ checksum = "1795ebc740ea791ffbe6685e0688ab1effec16c2864e0476db40bfdf0c02cb3d" [[package]] name = "bevy" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec689b5a79452b6f777b889bbff22d3216b82a8d2ab7814d4a0eb571e9938d97" +checksum = "1fd310426290cec560221f9750c2f4484be4a8eeea7de3483c423329b465c40e" dependencies = [ "bevy_internal", ] [[package]] name = "bevy_a11y" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef69b6d2dec07cbf407c63f6987e1746e4b735a9beea51f4bfc25ad49e344f75" +checksum = "e887b25c84f384ffe3278a17cf0e4b405eaa3c8fbc3db24d05d560a11780676d" dependencies = [ "accesskit", "bevy_app", @@ -404,18 +421,18 @@ dependencies = [ [[package]] name = "bevy_android" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "008133458cfe0d43a8870bfc4c5a729467cc5d9246611462add38bcf45ed896f" +checksum = "a8c58de772ac1148884112e8a456c4f127a94b95a0e42ab5b160b7a11895a241" dependencies = [ "android-activity", ] [[package]] name = "bevy_animation" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c852457843456c695ed22562969c83c3823454c3c40d359f92415371208ee7" +checksum = "be5bf5b285f0d3fab983b4505e62e195e06930a29007ffc95bdabde834e163a2" dependencies = [ "bevy_animation_macros", "bevy_app", @@ -446,20 +463,20 @@ dependencies = [ [[package]] name = "bevy_animation_macros" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac120bfd5a74e05f96013817d28318dc716afaa68864af069c7ffc3ccaf9d153" +checksum = "7cf35516d0e7ac9ec25df533be1bf8cbaa20596a8e65f36838a3f7803a267d6d" dependencies = [ "bevy_macro_utils", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] name = "bevy_anti_alias" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418087f7c36a62c9886b55be6278e7b3d21c9943b107953aa2068000956a736" +checksum = "726cc494eb7d6a84ce6291c23636fd451fa4846604dc059fa93febca4e60a928" dependencies = [ "bevy_app", "bevy_asset", @@ -479,9 +496,9 @@ dependencies = [ [[package]] name = "bevy_app" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2271a0123a7cc355c3fe98754360c75aa84b29f2a6b1a9f8c00aac427570d174" +checksum = "def9f41aa5bf9b9dec8beda307a332798609cffb9d44f71005e0cfb45164f2f6" dependencies = [ "bevy_derive", "bevy_ecs", @@ -502,13 +519,14 @@ dependencies = [ [[package]] name = "bevy_asset" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f7361669d1426a3359cb92f890ef9c62bd6e6b67f0190d2c5279d25ce24168" +checksum = "29f86fed15972b9fb1a3f7b092cf0390e67131caaedab15a2707c043e3a3c886" dependencies = [ "async-broadcast", "async-channel", "async-fs", + "async-io", "async-lock", "atomicow", "bevy_android", @@ -545,21 +563,21 @@ dependencies = [ [[package]] name = "bevy_asset_macros" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "288e1edf17069afe2e02a0c0e7e5936b3d22a67c7d2dc9201a27e4451875f909" +checksum = "12cb8d948365b06561b43b7d709282e62a6abb756baac5d8e295206d5e156168" dependencies = [ "bevy_macro_utils", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] name = "bevy_audio" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3cbecfc6c5d3860f224f56d3152b14aa313168d35c16e847f5a0202a992c3af" +checksum = "9d68da32468ce7f4bb2863b71326acfaaa88e9aef8da8306257cd487d40cede4" dependencies = [ "bevy_app", "bevy_asset", @@ -575,9 +593,9 @@ dependencies = [ [[package]] name = "bevy_camera" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c7e1f2a5da1755cd58e45c762f4ea2d72cef6c480f9c8ddbadbd2a4380c616" +checksum = "37ed9eed054e14341852236d06a7244597b1ace39ff9ae023fbd188ffde88619" dependencies = [ "bevy_app", "bevy_asset", @@ -601,9 +619,9 @@ dependencies = [ [[package]] name = "bevy_color" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74727302424d7ffc23528a974dbb44a34708662926e1a3bfc5040493f858886e" +checksum = "2eb41e8310a85811d14a4e75cfc2d6c07ac70661d6a4883509fc960f622970a8" dependencies = [ "bevy_math", "bevy_reflect", @@ -617,9 +635,9 @@ dependencies = [ [[package]] name = "bevy_core_pipeline" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e6bf0ba878bb5dd00ad4d70875b08eb11367829668c70d95785f5483ddb1cb" +checksum = "4d0810e85c2436e50c67448d48a83bf0bb1b5849899619ae2c7ea817221e9172" dependencies = [ "bevy_app", "bevy_asset", @@ -647,20 +665,20 @@ dependencies = [ [[package]] name = "bevy_derive" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70b6a05c31f54c83d681f1b8699bbaf581f06b25a40c9a6bb815625f731f5ba9" +checksum = "318ee0532c3da93749859d18f89a889c638fbc56aabac4d866583df7b951d103" dependencies = [ "bevy_macro_utils", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] name = "bevy_dev_tools" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3183daa165acce210c50c170c47433c90b1d55932ead9734ebca14b7cd242c4" +checksum = "a4f1464a3f5ef5c23d917987714ee89881f9f791e9ff97ecf6600ee846b9569e" dependencies = [ "bevy_app", "bevy_asset", @@ -687,9 +705,9 @@ dependencies = [ [[package]] name = "bevy_diagnostic" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aca4caa8a9014a435dca382b1bdebaee4363e9be69882c598fc4ff4d7cd56e6a" +checksum = "ec8543a0f7afd56d3499ba80ffab6ef0bad12f93c2d2ca9aa7b1f1b8816c3980" dependencies = [ "atomic-waker", "bevy_app", @@ -705,9 +723,9 @@ dependencies = [ [[package]] name = "bevy_ecs" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24637a7c8643cab493f4085cda6bde4895f0e0816699c59006f18819da2ca0b8" +checksum = "c9cf7a3ee41342dd7b5a5d82e200d0e8efb933169247fce853b4ad633d51e87d" dependencies = [ "arrayvec", "bevy_ecs_macros", @@ -733,31 +751,61 @@ dependencies = [ [[package]] name = "bevy_ecs_macros" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eb14c18ca71e11c69fbae873c2db129064efac6d52e48d0127d37bfba1acfa8" +checksum = "908baf585e2ea16bd53ef0da57b69580478af0059d2dbdb4369991ac9794b618" dependencies = [ "bevy_macro_utils", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] name = "bevy_encase_derive" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f89146a8fcbfe47310fc929ee762dd3b08d4de3e3371c601529cfa8eeb861de" +checksum = "d4fee46eeddcbc00a805ae00ffa973f224671fc5cf0fe1a796963804faeade90" dependencies = [ "bevy_macro_utils", "encase_derive_impl", ] +[[package]] +name = "bevy_feathers" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cb29be8f8443c5cc44e1c4710bbe02877e73703c60228ca043f20529a5496c6" +dependencies = [ + "accesskit", + "bevy_a11y", + "bevy_app", + "bevy_asset", + "bevy_camera", + "bevy_color", + "bevy_derive", + "bevy_ecs", + "bevy_input_focus", + "bevy_log", + "bevy_math", + "bevy_picking", + "bevy_platform", + "bevy_reflect", + "bevy_render", + "bevy_shader", + "bevy_text", + "bevy_ui", + "bevy_ui_render", + "bevy_ui_widgets", + "bevy_window", + "smol_str", +] + [[package]] name = "bevy_gilrs" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c76417261ff3cd7ecda532b58514224aee06e76fbd87636c3a80695be7c8192" +checksum = "611827ab0ce43b88c0a695e6603901b5f34687efecaf526c861456c9d8e6fedb" dependencies = [ "bevy_app", "bevy_ecs", @@ -771,9 +819,9 @@ dependencies = [ [[package]] name = "bevy_gizmos" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc78a5699580c2dce078f4c099028d26525a5a38e8eb587a31854c660a3c5ff7" +checksum = "6aaff0dd5f405c83d290c5cd591835f1ae8009894947ab19dadcb323062bd7e7" dependencies = [ "bevy_app", "bevy_asset", @@ -791,20 +839,20 @@ dependencies = [ [[package]] name = "bevy_gizmos_macros" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60bb92e0ef80ff7c59429133244765515db3d313fae77ee67ffe94dab5b2725d" +checksum = "6960ea308d7e94adcac5c712553ff86614bba6b663511f3f3812f6bec028b51e" dependencies = [ "bevy_macro_utils", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] name = "bevy_gizmos_render" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48fde3172a31f81033b4f497dd9df84476f527fadb00936ede380fb646c402eb" +checksum = "4a8d18c089102de4c5e9326023ad96ba618a6961029f8102a33640b966883237" dependencies = [ "bevy_app", "bevy_asset", @@ -827,9 +875,9 @@ dependencies = [ [[package]] name = "bevy_gltf" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08372f222676dba313061fc71128209b82f9711e7c5cba222b5c34bf1c5c70fe" +checksum = "5f37fb52655d0439656ca0a1db027d46926e463c81d893d4b1639668e5d7f1c1" dependencies = [ "async-lock", "base64", @@ -863,9 +911,9 @@ dependencies = [ [[package]] name = "bevy_image" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809101ebe678a76c4c5ba3ecad255cde9be3ae0af591cf0143ba2c157afb55e9" +checksum = "a71daf9b2afdd032c2b1122d1d501f99126218cb3e9983b3604ec381daa35f22" dependencies = [ "bevy_app", "bevy_asset", @@ -892,9 +940,9 @@ dependencies = [ [[package]] name = "bevy_input" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c2853993baf27b963a417d3603a73e02e39c5041913cd1ba7211b0a3037b191" +checksum = "dbc8ffbd02df34dfc52faf420a5263985973765e228043adf542fd0d790a6b21" dependencies = [ "bevy_app", "bevy_ecs", @@ -910,9 +958,9 @@ dependencies = [ [[package]] name = "bevy_input_focus" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05fc0fae5e4e081180f7f7bf8023a2b97dad13dcb5fa79eba50cda5bb95699a9" +checksum = "08d48a5bceccb9157549a39ab3de4017f5368b65db6471605e9a3f1c19d91bbc" dependencies = [ "bevy_app", "bevy_ecs", @@ -927,9 +975,9 @@ dependencies = [ [[package]] name = "bevy_internal" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57463815630ea71221c0b8e7bff72d816a3071a89507c45f9e2686fbb5e1956b" +checksum = "6a11df62e49897def470471551c02f13c6fb488e55dddb5ab7ef098132e07754" dependencies = [ "bevy_a11y", "bevy_android", @@ -945,6 +993,7 @@ dependencies = [ "bevy_dev_tools", "bevy_diagnostic", "bevy_ecs", + "bevy_feathers", "bevy_gilrs", "bevy_gizmos", "bevy_gizmos_render", @@ -981,9 +1030,9 @@ dependencies = [ [[package]] name = "bevy_light" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f9968b8f8a6a766a88b66144474c39d1415edc277d042fec1526eae85e1f8b4" +checksum = "4d9d2ac64390a9baacb3c0fa0f5456ac1553959d5a387874c102a09aab8b92cc" dependencies = [ "bevy_app", "bevy_asset", @@ -1002,9 +1051,9 @@ dependencies = [ [[package]] name = "bevy_log" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "406304a9b867a2de98c3edf0cc9e5a608fad1a1ddc567e15e72c186a8273ef51" +checksum = "c2aac1187f83a1ab2eae887564f7fb14b4abb3fbe8b2267a6426663463923120" dependencies = [ "android_log-sys", "bevy_app", @@ -1020,21 +1069,21 @@ dependencies = [ [[package]] name = "bevy_macro_utils" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7272fca0bf30d8ca2571a803598856104b63e5c596d52850f811ed37c5e1e3" +checksum = "3b147843b81a7ec548876ff97fa7bfdc646ef2567cb465566259237b39664438" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", - "toml_edit", + "syn 2.0.119", + "toml_edit 0.23.10+spec-1.0.0", ] [[package]] name = "bevy_math" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a815c514b8a6f7b11508cdc8b3a4bf0761e96a14227af40aa93cb1160989ce0" +checksum = "e931fa969f89c83498b22c97432383afe90e90fd1a5e04fa07be8da4d3bcac84" dependencies = [ "approx", "arrayvec", @@ -1052,9 +1101,9 @@ dependencies = [ [[package]] name = "bevy_mesh" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aacf09d0ffd1a15baf8d201c4a34b918912a506395c2817aa55ab3d3776c09f2" +checksum = "288f590c8173d4cca3cae5f2ba579accd5ed1a35dd3fab338f427eb39d55f05e" dependencies = [ "bevy_app", "bevy_asset", @@ -1084,9 +1133,9 @@ checksum = "7ef8e4b7e61dfe7719bb03c884dc270cd46a82efb40f93e9933b990c5c190c59" [[package]] name = "bevy_pbr" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cc361c65035f7e531b592d99bce95b6ab3f643cae2abe97dfa7681363159a6" +checksum = "a5ab6944ffc6fd71604c0fbca68cc3e2a3654edfcdbfd232f9d8b88e3d20fdc0" dependencies = [ "bevy_app", "bevy_asset", @@ -1121,9 +1170,9 @@ dependencies = [ [[package]] name = "bevy_picking" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4d10bb2a776087e1d8a9b87e8deb091d25bcedbe6160c613df2dc5fe069c3c5" +checksum = "b7d524dbc8f2c9e73f7ab70c148c8f7886f3c24b8aa8c252a38ba68ed06cbf10" dependencies = [ "bevy_app", "bevy_asset", @@ -1145,9 +1194,9 @@ dependencies = [ [[package]] name = "bevy_platform" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b29ea749a8e85f98186ab662f607b885b97c804bb14cdb0cdf838164496d474" +checksum = "ec6b36504169b644acd26a5469fd8d371aa6f1d73ee5c01b1b1181ae1cefbf9b" dependencies = [ "critical-section", "foldhash 0.2.0", @@ -1165,9 +1214,9 @@ dependencies = [ [[package]] name = "bevy_post_process" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8e1116cbc35637f267a29c7d2fe376e020f2b4402d6b525d328bae9c10460c7" +checksum = "8f77a4e894aea992e3d6938f1d5898a1cdbb87dba6eebfb95cb4038d0a2600e9" dependencies = [ "bevy_app", "bevy_asset", @@ -1195,15 +1244,15 @@ dependencies = [ [[package]] name = "bevy_ptr" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f98cbc6d34bbdb58240b72ed1731931b4991a893b3a3238bb7c42ae054aa676" +checksum = "c7a9329e8dc4e01ced480eeec4902e6d7cb56e56ec37f6fbc4323e5c937290a7" [[package]] name = "bevy_reflect" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b2a977e2b8dba65b6e9c11039c5f9ef108be428f036b3d1cac13ad86ec59f9c" +checksum = "d1dfeb67a9fe4f59003a84f5f99ba6302141c70e926601cbc6abfd4a1eea9ca9" dependencies = [ "assert_type_match", "bevy_platform", @@ -1230,23 +1279,23 @@ dependencies = [ [[package]] name = "bevy_reflect_derive" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "067af30072b1611fda1a577f1cb678b8ea2c9226133068be808dd49aac30cef0" +checksum = "475f68c93e9cd5f17e9167635c8533a4f388f12d38245a202359e4c2721d87ba" dependencies = [ "bevy_macro_utils", "indexmap", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", "uuid", ] [[package]] name = "bevy_render" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6b2c9a276646bde8ba58a7e15711b459fb4a5cdf46c47059b7a310f97a70d9c" +checksum = "243523e33fe5dfcebc4240b1eb2fc16e855c5d4c0ea6a8393910740956770f44" dependencies = [ "async-channel", "bevy_app", @@ -1294,21 +1343,21 @@ dependencies = [ [[package]] name = "bevy_render_macros" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03e16b8cac95b87021399ed19f6ab79c0b1e03101a448e3a0240934f78f66a56" +checksum = "66b6325e9c495a71270446784611e8d7f446f927eac8506c4c099fd10cb4c3ed" dependencies = [ "bevy_macro_utils", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] name = "bevy_scene" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0046bb071ee358619f2fa9409ccced47375502b098b4107ec3385f3a1acf6600" +checksum = "34cc1047d85ec8048261b63ef675c12f1e6b5782dc0b422fbcee0c140d026bd4" dependencies = [ "bevy_app", "bevy_asset", @@ -1328,9 +1377,9 @@ dependencies = [ [[package]] name = "bevy_shader" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a14cb0991b2482a66b94728cbcf7482d1b74364be017197396435d3d542b8d3" +checksum = "9eea95f0273c32be13d6a0b799a93bc256ad7830759ede595c404d5234302da2" dependencies = [ "bevy_asset", "bevy_platform", @@ -1345,9 +1394,9 @@ dependencies = [ [[package]] name = "bevy_sprite" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b3921ce1a8ce801c29d9552cbc204548bfeb16b9b829045c9e82b5917d99cc" +checksum = "96ec5bc0cbdee551b610a46f41d30374bbe42b8951ffc676253c6243ab2b9395" dependencies = [ "bevy_app", "bevy_asset", @@ -1379,9 +1428,9 @@ dependencies = [ [[package]] name = "bevy_sprite_render" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed40642fa0e1330df65b6a1bf0b14aa32fcd9d7f3306e08e0784c10362bd6265" +checksum = "b82cb08905e7ddcea2694a95f757ae7f1fd01e6a7304076bad595d2158e4bfe0" dependencies = [ "bevy_app", "bevy_asset", @@ -1411,9 +1460,9 @@ dependencies = [ [[package]] name = "bevy_state" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9453325ca0c185a043f4515158daa15a8ab19139a60fd1edaf87fbe896cb7f83" +checksum = "0ae0682968e97d29c1eccc8c6bb6283f2678d362779bc03f1bb990967059473b" dependencies = [ "bevy_app", "bevy_ecs", @@ -1427,20 +1476,20 @@ dependencies = [ [[package]] name = "bevy_state_macros" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d733081e57e49b3c43bdf3766d1de74c7df32e0f4db20c20437c85b1d18908de" +checksum = "73d32f90f9cfcef5a44401db7ce206770daaa1707b0fb95eb7a96a6933f54f1b" dependencies = [ "bevy_macro_utils", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] name = "bevy_tasks" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "990ffedd374dd2c4fe8f0fd4bcefd5617d1ee59164b6c3fcc356a69b48e26e8e" +checksum = "384eb04d80aa38664d69988fd30cbbe03e937ecb65c66aa6abe60ce0bca826aa" dependencies = [ "async-channel", "async-executor", @@ -1457,9 +1506,9 @@ dependencies = [ [[package]] name = "bevy_text" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecbb6eeaa9a63d1f8aae8c0d79f8d5e14c584a962a4ef9f69115fd7d10941101" +checksum = "fdc5233291dfc22e584de2535f2e37ae9766d37cb5a01652de2133ba202dcb9b" dependencies = [ "bevy_app", "bevy_asset", @@ -1483,9 +1532,9 @@ dependencies = [ [[package]] name = "bevy_time" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4c68b78e7ca1cc10c811cd1ded8350f53f2be11eb46946879a74c684026bff7" +checksum = "b5ef9af4e523195e561074cf60fbfad0f4cb8d1db504855fee3c4ce8896c7244" dependencies = [ "bevy_app", "bevy_ecs", @@ -1498,9 +1547,9 @@ dependencies = [ [[package]] name = "bevy_transform" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30e3957de42c2f7d88dfe8428e739b74deab8932d2a8bbb9d4eefbd64b6aa34" +checksum = "3c3bb3de7842fef699344beb03f22bdbff16599d788fe0f47fbb3b1e6fa320eb" dependencies = [ "bevy_app", "bevy_ecs", @@ -1516,9 +1565,9 @@ dependencies = [ [[package]] name = "bevy_ui" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "889c6892e9c5c308ab225a1322d07fb2358ccf39493526cda4d5f083d717773d" +checksum = "1691a411014085e0d35f8bb8208e5f973edd7ace061a4b1c41c83de21579dc70" dependencies = [ "accesskit", "bevy_a11y", @@ -1551,9 +1600,9 @@ dependencies = [ [[package]] name = "bevy_ui_render" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b649395e32a4761d4f17aeff37170a4421c94a14c505645397b8ee8510eb19e9" +checksum = "c2c35402d8a052f512e3fec1f36b26e83eee713fcca57f965c244ee795e1fcb0" dependencies = [ "bevy_app", "bevy_asset", @@ -1580,11 +1629,31 @@ dependencies = [ "tracing", ] +[[package]] +name = "bevy_ui_widgets" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6a63cb818b0de41bdb14990e0ce1aaaa347f871750ab280f80c427e83d72712" +dependencies = [ + "accesskit", + "bevy_a11y", + "bevy_app", + "bevy_camera", + "bevy_ecs", + "bevy_input", + "bevy_input_focus", + "bevy_log", + "bevy_math", + "bevy_picking", + "bevy_reflect", + "bevy_ui", +] + [[package]] name = "bevy_utils" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e258c44d869f9c41ac0f88a16815c67f2569eb9fff4716828a40273d127b6f84" +checksum = "2111910cd7a4b1e6ce07eaaeb6f68a2c0ea0ca609ed0d0d506e3eb161101435b" dependencies = [ "bevy_platform", "disqualified", @@ -1593,9 +1662,9 @@ dependencies = [ [[package]] name = "bevy_window" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "869a56f1da2544641734018e1f1caa660299cd6e3af794f3fa0df72293d8eed2" +checksum = "6df06e6993a0896bae2fe7644ae6def29a1a92b45dfb1bcebbd92af782be3638" dependencies = [ "bevy_app", "bevy_asset", @@ -1612,9 +1681,9 @@ dependencies = [ [[package]] name = "bevy_winit" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8142a3749fc491eeae481c30bb3830cf5a71d2fa3dba4d450a42792f6d39eb2d" +checksum = "f2de1c13d32ab8528435b58eca7ab874a1068184c6d6f266ee11433ae99d4069" dependencies = [ "accesskit", "accesskit_winit", @@ -1669,7 +1738,7 @@ dependencies = [ "bevy_sprite3d", "bevy_yarnspinner", "bevy_yarnspinner_example_dialogue_view", - "getrandom 0.4.1", + "getrandom 0.4.2", ] [[package]] @@ -1694,9 +1763,9 @@ dependencies = [ "proc-macro2", "quote", "regex", - "rustc-hash 2.1.1", + "rustc-hash 2.1.2", "shlex", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -1747,16 +1816,16 @@ dependencies = [ [[package]] name = "blake3" -version = "1.8.3" +version = "1.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2468ef7d57b3fb7e16b576e8377cdbde2320c60e1491e961d11da40fc4f02a2d" +checksum = "4d2d5991425dfd0785aed03aedcf0b321d61975c9b5b3689c774a2610ae0b51e" dependencies = [ "arrayref", "arrayvec", "cc", "cfg-if", "constant_time_eq", - "cpufeatures", + "cpufeatures 0.3.0", ] [[package]] @@ -1838,7 +1907,7 @@ checksum = "f9abbd1bc6865053c427f7198e6af43bfdedc55ab791faed4fbd361d789575ff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -1896,9 +1965,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.56" +version = "1.2.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aebf35691d1bfb0ac386a69bac2fde4dd276fb618cf8bf4f5318fe285e821bb2" +checksum = "e1e928d4b69e3077709075a938a05ffbedfa53a84c8f766efbf8220bb1ff60e1" dependencies = [ "find-msvc-tools", "jobserver", @@ -2168,7 +2237,7 @@ dependencies = [ "core-foundation-sys", "coreaudio-rs", "dasp_sample", - "jni", + "jni 0.21.1", "js-sys", "libc", "mach2", @@ -2190,6 +2259,15 @@ dependencies = [ "libc", ] +[[package]] +name = "cpufeatures" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201" +dependencies = [ + "libc", +] + [[package]] name = "crc32fast" version = "1.5.0" @@ -2340,7 +2418,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -2351,7 +2429,7 @@ checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d" dependencies = [ "darling_core", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -2400,7 +2478,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.117", + "syn 2.0.119", "unicode-xid", ] @@ -2440,7 +2518,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -2519,7 +2597,7 @@ checksum = "c8bad72d8308f7a382de2391ec978ddd736e0103846b965d7e2a63a75768af30" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -2530,7 +2608,7 @@ checksum = "2f9ed6b3789237c8a0c1c505af1c7eb2c560df6186f01b098c3a1064ea532f38" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -2541,9 +2619,9 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "erased-serde" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89e8918065695684b2b0702da20382d5ae6065cf3327bc2d6436bd49a71ce9f3" +checksum = "d2add8a07dd6a8d93ff627029c51de145e12686fbc36ecb298ac22e74cf02dec" dependencies = [ "serde", "serde_core", @@ -2562,9 +2640,9 @@ dependencies = [ [[package]] name = "euclid" -version = "0.22.13" +version = "0.22.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df61bf483e837f88d5c2291dcf55c67be7e676b3a51acc48db3a7b163b91ed63" +checksum = "f1a05365e3b1c6d1650318537c7460c6923f1abdd272ad6842baa2b509957a06" dependencies = [ "num-traits", ] @@ -2708,6 +2786,15 @@ dependencies = [ "bytemuck", ] +[[package]] +name = "font-types" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73829a7b5c91198af28a99159b7ae4afbb252fb906159ff7f189f3a2ceaa3df2" +dependencies = [ + "bytemuck", +] + [[package]] name = "fontconfig-parser" version = "0.5.8" @@ -2749,7 +2836,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -2809,7 +2896,7 @@ checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -2859,20 +2946,20 @@ checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" dependencies = [ "cfg-if", "libc", - "r-efi", + "r-efi 5.3.0", "wasip2", ] [[package]] name = "getrandom" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "139ef39800118c7683f2fd3c98c1b23c09ae076556b435f8e9064ae108aaeeec" +checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" dependencies = [ "cfg-if", "js-sys", "libc", - "r-efi", + "r-efi 6.0.0", "rand_core 0.10.0", "wasip2", "wasip3", @@ -2989,7 +3076,7 @@ dependencies = [ "inflections", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -3280,9 +3367,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "image" -version = "0.25.9" +version = "0.25.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6506c6c10786659413faa717ceebcb8f70731c0a60cbae39795fdf114519c1a" +checksum = "85ab80394333c02fe689eaf900ab500fbd0c2213da414687ebf995a65d5a6104" dependencies = [ "bytemuck", "byteorder-lite", @@ -3320,9 +3407,9 @@ checksum = "a257582fdcde896fd96463bf2d40eefea0580021c0712a0e2b028b60b47a837a" [[package]] name = "inotify" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f37dccff2791ab604f9babef0ba14fbe0be30bd368dc541e2b08d07c8aa908f3" +checksum = "bd5b3eaf1a28b758ac0faa5a4254e8ab2705605496f1b1f3fbbc3988ad73d199" dependencies = [ "bitflags 2.11.0", "inotify-sys", @@ -3340,15 +3427,15 @@ dependencies = [ [[package]] name = "instability" -version = "0.3.11" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "357b7205c6cd18dd2c86ed312d1e70add149aea98e7ef72b9fdf0270e555c11d" +checksum = "5eb2d60ef19920a3a9193c3e371f726ec1dafc045dac788d0fb3704272458971" dependencies = [ "darling", "indoc", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -3365,9 +3452,9 @@ dependencies = [ [[package]] name = "inventory" -version = "0.3.22" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "009ae045c87e7082cb72dab0ccd01ae075dd00141ddc108f43a0ea150a9e7227" +checksum = "a4f0c30c76f2f4ccee3fe55a2435f691ca00c0e4bd87abe4f4a851b1d4dac39b" dependencies = [ "rustversion", ] @@ -3392,9 +3479,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" [[package]] name = "jni" @@ -3405,18 +3492,70 @@ dependencies = [ "cesu8", "cfg-if", "combine", - "jni-sys", + "jni-sys 0.3.1", "log", "thiserror 1.0.69", "walkdir", "windows-sys 0.45.0", ] +[[package]] +name = "jni" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5efd9a482cf3a427f00d6b35f14332adc7902ce91efb778580e180ff90fa3498" +dependencies = [ + "cfg-if", + "combine", + "jni-macros", + "jni-sys 0.4.1", + "log", + "simd_cesu8", + "thiserror 2.0.18", + "walkdir", + "windows-link 0.2.1", +] + +[[package]] +name = "jni-macros" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00109accc170f0bdb141fed3e393c565b6f5e072365c3bd58f5b062591560a3" +dependencies = [ + "proc-macro2", + "quote", + "rustc_version", + "simd_cesu8", + "syn 2.0.119", +] + [[package]] name = "jni-sys" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" +checksum = "41a652e1f9b6e0275df1f15b32661cf0d4b78d4d87ddec5e0c3c20f097433258" +dependencies = [ + "jni-sys 0.4.1", +] + +[[package]] +name = "jni-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2" +dependencies = [ + "jni-sys-macros", +] + +[[package]] +name = "jni-sys-macros" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" +dependencies = [ + "quote", + "syn 2.0.119", +] [[package]] name = "jobserver" @@ -3430,19 +3569,21 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.91" +version = "0.3.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b49715b7073f385ba4bc528e5747d02e66cb39c6146efb66b781f131f0fb399c" +checksum = "2e04e2ef80ce82e13552136fabeef8a5ed1f985a96805761cbb9a2c34e7664d9" dependencies = [ + "cfg-if", + "futures-util", "once_cell", "wasm-bindgen", ] [[package]] name = "kasuari" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fe90c1150662e858c7d5f945089b7517b0a80d8bf7ba4b1b5ffc984e7230a5b" +checksum = "bde5057d6143cc94e861d90f591b9303d6716c6b9602309150bd068853c10899" dependencies = [ "hashbrown 0.16.1", "portable-atomic", @@ -3526,9 +3667,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.182" +version = "0.2.184" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6800badb6cb2082ffd7b6a67e6125bb39f18782f793520caee8cb8846be06112" +checksum = "48f5d2a454e16a5ea0f4ced81bd44e4cfc7bd3a507b61887c99fd3538b28e4af" [[package]] name = "libloading" @@ -3548,9 +3689,9 @@ checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" [[package]] name = "libredox" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1744e39d1d6a9948f4f388969627434e31128196de472883b39f148769bfe30a" +checksum = "7ddbf48fd451246b1f8c2610bd3b4ac0cc6e149d89832867093ab69a17194f08" dependencies = [ "bitflags 2.11.0", "libc", @@ -3570,9 +3711,9 @@ dependencies = [ [[package]] name = "line-clipping" -version = "0.3.5" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4de44e98ddbf09375cbf4d17714d18f39195f4f4894e8524501726fd9a8a4a" +checksum = "3f50e8f47623268b5407192d26876c4d7f89d686ca130fdc53bced4814cd29f8" dependencies = [ "bitflags 2.11.0", ] @@ -3731,9 +3872,9 @@ dependencies = [ [[package]] name = "mio" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc" +checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1" dependencies = [ "libc", "log", @@ -3743,9 +3884,9 @@ dependencies = [ [[package]] name = "moxcms" -version = "0.7.11" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac9557c559cd6fc9867e122e20d2cbefc9ca29d80d027a8e39310920ed2f0a97" +checksum = "bb85c154ba489f01b25c0d36ae69a87e4a1c73a72631fc6c0eb6dde34a73e44b" dependencies = [ "num-traits", "pxfm", @@ -3817,7 +3958,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2076a31b7010b17a38c01907c45b945e8f11495ee4dd588309718901b1f7a5b7" dependencies = [ "bitflags 2.11.0", - "jni-sys", + "jni-sys 0.3.1", "log", "ndk-sys 0.5.0+25.2.9519653", "num_enum", @@ -3831,7 +3972,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" dependencies = [ "bitflags 2.11.0", - "jni-sys", + "jni-sys 0.3.1", "log", "ndk-sys 0.6.0+11769913", "num_enum", @@ -3851,7 +3992,7 @@ version = "0.5.0+25.2.9519653" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c196769dd60fd4f363e11d948139556a344e79d451aeb2fa2fd040738ef7691" dependencies = [ - "jni-sys", + "jni-sys 0.3.1", ] [[package]] @@ -3860,7 +4001,7 @@ version = "0.6.0+11769913" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873" dependencies = [ - "jni-sys", + "jni-sys 0.3.1", ] [[package]] @@ -3976,9 +4117,9 @@ dependencies = [ [[package]] name = "num-conv" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf97ec579c3c42f953ef76dbf8d55ac91fb219dde70e49aa4a6b7d74e9919050" +checksum = "c6673768db2d862beb9b39a78fdcb1a69439615d5794a1be50caa9bc92c81967" [[package]] name = "num-derive" @@ -3988,7 +4129,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -4003,9 +4144,9 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.7.5" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1207a7e20ad57b847bbddc6776b968420d38292bbfe2089accff5e19e82454c" +checksum = "5d0bca838442ec211fa11de3a8b0e0e8f3a4522575b5c4c06ed722e005036f26" dependencies = [ "num_enum_derive", "rustversion", @@ -4013,14 +4154,14 @@ dependencies = [ [[package]] name = "num_enum_derive" -version = "0.7.5" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff32365de1b6743cb203b710788263c44a03de03802daf96092f2da4fe6ba4d7" +checksum = "680998035259dcfcafe653688bf2aa6d3e2dc05e98be6ab46afb089dc84f1df8" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -4279,7 +4420,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8b61bebd49e5d43f5f8cc7ee2891c16e0f41ec7954d36bcb6c14c5e0de867fb" dependencies = [ - "jni", + "jni 0.21.1", "ndk 0.8.0", "ndk-context", "num-derive", @@ -4317,15 +4458,15 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.21.3" +version = "1.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" [[package]] name = "orbclient" -version = "0.3.50" +version = "0.3.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ad2c6bae700b7aa5d1cc30c59bdd3a1c180b09dbaea51e2ae2b8e1cf211fdd" +checksum = "59aed3b33578edcfa1bc96a321d590d31832b6ad55a26f0313362ce687e9abd6" dependencies = [ "libc", "libredox", @@ -4342,9 +4483,9 @@ dependencies = [ [[package]] name = "ordered-float" -version = "5.1.0" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4779c6901a562440c3786d08192c6fbda7c1c2060edd10006b05ee35d10f2d" +checksum = "b7d950ca161dc355eaf28f82b11345ed76c6e1f6eb1f4f4479e0323b9e2fbd0e" dependencies = [ "num-traits", ] @@ -4429,7 +4570,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -4495,7 +4636,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -4524,7 +4665,7 @@ checksum = "d9b20ed30f105399776b9c883e68e536ef602a16ae6f596d2c473591d6ad64c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -4591,9 +4732,9 @@ checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" [[package]] name = "portable-atomic-util" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a9db96d7fa8782dd8c15ce32ffe8680bbd1e978a43bf51a34d39483540495f5" +checksum = "091397be61a01d4be58e7841595bd4bfedb15f1cd54977d79b8271e94ed799a3" dependencies = [ "portable-atomic", ] @@ -4646,16 +4787,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" dependencies = [ "proc-macro2", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] name = "proc-macro-crate" -version = "3.4.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "219cb19e96be00ab2e37d6e299658a0cfa83e52429179969b0f0121b4ac46983" +checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" dependencies = [ - "toml_edit", + "toml_edit 0.25.9+spec-1.1.0", ] [[package]] @@ -4698,7 +4839,7 @@ dependencies = [ "prost", "prost-types", "regex", - "syn 2.0.117", + "syn 2.0.119", "tempfile", ] @@ -4712,7 +4853,7 @@ dependencies = [ "itertools 0.14.0", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -4732,18 +4873,18 @@ checksum = "b5a041e753da8b807c9255f28de81879c78c876392ff2469cde94799b2896b9d" [[package]] name = "quick-xml" -version = "0.38.4" +version = "0.39.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b66c2058c55a409d601666cffe35f04333cf1013010882cec174a7467cd4e21c" +checksum = "958f21e8e7ceb5a1aa7fa87fab28e7c75976e0bfe7e23ff069e0a260f894067d" dependencies = [ "memchr", ] [[package]] name = "quote" -version = "1.0.44" +version = "1.0.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" dependencies = [ "proc-macro2", ] @@ -4754,6 +4895,12 @@ version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + [[package]] name = "radsort" version = "0.1.1" @@ -4785,7 +4932,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc266eb313df6c5c09c1c7b1fbe2510961e5bcd3add930c1e31f7ed9da0feff8" dependencies = [ - "getrandom 0.4.1", + "getrandom 0.4.2", "rand_core 0.10.0", ] @@ -4935,23 +5082,23 @@ checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" [[package]] name = "read-fonts" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6717cf23b488adf64b9d711329542ba34de147df262370221940dfabc2c91358" +checksum = "5eaa2941a4c05443ee3a7b26ab076a553c343ad5995230cc2b1d3e993bdc6345" dependencies = [ "bytemuck", - "font-types", + "core_maths", + "font-types 0.10.1", ] [[package]] name = "read-fonts" -version = "0.36.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eaa2941a4c05443ee3a7b26ab076a553c343ad5995230cc2b1d3e993bdc6345" +checksum = "7b634fabf032fab15307ffd272149b622260f55974d9fad689292a5d33df02e5" dependencies = [ "bytemuck", - "core_maths", - "font-types", + "font-types 0.11.1", ] [[package]] @@ -5034,9 +5181,9 @@ dependencies = [ [[package]] name = "ron" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd490c5b18261893f14449cbd28cb9c0b637aebf161cd77900bfdedaff21ec32" +checksum = "4147b952f3f819eca0e99527022f7d6a8d05f111aeb0a62960c74eb283bec8fc" dependencies = [ "bitflags 2.11.0", "once_cell", @@ -5060,9 +5207,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustc-hash" -version = "2.1.1" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" +checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" [[package]] name = "rustc_version" @@ -5199,7 +5346,7 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -5222,7 +5369,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ "cfg-if", - "cpufeatures", + "cpufeatures 0.2.17", "digest", ] @@ -5274,9 +5421,25 @@ dependencies = [ [[package]] name = "simd-adler32" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" +checksum = "703d5c7ef118737c72f1af64ad2f6f8c5e1921f818cdcb97b8fe6fc69bf66214" + +[[package]] +name = "simd_cesu8" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94f90157bb87cddf702797c5dadfa0be7d266cdf49e22da2fcaa32eff75b2c33" +dependencies = [ + "rustc_version", + "simdutf8", +] + +[[package]] +name = "simdutf8" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" [[package]] name = "siphasher" @@ -5286,22 +5449,22 @@ checksum = "b2aa850e253778c88a04c3d7323b043aeda9d3e30d5971937c1855769763678e" [[package]] name = "skrifa" -version = "0.37.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c31071dedf532758ecf3fed987cdb4bd9509f900e026ab684b4ecb81ea49841" +checksum = "9c9eb0b904a04d09bd68c65d946617b8ff733009999050f3b851c32fb3cfb60e" dependencies = [ "bytemuck", - "read-fonts 0.35.0", + "read-fonts 0.36.0", ] [[package]] name = "skrifa" -version = "0.39.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c9eb0b904a04d09bd68c65d946617b8ff733009999050f3b851c32fb3cfb60e" +checksum = "7fbdfe3d2475fbd7ddd1f3e5cf8288a30eb3e5f95832829570cd88115a7434ac" dependencies = [ "bytemuck", - "read-fonts 0.36.0", + "read-fonts 0.37.0", ] [[package]] @@ -5431,7 +5594,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -5442,11 +5605,11 @@ checksum = "0193cc4331cfd2f3d2011ef287590868599a2f33c3e69bc22c1a3d3acf9e02fb" [[package]] name = "swash" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47846491253e976bdd07d0f9cc24b7daf24720d11309302ccbbc6e6b6e53550a" +checksum = "842f3cd369c2ba38966204f983eaa5e54a8e84a7d7159ed36ade2b6c335aae64" dependencies = [ - "skrifa 0.37.0", + "skrifa 0.40.0", "yazi", "zeno", ] @@ -5464,9 +5627,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.117" +version = "2.0.119" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297" dependencies = [ "proc-macro2", "quote", @@ -5481,7 +5644,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -5521,12 +5684,12 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.26.0" +version = "3.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82a72c767771b47409d2345987fda8628641887d5466101319899796367354a0" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" dependencies = [ "fastrand", - "getrandom 0.4.1", + "getrandom 0.4.2", "once_cell", "rustix 1.1.4", "windows-sys 0.61.2", @@ -5630,7 +5793,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -5641,7 +5804,7 @@ checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -5712,9 +5875,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" +checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" dependencies = [ "tinyvec_macros", ] @@ -5734,6 +5897,15 @@ dependencies = [ "serde_core", ] +[[package]] +name = "toml_datetime" +version = "1.1.1+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" +dependencies = [ + "serde_core", +] + [[package]] name = "toml_edit" version = "0.23.10+spec-1.0.0" @@ -5741,18 +5913,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84c8b9f757e028cee9fa244aea147aab2a9ec09d5325a9b01e0a49730c2b5269" dependencies = [ "indexmap", - "toml_datetime", + "toml_datetime 0.7.5+spec-1.1.0", "toml_parser", - "winnow", + "winnow 0.7.15", +] + +[[package]] +name = "toml_edit" +version = "0.25.9+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da053d28fe57e2c9d21b48261e14e7b4c8b670b54d2c684847b91feaf4c7dac5" +dependencies = [ + "indexmap", + "toml_datetime 1.1.1+spec-1.1.0", + "toml_parser", + "winnow 1.0.1", ] [[package]] name = "toml_parser" -version = "1.0.9+spec-1.1.0" +version = "1.1.1+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702d4415e08923e7e1ef96cd5727c0dfed80b4d2fa25db9647fe5eb6f7c5a4c4" +checksum = "39ca317ebc49f06bd748bfba29533eac9485569dc9bf80b849024b025e814fb9" dependencies = [ - "winnow", + "winnow 1.0.1", ] [[package]] @@ -5774,7 +5958,7 @@ checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -5812,9 +5996,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.22" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f30143827ddab0d256fd843b7a66d164e9f271cfa0dde49142c5ca0ca291f1e" +checksum = "cb7f578e5945fb242538965c2d0b04418d38ec25c79d160cd279bf0731c8d319" dependencies = [ "matchers", "nu-ansi-term", @@ -5919,9 +6103,9 @@ checksum = "383ad40bb927465ec0ce7720e033cb4ca06912855fc35db31b5755d0de75b1ee" [[package]] name = "unicode-segmentation" -version = "1.12.0" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" +checksum = "9629274872b2bfaf8d66f5f15725007f635594914870f65218920345aa11aa8c" [[package]] name = "unicode-truncate" @@ -5954,12 +6138,12 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.21.0" +version = "1.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b672338555252d43fd2240c714dc444b8c6fb0a5c5335e65a07bba7742735ddb" +checksum = "5ac8b6f42ead25368cf5b098aeb3dc8a1a2c05a3eee8a9a1a68c640edbfc79d9" dependencies = [ "atomic", - "getrandom 0.4.1", + "getrandom 0.4.2", "js-sys", "serde_core", "wasm-bindgen", @@ -5979,7 +6163,7 @@ checksum = "41b6d82be61465f97d42bd1d15bf20f3b0a3a0905018f38f9d6f6962055b0b5c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -6039,9 +6223,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.114" +version = "0.2.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6532f9a5c1ece3798cb1c2cfdba640b9b3ba884f5db45973a6f442510a87d38e" +checksum = "0551fc1bb415591e3372d0bc4780db7e587d84e2a7e79da121051c5c4b89d0b0" dependencies = [ "cfg-if", "once_cell", @@ -6052,23 +6236,19 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.64" +version = "0.4.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9c5522b3a28661442748e09d40924dfb9ca614b21c00d3fd135720e48b67db8" +checksum = "03623de6905b7206edd0a75f69f747f134b7f0a2323392d664448bf2d3c5d87e" dependencies = [ - "cfg-if", - "futures-util", "js-sys", - "once_cell", "wasm-bindgen", - "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.114" +version = "0.2.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18a2d50fcf105fb33bb15f00e7a77b772945a2ee45dcf454961fd843e74c18e6" +checksum = "7fbdf9a35adf44786aecd5ff89b4563a90325f9da0923236f6104e603c7e86be" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -6076,22 +6256,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.114" +version = "0.2.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03ce4caeaac547cdf713d280eda22a730824dd11e6b8c3ca9e42247b25c631e3" +checksum = "dca9693ef2bab6d4e6707234500350d8dad079eb508dca05530c85dc3a529ff2" dependencies = [ "bumpalo", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.114" +version = "0.2.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75a326b8c223ee17883a4251907455a2431acc2791c98c26279376490c378c16" +checksum = "39129a682a6d2d841b6c429d0c51e5cb0ed1a03829d8b3d1e69a011e62cb3d3b" dependencies = [ "unicode-ident", ] @@ -6132,9 +6312,9 @@ dependencies = [ [[package]] name = "wayland-backend" -version = "0.3.12" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fee64194ccd96bf648f42a65a7e589547096dfa702f7cadef84347b66ad164f9" +checksum = "2857dd20b54e916ec7253b3d6b4d5c4d7d4ca2c33c2e11c6c76a99bd8744755d" dependencies = [ "cc", "downcast-rs 1.2.1", @@ -6146,9 +6326,9 @@ dependencies = [ [[package]] name = "wayland-client" -version = "0.31.12" +version = "0.31.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e6faa537fbb6c186cb9f1d41f2f811a4120d1b57ec61f50da451a0c5122bec" +checksum = "645c7c96bb74690c3189b5c9cb4ca1627062bb23693a4fad9d8c3de958260144" dependencies = [ "bitflags 2.11.0", "rustix 1.1.4", @@ -6169,9 +6349,9 @@ dependencies = [ [[package]] name = "wayland-cursor" -version = "0.31.12" +version = "0.31.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5864c4b5b6064b06b1e8b74ead4a98a6c45a285fe7a0e784d24735f011fdb078" +checksum = "4a52d18780be9b1314328a3de5f930b73d2200112e3849ca6cb11822793fb34d" dependencies = [ "rustix 1.1.4", "wayland-client", @@ -6180,9 +6360,9 @@ dependencies = [ [[package]] name = "wayland-protocols" -version = "0.32.10" +version = "0.32.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baeda9ffbcfc8cd6ddaade385eaf2393bd2115a69523c735f12242353c3df4f3" +checksum = "563a85523cade2429938e790815fd7319062103b9f4a2dc806e9b53b95982d8f" dependencies = [ "bitflags 2.11.0", "wayland-backend", @@ -6192,9 +6372,9 @@ dependencies = [ [[package]] name = "wayland-protocols-plasma" -version = "0.3.10" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa98634619300a535a9a97f338aed9a5ff1e01a461943e8346ff4ae26007306b" +checksum = "2b6d8cf1eb2c1c31ed1f5643c88a6e53538129d4af80030c8cabd1f9fa884d91" dependencies = [ "bitflags 2.11.0", "wayland-backend", @@ -6205,9 +6385,9 @@ dependencies = [ [[package]] name = "wayland-protocols-wlr" -version = "0.3.10" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9597cdf02cf0c34cd5823786dce6b5ae8598f05c2daf5621b6e178d4f7345f3" +checksum = "eb04e52f7836d7c7976c78ca0250d61e33873c34156a2a1fc9474828ec268234" dependencies = [ "bitflags 2.11.0", "wayland-backend", @@ -6218,9 +6398,9 @@ dependencies = [ [[package]] name = "wayland-scanner" -version = "0.31.8" +version = "0.31.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5423e94b6a63e68e439803a3e153a9252d5ead12fd853334e2ad33997e3889e3" +checksum = "9c324a910fd86ebdc364a3e61ec1f11737d3b1d6c273c0239ee8ff4bc0d24b4a" dependencies = [ "proc-macro2", "quick-xml", @@ -6229,9 +6409,9 @@ dependencies = [ [[package]] name = "wayland-sys" -version = "0.31.8" +version = "0.31.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e6dbfc3ac5ef974c92a2235805cc0114033018ae1290a72e474aa8b28cbbdfd" +checksum = "d8eab23fefc9e41f8e841df4a9c707e8a8c4ed26e944ef69297184de2785e3be" dependencies = [ "dlib", "log", @@ -6240,9 +6420,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.91" +version = "0.3.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854ba17bb104abfb26ba36da9729addc7ce7f06f5c0f90f3c391f8461cca21f9" +checksum = "cd70027e39b12f0849461e08ffc50b9cd7688d942c1c8e3c7b22273236b4dd0a" dependencies = [ "js-sys", "wasm-bindgen", @@ -6448,7 +6628,7 @@ dependencies = [ "ndk-sys 0.6.0+11769913", "objc", "once_cell", - "ordered-float 5.1.0", + "ordered-float 5.3.0", "parking_lot", "portable-atomic", "portable-atomic-util", @@ -6653,7 +6833,7 @@ checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -6664,7 +6844,7 @@ checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -6675,7 +6855,7 @@ checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -6686,7 +6866,7 @@ checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -7088,9 +7268,18 @@ dependencies = [ [[package]] name = "winnow" -version = "0.7.14" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" +dependencies = [ + "memchr", +] + +[[package]] +name = "winnow" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" +checksum = "09dac053f1cd375980747450bfc7250c264eaae0583872e845c0c7cd578872b5" dependencies = [ "memchr", ] @@ -7125,7 +7314,7 @@ dependencies = [ "heck", "indexmap", "prettyplease", - "syn 2.0.117", + "syn 2.0.119", "wasm-metadata", "wit-bindgen-core", "wit-component", @@ -7141,7 +7330,7 @@ dependencies = [ "prettyplease", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", "wit-bindgen-core", "wit-bindgen-rust", ] @@ -7299,7 +7488,7 @@ name = "yarnspinner_core" version = "0.8.0" dependencies = [ "bevy", - "getrandom 0.4.1", + "getrandom 0.4.2", "hashbrown 0.16.1", "prost", "rand 0.10.0", @@ -7376,7 +7565,7 @@ checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", "synstructure", ] @@ -7388,22 +7577,22 @@ checksum = "6df3dc4292935e51816d896edcd52aa30bc297907c26167fec31e2b0c6a32524" [[package]] name = "zerocopy" -version = "0.8.40" +version = "0.8.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a789c6e490b576db9f7e6b6d661bcc9799f7c0ac8352f56ea20193b2681532e5" +checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.40" +version = "0.8.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f65c489a7071a749c849713807783f70672b28094011623e200cb86dcb835953" +checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] @@ -7423,7 +7612,7 @@ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", "synstructure", ] @@ -7456,7 +7645,7 @@ checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.119", ] [[package]] diff --git a/crates/codegen/src/bin/generate_proto.rs b/crates/codegen/src/bin/generate_proto.rs index 59c24c896..0bd3e2eb8 100644 --- a/crates/codegen/src/bin/generate_proto.rs +++ b/crates/codegen/src/bin/generate_proto.rs @@ -3,7 +3,7 @@ use std::io::Result; use yarnspinner_codegen::*; fn main() -> Result<()> { - let include_dir = path(ProjectPath::ThirdPersonYarnSpinner).join("YarnSpinner"); + let include_dir = path(ProjectPath::ThirdParty); let proto_file = include_dir.join("yarn_spinner.proto"); let output_dir = path(ProjectPath::Core).join("src/generated"); unsafe { diff --git a/crates/codegen/src/lib.rs b/crates/codegen/src/lib.rs index da19153fb..4f47b4f9d 100644 --- a/crates/codegen/src/lib.rs +++ b/crates/codegen/src/lib.rs @@ -2,6 +2,7 @@ use std::path::{Path, PathBuf}; #[derive(Debug, Clone, Copy)] pub enum ProjectPath { + ThirdParty, ThirdPersonYarnSpinner, MainCrate, Core, @@ -15,6 +16,7 @@ pub fn path(path: ProjectPath) -> PathBuf { let current_dir = Path::new(file!()).parent().unwrap(); let crates_dir = current_dir.join("../.."); let fragment = match path { + ProjectPath::ThirdParty => "../third-party", ProjectPath::ThirdPersonYarnSpinner => "../third-party/YarnSpinner", ProjectPath::MainCrate => "yarnspinner", ProjectPath::Core => "core", diff --git a/crates/compiler/src/compiler/add_tags_to_lines.rs b/crates/compiler/src/compiler/add_tags_to_lines.rs index 2232d1e10..1bb40afa4 100644 --- a/crates/compiler/src/compiler/add_tags_to_lines.rs +++ b/crates/compiler/src/compiler/add_tags_to_lines.rs @@ -134,7 +134,7 @@ impl Compiler { string.push('\n'); Ok(Some(( string, - untagged_line_listener.existing_line_tags.clone(), + untagged_line_listener.existing_line_tags.clone(), // FIXME: unwrap ))) } else { Ok(None) diff --git a/crates/compiler/src/compiler/utils.rs b/crates/compiler/src/compiler/utils.rs index 46ac7ec4e..999c0171e 100644 --- a/crates/compiler/src/compiler/utils.rs +++ b/crates/compiler/src/compiler/utils.rs @@ -3,13 +3,14 @@ use crate::error_strategy::ErrorStrategy; use crate::listeners::*; -use crate::prelude::generated::yarnspinnerlexer; +use crate::parser::generated::yarnspinnerlexer; use crate::prelude::generated::yarnspinnerparser::*; use crate::prelude::*; use antlr4rust::Parser; use antlr4rust::common_token_stream::CommonTokenStream; use antlr4rust::input_stream::CodePoint32BitCharStream; use antlr4rust::token::{TOKEN_DEFAULT_CHANNEL, Token}; +use antlr4rust::tree::{ParseTree, Tree}; use std::collections::HashSet; use std::rc::Rc; use yarnspinner_core::prelude::*; diff --git a/crates/compiler/src/error_strategy.rs b/crates/compiler/src/error_strategy.rs index 2179198f9..9767f688f 100644 --- a/crates/compiler/src/error_strategy.rs +++ b/crates/compiler/src/error_strategy.rs @@ -90,15 +90,15 @@ impl<'input, Ctx: ParserNodeType<'input>> ErrorStrategy<'input, Ctx> { if is_inside_rule(recognizer, yarnspinnerparser::RULE_if_statement) && recognizer.get_parser_rule_context().get_rule_index() == yarnspinnerparser::RULE_statement - && e.start_token.token_type == yarnspinnerlexer::COMMAND_START - && e.base.offending_token.token_type == yarnspinnerlexer::COMMAND_ELSE + && e.start_token.token_type == yarnspinnerparser::YarnSpinnerParser_COMMAND_START + && e.base.offending_token.token_type == yarnspinnerparser::YarnSpinnerParser_COMMAND_ELSE { // We are inside an if statement, we're attempting to parse a // statement, and we got an '<<', 'else', and we weren't able // to match that. The programmer included an extra '<>'. "More than one <> statement in an <> statement isn't allowed".to_owned() - } else if e.start_token.token_type == yarnspinnerlexer::COMMAND_START - && e.base.offending_token.token_type == yarnspinnerlexer::COMMAND_END + } else if e.start_token.token_type == yarnspinnerparser::YarnSpinnerParser_COMMAND_START + && e.base.offending_token.token_type == yarnspinnerparser::YarnSpinnerParser_COMMAND_END { // We saw a << immediately followed by a >>. The programmer // forgot to include command text. @@ -122,7 +122,7 @@ impl<'input, Ctx: ParserNodeType<'input>> ErrorStrategy<'input, Ctx> { let msg = match rule_context.get_rule_index() { yarnspinnerparser::RULE_if_statement => { match e.base.offending_token.token_type { - yarnspinnerlexer::BODY_END => { + yarnspinnerparser::YarnSpinnerParser_BODY_END => { // We have exited a body in the middle of an if // statement. The programmer forgot to include an // <>. @@ -131,10 +131,10 @@ impl<'input, Ctx: ParserNodeType<'input>> ErrorStrategy<'input, Ctx> { rule_context.start().get_line_as_usize() )) } - yarnspinnerlexer::COMMAND_ELSE + yarnspinnerparser::YarnSpinnerParser_COMMAND_ELSE if recognizer .get_expected_tokens() - .contains(yarnspinnerlexer::COMMAND_ENDIF) => + .contains(yarnspinnerparser::YarnSpinnerParser_COMMAND_ENDIF) => { // We saw an else, but we expected to see an endif. The // programmer wrote an additional <>. @@ -147,7 +147,7 @@ impl<'input, Ctx: ParserNodeType<'input>> ErrorStrategy<'input, Ctx> { } } yarnspinnerparser::RULE_variable - if e.base.offending_token.token_type == yarnspinnerlexer::FUNC_ID => + if e.base.offending_token.token_type == yarnspinnerparser::YarnSpinnerParser_FUNC_ID => { // We're parsing a variable (which starts with a '$'), // but we encountered a FUNC_ID (which doesn't). The diff --git a/crates/compiler/src/listeners/compiler_listener.rs b/crates/compiler/src/listeners/compiler_listener.rs index 31d705aa9..f2b8a5aab 100644 --- a/crates/compiler/src/listeners/compiler_listener.rs +++ b/crates/compiler/src/listeners/compiler_listener.rs @@ -7,17 +7,13 @@ use antlr4rust::tree::{ParseTreeListener, ParseTreeVisitorCompat}; use std::cell::RefCell; use std::collections::HashSet; use std::rc::Rc; +use antlr4rust::CoerceTo; use yarnspinner_core::prelude::*; -mod emit; -use crate::parser::generated::yarnspinnerparser::{ - BodyContext, HeaderContext, NodeContext, YarnSpinnerParserContextType, -}; +use crate::parser::generated::yarnspinnerparser::{BodyContext, HeaderContext, LineOnceConditionContext, Line_statementContext, NodeContext, Title_headerContext, YarnSpinnerParserContext, YarnSpinnerParserContextType}; use crate::prelude::generated::yarnspinnerparser::BodyContextAttrs; use crate::prelude::generated::yarnspinnerparserlistener::YarnSpinnerParserListener; use crate::visitors::{CodeGenerationVisitor, KnownTypes}; -pub(crate) use emit::*; -use yarnspinner_core::prelude::OpCode; pub(crate) struct CompilerListener<'input> { pub(crate) debug_infos: Rc>>, @@ -116,11 +112,19 @@ impl<'input> YarnSpinnerParserListener<'input> for CompilerListener<'input> { self.is_current_node_raw_text = false; } + fn exit_title_header(&mut self, ctx: &Title_headerContext<'input>) { + todo!() + } + + fn enter_header(&mut self, _ctx: &HeaderContext<'input>) { + () + } + fn exit_header(&mut self, ctx: &HeaderContext<'input>) { // have finished with the header so about to enter the node body // and all its statements do the initial setup required before // compiling that body statements eg emit a new startlabel - let header_key = ctx.header_key.as_ref().unwrap().get_text(); + let header_key = ctx.header_key.as_ref().unwrap().get_text().to_owned(); let current_node = self.current_node.as_mut().unwrap(); // Use the header value if provided, else fall back to the @@ -134,22 +138,7 @@ impl<'input> YarnSpinnerParserListener<'input> for CompilerListener<'input> { .map(|v| v.get_text()) .unwrap_or_default() .to_owned(); - match header_key { - "title" => { - // Set the name of the node - current_node.name.clone_from(&header_value); - } - "tags" => { - // Split the list of tags by spaces, and use that - let tags = header_value.split(' ').map(|s| s.to_owned()); - current_node.tags.extend(tags); - if current_node.tags.contains(&"rawText".to_owned()) { - // This is a raw text node. Flag it as such for future compilation. - self.is_current_node_raw_text = true; - } - } - _ => {} - } + let header = Header { key: header_key.to_owned(), value: header_value, @@ -164,13 +153,7 @@ impl<'input> YarnSpinnerParserListener<'input> for CompilerListener<'input> { // if it is a regular node if !self.is_current_node_raw_text { - // This is the start of a node that we can jump to. Add a - // label at this point - let label = self.register_label(None); let current_node = self.current_node.as_mut().unwrap(); - current_node - .labels - .insert(label, current_node.instructions.len() as i32); let track = (self.tracking_nodes.borrow().contains(¤t_node.name)) .then(|| Library::generate_unique_visited_variable_for_node(¤t_node.name)); @@ -181,7 +164,6 @@ impl<'input> YarnSpinnerParserListener<'input> for CompilerListener<'input> { } else { // We are a rawText node. Don't compile it; instead, note the string let current_node = self.current_node.as_mut().unwrap(); - current_node.source_text_string_id = get_line_id_for_node_name(¤t_node.name).0; } } @@ -207,4 +189,8 @@ impl<'input> YarnSpinnerParserListener<'input> for CompilerListener<'input> { character: 0, })); } + + fn exit_lineOnceCondition(&mut self, ctx: &LineOnceConditionContext<'input>) { + todo!() + } } diff --git a/crates/compiler/src/listeners/compiler_listener/emit.rs b/crates/compiler/src/listeners/compiler_listener/emit.rs deleted file mode 100644 index 605241dc7..000000000 --- a/crates/compiler/src/listeners/compiler_listener/emit.rs +++ /dev/null @@ -1,62 +0,0 @@ -use crate::listeners::CompilerListener; -use crate::prelude::*; -use antlr4rust::token::Token; -use yarnspinner_core::prelude::OpCode; -use yarnspinner_core::prelude::*; - -impl CompilerListener<'_> { - /// Creates a new instruction, and appends it to a node in the [`Program`]. - pub(crate) fn emit(&mut self, emit: Emit) { - let instruction = Instruction { - opcode: emit.op_code.into(), - operands: emit.operands, - }; - - let current_node = self.current_node.as_mut().unwrap(); - self.current_debug_info - .line_positions - .insert(current_node.instructions.len(), emit.source); - current_node.instructions.push(instruction); - } -} - -#[derive(Debug, Clone)] -pub(crate) struct Emit { - source: Option, - op_code: OpCode, - operands: Vec, -} - -impl Emit { - pub(crate) fn from_op_code(op_code: OpCode) -> Self { - Self { - op_code, - source: Default::default(), - operands: Default::default(), - } - } - - pub(crate) fn with_source(mut self, source: Position) -> Self { - self.source = Some(source); - self - } - - pub(crate) fn with_operand(mut self, operand: impl Into) -> Self { - self.operands.push(operand.into()); - self - } - - pub(crate) fn with_token(mut self, token: &(impl Token + ?Sized)) -> Self { - self.source = Some(Position { - line: token.get_line_as_usize().saturating_sub(1), - character: token.get_column_as_usize(), - }); - self - } -} - -impl From for Emit { - fn from(op_code: OpCode) -> Self { - Self::from_op_code(op_code) - } -} diff --git a/crates/compiler/src/parser/generated.rs b/crates/compiler/src/parser/generated.rs index b331f4343..2df6bbc86 100644 --- a/crates/compiler/src/parser/generated.rs +++ b/crates/compiler/src/parser/generated.rs @@ -20,6 +20,16 @@ pub(crate) mod yarnspinnerparserlistener; #[allow(clippy)] pub(crate) mod yarnspinnerparservisitor; +#[cfg_attr(rustfmt, rustfmt_skip)] +#[allow(warnings)] +#[allow(clippy)] +pub(crate) mod yarnspinnerparserbaselistener; + +#[cfg_attr(rustfmt, rustfmt_skip)] +#[allow(warnings)] +#[allow(clippy)] +pub(crate) mod yarnspinnerparserbasevisitor; + #[cfg(test)] mod tests { use super::*; diff --git a/crates/compiler/src/parser/generated/YarnSpinnerLexer.interp b/crates/compiler/src/parser/generated/YarnSpinnerLexer.interp index 6c642a637..f67902e1d 100644 --- a/crates/compiler/src/parser/generated/YarnSpinnerLexer.interp +++ b/crates/compiler/src/parser/generated/YarnSpinnerLexer.interp @@ -6,18 +6,21 @@ null null null null +'when' +'title' null '---' null '#' null null +null '===' '->' +'=>' '<<' null null -'\\' null null null @@ -27,6 +30,8 @@ null null null null +null +'always' 'true' 'false' 'null' @@ -65,20 +70,25 @@ null null null null -null +'else' null 'endif' null null null null +'return' null null +'endenum' +'once' +'endonce' +'local' null null +'{' null null -'{' null null 'string' @@ -93,14 +103,18 @@ BLANK_LINE_FOLLOWING_OPTION WS COMMENT NEWLINE +HEADER_WHEN +HEADER_TITLE ID BODY_START HEADER_DELIMITER HASHTAG +HEADER_WHEN_UNKNOWN REST_OF_LINE BODY_WS BODY_END SHORTCUT_ARROW +LINE_GROUP_ARROW COMMAND_START EXPRESSION_START ESCAPED_ANY @@ -114,6 +128,7 @@ TEXT_COMMANDHASHTAG_ERROR HASHTAG_WS HASHTAG_TEXT EXPR_WS +EXPRESSION_WHEN_ALWAYS KEYWORD_TRUE KEYWORD_FALSE KEYWORD_NULL @@ -158,16 +173,21 @@ COMMAND_ENDIF COMMAND_CALL COMMAND_DECLARE COMMAND_JUMP +COMMAND_DETOUR +COMMAND_RETURN COMMAND_ENUM COMMAND_CASE COMMAND_ENDENUM +COMMAND_ONCE +COMMAND_ENDONCE COMMAND_LOCAL COMMAND_END COMMAND_TEXT_NEWLINE -COMMAND_TEXT_END COMMAND_EXPRESSION_START COMMAND_TEXT +COMMAND_ID_WS COMMAND_ID_NEWLINE +COMMAND_ID_OR_EXPRESSION_WS TYPE_STRING TYPE_NUMBER TYPE_BOOL @@ -176,6 +196,8 @@ rule names: WS COMMENT NEWLINE +HEADER_WHEN +HEADER_TITLE ID IDENTIFIER_HEAD IDENTIFIER_CHARACTER @@ -183,6 +205,11 @@ IDENTIFIER_CHARACTERS BODY_START HEADER_DELIMITER HASHTAG +HEADER_WHEN_DELIMITER +HEADER_WHEN_UNKNOWN +HEADER_TITLE_DELIMITER +HEADER_TITLE_ID +HEADER_TITLE_NEWLINE REST_OF_LINE HEADER_NEWLINE BODY_WS @@ -190,6 +217,7 @@ BODY_NEWLINE BODY_COMMENT BODY_END SHORTCUT_ARROW +LINE_GROUP_ARROW COMMAND_START BODY_HASHTAG EXPRESSION_START @@ -217,6 +245,9 @@ HASHTAG_WS HASHTAG_TAG HASHTAG_TEXT EXPR_WS +EXPRESSION_WHEN_ALWAYS +EXPRESSION_WHEN_ONCE +EXPRESSION_WHEN_IF KEYWORD_TRUE KEYWORD_FALSE KEYWORD_NULL @@ -255,6 +286,7 @@ EXPRESSION_COMMAND_END VAR_ID DOT NUMBER +EXPRESSION_NEWLINE INT DIGIT COMMAND_NEWLINE @@ -267,9 +299,13 @@ COMMAND_ENDIF COMMAND_CALL COMMAND_DECLARE COMMAND_JUMP +COMMAND_DETOUR +COMMAND_RETURN COMMAND_ENUM COMMAND_CASE COMMAND_ENDENUM +COMMAND_ONCE +COMMAND_ENDONCE COMMAND_LOCAL COMMAND_END COMMAND_EXPRESSION_AT_START @@ -278,9 +314,11 @@ COMMAND_TEXT_NEWLINE COMMAND_TEXT_END COMMAND_EXPRESSION_START COMMAND_TEXT +COMMAND_ID_WS COMMAND_ID_NEWLINE COMMAND_ID COMMAND_ID_END +COMMAND_ID_OR_EXPRESSION_WS COMMAND_ID_OR_EXPRESSION_ID COMMAND_ID_OR_EXPRESSION_START COMMAND_ID_OR_EXPRESSION_END @@ -295,6 +333,8 @@ COMMENTS mode names: DEFAULT_MODE +HeaderWhenMode +HeaderTitleMode HeaderMode BodyMode TextMode @@ -308,4 +348,4 @@ CommandIDMode CommandIDOrExpressionMode atn: -[4, 0, 84, 834, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, 2, 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, 7, 72, 2, 73, 7, 73, 2, 74, 7, 74, 2, 75, 7, 75, 2, 76, 7, 76, 2, 77, 7, 77, 2, 78, 7, 78, 2, 79, 7, 79, 2, 80, 7, 80, 2, 81, 7, 81, 2, 82, 7, 82, 2, 83, 7, 83, 2, 84, 7, 84, 2, 85, 7, 85, 2, 86, 7, 86, 2, 87, 7, 87, 2, 88, 7, 88, 2, 89, 7, 89, 2, 90, 7, 90, 2, 91, 7, 91, 2, 92, 7, 92, 2, 93, 7, 93, 2, 94, 7, 94, 2, 95, 7, 95, 2, 96, 7, 96, 2, 97, 7, 97, 2, 98, 7, 98, 2, 99, 7, 99, 2, 100, 7, 100, 2, 101, 7, 101, 2, 102, 7, 102, 2, 103, 7, 103, 2, 104, 7, 104, 2, 105, 7, 105, 2, 106, 7, 106, 2, 107, 7, 107, 2, 108, 7, 108, 2, 109, 7, 109, 2, 110, 7, 110, 1, 0, 4, 0, 236, 8, 0, 11, 0, 12, 0, 237, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 246, 8, 1, 10, 1, 12, 1, 249, 9, 1, 1, 1, 1, 1, 1, 2, 3, 2, 254, 8, 2, 1, 2, 1, 2, 3, 2, 258, 8, 2, 1, 2, 5, 2, 261, 8, 2, 10, 2, 12, 2, 264, 9, 2, 1, 2, 1, 2, 1, 3, 1, 3, 3, 3, 270, 8, 3, 1, 4, 3, 4, 273, 8, 4, 1, 5, 1, 5, 3, 5, 277, 8, 5, 1, 6, 4, 6, 280, 8, 6, 11, 6, 12, 6, 281, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 5, 8, 292, 8, 8, 10, 8, 12, 8, 295, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 4, 10, 304, 8, 10, 11, 10, 12, 10, 305, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 3, 24, 379, 8, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 4, 30, 411, 8, 30, 11, 30, 12, 30, 412, 1, 30, 3, 30, 416, 8, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 4, 42, 464, 8, 42, 11, 42, 12, 42, 465, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, 47, 3, 47, 493, 8, 47, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 500, 8, 48, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 3, 49, 507, 8, 49, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 3, 50, 515, 8, 50, 1, 51, 1, 51, 1, 51, 3, 51, 520, 8, 51, 1, 52, 1, 52, 1, 52, 3, 52, 525, 8, 52, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 3, 53, 532, 8, 53, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 539, 8, 54, 1, 55, 1, 55, 1, 55, 1, 55, 3, 55, 545, 8, 55, 1, 56, 1, 56, 1, 56, 1, 56, 3, 56, 551, 8, 56, 1, 57, 1, 57, 1, 57, 1, 57, 3, 57, 557, 8, 57, 1, 58, 1, 58, 1, 58, 1, 59, 1, 59, 1, 59, 1, 60, 1, 60, 1, 60, 1, 61, 1, 61, 1, 61, 1, 62, 1, 62, 1, 62, 1, 63, 1, 63, 1, 64, 1, 64, 1, 65, 1, 65, 1, 66, 1, 66, 1, 67, 1, 67, 1, 68, 1, 68, 1, 69, 1, 69, 1, 70, 1, 70, 1, 71, 1, 71, 1, 71, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 73, 1, 73, 1, 73, 1, 73, 1, 73, 1, 73, 1, 73, 1, 73, 1, 73, 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 75, 1, 75, 1, 75, 1, 75, 5, 75, 622, 8, 75, 10, 75, 12, 75, 625, 9, 75, 1, 75, 1, 75, 1, 76, 1, 76, 1, 77, 1, 77, 1, 77, 1, 77, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 79, 1, 79, 1, 79, 1, 80, 1, 80, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 3, 81, 652, 8, 81, 1, 82, 4, 82, 655, 8, 82, 11, 82, 12, 82, 656, 1, 83, 1, 83, 1, 84, 1, 84, 1, 85, 1, 85, 1, 85, 1, 85, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, 3, 88, 691, 8, 88, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 3, 96, 764, 8, 96, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 101, 1, 101, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 103, 1, 103, 1, 103, 1, 103, 1, 104, 4, 104, 802, 8, 104, 11, 104, 12, 104, 803, 1, 105, 1, 105, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 108, 1, 108, 1, 108, 1, 108, 1, 108, 1, 109, 1, 109, 1, 109, 1, 109, 1, 109, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 0, 0, 111, 12, 4, 14, 5, 16, 6, 18, 7, 20, 0, 22, 0, 24, 0, 26, 8, 28, 9, 30, 10, 32, 11, 34, 0, 36, 12, 38, 0, 40, 0, 42, 13, 44, 14, 46, 15, 48, 0, 50, 16, 52, 0, 54, 17, 56, 0, 58, 0, 60, 0, 62, 18, 64, 0, 66, 0, 68, 0, 70, 19, 72, 20, 74, 0, 76, 0, 78, 21, 80, 22, 82, 23, 84, 0, 86, 0, 88, 0, 90, 24, 92, 25, 94, 0, 96, 26, 98, 27, 100, 28, 102, 29, 104, 30, 106, 31, 108, 32, 110, 33, 112, 34, 114, 35, 116, 36, 118, 37, 120, 38, 122, 39, 124, 40, 126, 41, 128, 42, 130, 43, 132, 44, 134, 45, 136, 46, 138, 47, 140, 48, 142, 49, 144, 50, 146, 51, 148, 52, 150, 53, 152, 54, 154, 55, 156, 82, 158, 83, 160, 84, 162, 56, 164, 57, 166, 58, 168, 0, 170, 59, 172, 60, 174, 61, 176, 0, 178, 0, 180, 62, 182, 63, 184, 64, 186, 65, 188, 66, 190, 67, 192, 68, 194, 69, 196, 70, 198, 71, 200, 72, 202, 73, 204, 74, 206, 75, 208, 76, 210, 0, 212, 0, 214, 77, 216, 78, 218, 79, 220, 80, 222, 81, 224, 0, 226, 0, 228, 0, 230, 0, 232, 0, 12, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 14, 2, 0, 9, 9, 32, 32, 2, 0, 10, 10, 13, 13, 49, 0, 65, 90, 95, 95, 97, 122, 168, 168, 170, 170, 173, 173, 175, 175, 178, 181, 183, 186, 188, 190, 192, 214, 216, 246, 248, 767, 880, 5759, 5761, 6157, 6159, 7615, 7680, 8191, 8203, 8205, 8234, 8238, 8255, 8256, 8276, 8276, 8288, 8399, 8448, 8591, 9312, 9471, 10102, 10131, 11264, 11775, 11904, 12287, 12292, 12295, 12321, 12335, 12337, 55295, 63744, 64829, 64832, 64975, 65008, 65055, 65072, 65092, 65095, 65533, 65536, 131069, 131072, 196605, 196608, 262141, 262144, 327677, 327680, 393213, 393216, 458749, 458752, 524285, 524288, 589821, 589824, 655357, 655360, 720893, 720896, 786429, 786432, 851965, 851968, 917501, 917504, 983037, 5, 0, 48, 57, 768, 879, 7616, 7679, 8400, 8447, 65056, 65071, 1, 0, 32, 32, 2, 0, 47, 47, 60, 60, 7, 0, 10, 10, 13, 13, 35, 35, 47, 47, 60, 60, 92, 92, 123, 123, 7, 0, 35, 35, 47, 47, 60, 60, 62, 62, 92, 92, 123, 123, 125, 125, 5, 0, 9, 10, 13, 13, 32, 32, 35, 36, 60, 60, 4, 0, 10, 10, 13, 13, 34, 34, 92, 92, 2, 0, 34, 34, 92, 92, 1, 0, 48, 57, 10, 0, 9, 13, 32, 32, 133, 133, 160, 160, 5760, 5760, 8192, 8202, 8232, 8233, 8239, 8239, 8287, 8287, 12288, 12288, 4, 0, 10, 10, 13, 13, 62, 62, 123, 123, 849, 0, 12, 1, 0, 0, 0, 0, 14, 1, 0, 0, 0, 0, 16, 1, 0, 0, 0, 0, 18, 1, 0, 0, 0, 0, 26, 1, 0, 0, 0, 0, 28, 1, 0, 0, 0, 0, 30, 1, 0, 0, 0, 1, 32, 1, 0, 0, 0, 1, 34, 1, 0, 0, 0, 2, 36, 1, 0, 0, 0, 2, 38, 1, 0, 0, 0, 2, 40, 1, 0, 0, 0, 2, 42, 1, 0, 0, 0, 2, 44, 1, 0, 0, 0, 2, 46, 1, 0, 0, 0, 2, 48, 1, 0, 0, 0, 2, 50, 1, 0, 0, 0, 2, 52, 1, 0, 0, 0, 2, 54, 1, 0, 0, 0, 2, 56, 1, 0, 0, 0, 3, 58, 1, 0, 0, 0, 3, 60, 1, 0, 0, 0, 3, 62, 1, 0, 0, 0, 3, 64, 1, 0, 0, 0, 3, 66, 1, 0, 0, 0, 3, 68, 1, 0, 0, 0, 3, 70, 1, 0, 0, 0, 3, 72, 1, 0, 0, 0, 4, 76, 1, 0, 0, 0, 4, 78, 1, 0, 0, 0, 5, 80, 1, 0, 0, 0, 5, 82, 1, 0, 0, 0, 5, 84, 1, 0, 0, 0, 5, 86, 1, 0, 0, 0, 5, 88, 1, 0, 0, 0, 5, 90, 1, 0, 0, 0, 6, 92, 1, 0, 0, 0, 6, 94, 1, 0, 0, 0, 6, 96, 1, 0, 0, 0, 7, 98, 1, 0, 0, 0, 7, 100, 1, 0, 0, 0, 7, 102, 1, 0, 0, 0, 7, 104, 1, 0, 0, 0, 7, 106, 1, 0, 0, 0, 7, 108, 1, 0, 0, 0, 7, 110, 1, 0, 0, 0, 7, 112, 1, 0, 0, 0, 7, 114, 1, 0, 0, 0, 7, 116, 1, 0, 0, 0, 7, 118, 1, 0, 0, 0, 7, 120, 1, 0, 0, 0, 7, 122, 1, 0, 0, 0, 7, 124, 1, 0, 0, 0, 7, 126, 1, 0, 0, 0, 7, 128, 1, 0, 0, 0, 7, 130, 1, 0, 0, 0, 7, 132, 1, 0, 0, 0, 7, 134, 1, 0, 0, 0, 7, 136, 1, 0, 0, 0, 7, 138, 1, 0, 0, 0, 7, 140, 1, 0, 0, 0, 7, 142, 1, 0, 0, 0, 7, 144, 1, 0, 0, 0, 7, 146, 1, 0, 0, 0, 7, 148, 1, 0, 0, 0, 7, 150, 1, 0, 0, 0, 7, 152, 1, 0, 0, 0, 7, 154, 1, 0, 0, 0, 7, 156, 1, 0, 0, 0, 7, 158, 1, 0, 0, 0, 7, 160, 1, 0, 0, 0, 7, 162, 1, 0, 0, 0, 7, 164, 1, 0, 0, 0, 7, 166, 1, 0, 0, 0, 7, 168, 1, 0, 0, 0, 7, 170, 1, 0, 0, 0, 7, 172, 1, 0, 0, 0, 7, 174, 1, 0, 0, 0, 8, 180, 1, 0, 0, 0, 8, 182, 1, 0, 0, 0, 8, 184, 1, 0, 0, 0, 8, 186, 1, 0, 0, 0, 8, 188, 1, 0, 0, 0, 8, 190, 1, 0, 0, 0, 8, 192, 1, 0, 0, 0, 8, 194, 1, 0, 0, 0, 8, 196, 1, 0, 0, 0, 8, 198, 1, 0, 0, 0, 8, 200, 1, 0, 0, 0, 8, 202, 1, 0, 0, 0, 8, 204, 1, 0, 0, 0, 8, 206, 1, 0, 0, 0, 8, 208, 1, 0, 0, 0, 8, 210, 1, 0, 0, 0, 8, 212, 1, 0, 0, 0, 9, 214, 1, 0, 0, 0, 9, 216, 1, 0, 0, 0, 9, 218, 1, 0, 0, 0, 9, 220, 1, 0, 0, 0, 10, 222, 1, 0, 0, 0, 10, 224, 1, 0, 0, 0, 10, 226, 1, 0, 0, 0, 11, 228, 1, 0, 0, 0, 11, 230, 1, 0, 0, 0, 11, 232, 1, 0, 0, 0, 12, 235, 1, 0, 0, 0, 14, 241, 1, 0, 0, 0, 16, 257, 1, 0, 0, 0, 18, 267, 1, 0, 0, 0, 20, 272, 1, 0, 0, 0, 22, 276, 1, 0, 0, 0, 24, 279, 1, 0, 0, 0, 26, 283, 1, 0, 0, 0, 28, 289, 1, 0, 0, 0, 30, 298, 1, 0, 0, 0, 32, 303, 1, 0, 0, 0, 34, 307, 1, 0, 0, 0, 36, 313, 1, 0, 0, 0, 38, 317, 1, 0, 0, 0, 40, 322, 1, 0, 0, 0, 42, 327, 1, 0, 0, 0, 44, 333, 1, 0, 0, 0, 46, 336, 1, 0, 0, 0, 48, 341, 1, 0, 0, 0, 50, 347, 1, 0, 0, 0, 52, 352, 1, 0, 0, 0, 54, 358, 1, 0, 0, 0, 56, 364, 1, 0, 0, 0, 58, 369, 1, 0, 0, 0, 60, 378, 1, 0, 0, 0, 62, 382, 1, 0, 0, 0, 64, 387, 1, 0, 0, 0, 66, 393, 1, 0, 0, 0, 68, 398, 1, 0, 0, 0, 70, 405, 1, 0, 0, 0, 72, 415, 1, 0, 0, 0, 74, 417, 1, 0, 0, 0, 76, 419, 1, 0, 0, 0, 78, 424, 1, 0, 0, 0, 80, 428, 1, 0, 0, 0, 82, 432, 1, 0, 0, 0, 84, 436, 1, 0, 0, 0, 86, 442, 1, 0, 0, 0, 88, 447, 1, 0, 0, 0, 90, 452, 1, 0, 0, 0, 92, 454, 1, 0, 0, 0, 94, 458, 1, 0, 0, 0, 96, 463, 1, 0, 0, 0, 98, 469, 1, 0, 0, 0, 100, 473, 1, 0, 0, 0, 102, 478, 1, 0, 0, 0, 104, 484, 1, 0, 0, 0, 106, 492, 1, 0, 0, 0, 108, 499, 1, 0, 0, 0, 110, 506, 1, 0, 0, 0, 112, 514, 1, 0, 0, 0, 114, 519, 1, 0, 0, 0, 116, 524, 1, 0, 0, 0, 118, 531, 1, 0, 0, 0, 120, 538, 1, 0, 0, 0, 122, 544, 1, 0, 0, 0, 124, 550, 1, 0, 0, 0, 126, 556, 1, 0, 0, 0, 128, 558, 1, 0, 0, 0, 130, 561, 1, 0, 0, 0, 132, 564, 1, 0, 0, 0, 134, 567, 1, 0, 0, 0, 136, 570, 1, 0, 0, 0, 138, 573, 1, 0, 0, 0, 140, 575, 1, 0, 0, 0, 142, 577, 1, 0, 0, 0, 144, 579, 1, 0, 0, 0, 146, 581, 1, 0, 0, 0, 148, 583, 1, 0, 0, 0, 150, 585, 1, 0, 0, 0, 152, 587, 1, 0, 0, 0, 154, 589, 1, 0, 0, 0, 156, 592, 1, 0, 0, 0, 158, 601, 1, 0, 0, 0, 160, 610, 1, 0, 0, 0, 162, 617, 1, 0, 0, 0, 164, 628, 1, 0, 0, 0, 166, 630, 1, 0, 0, 0, 168, 634, 1, 0, 0, 0, 170, 641, 1, 0, 0, 0, 172, 644, 1, 0, 0, 0, 174, 651, 1, 0, 0, 0, 176, 654, 1, 0, 0, 0, 178, 658, 1, 0, 0, 0, 180, 660, 1, 0, 0, 0, 182, 662, 1, 0, 0, 0, 184, 666, 1, 0, 0, 0, 186, 673, 1, 0, 0, 0, 188, 684, 1, 0, 0, 0, 190, 692, 1, 0, 0, 0, 192, 700, 1, 0, 0, 0, 194, 706, 1, 0, 0, 0, 196, 715, 1, 0, 0, 0, 198, 727, 1, 0, 0, 0, 200, 736, 1, 0, 0, 0, 202, 745, 1, 0, 0, 0, 204, 754, 1, 0, 0, 0, 206, 765, 1, 0, 0, 0, 208, 773, 1, 0, 0, 0, 210, 778, 1, 0, 0, 0, 212, 784, 1, 0, 0, 0, 214, 789, 1, 0, 0, 0, 216, 791, 1, 0, 0, 0, 218, 796, 1, 0, 0, 0, 220, 801, 1, 0, 0, 0, 222, 805, 1, 0, 0, 0, 224, 807, 1, 0, 0, 0, 226, 812, 1, 0, 0, 0, 228, 818, 1, 0, 0, 0, 230, 823, 1, 0, 0, 0, 232, 828, 1, 0, 0, 0, 234, 236, 7, 0, 0, 0, 235, 234, 1, 0, 0, 0, 236, 237, 1, 0, 0, 0, 237, 235, 1, 0, 0, 0, 237, 238, 1, 0, 0, 0, 238, 239, 1, 0, 0, 0, 239, 240, 6, 0, 0, 0, 240, 13, 1, 0, 0, 0, 241, 242, 5, 47, 0, 0, 242, 243, 5, 47, 0, 0, 243, 247, 1, 0, 0, 0, 244, 246, 8, 1, 0, 0, 245, 244, 1, 0, 0, 0, 246, 249, 1, 0, 0, 0, 247, 245, 1, 0, 0, 0, 247, 248, 1, 0, 0, 0, 248, 250, 1, 0, 0, 0, 249, 247, 1, 0, 0, 0, 250, 251, 6, 1, 1, 0, 251, 15, 1, 0, 0, 0, 252, 254, 5, 13, 0, 0, 253, 252, 1, 0, 0, 0, 253, 254, 1, 0, 0, 0, 254, 255, 1, 0, 0, 0, 255, 258, 5, 10, 0, 0, 256, 258, 5, 13, 0, 0, 257, 253, 1, 0, 0, 0, 257, 256, 1, 0, 0, 0, 258, 262, 1, 0, 0, 0, 259, 261, 7, 0, 0, 0, 260, 259, 1, 0, 0, 0, 261, 264, 1, 0, 0, 0, 262, 260, 1, 0, 0, 0, 262, 263, 1, 0, 0, 0, 263, 265, 1, 0, 0, 0, 264, 262, 1, 0, 0, 0, 265, 266, 6, 2, 2, 0, 266, 17, 1, 0, 0, 0, 267, 269, 3, 20, 4, 0, 268, 270, 3, 24, 6, 0, 269, 268, 1, 0, 0, 0, 269, 270, 1, 0, 0, 0, 270, 19, 1, 0, 0, 0, 271, 273, 7, 2, 0, 0, 272, 271, 1, 0, 0, 0, 273, 21, 1, 0, 0, 0, 274, 277, 7, 3, 0, 0, 275, 277, 3, 20, 4, 0, 276, 274, 1, 0, 0, 0, 276, 275, 1, 0, 0, 0, 277, 23, 1, 0, 0, 0, 278, 280, 3, 22, 5, 0, 279, 278, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, 281, 279, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 25, 1, 0, 0, 0, 283, 284, 5, 45, 0, 0, 284, 285, 5, 45, 0, 0, 285, 286, 5, 45, 0, 0, 286, 287, 1, 0, 0, 0, 287, 288, 6, 7, 3, 0, 288, 27, 1, 0, 0, 0, 289, 293, 5, 58, 0, 0, 290, 292, 7, 4, 0, 0, 291, 290, 1, 0, 0, 0, 292, 295, 1, 0, 0, 0, 293, 291, 1, 0, 0, 0, 293, 294, 1, 0, 0, 0, 294, 296, 1, 0, 0, 0, 295, 293, 1, 0, 0, 0, 296, 297, 6, 8, 4, 0, 297, 29, 1, 0, 0, 0, 298, 299, 5, 35, 0, 0, 299, 300, 1, 0, 0, 0, 300, 301, 6, 9, 5, 0, 301, 31, 1, 0, 0, 0, 302, 304, 8, 1, 0, 0, 303, 302, 1, 0, 0, 0, 304, 305, 1, 0, 0, 0, 305, 303, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 33, 1, 0, 0, 0, 307, 308, 3, 16, 2, 0, 308, 309, 1, 0, 0, 0, 309, 310, 6, 11, 6, 0, 310, 311, 6, 11, 2, 0, 311, 312, 6, 11, 7, 0, 312, 35, 1, 0, 0, 0, 313, 314, 3, 12, 0, 0, 314, 315, 1, 0, 0, 0, 315, 316, 6, 12, 0, 0, 316, 37, 1, 0, 0, 0, 317, 318, 3, 16, 2, 0, 318, 319, 1, 0, 0, 0, 319, 320, 6, 13, 6, 0, 320, 321, 6, 13, 2, 0, 321, 39, 1, 0, 0, 0, 322, 323, 3, 14, 1, 0, 323, 324, 1, 0, 0, 0, 324, 325, 6, 14, 8, 0, 325, 326, 6, 14, 1, 0, 326, 41, 1, 0, 0, 0, 327, 328, 5, 61, 0, 0, 328, 329, 5, 61, 0, 0, 329, 330, 5, 61, 0, 0, 330, 331, 1, 0, 0, 0, 331, 332, 6, 15, 7, 0, 332, 43, 1, 0, 0, 0, 333, 334, 5, 45, 0, 0, 334, 335, 5, 62, 0, 0, 335, 45, 1, 0, 0, 0, 336, 337, 5, 60, 0, 0, 337, 338, 5, 60, 0, 0, 338, 339, 1, 0, 0, 0, 339, 340, 6, 17, 9, 0, 340, 47, 1, 0, 0, 0, 341, 342, 5, 35, 0, 0, 342, 343, 1, 0, 0, 0, 343, 344, 6, 18, 10, 0, 344, 345, 6, 18, 11, 0, 345, 346, 6, 18, 5, 0, 346, 49, 1, 0, 0, 0, 347, 348, 5, 123, 0, 0, 348, 349, 1, 0, 0, 0, 349, 350, 6, 19, 12, 0, 350, 351, 6, 19, 13, 0, 351, 51, 1, 0, 0, 0, 352, 353, 5, 92, 0, 0, 353, 354, 5, 91, 0, 0, 354, 355, 1, 0, 0, 0, 355, 356, 6, 20, 14, 0, 356, 357, 6, 20, 12, 0, 357, 53, 1, 0, 0, 0, 358, 359, 5, 92, 0, 0, 359, 360, 1, 0, 0, 0, 360, 361, 6, 21, 0, 0, 361, 362, 6, 21, 12, 0, 362, 363, 6, 21, 15, 0, 363, 55, 1, 0, 0, 0, 364, 365, 9, 0, 0, 0, 365, 366, 1, 0, 0, 0, 366, 367, 6, 22, 14, 0, 367, 368, 6, 22, 12, 0, 368, 57, 1, 0, 0, 0, 369, 370, 3, 16, 2, 0, 370, 371, 1, 0, 0, 0, 371, 372, 6, 23, 6, 0, 372, 373, 6, 23, 7, 0, 373, 59, 1, 0, 0, 0, 374, 375, 5, 92, 0, 0, 375, 379, 5, 91, 0, 0, 376, 377, 5, 92, 0, 0, 377, 379, 5, 93, 0, 0, 378, 374, 1, 0, 0, 0, 378, 376, 1, 0, 0, 0, 379, 380, 1, 0, 0, 0, 380, 381, 6, 24, 14, 0, 381, 61, 1, 0, 0, 0, 382, 383, 5, 92, 0, 0, 383, 384, 1, 0, 0, 0, 384, 385, 6, 25, 16, 0, 385, 386, 6, 25, 15, 0, 386, 63, 1, 0, 0, 0, 387, 388, 3, 30, 9, 0, 388, 389, 1, 0, 0, 0, 389, 390, 6, 26, 10, 0, 390, 391, 6, 26, 17, 0, 391, 392, 6, 26, 5, 0, 392, 65, 1, 0, 0, 0, 393, 394, 5, 123, 0, 0, 394, 395, 1, 0, 0, 0, 395, 396, 6, 27, 18, 0, 396, 397, 6, 27, 13, 0, 397, 67, 1, 0, 0, 0, 398, 399, 5, 60, 0, 0, 399, 400, 5, 60, 0, 0, 400, 401, 1, 0, 0, 0, 401, 402, 6, 28, 19, 0, 402, 403, 6, 28, 17, 0, 403, 404, 6, 28, 9, 0, 404, 69, 1, 0, 0, 0, 405, 406, 3, 14, 1, 0, 406, 407, 1, 0, 0, 0, 407, 408, 6, 29, 1, 0, 408, 71, 1, 0, 0, 0, 409, 411, 3, 74, 31, 0, 410, 409, 1, 0, 0, 0, 411, 412, 1, 0, 0, 0, 412, 410, 1, 0, 0, 0, 412, 413, 1, 0, 0, 0, 413, 416, 1, 0, 0, 0, 414, 416, 7, 5, 0, 0, 415, 410, 1, 0, 0, 0, 415, 414, 1, 0, 0, 0, 416, 73, 1, 0, 0, 0, 417, 418, 8, 6, 0, 0, 418, 75, 1, 0, 0, 0, 419, 420, 7, 7, 0, 0, 420, 421, 1, 0, 0, 0, 421, 422, 6, 32, 14, 0, 422, 423, 6, 32, 7, 0, 423, 77, 1, 0, 0, 0, 424, 425, 9, 0, 0, 0, 425, 426, 1, 0, 0, 0, 426, 427, 6, 33, 7, 0, 427, 79, 1, 0, 0, 0, 428, 429, 3, 12, 0, 0, 429, 430, 1, 0, 0, 0, 430, 431, 6, 34, 0, 0, 431, 81, 1, 0, 0, 0, 432, 433, 3, 14, 1, 0, 433, 434, 1, 0, 0, 0, 434, 435, 6, 35, 1, 0, 435, 83, 1, 0, 0, 0, 436, 437, 5, 60, 0, 0, 437, 438, 5, 60, 0, 0, 438, 439, 1, 0, 0, 0, 439, 440, 6, 36, 19, 0, 440, 441, 6, 36, 9, 0, 441, 85, 1, 0, 0, 0, 442, 443, 5, 35, 0, 0, 443, 444, 1, 0, 0, 0, 444, 445, 6, 37, 10, 0, 445, 446, 6, 37, 5, 0, 446, 87, 1, 0, 0, 0, 447, 448, 3, 16, 2, 0, 448, 449, 1, 0, 0, 0, 449, 450, 6, 38, 6, 0, 450, 451, 6, 38, 7, 0, 451, 89, 1, 0, 0, 0, 452, 453, 9, 0, 0, 0, 453, 91, 1, 0, 0, 0, 454, 455, 3, 12, 0, 0, 455, 456, 1, 0, 0, 0, 456, 457, 6, 40, 0, 0, 457, 93, 1, 0, 0, 0, 458, 459, 3, 30, 9, 0, 459, 460, 1, 0, 0, 0, 460, 461, 6, 41, 10, 0, 461, 95, 1, 0, 0, 0, 462, 464, 8, 8, 0, 0, 463, 462, 1, 0, 0, 0, 464, 465, 1, 0, 0, 0, 465, 463, 1, 0, 0, 0, 465, 466, 1, 0, 0, 0, 466, 467, 1, 0, 0, 0, 467, 468, 6, 42, 7, 0, 468, 97, 1, 0, 0, 0, 469, 470, 3, 12, 0, 0, 470, 471, 1, 0, 0, 0, 471, 472, 6, 43, 0, 0, 472, 99, 1, 0, 0, 0, 473, 474, 5, 116, 0, 0, 474, 475, 5, 114, 0, 0, 475, 476, 5, 117, 0, 0, 476, 477, 5, 101, 0, 0, 477, 101, 1, 0, 0, 0, 478, 479, 5, 102, 0, 0, 479, 480, 5, 97, 0, 0, 480, 481, 5, 108, 0, 0, 481, 482, 5, 115, 0, 0, 482, 483, 5, 101, 0, 0, 483, 103, 1, 0, 0, 0, 484, 485, 5, 110, 0, 0, 485, 486, 5, 117, 0, 0, 486, 487, 5, 108, 0, 0, 487, 488, 5, 108, 0, 0, 488, 105, 1, 0, 0, 0, 489, 493, 5, 61, 0, 0, 490, 491, 5, 116, 0, 0, 491, 493, 5, 111, 0, 0, 492, 489, 1, 0, 0, 0, 492, 490, 1, 0, 0, 0, 493, 107, 1, 0, 0, 0, 494, 495, 5, 60, 0, 0, 495, 500, 5, 61, 0, 0, 496, 497, 5, 108, 0, 0, 497, 498, 5, 116, 0, 0, 498, 500, 5, 101, 0, 0, 499, 494, 1, 0, 0, 0, 499, 496, 1, 0, 0, 0, 500, 109, 1, 0, 0, 0, 501, 502, 5, 62, 0, 0, 502, 507, 5, 61, 0, 0, 503, 504, 5, 103, 0, 0, 504, 505, 5, 116, 0, 0, 505, 507, 5, 101, 0, 0, 506, 501, 1, 0, 0, 0, 506, 503, 1, 0, 0, 0, 507, 111, 1, 0, 0, 0, 508, 509, 5, 61, 0, 0, 509, 515, 5, 61, 0, 0, 510, 511, 5, 105, 0, 0, 511, 515, 5, 115, 0, 0, 512, 513, 5, 101, 0, 0, 513, 515, 5, 113, 0, 0, 514, 508, 1, 0, 0, 0, 514, 510, 1, 0, 0, 0, 514, 512, 1, 0, 0, 0, 515, 113, 1, 0, 0, 0, 516, 520, 5, 60, 0, 0, 517, 518, 5, 108, 0, 0, 518, 520, 5, 116, 0, 0, 519, 516, 1, 0, 0, 0, 519, 517, 1, 0, 0, 0, 520, 115, 1, 0, 0, 0, 521, 525, 5, 62, 0, 0, 522, 523, 5, 103, 0, 0, 523, 525, 5, 116, 0, 0, 524, 521, 1, 0, 0, 0, 524, 522, 1, 0, 0, 0, 525, 117, 1, 0, 0, 0, 526, 527, 5, 33, 0, 0, 527, 532, 5, 61, 0, 0, 528, 529, 5, 110, 0, 0, 529, 530, 5, 101, 0, 0, 530, 532, 5, 113, 0, 0, 531, 526, 1, 0, 0, 0, 531, 528, 1, 0, 0, 0, 532, 119, 1, 0, 0, 0, 533, 534, 5, 97, 0, 0, 534, 535, 5, 110, 0, 0, 535, 539, 5, 100, 0, 0, 536, 537, 5, 38, 0, 0, 537, 539, 5, 38, 0, 0, 538, 533, 1, 0, 0, 0, 538, 536, 1, 0, 0, 0, 539, 121, 1, 0, 0, 0, 540, 541, 5, 111, 0, 0, 541, 545, 5, 114, 0, 0, 542, 543, 5, 124, 0, 0, 543, 545, 5, 124, 0, 0, 544, 540, 1, 0, 0, 0, 544, 542, 1, 0, 0, 0, 545, 123, 1, 0, 0, 0, 546, 547, 5, 120, 0, 0, 547, 548, 5, 111, 0, 0, 548, 551, 5, 114, 0, 0, 549, 551, 5, 94, 0, 0, 550, 546, 1, 0, 0, 0, 550, 549, 1, 0, 0, 0, 551, 125, 1, 0, 0, 0, 552, 553, 5, 110, 0, 0, 553, 554, 5, 111, 0, 0, 554, 557, 5, 116, 0, 0, 555, 557, 5, 33, 0, 0, 556, 552, 1, 0, 0, 0, 556, 555, 1, 0, 0, 0, 557, 127, 1, 0, 0, 0, 558, 559, 5, 43, 0, 0, 559, 560, 5, 61, 0, 0, 560, 129, 1, 0, 0, 0, 561, 562, 5, 45, 0, 0, 562, 563, 5, 61, 0, 0, 563, 131, 1, 0, 0, 0, 564, 565, 5, 42, 0, 0, 565, 566, 5, 61, 0, 0, 566, 133, 1, 0, 0, 0, 567, 568, 5, 37, 0, 0, 568, 569, 5, 61, 0, 0, 569, 135, 1, 0, 0, 0, 570, 571, 5, 47, 0, 0, 571, 572, 5, 61, 0, 0, 572, 137, 1, 0, 0, 0, 573, 574, 5, 43, 0, 0, 574, 139, 1, 0, 0, 0, 575, 576, 5, 45, 0, 0, 576, 141, 1, 0, 0, 0, 577, 578, 5, 42, 0, 0, 578, 143, 1, 0, 0, 0, 579, 580, 5, 47, 0, 0, 580, 145, 1, 0, 0, 0, 581, 582, 5, 37, 0, 0, 582, 147, 1, 0, 0, 0, 583, 584, 5, 40, 0, 0, 584, 149, 1, 0, 0, 0, 585, 586, 5, 41, 0, 0, 586, 151, 1, 0, 0, 0, 587, 588, 5, 44, 0, 0, 588, 153, 1, 0, 0, 0, 589, 590, 5, 97, 0, 0, 590, 591, 5, 115, 0, 0, 591, 155, 1, 0, 0, 0, 592, 593, 5, 115, 0, 0, 593, 594, 5, 116, 0, 0, 594, 595, 5, 114, 0, 0, 595, 596, 5, 105, 0, 0, 596, 597, 5, 110, 0, 0, 597, 598, 5, 103, 0, 0, 598, 599, 1, 0, 0, 0, 599, 600, 6, 72, 20, 0, 600, 157, 1, 0, 0, 0, 601, 602, 5, 110, 0, 0, 602, 603, 5, 117, 0, 0, 603, 604, 5, 109, 0, 0, 604, 605, 5, 98, 0, 0, 605, 606, 5, 101, 0, 0, 606, 607, 5, 114, 0, 0, 607, 608, 1, 0, 0, 0, 608, 609, 6, 73, 20, 0, 609, 159, 1, 0, 0, 0, 610, 611, 5, 98, 0, 0, 611, 612, 5, 111, 0, 0, 612, 613, 5, 111, 0, 0, 613, 614, 5, 108, 0, 0, 614, 615, 1, 0, 0, 0, 615, 616, 6, 74, 20, 0, 616, 161, 1, 0, 0, 0, 617, 623, 5, 34, 0, 0, 618, 622, 8, 9, 0, 0, 619, 620, 5, 92, 0, 0, 620, 622, 7, 10, 0, 0, 621, 618, 1, 0, 0, 0, 621, 619, 1, 0, 0, 0, 622, 625, 1, 0, 0, 0, 623, 621, 1, 0, 0, 0, 623, 624, 1, 0, 0, 0, 624, 626, 1, 0, 0, 0, 625, 623, 1, 0, 0, 0, 626, 627, 5, 34, 0, 0, 627, 163, 1, 0, 0, 0, 628, 629, 3, 18, 3, 0, 629, 165, 1, 0, 0, 0, 630, 631, 5, 125, 0, 0, 631, 632, 1, 0, 0, 0, 632, 633, 6, 77, 7, 0, 633, 167, 1, 0, 0, 0, 634, 635, 5, 62, 0, 0, 635, 636, 5, 62, 0, 0, 636, 637, 1, 0, 0, 0, 637, 638, 6, 78, 21, 0, 638, 639, 6, 78, 7, 0, 639, 640, 6, 78, 7, 0, 640, 169, 1, 0, 0, 0, 641, 642, 5, 36, 0, 0, 642, 643, 3, 18, 3, 0, 643, 171, 1, 0, 0, 0, 644, 645, 5, 46, 0, 0, 645, 173, 1, 0, 0, 0, 646, 652, 3, 176, 82, 0, 647, 648, 3, 176, 82, 0, 648, 649, 5, 46, 0, 0, 649, 650, 3, 176, 82, 0, 650, 652, 1, 0, 0, 0, 651, 646, 1, 0, 0, 0, 651, 647, 1, 0, 0, 0, 652, 175, 1, 0, 0, 0, 653, 655, 3, 178, 83, 0, 654, 653, 1, 0, 0, 0, 655, 656, 1, 0, 0, 0, 656, 654, 1, 0, 0, 0, 656, 657, 1, 0, 0, 0, 657, 177, 1, 0, 0, 0, 658, 659, 7, 11, 0, 0, 659, 179, 1, 0, 0, 0, 660, 661, 3, 16, 2, 0, 661, 181, 1, 0, 0, 0, 662, 663, 3, 12, 0, 0, 663, 664, 1, 0, 0, 0, 664, 665, 6, 85, 0, 0, 665, 183, 1, 0, 0, 0, 666, 667, 5, 105, 0, 0, 667, 668, 5, 102, 0, 0, 668, 669, 1, 0, 0, 0, 669, 670, 7, 12, 0, 0, 670, 671, 1, 0, 0, 0, 671, 672, 6, 86, 13, 0, 672, 185, 1, 0, 0, 0, 673, 674, 5, 101, 0, 0, 674, 675, 5, 108, 0, 0, 675, 676, 5, 115, 0, 0, 676, 677, 5, 101, 0, 0, 677, 678, 5, 105, 0, 0, 678, 679, 5, 102, 0, 0, 679, 680, 1, 0, 0, 0, 680, 681, 7, 12, 0, 0, 681, 682, 1, 0, 0, 0, 682, 683, 6, 87, 13, 0, 683, 187, 1, 0, 0, 0, 684, 685, 5, 101, 0, 0, 685, 686, 5, 108, 0, 0, 686, 687, 5, 115, 0, 0, 687, 688, 5, 101, 0, 0, 688, 690, 1, 0, 0, 0, 689, 691, 7, 12, 0, 0, 690, 689, 1, 0, 0, 0, 690, 691, 1, 0, 0, 0, 691, 189, 1, 0, 0, 0, 692, 693, 5, 115, 0, 0, 693, 694, 5, 101, 0, 0, 694, 695, 5, 116, 0, 0, 695, 696, 1, 0, 0, 0, 696, 697, 7, 12, 0, 0, 697, 698, 1, 0, 0, 0, 698, 699, 6, 89, 13, 0, 699, 191, 1, 0, 0, 0, 700, 701, 5, 101, 0, 0, 701, 702, 5, 110, 0, 0, 702, 703, 5, 100, 0, 0, 703, 704, 5, 105, 0, 0, 704, 705, 5, 102, 0, 0, 705, 193, 1, 0, 0, 0, 706, 707, 5, 99, 0, 0, 707, 708, 5, 97, 0, 0, 708, 709, 5, 108, 0, 0, 709, 710, 5, 108, 0, 0, 710, 711, 1, 0, 0, 0, 711, 712, 7, 12, 0, 0, 712, 713, 1, 0, 0, 0, 713, 714, 6, 91, 13, 0, 714, 195, 1, 0, 0, 0, 715, 716, 5, 100, 0, 0, 716, 717, 5, 101, 0, 0, 717, 718, 5, 99, 0, 0, 718, 719, 5, 108, 0, 0, 719, 720, 5, 97, 0, 0, 720, 721, 5, 114, 0, 0, 721, 722, 5, 101, 0, 0, 722, 723, 1, 0, 0, 0, 723, 724, 7, 12, 0, 0, 724, 725, 1, 0, 0, 0, 725, 726, 6, 92, 13, 0, 726, 197, 1, 0, 0, 0, 727, 728, 5, 106, 0, 0, 728, 729, 5, 117, 0, 0, 729, 730, 5, 109, 0, 0, 730, 731, 5, 112, 0, 0, 731, 732, 1, 0, 0, 0, 732, 733, 7, 12, 0, 0, 733, 734, 1, 0, 0, 0, 734, 735, 6, 93, 22, 0, 735, 199, 1, 0, 0, 0, 736, 737, 5, 101, 0, 0, 737, 738, 5, 110, 0, 0, 738, 739, 5, 117, 0, 0, 739, 740, 5, 109, 0, 0, 740, 741, 1, 0, 0, 0, 741, 742, 7, 12, 0, 0, 742, 743, 1, 0, 0, 0, 743, 744, 6, 94, 23, 0, 744, 201, 1, 0, 0, 0, 745, 746, 5, 99, 0, 0, 746, 747, 5, 97, 0, 0, 747, 748, 5, 115, 0, 0, 748, 749, 5, 101, 0, 0, 749, 750, 1, 0, 0, 0, 750, 751, 7, 12, 0, 0, 751, 752, 1, 0, 0, 0, 752, 753, 6, 95, 23, 0, 753, 203, 1, 0, 0, 0, 754, 755, 5, 101, 0, 0, 755, 756, 5, 110, 0, 0, 756, 757, 5, 100, 0, 0, 757, 758, 5, 101, 0, 0, 758, 759, 5, 110, 0, 0, 759, 760, 5, 117, 0, 0, 760, 761, 5, 109, 0, 0, 761, 763, 1, 0, 0, 0, 762, 764, 7, 12, 0, 0, 763, 762, 1, 0, 0, 0, 763, 764, 1, 0, 0, 0, 764, 205, 1, 0, 0, 0, 765, 766, 5, 108, 0, 0, 766, 767, 5, 111, 0, 0, 767, 768, 5, 99, 0, 0, 768, 769, 5, 97, 0, 0, 769, 770, 5, 108, 0, 0, 770, 771, 1, 0, 0, 0, 771, 772, 7, 12, 0, 0, 772, 207, 1, 0, 0, 0, 773, 774, 5, 62, 0, 0, 774, 775, 5, 62, 0, 0, 775, 776, 1, 0, 0, 0, 776, 777, 6, 98, 7, 0, 777, 209, 1, 0, 0, 0, 778, 779, 5, 123, 0, 0, 779, 780, 1, 0, 0, 0, 780, 781, 6, 99, 24, 0, 781, 782, 6, 99, 25, 0, 782, 783, 6, 99, 13, 0, 783, 211, 1, 0, 0, 0, 784, 785, 9, 0, 0, 0, 785, 786, 1, 0, 0, 0, 786, 787, 6, 100, 26, 0, 787, 788, 6, 100, 25, 0, 788, 213, 1, 0, 0, 0, 789, 790, 3, 16, 2, 0, 790, 215, 1, 0, 0, 0, 791, 792, 5, 62, 0, 0, 792, 793, 5, 62, 0, 0, 793, 794, 1, 0, 0, 0, 794, 795, 6, 102, 7, 0, 795, 217, 1, 0, 0, 0, 796, 797, 5, 123, 0, 0, 797, 798, 1, 0, 0, 0, 798, 799, 6, 103, 13, 0, 799, 219, 1, 0, 0, 0, 800, 802, 8, 13, 0, 0, 801, 800, 1, 0, 0, 0, 802, 803, 1, 0, 0, 0, 803, 801, 1, 0, 0, 0, 803, 804, 1, 0, 0, 0, 804, 221, 1, 0, 0, 0, 805, 806, 3, 16, 2, 0, 806, 223, 1, 0, 0, 0, 807, 808, 3, 18, 3, 0, 808, 809, 1, 0, 0, 0, 809, 810, 6, 106, 27, 0, 810, 811, 6, 106, 7, 0, 811, 225, 1, 0, 0, 0, 812, 813, 5, 62, 0, 0, 813, 814, 5, 62, 0, 0, 814, 815, 1, 0, 0, 0, 815, 816, 6, 107, 21, 0, 816, 817, 6, 107, 7, 0, 817, 227, 1, 0, 0, 0, 818, 819, 3, 18, 3, 0, 819, 820, 1, 0, 0, 0, 820, 821, 6, 108, 27, 0, 821, 822, 6, 108, 7, 0, 822, 229, 1, 0, 0, 0, 823, 824, 3, 50, 19, 0, 824, 825, 1, 0, 0, 0, 825, 826, 6, 109, 18, 0, 826, 827, 6, 109, 28, 0, 827, 231, 1, 0, 0, 0, 828, 829, 5, 62, 0, 0, 829, 830, 5, 62, 0, 0, 830, 831, 1, 0, 0, 0, 831, 832, 6, 110, 21, 0, 832, 833, 6, 110, 7, 0, 833, 233, 1, 0, 0, 0, 45, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 237, 247, 253, 257, 262, 269, 272, 276, 281, 293, 305, 378, 412, 415, 465, 492, 499, 506, 514, 519, 524, 531, 538, 544, 550, 556, 621, 623, 651, 656, 690, 763, 803, 29, 0, 1, 0, 0, 3, 0, 0, 2, 0, 5, 2, 0, 5, 1, 0, 5, 6, 0, 7, 6, 0, 4, 0, 0, 7, 5, 0, 5, 8, 0, 7, 10, 0, 5, 5, 0, 5, 3, 0, 5, 7, 0, 7, 20, 0, 5, 4, 0, 6, 0, 0, 2, 5, 0, 7, 16, 0, 7, 15, 0, 7, 57, 0, 7, 76, 0, 5, 11, 0, 5, 10, 0, 7, 79, 0, 2, 9, 0, 7, 80, 0, 7, 7, 0, 2, 7, 0] \ No newline at end of file +[4, 0, 94, 1011, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, 2, 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, 7, 72, 2, 73, 7, 73, 2, 74, 7, 74, 2, 75, 7, 75, 2, 76, 7, 76, 2, 77, 7, 77, 2, 78, 7, 78, 2, 79, 7, 79, 2, 80, 7, 80, 2, 81, 7, 81, 2, 82, 7, 82, 2, 83, 7, 83, 2, 84, 7, 84, 2, 85, 7, 85, 2, 86, 7, 86, 2, 87, 7, 87, 2, 88, 7, 88, 2, 89, 7, 89, 2, 90, 7, 90, 2, 91, 7, 91, 2, 92, 7, 92, 2, 93, 7, 93, 2, 94, 7, 94, 2, 95, 7, 95, 2, 96, 7, 96, 2, 97, 7, 97, 2, 98, 7, 98, 2, 99, 7, 99, 2, 100, 7, 100, 2, 101, 7, 101, 2, 102, 7, 102, 2, 103, 7, 103, 2, 104, 7, 104, 2, 105, 7, 105, 2, 106, 7, 106, 2, 107, 7, 107, 2, 108, 7, 108, 2, 109, 7, 109, 2, 110, 7, 110, 2, 111, 7, 111, 2, 112, 7, 112, 2, 113, 7, 113, 2, 114, 7, 114, 2, 115, 7, 115, 2, 116, 7, 116, 2, 117, 7, 117, 2, 118, 7, 118, 2, 119, 7, 119, 2, 120, 7, 120, 2, 121, 7, 121, 2, 122, 7, 122, 2, 123, 7, 123, 2, 124, 7, 124, 2, 125, 7, 125, 2, 126, 7, 126, 2, 127, 7, 127, 2, 128, 7, 128, 1, 0, 4, 0, 274, 8, 0, 11, 0, 12, 0, 275, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 284, 8, 1, 10, 1, 12, 1, 287, 9, 1, 1, 1, 1, 1, 1, 2, 3, 2, 292, 8, 2, 1, 2, 1, 2, 3, 2, 296, 8, 2, 1, 2, 5, 2, 299, 8, 2, 10, 2, 12, 2, 302, 9, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 3, 5, 323, 8, 5, 1, 6, 3, 6, 326, 8, 6, 1, 7, 1, 7, 3, 7, 330, 8, 7, 1, 8, 4, 8, 333, 8, 8, 11, 8, 12, 8, 334, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 3, 10, 344, 8, 10, 1, 10, 1, 10, 3, 10, 348, 8, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 3, 12, 357, 8, 12, 1, 12, 1, 12, 3, 12, 361, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 3, 14, 373, 8, 14, 1, 14, 1, 14, 3, 14, 377, 8, 14, 1, 14, 1, 14, 1, 15, 3, 15, 382, 8, 15, 1, 15, 1, 15, 3, 15, 386, 8, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 4, 17, 396, 8, 17, 11, 17, 12, 17, 397, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 3, 32, 474, 8, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 4, 38, 506, 8, 38, 11, 38, 12, 38, 507, 1, 38, 3, 38, 511, 8, 38, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, 1, 49, 1, 50, 4, 50, 559, 8, 50, 11, 50, 12, 50, 560, 1, 50, 1, 50, 1, 51, 1, 51, 1, 51, 1, 51, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 56, 1, 56, 1, 56, 1, 56, 1, 56, 1, 56, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 58, 1, 58, 1, 58, 3, 58, 613, 8, 58, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 3, 59, 620, 8, 59, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 3, 60, 627, 8, 60, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 3, 61, 635, 8, 61, 1, 62, 1, 62, 1, 62, 3, 62, 640, 8, 62, 1, 63, 1, 63, 1, 63, 3, 63, 645, 8, 63, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 3, 64, 652, 8, 64, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 3, 65, 659, 8, 65, 1, 66, 1, 66, 1, 66, 1, 66, 3, 66, 665, 8, 66, 1, 67, 1, 67, 1, 67, 1, 67, 3, 67, 671, 8, 67, 1, 68, 1, 68, 1, 68, 1, 68, 3, 68, 677, 8, 68, 1, 69, 1, 69, 1, 69, 1, 70, 1, 70, 1, 70, 1, 71, 1, 71, 1, 71, 1, 72, 1, 72, 1, 72, 1, 73, 1, 73, 1, 73, 1, 74, 1, 74, 1, 75, 1, 75, 1, 76, 1, 76, 1, 77, 1, 77, 1, 78, 1, 78, 1, 79, 1, 79, 1, 80, 1, 80, 1, 81, 1, 81, 1, 82, 1, 82, 1, 82, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 86, 1, 86, 1, 86, 1, 86, 5, 86, 742, 8, 86, 10, 86, 12, 86, 745, 9, 86, 1, 86, 1, 86, 1, 87, 1, 87, 1, 88, 1, 88, 1, 88, 1, 88, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 90, 1, 90, 1, 90, 1, 91, 1, 91, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 3, 92, 772, 8, 92, 1, 93, 4, 93, 775, 8, 93, 11, 93, 12, 93, 776, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 94, 4, 94, 786, 8, 94, 11, 94, 12, 94, 787, 1, 95, 1, 95, 1, 96, 1, 96, 1, 97, 1, 97, 1, 97, 1, 97, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 108, 1, 108, 1, 108, 1, 108, 1, 108, 1, 108, 1, 108, 1, 108, 1, 108, 1, 109, 1, 109, 1, 109, 1, 109, 1, 109, 1, 109, 1, 109, 1, 109, 1, 109, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 1, 111, 1, 111, 1, 111, 1, 111, 1, 111, 1, 111, 1, 111, 1, 112, 1, 112, 1, 112, 1, 112, 1, 112, 1, 112, 1, 112, 1, 112, 1, 112, 1, 112, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 114, 1, 114, 1, 114, 1, 114, 1, 114, 1, 115, 1, 115, 1, 115, 1, 115, 1, 115, 1, 115, 1, 116, 1, 116, 1, 116, 1, 116, 1, 116, 1, 117, 1, 117, 1, 118, 1, 118, 1, 118, 1, 118, 1, 118, 1, 118, 1, 119, 1, 119, 1, 119, 1, 119, 1, 120, 4, 120, 971, 8, 120, 11, 120, 12, 120, 972, 1, 121, 1, 121, 1, 121, 1, 121, 1, 122, 1, 122, 1, 123, 1, 123, 1, 123, 1, 123, 1, 123, 1, 124, 1, 124, 1, 124, 1, 124, 1, 124, 1, 124, 1, 125, 1, 125, 1, 125, 1, 125, 1, 126, 1, 126, 1, 126, 1, 126, 1, 126, 1, 127, 1, 127, 1, 127, 1, 127, 1, 127, 1, 128, 1, 128, 1, 128, 1, 128, 1, 128, 1, 128, 0, 0, 129, 14, 4, 16, 5, 18, 6, 20, 7, 22, 8, 24, 9, 26, 0, 28, 0, 30, 0, 32, 10, 34, 11, 36, 12, 38, 0, 40, 13, 42, 0, 44, 0, 46, 0, 48, 14, 50, 0, 52, 15, 54, 0, 56, 0, 58, 16, 60, 17, 62, 18, 64, 19, 66, 0, 68, 20, 70, 0, 72, 21, 74, 0, 76, 0, 78, 0, 80, 22, 82, 0, 84, 0, 86, 0, 88, 23, 90, 24, 92, 0, 94, 0, 96, 25, 98, 26, 100, 27, 102, 0, 104, 0, 106, 0, 108, 28, 110, 29, 112, 0, 114, 30, 116, 31, 118, 32, 120, 0, 122, 0, 124, 33, 126, 34, 128, 35, 130, 36, 132, 37, 134, 38, 136, 39, 138, 40, 140, 41, 142, 42, 144, 43, 146, 44, 148, 45, 150, 46, 152, 47, 154, 48, 156, 49, 158, 50, 160, 51, 162, 52, 164, 53, 166, 54, 168, 55, 170, 56, 172, 57, 174, 58, 176, 59, 178, 60, 180, 92, 182, 93, 184, 94, 186, 61, 188, 62, 190, 63, 192, 0, 194, 64, 196, 65, 198, 66, 200, 0, 202, 0, 204, 0, 206, 67, 208, 68, 210, 69, 212, 70, 214, 71, 216, 72, 218, 73, 220, 74, 222, 75, 224, 76, 226, 77, 228, 78, 230, 79, 232, 80, 234, 81, 236, 82, 238, 83, 240, 84, 242, 85, 244, 0, 246, 0, 248, 86, 250, 0, 252, 87, 254, 88, 256, 89, 258, 90, 260, 0, 262, 0, 264, 91, 266, 0, 268, 0, 270, 0, 14, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 12, 2, 0, 9, 9, 32, 32, 2, 0, 10, 10, 13, 13, 49, 0, 65, 90, 95, 95, 97, 122, 168, 168, 170, 170, 173, 173, 175, 175, 178, 181, 183, 186, 188, 190, 192, 214, 216, 246, 248, 767, 880, 5759, 5761, 6157, 6159, 7615, 7680, 8191, 8203, 8205, 8234, 8238, 8255, 8256, 8276, 8276, 8288, 8399, 8448, 8591, 9312, 9471, 10102, 10131, 11264, 11775, 11904, 12287, 12292, 12295, 12321, 12335, 12337, 55295, 63744, 64829, 64832, 64975, 65008, 65055, 65072, 65092, 65095, 65533, 65536, 131069, 131072, 196605, 196608, 262141, 262144, 327677, 327680, 393213, 393216, 458749, 458752, 524285, 524288, 589821, 589824, 655357, 655360, 720893, 720896, 786429, 786432, 851965, 851968, 917501, 917504, 983037, 5, 0, 48, 57, 768, 879, 7616, 7679, 8400, 8447, 65056, 65071, 2, 0, 47, 47, 60, 60, 7, 0, 10, 10, 13, 13, 35, 35, 47, 47, 60, 60, 92, 92, 123, 123, 7, 0, 35, 35, 47, 47, 60, 60, 62, 62, 92, 92, 123, 123, 125, 125, 5, 0, 9, 10, 13, 13, 32, 32, 35, 36, 60, 60, 4, 0, 10, 10, 13, 13, 34, 34, 92, 92, 2, 0, 34, 34, 92, 92, 1, 0, 48, 57, 4, 0, 10, 10, 13, 13, 62, 62, 123, 123, 1030, 0, 14, 1, 0, 0, 0, 0, 16, 1, 0, 0, 0, 0, 18, 1, 0, 0, 0, 0, 20, 1, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 24, 1, 0, 0, 0, 0, 32, 1, 0, 0, 0, 0, 34, 1, 0, 0, 0, 0, 36, 1, 0, 0, 0, 1, 38, 1, 0, 0, 0, 1, 40, 1, 0, 0, 0, 2, 42, 1, 0, 0, 0, 2, 44, 1, 0, 0, 0, 2, 46, 1, 0, 0, 0, 3, 48, 1, 0, 0, 0, 3, 50, 1, 0, 0, 0, 4, 52, 1, 0, 0, 0, 4, 54, 1, 0, 0, 0, 4, 56, 1, 0, 0, 0, 4, 58, 1, 0, 0, 0, 4, 60, 1, 0, 0, 0, 4, 62, 1, 0, 0, 0, 4, 64, 1, 0, 0, 0, 4, 66, 1, 0, 0, 0, 4, 68, 1, 0, 0, 0, 4, 70, 1, 0, 0, 0, 4, 72, 1, 0, 0, 0, 4, 74, 1, 0, 0, 0, 5, 76, 1, 0, 0, 0, 5, 78, 1, 0, 0, 0, 5, 80, 1, 0, 0, 0, 5, 82, 1, 0, 0, 0, 5, 84, 1, 0, 0, 0, 5, 86, 1, 0, 0, 0, 5, 88, 1, 0, 0, 0, 5, 90, 1, 0, 0, 0, 6, 94, 1, 0, 0, 0, 6, 96, 1, 0, 0, 0, 7, 98, 1, 0, 0, 0, 7, 100, 1, 0, 0, 0, 7, 102, 1, 0, 0, 0, 7, 104, 1, 0, 0, 0, 7, 106, 1, 0, 0, 0, 7, 108, 1, 0, 0, 0, 8, 110, 1, 0, 0, 0, 8, 112, 1, 0, 0, 0, 8, 114, 1, 0, 0, 0, 9, 116, 1, 0, 0, 0, 9, 118, 1, 0, 0, 0, 9, 120, 1, 0, 0, 0, 9, 122, 1, 0, 0, 0, 9, 124, 1, 0, 0, 0, 9, 126, 1, 0, 0, 0, 9, 128, 1, 0, 0, 0, 9, 130, 1, 0, 0, 0, 9, 132, 1, 0, 0, 0, 9, 134, 1, 0, 0, 0, 9, 136, 1, 0, 0, 0, 9, 138, 1, 0, 0, 0, 9, 140, 1, 0, 0, 0, 9, 142, 1, 0, 0, 0, 9, 144, 1, 0, 0, 0, 9, 146, 1, 0, 0, 0, 9, 148, 1, 0, 0, 0, 9, 150, 1, 0, 0, 0, 9, 152, 1, 0, 0, 0, 9, 154, 1, 0, 0, 0, 9, 156, 1, 0, 0, 0, 9, 158, 1, 0, 0, 0, 9, 160, 1, 0, 0, 0, 9, 162, 1, 0, 0, 0, 9, 164, 1, 0, 0, 0, 9, 166, 1, 0, 0, 0, 9, 168, 1, 0, 0, 0, 9, 170, 1, 0, 0, 0, 9, 172, 1, 0, 0, 0, 9, 174, 1, 0, 0, 0, 9, 176, 1, 0, 0, 0, 9, 178, 1, 0, 0, 0, 9, 180, 1, 0, 0, 0, 9, 182, 1, 0, 0, 0, 9, 184, 1, 0, 0, 0, 9, 186, 1, 0, 0, 0, 9, 188, 1, 0, 0, 0, 9, 190, 1, 0, 0, 0, 9, 192, 1, 0, 0, 0, 9, 194, 1, 0, 0, 0, 9, 196, 1, 0, 0, 0, 9, 198, 1, 0, 0, 0, 9, 200, 1, 0, 0, 0, 10, 206, 1, 0, 0, 0, 10, 208, 1, 0, 0, 0, 10, 210, 1, 0, 0, 0, 10, 212, 1, 0, 0, 0, 10, 214, 1, 0, 0, 0, 10, 216, 1, 0, 0, 0, 10, 218, 1, 0, 0, 0, 10, 220, 1, 0, 0, 0, 10, 222, 1, 0, 0, 0, 10, 224, 1, 0, 0, 0, 10, 226, 1, 0, 0, 0, 10, 228, 1, 0, 0, 0, 10, 230, 1, 0, 0, 0, 10, 232, 1, 0, 0, 0, 10, 234, 1, 0, 0, 0, 10, 236, 1, 0, 0, 0, 10, 238, 1, 0, 0, 0, 10, 240, 1, 0, 0, 0, 10, 242, 1, 0, 0, 0, 10, 244, 1, 0, 0, 0, 10, 246, 1, 0, 0, 0, 11, 248, 1, 0, 0, 0, 11, 250, 1, 0, 0, 0, 11, 252, 1, 0, 0, 0, 11, 254, 1, 0, 0, 0, 12, 256, 1, 0, 0, 0, 12, 258, 1, 0, 0, 0, 12, 260, 1, 0, 0, 0, 12, 262, 1, 0, 0, 0, 13, 264, 1, 0, 0, 0, 13, 266, 1, 0, 0, 0, 13, 268, 1, 0, 0, 0, 13, 270, 1, 0, 0, 0, 14, 273, 1, 0, 0, 0, 16, 279, 1, 0, 0, 0, 18, 295, 1, 0, 0, 0, 20, 305, 1, 0, 0, 0, 22, 312, 1, 0, 0, 0, 24, 320, 1, 0, 0, 0, 26, 325, 1, 0, 0, 0, 28, 329, 1, 0, 0, 0, 30, 332, 1, 0, 0, 0, 32, 336, 1, 0, 0, 0, 34, 343, 1, 0, 0, 0, 36, 351, 1, 0, 0, 0, 38, 356, 1, 0, 0, 0, 40, 367, 1, 0, 0, 0, 42, 372, 1, 0, 0, 0, 44, 381, 1, 0, 0, 0, 46, 389, 1, 0, 0, 0, 48, 395, 1, 0, 0, 0, 50, 399, 1, 0, 0, 0, 52, 405, 1, 0, 0, 0, 54, 409, 1, 0, 0, 0, 56, 414, 1, 0, 0, 0, 58, 419, 1, 0, 0, 0, 60, 425, 1, 0, 0, 0, 62, 428, 1, 0, 0, 0, 64, 431, 1, 0, 0, 0, 66, 436, 1, 0, 0, 0, 68, 442, 1, 0, 0, 0, 70, 447, 1, 0, 0, 0, 72, 453, 1, 0, 0, 0, 74, 459, 1, 0, 0, 0, 76, 464, 1, 0, 0, 0, 78, 473, 1, 0, 0, 0, 80, 477, 1, 0, 0, 0, 82, 482, 1, 0, 0, 0, 84, 488, 1, 0, 0, 0, 86, 493, 1, 0, 0, 0, 88, 500, 1, 0, 0, 0, 90, 510, 1, 0, 0, 0, 92, 512, 1, 0, 0, 0, 94, 514, 1, 0, 0, 0, 96, 519, 1, 0, 0, 0, 98, 523, 1, 0, 0, 0, 100, 527, 1, 0, 0, 0, 102, 531, 1, 0, 0, 0, 104, 537, 1, 0, 0, 0, 106, 542, 1, 0, 0, 0, 108, 547, 1, 0, 0, 0, 110, 549, 1, 0, 0, 0, 112, 553, 1, 0, 0, 0, 114, 558, 1, 0, 0, 0, 116, 564, 1, 0, 0, 0, 118, 568, 1, 0, 0, 0, 120, 577, 1, 0, 0, 0, 122, 586, 1, 0, 0, 0, 124, 593, 1, 0, 0, 0, 126, 598, 1, 0, 0, 0, 128, 604, 1, 0, 0, 0, 130, 612, 1, 0, 0, 0, 132, 619, 1, 0, 0, 0, 134, 626, 1, 0, 0, 0, 136, 634, 1, 0, 0, 0, 138, 639, 1, 0, 0, 0, 140, 644, 1, 0, 0, 0, 142, 651, 1, 0, 0, 0, 144, 658, 1, 0, 0, 0, 146, 664, 1, 0, 0, 0, 148, 670, 1, 0, 0, 0, 150, 676, 1, 0, 0, 0, 152, 678, 1, 0, 0, 0, 154, 681, 1, 0, 0, 0, 156, 684, 1, 0, 0, 0, 158, 687, 1, 0, 0, 0, 160, 690, 1, 0, 0, 0, 162, 693, 1, 0, 0, 0, 164, 695, 1, 0, 0, 0, 166, 697, 1, 0, 0, 0, 168, 699, 1, 0, 0, 0, 170, 701, 1, 0, 0, 0, 172, 703, 1, 0, 0, 0, 174, 705, 1, 0, 0, 0, 176, 707, 1, 0, 0, 0, 178, 709, 1, 0, 0, 0, 180, 712, 1, 0, 0, 0, 182, 721, 1, 0, 0, 0, 184, 730, 1, 0, 0, 0, 186, 737, 1, 0, 0, 0, 188, 748, 1, 0, 0, 0, 190, 750, 1, 0, 0, 0, 192, 754, 1, 0, 0, 0, 194, 761, 1, 0, 0, 0, 196, 764, 1, 0, 0, 0, 198, 771, 1, 0, 0, 0, 200, 774, 1, 0, 0, 0, 202, 785, 1, 0, 0, 0, 204, 789, 1, 0, 0, 0, 206, 791, 1, 0, 0, 0, 208, 793, 1, 0, 0, 0, 210, 797, 1, 0, 0, 0, 212, 804, 1, 0, 0, 0, 214, 815, 1, 0, 0, 0, 216, 822, 1, 0, 0, 0, 218, 830, 1, 0, 0, 0, 220, 838, 1, 0, 0, 0, 222, 847, 1, 0, 0, 0, 224, 859, 1, 0, 0, 0, 226, 868, 1, 0, 0, 0, 228, 879, 1, 0, 0, 0, 230, 888, 1, 0, 0, 0, 232, 897, 1, 0, 0, 0, 234, 906, 1, 0, 0, 0, 236, 916, 1, 0, 0, 0, 238, 923, 1, 0, 0, 0, 240, 933, 1, 0, 0, 0, 242, 941, 1, 0, 0, 0, 244, 946, 1, 0, 0, 0, 246, 952, 1, 0, 0, 0, 248, 957, 1, 0, 0, 0, 250, 959, 1, 0, 0, 0, 252, 965, 1, 0, 0, 0, 254, 970, 1, 0, 0, 0, 256, 974, 1, 0, 0, 0, 258, 978, 1, 0, 0, 0, 260, 980, 1, 0, 0, 0, 262, 985, 1, 0, 0, 0, 264, 991, 1, 0, 0, 0, 266, 995, 1, 0, 0, 0, 268, 1000, 1, 0, 0, 0, 270, 1005, 1, 0, 0, 0, 272, 274, 7, 0, 0, 0, 273, 272, 1, 0, 0, 0, 274, 275, 1, 0, 0, 0, 275, 273, 1, 0, 0, 0, 275, 276, 1, 0, 0, 0, 276, 277, 1, 0, 0, 0, 277, 278, 6, 0, 0, 0, 278, 15, 1, 0, 0, 0, 279, 280, 5, 47, 0, 0, 280, 281, 5, 47, 0, 0, 281, 285, 1, 0, 0, 0, 282, 284, 8, 1, 0, 0, 283, 282, 1, 0, 0, 0, 284, 287, 1, 0, 0, 0, 285, 283, 1, 0, 0, 0, 285, 286, 1, 0, 0, 0, 286, 288, 1, 0, 0, 0, 287, 285, 1, 0, 0, 0, 288, 289, 6, 1, 1, 0, 289, 17, 1, 0, 0, 0, 290, 292, 5, 13, 0, 0, 291, 290, 1, 0, 0, 0, 291, 292, 1, 0, 0, 0, 292, 293, 1, 0, 0, 0, 293, 296, 5, 10, 0, 0, 294, 296, 5, 13, 0, 0, 295, 291, 1, 0, 0, 0, 295, 294, 1, 0, 0, 0, 296, 300, 1, 0, 0, 0, 297, 299, 7, 0, 0, 0, 298, 297, 1, 0, 0, 0, 299, 302, 1, 0, 0, 0, 300, 298, 1, 0, 0, 0, 300, 301, 1, 0, 0, 0, 301, 303, 1, 0, 0, 0, 302, 300, 1, 0, 0, 0, 303, 304, 6, 2, 2, 0, 304, 19, 1, 0, 0, 0, 305, 306, 5, 119, 0, 0, 306, 307, 5, 104, 0, 0, 307, 308, 5, 101, 0, 0, 308, 309, 5, 110, 0, 0, 309, 310, 1, 0, 0, 0, 310, 311, 6, 3, 3, 0, 311, 21, 1, 0, 0, 0, 312, 313, 5, 116, 0, 0, 313, 314, 5, 105, 0, 0, 314, 315, 5, 116, 0, 0, 315, 316, 5, 108, 0, 0, 316, 317, 5, 101, 0, 0, 317, 318, 1, 0, 0, 0, 318, 319, 6, 4, 4, 0, 319, 23, 1, 0, 0, 0, 320, 322, 3, 26, 6, 0, 321, 323, 3, 30, 8, 0, 322, 321, 1, 0, 0, 0, 322, 323, 1, 0, 0, 0, 323, 25, 1, 0, 0, 0, 324, 326, 7, 2, 0, 0, 325, 324, 1, 0, 0, 0, 326, 27, 1, 0, 0, 0, 327, 330, 7, 3, 0, 0, 328, 330, 3, 26, 6, 0, 329, 327, 1, 0, 0, 0, 329, 328, 1, 0, 0, 0, 330, 29, 1, 0, 0, 0, 331, 333, 3, 28, 7, 0, 332, 331, 1, 0, 0, 0, 333, 334, 1, 0, 0, 0, 334, 332, 1, 0, 0, 0, 334, 335, 1, 0, 0, 0, 335, 31, 1, 0, 0, 0, 336, 337, 5, 45, 0, 0, 337, 338, 5, 45, 0, 0, 338, 339, 5, 45, 0, 0, 339, 340, 1, 0, 0, 0, 340, 341, 6, 9, 5, 0, 341, 33, 1, 0, 0, 0, 342, 344, 3, 14, 0, 0, 343, 342, 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, 344, 345, 1, 0, 0, 0, 345, 347, 5, 58, 0, 0, 346, 348, 3, 14, 0, 0, 347, 346, 1, 0, 0, 0, 347, 348, 1, 0, 0, 0, 348, 349, 1, 0, 0, 0, 349, 350, 6, 10, 6, 0, 350, 35, 1, 0, 0, 0, 351, 352, 5, 35, 0, 0, 352, 353, 1, 0, 0, 0, 353, 354, 6, 11, 7, 0, 354, 37, 1, 0, 0, 0, 355, 357, 3, 14, 0, 0, 356, 355, 1, 0, 0, 0, 356, 357, 1, 0, 0, 0, 357, 358, 1, 0, 0, 0, 358, 360, 5, 58, 0, 0, 359, 361, 3, 14, 0, 0, 360, 359, 1, 0, 0, 0, 360, 361, 1, 0, 0, 0, 361, 362, 1, 0, 0, 0, 362, 363, 6, 12, 8, 0, 363, 364, 1, 0, 0, 0, 364, 365, 6, 12, 9, 0, 365, 366, 6, 12, 10, 0, 366, 39, 1, 0, 0, 0, 367, 368, 9, 0, 0, 0, 368, 369, 1, 0, 0, 0, 369, 370, 6, 13, 11, 0, 370, 41, 1, 0, 0, 0, 371, 373, 3, 14, 0, 0, 372, 371, 1, 0, 0, 0, 372, 373, 1, 0, 0, 0, 373, 374, 1, 0, 0, 0, 374, 376, 5, 58, 0, 0, 375, 377, 3, 14, 0, 0, 376, 375, 1, 0, 0, 0, 376, 377, 1, 0, 0, 0, 377, 378, 1, 0, 0, 0, 378, 379, 6, 14, 9, 0, 379, 43, 1, 0, 0, 0, 380, 382, 3, 14, 0, 0, 381, 380, 1, 0, 0, 0, 381, 382, 1, 0, 0, 0, 382, 383, 1, 0, 0, 0, 383, 385, 3, 24, 5, 0, 384, 386, 3, 14, 0, 0, 385, 384, 1, 0, 0, 0, 385, 386, 1, 0, 0, 0, 386, 387, 1, 0, 0, 0, 387, 388, 6, 15, 12, 0, 388, 45, 1, 0, 0, 0, 389, 390, 3, 18, 2, 0, 390, 391, 1, 0, 0, 0, 391, 392, 6, 16, 13, 0, 392, 393, 6, 16, 11, 0, 393, 47, 1, 0, 0, 0, 394, 396, 8, 1, 0, 0, 395, 394, 1, 0, 0, 0, 396, 397, 1, 0, 0, 0, 397, 395, 1, 0, 0, 0, 397, 398, 1, 0, 0, 0, 398, 49, 1, 0, 0, 0, 399, 400, 3, 18, 2, 0, 400, 401, 1, 0, 0, 0, 401, 402, 6, 18, 13, 0, 402, 403, 6, 18, 2, 0, 403, 404, 6, 18, 11, 0, 404, 51, 1, 0, 0, 0, 405, 406, 3, 14, 0, 0, 406, 407, 1, 0, 0, 0, 407, 408, 6, 19, 0, 0, 408, 53, 1, 0, 0, 0, 409, 410, 3, 18, 2, 0, 410, 411, 1, 0, 0, 0, 411, 412, 6, 20, 13, 0, 412, 413, 6, 20, 2, 0, 413, 55, 1, 0, 0, 0, 414, 415, 3, 16, 1, 0, 415, 416, 1, 0, 0, 0, 416, 417, 6, 21, 14, 0, 417, 418, 6, 21, 1, 0, 418, 57, 1, 0, 0, 0, 419, 420, 5, 61, 0, 0, 420, 421, 5, 61, 0, 0, 421, 422, 5, 61, 0, 0, 422, 423, 1, 0, 0, 0, 423, 424, 6, 22, 11, 0, 424, 59, 1, 0, 0, 0, 425, 426, 5, 45, 0, 0, 426, 427, 5, 62, 0, 0, 427, 61, 1, 0, 0, 0, 428, 429, 5, 61, 0, 0, 429, 430, 5, 62, 0, 0, 430, 63, 1, 0, 0, 0, 431, 432, 5, 60, 0, 0, 432, 433, 5, 60, 0, 0, 433, 434, 1, 0, 0, 0, 434, 435, 6, 25, 15, 0, 435, 65, 1, 0, 0, 0, 436, 437, 5, 35, 0, 0, 437, 438, 1, 0, 0, 0, 438, 439, 6, 26, 16, 0, 439, 440, 6, 26, 17, 0, 440, 441, 6, 26, 7, 0, 441, 67, 1, 0, 0, 0, 442, 443, 5, 123, 0, 0, 443, 444, 1, 0, 0, 0, 444, 445, 6, 27, 18, 0, 445, 446, 6, 27, 19, 0, 446, 69, 1, 0, 0, 0, 447, 448, 5, 92, 0, 0, 448, 449, 5, 91, 0, 0, 449, 450, 1, 0, 0, 0, 450, 451, 6, 28, 20, 0, 451, 452, 6, 28, 18, 0, 452, 71, 1, 0, 0, 0, 453, 454, 5, 92, 0, 0, 454, 455, 1, 0, 0, 0, 455, 456, 6, 29, 0, 0, 456, 457, 6, 29, 18, 0, 457, 458, 6, 29, 21, 0, 458, 73, 1, 0, 0, 0, 459, 460, 9, 0, 0, 0, 460, 461, 1, 0, 0, 0, 461, 462, 6, 30, 20, 0, 462, 463, 6, 30, 18, 0, 463, 75, 1, 0, 0, 0, 464, 465, 3, 18, 2, 0, 465, 466, 1, 0, 0, 0, 466, 467, 6, 31, 13, 0, 467, 468, 6, 31, 11, 0, 468, 77, 1, 0, 0, 0, 469, 470, 5, 92, 0, 0, 470, 474, 5, 91, 0, 0, 471, 472, 5, 92, 0, 0, 472, 474, 5, 93, 0, 0, 473, 469, 1, 0, 0, 0, 473, 471, 1, 0, 0, 0, 474, 475, 1, 0, 0, 0, 475, 476, 6, 32, 20, 0, 476, 79, 1, 0, 0, 0, 477, 478, 5, 92, 0, 0, 478, 479, 1, 0, 0, 0, 479, 480, 6, 33, 0, 0, 480, 481, 6, 33, 21, 0, 481, 81, 1, 0, 0, 0, 482, 483, 3, 36, 11, 0, 483, 484, 1, 0, 0, 0, 484, 485, 6, 34, 16, 0, 485, 486, 6, 34, 22, 0, 486, 487, 6, 34, 7, 0, 487, 83, 1, 0, 0, 0, 488, 489, 5, 123, 0, 0, 489, 490, 1, 0, 0, 0, 490, 491, 6, 35, 23, 0, 491, 492, 6, 35, 19, 0, 492, 85, 1, 0, 0, 0, 493, 494, 5, 60, 0, 0, 494, 495, 5, 60, 0, 0, 495, 496, 1, 0, 0, 0, 496, 497, 6, 36, 24, 0, 497, 498, 6, 36, 22, 0, 498, 499, 6, 36, 15, 0, 499, 87, 1, 0, 0, 0, 500, 501, 3, 16, 1, 0, 501, 502, 1, 0, 0, 0, 502, 503, 6, 37, 1, 0, 503, 89, 1, 0, 0, 0, 504, 506, 3, 92, 39, 0, 505, 504, 1, 0, 0, 0, 506, 507, 1, 0, 0, 0, 507, 505, 1, 0, 0, 0, 507, 508, 1, 0, 0, 0, 508, 511, 1, 0, 0, 0, 509, 511, 7, 4, 0, 0, 510, 505, 1, 0, 0, 0, 510, 509, 1, 0, 0, 0, 511, 91, 1, 0, 0, 0, 512, 513, 8, 5, 0, 0, 513, 93, 1, 0, 0, 0, 514, 515, 7, 6, 0, 0, 515, 516, 1, 0, 0, 0, 516, 517, 6, 40, 20, 0, 517, 518, 6, 40, 11, 0, 518, 95, 1, 0, 0, 0, 519, 520, 9, 0, 0, 0, 520, 521, 1, 0, 0, 0, 521, 522, 6, 41, 11, 0, 522, 97, 1, 0, 0, 0, 523, 524, 3, 14, 0, 0, 524, 525, 1, 0, 0, 0, 525, 526, 6, 42, 0, 0, 526, 99, 1, 0, 0, 0, 527, 528, 3, 16, 1, 0, 528, 529, 1, 0, 0, 0, 529, 530, 6, 43, 1, 0, 530, 101, 1, 0, 0, 0, 531, 532, 5, 60, 0, 0, 532, 533, 5, 60, 0, 0, 533, 534, 1, 0, 0, 0, 534, 535, 6, 44, 24, 0, 535, 536, 6, 44, 15, 0, 536, 103, 1, 0, 0, 0, 537, 538, 5, 35, 0, 0, 538, 539, 1, 0, 0, 0, 539, 540, 6, 45, 16, 0, 540, 541, 6, 45, 7, 0, 541, 105, 1, 0, 0, 0, 542, 543, 3, 18, 2, 0, 543, 544, 1, 0, 0, 0, 544, 545, 6, 46, 13, 0, 545, 546, 6, 46, 11, 0, 546, 107, 1, 0, 0, 0, 547, 548, 9, 0, 0, 0, 548, 109, 1, 0, 0, 0, 549, 550, 3, 14, 0, 0, 550, 551, 1, 0, 0, 0, 551, 552, 6, 48, 0, 0, 552, 111, 1, 0, 0, 0, 553, 554, 3, 36, 11, 0, 554, 555, 1, 0, 0, 0, 555, 556, 6, 49, 16, 0, 556, 113, 1, 0, 0, 0, 557, 559, 8, 7, 0, 0, 558, 557, 1, 0, 0, 0, 559, 560, 1, 0, 0, 0, 560, 558, 1, 0, 0, 0, 560, 561, 1, 0, 0, 0, 561, 562, 1, 0, 0, 0, 562, 563, 6, 50, 11, 0, 563, 115, 1, 0, 0, 0, 564, 565, 3, 14, 0, 0, 565, 566, 1, 0, 0, 0, 566, 567, 6, 51, 0, 0, 567, 117, 1, 0, 0, 0, 568, 569, 5, 97, 0, 0, 569, 570, 5, 108, 0, 0, 570, 571, 5, 119, 0, 0, 571, 572, 5, 97, 0, 0, 572, 573, 5, 121, 0, 0, 573, 574, 5, 115, 0, 0, 574, 575, 1, 0, 0, 0, 575, 576, 4, 52, 0, 0, 576, 119, 1, 0, 0, 0, 577, 578, 5, 111, 0, 0, 578, 579, 5, 110, 0, 0, 579, 580, 5, 99, 0, 0, 580, 581, 5, 101, 0, 0, 581, 582, 1, 0, 0, 0, 582, 583, 4, 53, 1, 0, 583, 584, 1, 0, 0, 0, 584, 585, 6, 53, 25, 0, 585, 121, 1, 0, 0, 0, 586, 587, 5, 105, 0, 0, 587, 588, 5, 102, 0, 0, 588, 589, 1, 0, 0, 0, 589, 590, 4, 54, 2, 0, 590, 591, 1, 0, 0, 0, 591, 592, 6, 54, 26, 0, 592, 123, 1, 0, 0, 0, 593, 594, 5, 116, 0, 0, 594, 595, 5, 114, 0, 0, 595, 596, 5, 117, 0, 0, 596, 597, 5, 101, 0, 0, 597, 125, 1, 0, 0, 0, 598, 599, 5, 102, 0, 0, 599, 600, 5, 97, 0, 0, 600, 601, 5, 108, 0, 0, 601, 602, 5, 115, 0, 0, 602, 603, 5, 101, 0, 0, 603, 127, 1, 0, 0, 0, 604, 605, 5, 110, 0, 0, 605, 606, 5, 117, 0, 0, 606, 607, 5, 108, 0, 0, 607, 608, 5, 108, 0, 0, 608, 129, 1, 0, 0, 0, 609, 613, 5, 61, 0, 0, 610, 611, 5, 116, 0, 0, 611, 613, 5, 111, 0, 0, 612, 609, 1, 0, 0, 0, 612, 610, 1, 0, 0, 0, 613, 131, 1, 0, 0, 0, 614, 615, 5, 60, 0, 0, 615, 620, 5, 61, 0, 0, 616, 617, 5, 108, 0, 0, 617, 618, 5, 116, 0, 0, 618, 620, 5, 101, 0, 0, 619, 614, 1, 0, 0, 0, 619, 616, 1, 0, 0, 0, 620, 133, 1, 0, 0, 0, 621, 622, 5, 62, 0, 0, 622, 627, 5, 61, 0, 0, 623, 624, 5, 103, 0, 0, 624, 625, 5, 116, 0, 0, 625, 627, 5, 101, 0, 0, 626, 621, 1, 0, 0, 0, 626, 623, 1, 0, 0, 0, 627, 135, 1, 0, 0, 0, 628, 629, 5, 61, 0, 0, 629, 635, 5, 61, 0, 0, 630, 631, 5, 105, 0, 0, 631, 635, 5, 115, 0, 0, 632, 633, 5, 101, 0, 0, 633, 635, 5, 113, 0, 0, 634, 628, 1, 0, 0, 0, 634, 630, 1, 0, 0, 0, 634, 632, 1, 0, 0, 0, 635, 137, 1, 0, 0, 0, 636, 640, 5, 60, 0, 0, 637, 638, 5, 108, 0, 0, 638, 640, 5, 116, 0, 0, 639, 636, 1, 0, 0, 0, 639, 637, 1, 0, 0, 0, 640, 139, 1, 0, 0, 0, 641, 645, 5, 62, 0, 0, 642, 643, 5, 103, 0, 0, 643, 645, 5, 116, 0, 0, 644, 641, 1, 0, 0, 0, 644, 642, 1, 0, 0, 0, 645, 141, 1, 0, 0, 0, 646, 647, 5, 33, 0, 0, 647, 652, 5, 61, 0, 0, 648, 649, 5, 110, 0, 0, 649, 650, 5, 101, 0, 0, 650, 652, 5, 113, 0, 0, 651, 646, 1, 0, 0, 0, 651, 648, 1, 0, 0, 0, 652, 143, 1, 0, 0, 0, 653, 654, 5, 97, 0, 0, 654, 655, 5, 110, 0, 0, 655, 659, 5, 100, 0, 0, 656, 657, 5, 38, 0, 0, 657, 659, 5, 38, 0, 0, 658, 653, 1, 0, 0, 0, 658, 656, 1, 0, 0, 0, 659, 145, 1, 0, 0, 0, 660, 661, 5, 111, 0, 0, 661, 665, 5, 114, 0, 0, 662, 663, 5, 124, 0, 0, 663, 665, 5, 124, 0, 0, 664, 660, 1, 0, 0, 0, 664, 662, 1, 0, 0, 0, 665, 147, 1, 0, 0, 0, 666, 667, 5, 120, 0, 0, 667, 668, 5, 111, 0, 0, 668, 671, 5, 114, 0, 0, 669, 671, 5, 94, 0, 0, 670, 666, 1, 0, 0, 0, 670, 669, 1, 0, 0, 0, 671, 149, 1, 0, 0, 0, 672, 673, 5, 110, 0, 0, 673, 674, 5, 111, 0, 0, 674, 677, 5, 116, 0, 0, 675, 677, 5, 33, 0, 0, 676, 672, 1, 0, 0, 0, 676, 675, 1, 0, 0, 0, 677, 151, 1, 0, 0, 0, 678, 679, 5, 43, 0, 0, 679, 680, 5, 61, 0, 0, 680, 153, 1, 0, 0, 0, 681, 682, 5, 45, 0, 0, 682, 683, 5, 61, 0, 0, 683, 155, 1, 0, 0, 0, 684, 685, 5, 42, 0, 0, 685, 686, 5, 61, 0, 0, 686, 157, 1, 0, 0, 0, 687, 688, 5, 37, 0, 0, 688, 689, 5, 61, 0, 0, 689, 159, 1, 0, 0, 0, 690, 691, 5, 47, 0, 0, 691, 692, 5, 61, 0, 0, 692, 161, 1, 0, 0, 0, 693, 694, 5, 43, 0, 0, 694, 163, 1, 0, 0, 0, 695, 696, 5, 45, 0, 0, 696, 165, 1, 0, 0, 0, 697, 698, 5, 42, 0, 0, 698, 167, 1, 0, 0, 0, 699, 700, 5, 47, 0, 0, 700, 169, 1, 0, 0, 0, 701, 702, 5, 37, 0, 0, 702, 171, 1, 0, 0, 0, 703, 704, 5, 40, 0, 0, 704, 173, 1, 0, 0, 0, 705, 706, 5, 41, 0, 0, 706, 175, 1, 0, 0, 0, 707, 708, 5, 44, 0, 0, 708, 177, 1, 0, 0, 0, 709, 710, 5, 97, 0, 0, 710, 711, 5, 115, 0, 0, 711, 179, 1, 0, 0, 0, 712, 713, 5, 115, 0, 0, 713, 714, 5, 116, 0, 0, 714, 715, 5, 114, 0, 0, 715, 716, 5, 105, 0, 0, 716, 717, 5, 110, 0, 0, 717, 718, 5, 103, 0, 0, 718, 719, 1, 0, 0, 0, 719, 720, 6, 83, 27, 0, 720, 181, 1, 0, 0, 0, 721, 722, 5, 110, 0, 0, 722, 723, 5, 117, 0, 0, 723, 724, 5, 109, 0, 0, 724, 725, 5, 98, 0, 0, 725, 726, 5, 101, 0, 0, 726, 727, 5, 114, 0, 0, 727, 728, 1, 0, 0, 0, 728, 729, 6, 84, 27, 0, 729, 183, 1, 0, 0, 0, 730, 731, 5, 98, 0, 0, 731, 732, 5, 111, 0, 0, 732, 733, 5, 111, 0, 0, 733, 734, 5, 108, 0, 0, 734, 735, 1, 0, 0, 0, 735, 736, 6, 85, 27, 0, 736, 185, 1, 0, 0, 0, 737, 743, 5, 34, 0, 0, 738, 742, 8, 8, 0, 0, 739, 740, 5, 92, 0, 0, 740, 742, 7, 9, 0, 0, 741, 738, 1, 0, 0, 0, 741, 739, 1, 0, 0, 0, 742, 745, 1, 0, 0, 0, 743, 741, 1, 0, 0, 0, 743, 744, 1, 0, 0, 0, 744, 746, 1, 0, 0, 0, 745, 743, 1, 0, 0, 0, 746, 747, 5, 34, 0, 0, 747, 187, 1, 0, 0, 0, 748, 749, 3, 24, 5, 0, 749, 189, 1, 0, 0, 0, 750, 751, 5, 125, 0, 0, 751, 752, 1, 0, 0, 0, 752, 753, 6, 88, 11, 0, 753, 191, 1, 0, 0, 0, 754, 755, 5, 62, 0, 0, 755, 756, 5, 62, 0, 0, 756, 757, 1, 0, 0, 0, 757, 758, 6, 89, 28, 0, 758, 759, 6, 89, 11, 0, 759, 760, 6, 89, 11, 0, 760, 193, 1, 0, 0, 0, 761, 762, 5, 36, 0, 0, 762, 763, 3, 24, 5, 0, 763, 195, 1, 0, 0, 0, 764, 765, 5, 46, 0, 0, 765, 197, 1, 0, 0, 0, 766, 772, 3, 202, 94, 0, 767, 768, 3, 202, 94, 0, 768, 769, 5, 46, 0, 0, 769, 770, 3, 202, 94, 0, 770, 772, 1, 0, 0, 0, 771, 766, 1, 0, 0, 0, 771, 767, 1, 0, 0, 0, 772, 199, 1, 0, 0, 0, 773, 775, 7, 1, 0, 0, 774, 773, 1, 0, 0, 0, 775, 776, 1, 0, 0, 0, 776, 774, 1, 0, 0, 0, 776, 777, 1, 0, 0, 0, 777, 778, 1, 0, 0, 0, 778, 779, 4, 93, 3, 0, 779, 780, 6, 93, 29, 0, 780, 781, 1, 0, 0, 0, 781, 782, 6, 93, 13, 0, 782, 783, 6, 93, 11, 0, 783, 201, 1, 0, 0, 0, 784, 786, 3, 204, 95, 0, 785, 784, 1, 0, 0, 0, 786, 787, 1, 0, 0, 0, 787, 785, 1, 0, 0, 0, 787, 788, 1, 0, 0, 0, 788, 203, 1, 0, 0, 0, 789, 790, 7, 10, 0, 0, 790, 205, 1, 0, 0, 0, 791, 792, 3, 18, 2, 0, 792, 207, 1, 0, 0, 0, 793, 794, 3, 14, 0, 0, 794, 795, 1, 0, 0, 0, 795, 796, 6, 97, 0, 0, 796, 209, 1, 0, 0, 0, 797, 798, 5, 105, 0, 0, 798, 799, 5, 102, 0, 0, 799, 800, 1, 0, 0, 0, 800, 801, 4, 98, 4, 0, 801, 802, 1, 0, 0, 0, 802, 803, 6, 98, 19, 0, 803, 211, 1, 0, 0, 0, 804, 805, 5, 101, 0, 0, 805, 806, 5, 108, 0, 0, 806, 807, 5, 115, 0, 0, 807, 808, 5, 101, 0, 0, 808, 809, 5, 105, 0, 0, 809, 810, 5, 102, 0, 0, 810, 811, 1, 0, 0, 0, 811, 812, 4, 99, 5, 0, 812, 813, 1, 0, 0, 0, 813, 814, 6, 99, 19, 0, 814, 213, 1, 0, 0, 0, 815, 816, 5, 101, 0, 0, 816, 817, 5, 108, 0, 0, 817, 818, 5, 115, 0, 0, 818, 819, 5, 101, 0, 0, 819, 820, 1, 0, 0, 0, 820, 821, 4, 100, 6, 0, 821, 215, 1, 0, 0, 0, 822, 823, 5, 115, 0, 0, 823, 824, 5, 101, 0, 0, 824, 825, 5, 116, 0, 0, 825, 826, 1, 0, 0, 0, 826, 827, 4, 101, 7, 0, 827, 828, 1, 0, 0, 0, 828, 829, 6, 101, 19, 0, 829, 217, 1, 0, 0, 0, 830, 831, 5, 101, 0, 0, 831, 832, 5, 110, 0, 0, 832, 833, 5, 100, 0, 0, 833, 834, 5, 105, 0, 0, 834, 835, 5, 102, 0, 0, 835, 836, 1, 0, 0, 0, 836, 837, 4, 102, 8, 0, 837, 219, 1, 0, 0, 0, 838, 839, 5, 99, 0, 0, 839, 840, 5, 97, 0, 0, 840, 841, 5, 108, 0, 0, 841, 842, 5, 108, 0, 0, 842, 843, 1, 0, 0, 0, 843, 844, 4, 103, 9, 0, 844, 845, 1, 0, 0, 0, 845, 846, 6, 103, 19, 0, 846, 221, 1, 0, 0, 0, 847, 848, 5, 100, 0, 0, 848, 849, 5, 101, 0, 0, 849, 850, 5, 99, 0, 0, 850, 851, 5, 108, 0, 0, 851, 852, 5, 97, 0, 0, 852, 853, 5, 114, 0, 0, 853, 854, 5, 101, 0, 0, 854, 855, 1, 0, 0, 0, 855, 856, 4, 104, 10, 0, 856, 857, 1, 0, 0, 0, 857, 858, 6, 104, 19, 0, 858, 223, 1, 0, 0, 0, 859, 860, 5, 106, 0, 0, 860, 861, 5, 117, 0, 0, 861, 862, 5, 109, 0, 0, 862, 863, 5, 112, 0, 0, 863, 864, 1, 0, 0, 0, 864, 865, 4, 105, 11, 0, 865, 866, 1, 0, 0, 0, 866, 867, 6, 105, 30, 0, 867, 225, 1, 0, 0, 0, 868, 869, 5, 100, 0, 0, 869, 870, 5, 101, 0, 0, 870, 871, 5, 116, 0, 0, 871, 872, 5, 111, 0, 0, 872, 873, 5, 117, 0, 0, 873, 874, 5, 114, 0, 0, 874, 875, 1, 0, 0, 0, 875, 876, 4, 106, 12, 0, 876, 877, 1, 0, 0, 0, 877, 878, 6, 106, 30, 0, 878, 227, 1, 0, 0, 0, 879, 880, 5, 114, 0, 0, 880, 881, 5, 101, 0, 0, 881, 882, 5, 116, 0, 0, 882, 883, 5, 117, 0, 0, 883, 884, 5, 114, 0, 0, 884, 885, 5, 110, 0, 0, 885, 886, 1, 0, 0, 0, 886, 887, 4, 107, 13, 0, 887, 229, 1, 0, 0, 0, 888, 889, 5, 101, 0, 0, 889, 890, 5, 110, 0, 0, 890, 891, 5, 117, 0, 0, 891, 892, 5, 109, 0, 0, 892, 893, 1, 0, 0, 0, 893, 894, 4, 108, 14, 0, 894, 895, 1, 0, 0, 0, 895, 896, 6, 108, 31, 0, 896, 231, 1, 0, 0, 0, 897, 898, 5, 99, 0, 0, 898, 899, 5, 97, 0, 0, 899, 900, 5, 115, 0, 0, 900, 901, 5, 101, 0, 0, 901, 902, 1, 0, 0, 0, 902, 903, 4, 109, 15, 0, 903, 904, 1, 0, 0, 0, 904, 905, 6, 109, 19, 0, 905, 233, 1, 0, 0, 0, 906, 907, 5, 101, 0, 0, 907, 908, 5, 110, 0, 0, 908, 909, 5, 100, 0, 0, 909, 910, 5, 101, 0, 0, 910, 911, 5, 110, 0, 0, 911, 912, 5, 117, 0, 0, 912, 913, 5, 109, 0, 0, 913, 914, 1, 0, 0, 0, 914, 915, 4, 110, 16, 0, 915, 235, 1, 0, 0, 0, 916, 917, 5, 111, 0, 0, 917, 918, 5, 110, 0, 0, 918, 919, 5, 99, 0, 0, 919, 920, 5, 101, 0, 0, 920, 921, 1, 0, 0, 0, 921, 922, 4, 111, 17, 0, 922, 237, 1, 0, 0, 0, 923, 924, 5, 101, 0, 0, 924, 925, 5, 110, 0, 0, 925, 926, 5, 100, 0, 0, 926, 927, 5, 111, 0, 0, 927, 928, 5, 110, 0, 0, 928, 929, 5, 99, 0, 0, 929, 930, 5, 101, 0, 0, 930, 931, 1, 0, 0, 0, 931, 932, 4, 112, 18, 0, 932, 239, 1, 0, 0, 0, 933, 934, 5, 108, 0, 0, 934, 935, 5, 111, 0, 0, 935, 936, 5, 99, 0, 0, 936, 937, 5, 97, 0, 0, 937, 938, 5, 108, 0, 0, 938, 939, 1, 0, 0, 0, 939, 940, 4, 113, 19, 0, 940, 241, 1, 0, 0, 0, 941, 942, 5, 62, 0, 0, 942, 943, 5, 62, 0, 0, 943, 944, 1, 0, 0, 0, 944, 945, 6, 114, 11, 0, 945, 243, 1, 0, 0, 0, 946, 947, 5, 123, 0, 0, 947, 948, 1, 0, 0, 0, 948, 949, 6, 115, 32, 0, 949, 950, 6, 115, 33, 0, 950, 951, 6, 115, 19, 0, 951, 245, 1, 0, 0, 0, 952, 953, 9, 0, 0, 0, 953, 954, 1, 0, 0, 0, 954, 955, 6, 116, 34, 0, 955, 956, 6, 116, 33, 0, 956, 247, 1, 0, 0, 0, 957, 958, 3, 18, 2, 0, 958, 249, 1, 0, 0, 0, 959, 960, 5, 62, 0, 0, 960, 961, 5, 62, 0, 0, 961, 962, 1, 0, 0, 0, 962, 963, 6, 118, 28, 0, 963, 964, 6, 118, 11, 0, 964, 251, 1, 0, 0, 0, 965, 966, 5, 123, 0, 0, 966, 967, 1, 0, 0, 0, 967, 968, 6, 119, 19, 0, 968, 253, 1, 0, 0, 0, 969, 971, 8, 11, 0, 0, 970, 969, 1, 0, 0, 0, 971, 972, 1, 0, 0, 0, 972, 970, 1, 0, 0, 0, 972, 973, 1, 0, 0, 0, 973, 255, 1, 0, 0, 0, 974, 975, 3, 14, 0, 0, 975, 976, 1, 0, 0, 0, 976, 977, 6, 121, 0, 0, 977, 257, 1, 0, 0, 0, 978, 979, 3, 18, 2, 0, 979, 259, 1, 0, 0, 0, 980, 981, 3, 24, 5, 0, 981, 982, 1, 0, 0, 0, 982, 983, 6, 123, 12, 0, 983, 984, 6, 123, 11, 0, 984, 261, 1, 0, 0, 0, 985, 986, 5, 62, 0, 0, 986, 987, 5, 62, 0, 0, 987, 988, 1, 0, 0, 0, 988, 989, 6, 124, 28, 0, 989, 990, 6, 124, 11, 0, 990, 263, 1, 0, 0, 0, 991, 992, 3, 14, 0, 0, 992, 993, 1, 0, 0, 0, 993, 994, 6, 125, 0, 0, 994, 265, 1, 0, 0, 0, 995, 996, 3, 24, 5, 0, 996, 997, 1, 0, 0, 0, 997, 998, 6, 126, 12, 0, 998, 999, 6, 126, 11, 0, 999, 267, 1, 0, 0, 0, 1000, 1001, 3, 68, 27, 0, 1001, 1002, 1, 0, 0, 0, 1002, 1003, 6, 127, 23, 0, 1003, 1004, 6, 127, 10, 0, 1004, 269, 1, 0, 0, 0, 1005, 1006, 5, 62, 0, 0, 1006, 1007, 5, 62, 0, 0, 1007, 1008, 1, 0, 0, 0, 1008, 1009, 6, 128, 28, 0, 1009, 1010, 6, 128, 11, 0, 1010, 271, 1, 0, 0, 0, 53, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 275, 285, 291, 295, 300, 322, 325, 329, 334, 343, 347, 356, 360, 372, 376, 381, 385, 397, 473, 507, 510, 560, 612, 619, 626, 634, 639, 644, 651, 658, 664, 670, 676, 741, 743, 771, 776, 787, 972, 35, 0, 1, 0, 0, 3, 0, 0, 2, 0, 5, 1, 0, 5, 2, 0, 5, 4, 0, 5, 3, 0, 5, 8, 0, 1, 12, 0, 7, 11, 0, 2, 9, 0, 4, 0, 0, 7, 9, 0, 7, 6, 0, 7, 5, 0, 5, 10, 0, 7, 12, 0, 5, 7, 0, 5, 5, 0, 5, 9, 0, 7, 24, 0, 5, 6, 0, 2, 7, 0, 7, 20, 0, 7, 19, 0, 7, 82, 0, 7, 69, 0, 7, 62, 0, 7, 85, 0, 1, 93, 1, 5, 13, 0, 5, 12, 0, 7, 87, 0, 2, 11, 0, 7, 88, 0] \ No newline at end of file diff --git a/crates/compiler/src/parser/generated/YarnSpinnerLexer.tokens b/crates/compiler/src/parser/generated/YarnSpinnerLexer.tokens index 72d448475..5c13a89ae 100644 --- a/crates/compiler/src/parser/generated/YarnSpinnerLexer.tokens +++ b/crates/compiler/src/parser/generated/YarnSpinnerLexer.tokens @@ -4,111 +4,130 @@ BLANK_LINE_FOLLOWING_OPTION=3 WS=4 COMMENT=5 NEWLINE=6 -ID=7 -BODY_START=8 -HEADER_DELIMITER=9 -HASHTAG=10 -REST_OF_LINE=11 -BODY_WS=12 -BODY_END=13 -SHORTCUT_ARROW=14 -COMMAND_START=15 -EXPRESSION_START=16 -ESCAPED_ANY=17 -TEXT_ESCAPE=18 -TEXT_COMMENT=19 -TEXT=20 -UNESCAPABLE_CHARACTER=21 -TEXT_COMMANDHASHTAG_WS=22 -TEXT_COMMANDHASHTAG_COMMENT=23 -TEXT_COMMANDHASHTAG_ERROR=24 -HASHTAG_WS=25 -HASHTAG_TEXT=26 -EXPR_WS=27 -KEYWORD_TRUE=28 -KEYWORD_FALSE=29 -KEYWORD_NULL=30 -OPERATOR_ASSIGNMENT=31 -OPERATOR_LOGICAL_LESS_THAN_EQUALS=32 -OPERATOR_LOGICAL_GREATER_THAN_EQUALS=33 -OPERATOR_LOGICAL_EQUALS=34 -OPERATOR_LOGICAL_LESS=35 -OPERATOR_LOGICAL_GREATER=36 -OPERATOR_LOGICAL_NOT_EQUALS=37 -OPERATOR_LOGICAL_AND=38 -OPERATOR_LOGICAL_OR=39 -OPERATOR_LOGICAL_XOR=40 -OPERATOR_LOGICAL_NOT=41 -OPERATOR_MATHS_ADDITION_EQUALS=42 -OPERATOR_MATHS_SUBTRACTION_EQUALS=43 -OPERATOR_MATHS_MULTIPLICATION_EQUALS=44 -OPERATOR_MATHS_MODULUS_EQUALS=45 -OPERATOR_MATHS_DIVISION_EQUALS=46 -OPERATOR_MATHS_ADDITION=47 -OPERATOR_MATHS_SUBTRACTION=48 -OPERATOR_MATHS_MULTIPLICATION=49 -OPERATOR_MATHS_DIVISION=50 -OPERATOR_MATHS_MODULUS=51 -LPAREN=52 -RPAREN=53 -COMMA=54 -EXPRESSION_AS=55 -STRING=56 -FUNC_ID=57 -EXPRESSION_END=58 -VAR_ID=59 -DOT=60 -NUMBER=61 -COMMAND_NEWLINE=62 -COMMAND_WS=63 -COMMAND_IF=64 -COMMAND_ELSEIF=65 -COMMAND_ELSE=66 -COMMAND_SET=67 -COMMAND_ENDIF=68 -COMMAND_CALL=69 -COMMAND_DECLARE=70 -COMMAND_JUMP=71 -COMMAND_ENUM=72 -COMMAND_CASE=73 -COMMAND_ENDENUM=74 -COMMAND_LOCAL=75 -COMMAND_END=76 -COMMAND_TEXT_NEWLINE=77 -COMMAND_TEXT_END=78 -COMMAND_EXPRESSION_START=79 -COMMAND_TEXT=80 -COMMAND_ID_NEWLINE=81 -TYPE_STRING=82 -TYPE_NUMBER=83 -TYPE_BOOL=84 -'---'=8 -'#'=10 -'==='=13 -'->'=14 -'<<'=15 -'\\'=18 -'true'=28 -'false'=29 -'null'=30 -'+='=42 -'-='=43 -'*='=44 -'%='=45 -'/='=46 -'+'=47 -'-'=48 -'*'=49 -'/'=50 -'%'=51 -'('=52 -')'=53 -','=54 -'as'=55 -'string'=82 -'number'=83 -'bool'=84 -'}'=58 -'.'=60 -'endif'=68 -'{'=79 +HEADER_WHEN=7 +HEADER_TITLE=8 +ID=9 +BODY_START=10 +HEADER_DELIMITER=11 +HASHTAG=12 +HEADER_WHEN_UNKNOWN=13 +REST_OF_LINE=14 +BODY_WS=15 +BODY_END=16 +SHORTCUT_ARROW=17 +LINE_GROUP_ARROW=18 +COMMAND_START=19 +EXPRESSION_START=20 +ESCAPED_ANY=21 +TEXT_ESCAPE=22 +TEXT_COMMENT=23 +TEXT=24 +UNESCAPABLE_CHARACTER=25 +TEXT_COMMANDHASHTAG_WS=26 +TEXT_COMMANDHASHTAG_COMMENT=27 +TEXT_COMMANDHASHTAG_ERROR=28 +HASHTAG_WS=29 +HASHTAG_TEXT=30 +EXPR_WS=31 +EXPRESSION_WHEN_ALWAYS=32 +KEYWORD_TRUE=33 +KEYWORD_FALSE=34 +KEYWORD_NULL=35 +OPERATOR_ASSIGNMENT=36 +OPERATOR_LOGICAL_LESS_THAN_EQUALS=37 +OPERATOR_LOGICAL_GREATER_THAN_EQUALS=38 +OPERATOR_LOGICAL_EQUALS=39 +OPERATOR_LOGICAL_LESS=40 +OPERATOR_LOGICAL_GREATER=41 +OPERATOR_LOGICAL_NOT_EQUALS=42 +OPERATOR_LOGICAL_AND=43 +OPERATOR_LOGICAL_OR=44 +OPERATOR_LOGICAL_XOR=45 +OPERATOR_LOGICAL_NOT=46 +OPERATOR_MATHS_ADDITION_EQUALS=47 +OPERATOR_MATHS_SUBTRACTION_EQUALS=48 +OPERATOR_MATHS_MULTIPLICATION_EQUALS=49 +OPERATOR_MATHS_MODULUS_EQUALS=50 +OPERATOR_MATHS_DIVISION_EQUALS=51 +OPERATOR_MATHS_ADDITION=52 +OPERATOR_MATHS_SUBTRACTION=53 +OPERATOR_MATHS_MULTIPLICATION=54 +OPERATOR_MATHS_DIVISION=55 +OPERATOR_MATHS_MODULUS=56 +LPAREN=57 +RPAREN=58 +COMMA=59 +EXPRESSION_AS=60 +STRING=61 +FUNC_ID=62 +EXPRESSION_END=63 +VAR_ID=64 +DOT=65 +NUMBER=66 +COMMAND_NEWLINE=67 +COMMAND_WS=68 +COMMAND_IF=69 +COMMAND_ELSEIF=70 +COMMAND_ELSE=71 +COMMAND_SET=72 +COMMAND_ENDIF=73 +COMMAND_CALL=74 +COMMAND_DECLARE=75 +COMMAND_JUMP=76 +COMMAND_DETOUR=77 +COMMAND_RETURN=78 +COMMAND_ENUM=79 +COMMAND_CASE=80 +COMMAND_ENDENUM=81 +COMMAND_ONCE=82 +COMMAND_ENDONCE=83 +COMMAND_LOCAL=84 +COMMAND_END=85 +COMMAND_TEXT_NEWLINE=86 +COMMAND_EXPRESSION_START=87 +COMMAND_TEXT=88 +COMMAND_ID_WS=89 +COMMAND_ID_NEWLINE=90 +COMMAND_ID_OR_EXPRESSION_WS=91 +TYPE_STRING=92 +TYPE_NUMBER=93 +TYPE_BOOL=94 +'when'=7 +'title'=8 +'---'=10 +'#'=12 +'==='=16 +'->'=17 +'=>'=18 +'<<'=19 +'always'=32 +'true'=33 +'false'=34 +'null'=35 +'+='=47 +'-='=48 +'*='=49 +'%='=50 +'/='=51 +'+'=52 +'-'=53 +'*'=54 +'/'=55 +'%'=56 +'('=57 +')'=58 +','=59 +'as'=60 +'string'=92 +'number'=93 +'bool'=94 +'}'=63 +'.'=65 +'else'=71 +'endif'=73 +'return'=78 +'endenum'=81 +'once'=82 +'endonce'=83 +'local'=84 +'{'=87 diff --git a/crates/compiler/src/parser/generated/YarnSpinnerParser.interp b/crates/compiler/src/parser/generated/YarnSpinnerParser.interp index 3d90fc51c..278fcee24 100644 --- a/crates/compiler/src/parser/generated/YarnSpinnerParser.interp +++ b/crates/compiler/src/parser/generated/YarnSpinnerParser.interp @@ -6,18 +6,21 @@ null null null null +'when' +'title' null '---' null '#' null null +null '===' '->' +'=>' '<<' null null -'\\' null null null @@ -27,6 +30,8 @@ null null null null +null +'always' 'true' 'false' 'null' @@ -65,20 +70,25 @@ null null null null -null +'else' null 'endif' null null null null +'return' null null +'endenum' +'once' +'endonce' +'local' null null +'{' null null -'{' null null 'string' @@ -93,14 +103,18 @@ BLANK_LINE_FOLLOWING_OPTION WS COMMENT NEWLINE +HEADER_WHEN +HEADER_TITLE ID BODY_START HEADER_DELIMITER HASHTAG +HEADER_WHEN_UNKNOWN REST_OF_LINE BODY_WS BODY_END SHORTCUT_ARROW +LINE_GROUP_ARROW COMMAND_START EXPRESSION_START ESCAPED_ANY @@ -114,6 +128,7 @@ TEXT_COMMANDHASHTAG_ERROR HASHTAG_WS HASHTAG_TEXT EXPR_WS +EXPRESSION_WHEN_ALWAYS KEYWORD_TRUE KEYWORD_FALSE KEYWORD_NULL @@ -158,16 +173,21 @@ COMMAND_ENDIF COMMAND_CALL COMMAND_DECLARE COMMAND_JUMP +COMMAND_DETOUR +COMMAND_RETURN COMMAND_ENUM COMMAND_CASE COMMAND_ENDENUM +COMMAND_ONCE +COMMAND_ENDONCE COMMAND_LOCAL COMMAND_END COMMAND_TEXT_NEWLINE -COMMAND_TEXT_END COMMAND_EXPRESSION_START COMMAND_TEXT +COMMAND_ID_WS COMMAND_ID_NEWLINE +COMMAND_ID_OR_EXPRESSION_WS TYPE_STRING TYPE_NUMBER TYPE_BOOL @@ -176,7 +196,10 @@ rule names: dialogue file_hashtag node +title_header +when_header header +header_when_expression body statement line_statement @@ -187,6 +210,7 @@ expression value variable function_call +typeMemberReference if_statement if_clause else_if_clause @@ -197,9 +221,19 @@ command_statement command_formatted_text shortcut_option_statement shortcut_option +line_group_statement +line_group_item declare_statement +enum_statement +enum_case_statement jump_statement +return_statement +once_statement +once_primary_clause +once_alternate_clause +structured_command +structured_command_value atn: -[4, 1, 84, 315, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 1, 0, 5, 0, 54, 8, 0, 10, 0, 12, 0, 57, 9, 0, 1, 0, 4, 0, 60, 8, 0, 11, 0, 12, 0, 61, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 68, 8, 2, 11, 2, 12, 2, 69, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 3, 3, 79, 8, 3, 1, 4, 5, 4, 82, 8, 4, 10, 4, 12, 4, 85, 9, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 97, 8, 5, 10, 5, 12, 5, 100, 9, 5, 1, 5, 3, 5, 103, 8, 5, 1, 6, 1, 6, 3, 6, 107, 8, 6, 1, 6, 5, 6, 110, 8, 6, 10, 6, 12, 6, 113, 9, 6, 1, 6, 1, 6, 1, 7, 4, 7, 118, 8, 7, 11, 7, 12, 7, 119, 1, 7, 1, 7, 1, 7, 1, 7, 4, 7, 126, 8, 7, 11, 7, 12, 7, 127, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 148, 8, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 5, 10, 165, 8, 10, 10, 10, 12, 10, 168, 9, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 177, 8, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 3, 13, 184, 8, 13, 1, 13, 1, 13, 5, 13, 188, 8, 13, 10, 13, 12, 13, 191, 9, 13, 1, 13, 1, 13, 1, 14, 1, 14, 5, 14, 197, 8, 14, 10, 14, 12, 14, 200, 9, 14, 1, 14, 3, 14, 203, 8, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 214, 8, 15, 10, 15, 12, 15, 217, 9, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 224, 8, 16, 10, 16, 12, 16, 227, 9, 16, 1, 17, 1, 17, 1, 17, 1, 17, 5, 17, 233, 8, 17, 10, 17, 12, 17, 236, 9, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 5, 20, 254, 8, 20, 10, 20, 12, 20, 257, 9, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 5, 21, 264, 8, 21, 10, 21, 12, 21, 267, 9, 21, 1, 22, 5, 22, 270, 8, 22, 10, 22, 12, 22, 273, 9, 22, 1, 22, 1, 22, 3, 22, 277, 8, 22, 1, 23, 1, 23, 1, 23, 1, 23, 5, 23, 283, 8, 23, 10, 23, 12, 23, 286, 9, 23, 1, 23, 3, 23, 289, 8, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 3, 24, 298, 8, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 3, 25, 313, 8, 25, 1, 25, 0, 1, 20, 26, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 0, 6, 1, 0, 49, 51, 1, 0, 47, 48, 2, 0, 32, 33, 35, 36, 2, 0, 34, 34, 37, 37, 1, 0, 38, 40, 2, 0, 31, 31, 42, 46, 337, 0, 55, 1, 0, 0, 0, 2, 63, 1, 0, 0, 0, 4, 67, 1, 0, 0, 0, 6, 75, 1, 0, 0, 0, 8, 83, 1, 0, 0, 0, 10, 102, 1, 0, 0, 0, 12, 104, 1, 0, 0, 0, 14, 125, 1, 0, 0, 0, 16, 129, 1, 0, 0, 0, 18, 132, 1, 0, 0, 0, 20, 147, 1, 0, 0, 0, 22, 176, 1, 0, 0, 0, 24, 178, 1, 0, 0, 0, 26, 180, 1, 0, 0, 0, 28, 194, 1, 0, 0, 0, 30, 208, 1, 0, 0, 0, 32, 218, 1, 0, 0, 0, 34, 228, 1, 0, 0, 0, 36, 237, 1, 0, 0, 0, 38, 244, 1, 0, 0, 0, 40, 249, 1, 0, 0, 0, 42, 265, 1, 0, 0, 0, 44, 271, 1, 0, 0, 0, 46, 278, 1, 0, 0, 0, 48, 290, 1, 0, 0, 0, 50, 312, 1, 0, 0, 0, 52, 54, 3, 2, 1, 0, 53, 52, 1, 0, 0, 0, 54, 57, 1, 0, 0, 0, 55, 53, 1, 0, 0, 0, 55, 56, 1, 0, 0, 0, 56, 59, 1, 0, 0, 0, 57, 55, 1, 0, 0, 0, 58, 60, 3, 4, 2, 0, 59, 58, 1, 0, 0, 0, 60, 61, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 61, 62, 1, 0, 0, 0, 62, 1, 1, 0, 0, 0, 63, 64, 5, 10, 0, 0, 64, 65, 5, 26, 0, 0, 65, 3, 1, 0, 0, 0, 66, 68, 3, 6, 3, 0, 67, 66, 1, 0, 0, 0, 68, 69, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 69, 70, 1, 0, 0, 0, 70, 71, 1, 0, 0, 0, 71, 72, 5, 8, 0, 0, 72, 73, 3, 8, 4, 0, 73, 74, 5, 13, 0, 0, 74, 5, 1, 0, 0, 0, 75, 76, 5, 7, 0, 0, 76, 78, 5, 9, 0, 0, 77, 79, 5, 11, 0, 0, 78, 77, 1, 0, 0, 0, 78, 79, 1, 0, 0, 0, 79, 7, 1, 0, 0, 0, 80, 82, 3, 10, 5, 0, 81, 80, 1, 0, 0, 0, 82, 85, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 9, 1, 0, 0, 0, 85, 83, 1, 0, 0, 0, 86, 103, 3, 12, 6, 0, 87, 103, 3, 28, 14, 0, 88, 103, 3, 36, 18, 0, 89, 103, 3, 44, 22, 0, 90, 103, 3, 38, 19, 0, 91, 103, 3, 40, 20, 0, 92, 103, 3, 48, 24, 0, 93, 103, 3, 50, 25, 0, 94, 98, 5, 1, 0, 0, 95, 97, 3, 10, 5, 0, 96, 95, 1, 0, 0, 0, 97, 100, 1, 0, 0, 0, 98, 96, 1, 0, 0, 0, 98, 99, 1, 0, 0, 0, 99, 101, 1, 0, 0, 0, 100, 98, 1, 0, 0, 0, 101, 103, 5, 2, 0, 0, 102, 86, 1, 0, 0, 0, 102, 87, 1, 0, 0, 0, 102, 88, 1, 0, 0, 0, 102, 89, 1, 0, 0, 0, 102, 90, 1, 0, 0, 0, 102, 91, 1, 0, 0, 0, 102, 92, 1, 0, 0, 0, 102, 93, 1, 0, 0, 0, 102, 94, 1, 0, 0, 0, 103, 11, 1, 0, 0, 0, 104, 106, 3, 14, 7, 0, 105, 107, 3, 18, 9, 0, 106, 105, 1, 0, 0, 0, 106, 107, 1, 0, 0, 0, 107, 111, 1, 0, 0, 0, 108, 110, 3, 16, 8, 0, 109, 108, 1, 0, 0, 0, 110, 113, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 114, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, 115, 5, 6, 0, 0, 115, 13, 1, 0, 0, 0, 116, 118, 5, 20, 0, 0, 117, 116, 1, 0, 0, 0, 118, 119, 1, 0, 0, 0, 119, 117, 1, 0, 0, 0, 119, 120, 1, 0, 0, 0, 120, 126, 1, 0, 0, 0, 121, 122, 5, 16, 0, 0, 122, 123, 3, 20, 10, 0, 123, 124, 5, 58, 0, 0, 124, 126, 1, 0, 0, 0, 125, 117, 1, 0, 0, 0, 125, 121, 1, 0, 0, 0, 126, 127, 1, 0, 0, 0, 127, 125, 1, 0, 0, 0, 127, 128, 1, 0, 0, 0, 128, 15, 1, 0, 0, 0, 129, 130, 5, 10, 0, 0, 130, 131, 5, 26, 0, 0, 131, 17, 1, 0, 0, 0, 132, 133, 5, 15, 0, 0, 133, 134, 5, 64, 0, 0, 134, 135, 3, 20, 10, 0, 135, 136, 5, 76, 0, 0, 136, 19, 1, 0, 0, 0, 137, 138, 6, 10, -1, 0, 138, 139, 5, 52, 0, 0, 139, 140, 3, 20, 10, 0, 140, 141, 5, 53, 0, 0, 141, 148, 1, 0, 0, 0, 142, 143, 5, 48, 0, 0, 143, 148, 3, 20, 10, 8, 144, 145, 5, 41, 0, 0, 145, 148, 3, 20, 10, 7, 146, 148, 3, 22, 11, 0, 147, 137, 1, 0, 0, 0, 147, 142, 1, 0, 0, 0, 147, 144, 1, 0, 0, 0, 147, 146, 1, 0, 0, 0, 148, 166, 1, 0, 0, 0, 149, 150, 10, 6, 0, 0, 150, 151, 7, 0, 0, 0, 151, 165, 3, 20, 10, 7, 152, 153, 10, 5, 0, 0, 153, 154, 7, 1, 0, 0, 154, 165, 3, 20, 10, 6, 155, 156, 10, 4, 0, 0, 156, 157, 7, 2, 0, 0, 157, 165, 3, 20, 10, 5, 158, 159, 10, 3, 0, 0, 159, 160, 7, 3, 0, 0, 160, 165, 3, 20, 10, 4, 161, 162, 10, 2, 0, 0, 162, 163, 7, 4, 0, 0, 163, 165, 3, 20, 10, 3, 164, 149, 1, 0, 0, 0, 164, 152, 1, 0, 0, 0, 164, 155, 1, 0, 0, 0, 164, 158, 1, 0, 0, 0, 164, 161, 1, 0, 0, 0, 165, 168, 1, 0, 0, 0, 166, 164, 1, 0, 0, 0, 166, 167, 1, 0, 0, 0, 167, 21, 1, 0, 0, 0, 168, 166, 1, 0, 0, 0, 169, 177, 5, 61, 0, 0, 170, 177, 5, 28, 0, 0, 171, 177, 5, 29, 0, 0, 172, 177, 3, 24, 12, 0, 173, 177, 5, 56, 0, 0, 174, 177, 5, 30, 0, 0, 175, 177, 3, 26, 13, 0, 176, 169, 1, 0, 0, 0, 176, 170, 1, 0, 0, 0, 176, 171, 1, 0, 0, 0, 176, 172, 1, 0, 0, 0, 176, 173, 1, 0, 0, 0, 176, 174, 1, 0, 0, 0, 176, 175, 1, 0, 0, 0, 177, 23, 1, 0, 0, 0, 178, 179, 5, 59, 0, 0, 179, 25, 1, 0, 0, 0, 180, 181, 5, 57, 0, 0, 181, 183, 5, 52, 0, 0, 182, 184, 3, 20, 10, 0, 183, 182, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 189, 1, 0, 0, 0, 185, 186, 5, 54, 0, 0, 186, 188, 3, 20, 10, 0, 187, 185, 1, 0, 0, 0, 188, 191, 1, 0, 0, 0, 189, 187, 1, 0, 0, 0, 189, 190, 1, 0, 0, 0, 190, 192, 1, 0, 0, 0, 191, 189, 1, 0, 0, 0, 192, 193, 5, 53, 0, 0, 193, 27, 1, 0, 0, 0, 194, 198, 3, 30, 15, 0, 195, 197, 3, 32, 16, 0, 196, 195, 1, 0, 0, 0, 197, 200, 1, 0, 0, 0, 198, 196, 1, 0, 0, 0, 198, 199, 1, 0, 0, 0, 199, 202, 1, 0, 0, 0, 200, 198, 1, 0, 0, 0, 201, 203, 3, 34, 17, 0, 202, 201, 1, 0, 0, 0, 202, 203, 1, 0, 0, 0, 203, 204, 1, 0, 0, 0, 204, 205, 5, 15, 0, 0, 205, 206, 5, 68, 0, 0, 206, 207, 5, 76, 0, 0, 207, 29, 1, 0, 0, 0, 208, 209, 5, 15, 0, 0, 209, 210, 5, 64, 0, 0, 210, 211, 3, 20, 10, 0, 211, 215, 5, 76, 0, 0, 212, 214, 3, 10, 5, 0, 213, 212, 1, 0, 0, 0, 214, 217, 1, 0, 0, 0, 215, 213, 1, 0, 0, 0, 215, 216, 1, 0, 0, 0, 216, 31, 1, 0, 0, 0, 217, 215, 1, 0, 0, 0, 218, 219, 5, 15, 0, 0, 219, 220, 5, 65, 0, 0, 220, 221, 3, 20, 10, 0, 221, 225, 5, 76, 0, 0, 222, 224, 3, 10, 5, 0, 223, 222, 1, 0, 0, 0, 224, 227, 1, 0, 0, 0, 225, 223, 1, 0, 0, 0, 225, 226, 1, 0, 0, 0, 226, 33, 1, 0, 0, 0, 227, 225, 1, 0, 0, 0, 228, 229, 5, 15, 0, 0, 229, 230, 5, 66, 0, 0, 230, 234, 5, 76, 0, 0, 231, 233, 3, 10, 5, 0, 232, 231, 1, 0, 0, 0, 233, 236, 1, 0, 0, 0, 234, 232, 1, 0, 0, 0, 234, 235, 1, 0, 0, 0, 235, 35, 1, 0, 0, 0, 236, 234, 1, 0, 0, 0, 237, 238, 5, 15, 0, 0, 238, 239, 5, 67, 0, 0, 239, 240, 3, 24, 12, 0, 240, 241, 7, 5, 0, 0, 241, 242, 3, 20, 10, 0, 242, 243, 5, 76, 0, 0, 243, 37, 1, 0, 0, 0, 244, 245, 5, 15, 0, 0, 245, 246, 5, 69, 0, 0, 246, 247, 3, 26, 13, 0, 247, 248, 5, 76, 0, 0, 248, 39, 1, 0, 0, 0, 249, 250, 5, 15, 0, 0, 250, 251, 3, 42, 21, 0, 251, 255, 5, 78, 0, 0, 252, 254, 3, 16, 8, 0, 253, 252, 1, 0, 0, 0, 254, 257, 1, 0, 0, 0, 255, 253, 1, 0, 0, 0, 255, 256, 1, 0, 0, 0, 256, 41, 1, 0, 0, 0, 257, 255, 1, 0, 0, 0, 258, 264, 5, 80, 0, 0, 259, 260, 5, 79, 0, 0, 260, 261, 3, 20, 10, 0, 261, 262, 5, 58, 0, 0, 262, 264, 1, 0, 0, 0, 263, 258, 1, 0, 0, 0, 263, 259, 1, 0, 0, 0, 264, 267, 1, 0, 0, 0, 265, 263, 1, 0, 0, 0, 265, 266, 1, 0, 0, 0, 266, 43, 1, 0, 0, 0, 267, 265, 1, 0, 0, 0, 268, 270, 3, 46, 23, 0, 269, 268, 1, 0, 0, 0, 270, 273, 1, 0, 0, 0, 271, 269, 1, 0, 0, 0, 271, 272, 1, 0, 0, 0, 272, 274, 1, 0, 0, 0, 273, 271, 1, 0, 0, 0, 274, 276, 3, 46, 23, 0, 275, 277, 5, 3, 0, 0, 276, 275, 1, 0, 0, 0, 276, 277, 1, 0, 0, 0, 277, 45, 1, 0, 0, 0, 278, 279, 5, 14, 0, 0, 279, 288, 3, 12, 6, 0, 280, 284, 5, 1, 0, 0, 281, 283, 3, 10, 5, 0, 282, 281, 1, 0, 0, 0, 283, 286, 1, 0, 0, 0, 284, 282, 1, 0, 0, 0, 284, 285, 1, 0, 0, 0, 285, 287, 1, 0, 0, 0, 286, 284, 1, 0, 0, 0, 287, 289, 5, 2, 0, 0, 288, 280, 1, 0, 0, 0, 288, 289, 1, 0, 0, 0, 289, 47, 1, 0, 0, 0, 290, 291, 5, 15, 0, 0, 291, 292, 5, 70, 0, 0, 292, 293, 3, 24, 12, 0, 293, 294, 5, 31, 0, 0, 294, 297, 3, 22, 11, 0, 295, 296, 5, 55, 0, 0, 296, 298, 5, 57, 0, 0, 297, 295, 1, 0, 0, 0, 297, 298, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 300, 5, 76, 0, 0, 300, 49, 1, 0, 0, 0, 301, 302, 5, 15, 0, 0, 302, 303, 5, 71, 0, 0, 303, 304, 5, 7, 0, 0, 304, 313, 5, 76, 0, 0, 305, 306, 5, 15, 0, 0, 306, 307, 5, 71, 0, 0, 307, 308, 5, 16, 0, 0, 308, 309, 3, 20, 10, 0, 309, 310, 5, 58, 0, 0, 310, 311, 5, 76, 0, 0, 311, 313, 1, 0, 0, 0, 312, 301, 1, 0, 0, 0, 312, 305, 1, 0, 0, 0, 313, 51, 1, 0, 0, 0, 32, 55, 61, 69, 78, 83, 98, 102, 106, 111, 119, 125, 127, 147, 164, 166, 176, 183, 189, 198, 202, 215, 225, 234, 255, 263, 265, 271, 276, 284, 288, 297, 312] \ No newline at end of file +[4, 1, 94, 487, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 1, 0, 5, 0, 82, 8, 0, 10, 0, 12, 0, 85, 9, 0, 1, 0, 4, 0, 88, 8, 0, 11, 0, 12, 0, 89, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 4, 2, 98, 8, 2, 11, 2, 12, 2, 99, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 3, 5, 119, 8, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 126, 8, 6, 3, 6, 128, 8, 6, 1, 7, 5, 7, 131, 8, 7, 10, 7, 12, 7, 134, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 5, 8, 150, 8, 8, 10, 8, 12, 8, 153, 9, 8, 1, 8, 3, 8, 156, 8, 8, 1, 9, 1, 9, 3, 9, 160, 8, 9, 1, 9, 5, 9, 163, 8, 9, 10, 9, 12, 9, 166, 9, 9, 1, 9, 1, 9, 1, 10, 4, 10, 171, 8, 10, 11, 10, 12, 10, 172, 1, 10, 1, 10, 1, 10, 1, 10, 4, 10, 179, 8, 10, 11, 10, 12, 10, 180, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 195, 8, 12, 1, 12, 3, 12, 198, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 210, 8, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 5, 13, 227, 8, 13, 10, 13, 12, 13, 230, 9, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 239, 8, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 3, 16, 246, 8, 16, 1, 16, 1, 16, 5, 16, 250, 8, 16, 10, 16, 12, 16, 253, 9, 16, 1, 16, 1, 16, 1, 17, 3, 17, 258, 8, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 5, 18, 265, 8, 18, 10, 18, 12, 18, 268, 9, 18, 1, 18, 3, 18, 271, 8, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 5, 19, 282, 8, 19, 10, 19, 12, 19, 285, 9, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 5, 20, 292, 8, 20, 10, 20, 12, 20, 295, 9, 20, 1, 21, 1, 21, 1, 21, 1, 21, 5, 21, 301, 8, 21, 10, 21, 12, 21, 304, 9, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 5, 24, 322, 8, 24, 10, 24, 12, 24, 325, 9, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 4, 25, 332, 8, 25, 11, 25, 12, 25, 333, 1, 26, 5, 26, 337, 8, 26, 10, 26, 12, 26, 340, 9, 26, 1, 26, 1, 26, 3, 26, 344, 8, 26, 1, 27, 1, 27, 1, 27, 1, 27, 5, 27, 350, 8, 27, 10, 27, 12, 27, 353, 9, 27, 1, 27, 3, 27, 356, 8, 27, 1, 28, 5, 28, 359, 8, 28, 10, 28, 12, 28, 362, 9, 28, 1, 28, 1, 28, 3, 28, 366, 8, 28, 1, 29, 1, 29, 1, 29, 1, 29, 5, 29, 372, 8, 29, 10, 29, 12, 29, 375, 9, 29, 1, 29, 3, 29, 378, 8, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 3, 30, 387, 8, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 4, 31, 396, 8, 31, 11, 31, 12, 31, 397, 1, 31, 1, 31, 1, 31, 1, 31, 1, 32, 3, 32, 405, 8, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 3, 32, 412, 8, 32, 1, 32, 1, 32, 3, 32, 416, 8, 32, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 3, 33, 440, 8, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 3, 35, 448, 8, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 3, 36, 458, 8, 36, 1, 36, 1, 36, 5, 36, 462, 8, 36, 10, 36, 12, 36, 465, 9, 36, 1, 37, 1, 37, 1, 37, 1, 37, 5, 37, 471, 8, 37, 10, 37, 12, 37, 474, 9, 37, 1, 38, 1, 38, 5, 38, 478, 8, 38, 10, 38, 12, 38, 481, 9, 38, 1, 39, 1, 39, 3, 39, 485, 8, 39, 1, 39, 0, 1, 26, 40, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 0, 6, 1, 0, 54, 56, 1, 0, 52, 53, 2, 0, 37, 38, 40, 41, 2, 0, 39, 39, 42, 42, 1, 0, 43, 45, 2, 0, 36, 36, 47, 51, 523, 0, 83, 1, 0, 0, 0, 2, 91, 1, 0, 0, 0, 4, 97, 1, 0, 0, 0, 6, 105, 1, 0, 0, 0, 8, 110, 1, 0, 0, 0, 10, 115, 1, 0, 0, 0, 12, 127, 1, 0, 0, 0, 14, 132, 1, 0, 0, 0, 16, 155, 1, 0, 0, 0, 18, 157, 1, 0, 0, 0, 20, 178, 1, 0, 0, 0, 22, 182, 1, 0, 0, 0, 24, 197, 1, 0, 0, 0, 26, 209, 1, 0, 0, 0, 28, 238, 1, 0, 0, 0, 30, 240, 1, 0, 0, 0, 32, 242, 1, 0, 0, 0, 34, 257, 1, 0, 0, 0, 36, 262, 1, 0, 0, 0, 38, 276, 1, 0, 0, 0, 40, 286, 1, 0, 0, 0, 42, 296, 1, 0, 0, 0, 44, 305, 1, 0, 0, 0, 46, 312, 1, 0, 0, 0, 48, 317, 1, 0, 0, 0, 50, 331, 1, 0, 0, 0, 52, 338, 1, 0, 0, 0, 54, 345, 1, 0, 0, 0, 56, 360, 1, 0, 0, 0, 58, 367, 1, 0, 0, 0, 60, 379, 1, 0, 0, 0, 62, 390, 1, 0, 0, 0, 64, 404, 1, 0, 0, 0, 66, 439, 1, 0, 0, 0, 68, 441, 1, 0, 0, 0, 70, 445, 1, 0, 0, 0, 72, 453, 1, 0, 0, 0, 74, 466, 1, 0, 0, 0, 76, 475, 1, 0, 0, 0, 78, 484, 1, 0, 0, 0, 80, 82, 3, 2, 1, 0, 81, 80, 1, 0, 0, 0, 82, 85, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 87, 1, 0, 0, 0, 85, 83, 1, 0, 0, 0, 86, 88, 3, 4, 2, 0, 87, 86, 1, 0, 0, 0, 88, 89, 1, 0, 0, 0, 89, 87, 1, 0, 0, 0, 89, 90, 1, 0, 0, 0, 90, 1, 1, 0, 0, 0, 91, 92, 5, 12, 0, 0, 92, 93, 5, 30, 0, 0, 93, 3, 1, 0, 0, 0, 94, 98, 3, 10, 5, 0, 95, 98, 3, 8, 4, 0, 96, 98, 3, 6, 3, 0, 97, 94, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 97, 96, 1, 0, 0, 0, 98, 99, 1, 0, 0, 0, 99, 97, 1, 0, 0, 0, 99, 100, 1, 0, 0, 0, 100, 101, 1, 0, 0, 0, 101, 102, 5, 10, 0, 0, 102, 103, 3, 14, 7, 0, 103, 104, 5, 16, 0, 0, 104, 5, 1, 0, 0, 0, 105, 106, 5, 8, 0, 0, 106, 107, 5, 11, 0, 0, 107, 108, 5, 9, 0, 0, 108, 109, 5, 6, 0, 0, 109, 7, 1, 0, 0, 0, 110, 111, 5, 7, 0, 0, 111, 112, 5, 11, 0, 0, 112, 113, 3, 12, 6, 0, 113, 114, 5, 6, 0, 0, 114, 9, 1, 0, 0, 0, 115, 116, 5, 9, 0, 0, 116, 118, 5, 11, 0, 0, 117, 119, 5, 14, 0, 0, 118, 117, 1, 0, 0, 0, 118, 119, 1, 0, 0, 0, 119, 11, 1, 0, 0, 0, 120, 128, 3, 26, 13, 0, 121, 128, 5, 32, 0, 0, 122, 125, 5, 82, 0, 0, 123, 124, 5, 69, 0, 0, 124, 126, 3, 26, 13, 0, 125, 123, 1, 0, 0, 0, 125, 126, 1, 0, 0, 0, 126, 128, 1, 0, 0, 0, 127, 120, 1, 0, 0, 0, 127, 121, 1, 0, 0, 0, 127, 122, 1, 0, 0, 0, 128, 13, 1, 0, 0, 0, 129, 131, 3, 16, 8, 0, 130, 129, 1, 0, 0, 0, 131, 134, 1, 0, 0, 0, 132, 130, 1, 0, 0, 0, 132, 133, 1, 0, 0, 0, 133, 15, 1, 0, 0, 0, 134, 132, 1, 0, 0, 0, 135, 156, 3, 18, 9, 0, 136, 156, 3, 36, 18, 0, 137, 156, 3, 44, 22, 0, 138, 156, 3, 52, 26, 0, 139, 156, 3, 46, 23, 0, 140, 156, 3, 48, 24, 0, 141, 156, 3, 60, 30, 0, 142, 156, 3, 62, 31, 0, 143, 156, 3, 66, 33, 0, 144, 156, 3, 68, 34, 0, 145, 156, 3, 56, 28, 0, 146, 156, 3, 70, 35, 0, 147, 151, 5, 1, 0, 0, 148, 150, 3, 16, 8, 0, 149, 148, 1, 0, 0, 0, 150, 153, 1, 0, 0, 0, 151, 149, 1, 0, 0, 0, 151, 152, 1, 0, 0, 0, 152, 154, 1, 0, 0, 0, 153, 151, 1, 0, 0, 0, 154, 156, 5, 2, 0, 0, 155, 135, 1, 0, 0, 0, 155, 136, 1, 0, 0, 0, 155, 137, 1, 0, 0, 0, 155, 138, 1, 0, 0, 0, 155, 139, 1, 0, 0, 0, 155, 140, 1, 0, 0, 0, 155, 141, 1, 0, 0, 0, 155, 142, 1, 0, 0, 0, 155, 143, 1, 0, 0, 0, 155, 144, 1, 0, 0, 0, 155, 145, 1, 0, 0, 0, 155, 146, 1, 0, 0, 0, 155, 147, 1, 0, 0, 0, 156, 17, 1, 0, 0, 0, 157, 159, 3, 20, 10, 0, 158, 160, 3, 24, 12, 0, 159, 158, 1, 0, 0, 0, 159, 160, 1, 0, 0, 0, 160, 164, 1, 0, 0, 0, 161, 163, 3, 22, 11, 0, 162, 161, 1, 0, 0, 0, 163, 166, 1, 0, 0, 0, 164, 162, 1, 0, 0, 0, 164, 165, 1, 0, 0, 0, 165, 167, 1, 0, 0, 0, 166, 164, 1, 0, 0, 0, 167, 168, 5, 6, 0, 0, 168, 19, 1, 0, 0, 0, 169, 171, 5, 24, 0, 0, 170, 169, 1, 0, 0, 0, 171, 172, 1, 0, 0, 0, 172, 170, 1, 0, 0, 0, 172, 173, 1, 0, 0, 0, 173, 179, 1, 0, 0, 0, 174, 175, 5, 20, 0, 0, 175, 176, 3, 26, 13, 0, 176, 177, 5, 63, 0, 0, 177, 179, 1, 0, 0, 0, 178, 170, 1, 0, 0, 0, 178, 174, 1, 0, 0, 0, 179, 180, 1, 0, 0, 0, 180, 178, 1, 0, 0, 0, 180, 181, 1, 0, 0, 0, 181, 21, 1, 0, 0, 0, 182, 183, 5, 12, 0, 0, 183, 184, 5, 30, 0, 0, 184, 23, 1, 0, 0, 0, 185, 186, 5, 19, 0, 0, 186, 187, 5, 69, 0, 0, 187, 188, 3, 26, 13, 0, 188, 189, 5, 85, 0, 0, 189, 198, 1, 0, 0, 0, 190, 191, 5, 19, 0, 0, 191, 194, 5, 82, 0, 0, 192, 193, 5, 69, 0, 0, 193, 195, 3, 26, 13, 0, 194, 192, 1, 0, 0, 0, 194, 195, 1, 0, 0, 0, 195, 196, 1, 0, 0, 0, 196, 198, 5, 85, 0, 0, 197, 185, 1, 0, 0, 0, 197, 190, 1, 0, 0, 0, 198, 25, 1, 0, 0, 0, 199, 200, 6, 13, -1, 0, 200, 201, 5, 57, 0, 0, 201, 202, 3, 26, 13, 0, 202, 203, 5, 58, 0, 0, 203, 210, 1, 0, 0, 0, 204, 205, 5, 53, 0, 0, 205, 210, 3, 26, 13, 8, 206, 207, 5, 46, 0, 0, 207, 210, 3, 26, 13, 7, 208, 210, 3, 28, 14, 0, 209, 199, 1, 0, 0, 0, 209, 204, 1, 0, 0, 0, 209, 206, 1, 0, 0, 0, 209, 208, 1, 0, 0, 0, 210, 228, 1, 0, 0, 0, 211, 212, 10, 6, 0, 0, 212, 213, 7, 0, 0, 0, 213, 227, 3, 26, 13, 7, 214, 215, 10, 5, 0, 0, 215, 216, 7, 1, 0, 0, 216, 227, 3, 26, 13, 6, 217, 218, 10, 4, 0, 0, 218, 219, 7, 2, 0, 0, 219, 227, 3, 26, 13, 5, 220, 221, 10, 3, 0, 0, 221, 222, 7, 3, 0, 0, 222, 227, 3, 26, 13, 4, 223, 224, 10, 2, 0, 0, 224, 225, 7, 4, 0, 0, 225, 227, 3, 26, 13, 3, 226, 211, 1, 0, 0, 0, 226, 214, 1, 0, 0, 0, 226, 217, 1, 0, 0, 0, 226, 220, 1, 0, 0, 0, 226, 223, 1, 0, 0, 0, 227, 230, 1, 0, 0, 0, 228, 226, 1, 0, 0, 0, 228, 229, 1, 0, 0, 0, 229, 27, 1, 0, 0, 0, 230, 228, 1, 0, 0, 0, 231, 239, 5, 66, 0, 0, 232, 239, 5, 33, 0, 0, 233, 239, 5, 34, 0, 0, 234, 239, 3, 30, 15, 0, 235, 239, 5, 61, 0, 0, 236, 239, 3, 32, 16, 0, 237, 239, 3, 34, 17, 0, 238, 231, 1, 0, 0, 0, 238, 232, 1, 0, 0, 0, 238, 233, 1, 0, 0, 0, 238, 234, 1, 0, 0, 0, 238, 235, 1, 0, 0, 0, 238, 236, 1, 0, 0, 0, 238, 237, 1, 0, 0, 0, 239, 29, 1, 0, 0, 0, 240, 241, 5, 64, 0, 0, 241, 31, 1, 0, 0, 0, 242, 243, 5, 62, 0, 0, 243, 245, 5, 57, 0, 0, 244, 246, 3, 26, 13, 0, 245, 244, 1, 0, 0, 0, 245, 246, 1, 0, 0, 0, 246, 251, 1, 0, 0, 0, 247, 248, 5, 59, 0, 0, 248, 250, 3, 26, 13, 0, 249, 247, 1, 0, 0, 0, 250, 253, 1, 0, 0, 0, 251, 249, 1, 0, 0, 0, 251, 252, 1, 0, 0, 0, 252, 254, 1, 0, 0, 0, 253, 251, 1, 0, 0, 0, 254, 255, 5, 58, 0, 0, 255, 33, 1, 0, 0, 0, 256, 258, 5, 62, 0, 0, 257, 256, 1, 0, 0, 0, 257, 258, 1, 0, 0, 0, 258, 259, 1, 0, 0, 0, 259, 260, 5, 65, 0, 0, 260, 261, 5, 62, 0, 0, 261, 35, 1, 0, 0, 0, 262, 266, 3, 38, 19, 0, 263, 265, 3, 40, 20, 0, 264, 263, 1, 0, 0, 0, 265, 268, 1, 0, 0, 0, 266, 264, 1, 0, 0, 0, 266, 267, 1, 0, 0, 0, 267, 270, 1, 0, 0, 0, 268, 266, 1, 0, 0, 0, 269, 271, 3, 42, 21, 0, 270, 269, 1, 0, 0, 0, 270, 271, 1, 0, 0, 0, 271, 272, 1, 0, 0, 0, 272, 273, 5, 19, 0, 0, 273, 274, 5, 73, 0, 0, 274, 275, 5, 85, 0, 0, 275, 37, 1, 0, 0, 0, 276, 277, 5, 19, 0, 0, 277, 278, 5, 69, 0, 0, 278, 279, 3, 26, 13, 0, 279, 283, 5, 85, 0, 0, 280, 282, 3, 16, 8, 0, 281, 280, 1, 0, 0, 0, 282, 285, 1, 0, 0, 0, 283, 281, 1, 0, 0, 0, 283, 284, 1, 0, 0, 0, 284, 39, 1, 0, 0, 0, 285, 283, 1, 0, 0, 0, 286, 287, 5, 19, 0, 0, 287, 288, 5, 70, 0, 0, 288, 289, 3, 26, 13, 0, 289, 293, 5, 85, 0, 0, 290, 292, 3, 16, 8, 0, 291, 290, 1, 0, 0, 0, 292, 295, 1, 0, 0, 0, 293, 291, 1, 0, 0, 0, 293, 294, 1, 0, 0, 0, 294, 41, 1, 0, 0, 0, 295, 293, 1, 0, 0, 0, 296, 297, 5, 19, 0, 0, 297, 298, 5, 71, 0, 0, 298, 302, 5, 85, 0, 0, 299, 301, 3, 16, 8, 0, 300, 299, 1, 0, 0, 0, 301, 304, 1, 0, 0, 0, 302, 300, 1, 0, 0, 0, 302, 303, 1, 0, 0, 0, 303, 43, 1, 0, 0, 0, 304, 302, 1, 0, 0, 0, 305, 306, 5, 19, 0, 0, 306, 307, 5, 72, 0, 0, 307, 308, 3, 30, 15, 0, 308, 309, 7, 5, 0, 0, 309, 310, 3, 26, 13, 0, 310, 311, 5, 85, 0, 0, 311, 45, 1, 0, 0, 0, 312, 313, 5, 19, 0, 0, 313, 314, 5, 74, 0, 0, 314, 315, 3, 32, 16, 0, 315, 316, 5, 85, 0, 0, 316, 47, 1, 0, 0, 0, 317, 318, 5, 19, 0, 0, 318, 319, 3, 50, 25, 0, 319, 323, 5, 85, 0, 0, 320, 322, 3, 22, 11, 0, 321, 320, 1, 0, 0, 0, 322, 325, 1, 0, 0, 0, 323, 321, 1, 0, 0, 0, 323, 324, 1, 0, 0, 0, 324, 49, 1, 0, 0, 0, 325, 323, 1, 0, 0, 0, 326, 332, 5, 88, 0, 0, 327, 328, 5, 87, 0, 0, 328, 329, 3, 26, 13, 0, 329, 330, 5, 63, 0, 0, 330, 332, 1, 0, 0, 0, 331, 326, 1, 0, 0, 0, 331, 327, 1, 0, 0, 0, 332, 333, 1, 0, 0, 0, 333, 331, 1, 0, 0, 0, 333, 334, 1, 0, 0, 0, 334, 51, 1, 0, 0, 0, 335, 337, 3, 54, 27, 0, 336, 335, 1, 0, 0, 0, 337, 340, 1, 0, 0, 0, 338, 336, 1, 0, 0, 0, 338, 339, 1, 0, 0, 0, 339, 341, 1, 0, 0, 0, 340, 338, 1, 0, 0, 0, 341, 343, 3, 54, 27, 0, 342, 344, 5, 3, 0, 0, 343, 342, 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, 344, 53, 1, 0, 0, 0, 345, 346, 5, 17, 0, 0, 346, 355, 3, 18, 9, 0, 347, 351, 5, 1, 0, 0, 348, 350, 3, 16, 8, 0, 349, 348, 1, 0, 0, 0, 350, 353, 1, 0, 0, 0, 351, 349, 1, 0, 0, 0, 351, 352, 1, 0, 0, 0, 352, 354, 1, 0, 0, 0, 353, 351, 1, 0, 0, 0, 354, 356, 5, 2, 0, 0, 355, 347, 1, 0, 0, 0, 355, 356, 1, 0, 0, 0, 356, 55, 1, 0, 0, 0, 357, 359, 3, 58, 29, 0, 358, 357, 1, 0, 0, 0, 359, 362, 1, 0, 0, 0, 360, 358, 1, 0, 0, 0, 360, 361, 1, 0, 0, 0, 361, 363, 1, 0, 0, 0, 362, 360, 1, 0, 0, 0, 363, 365, 3, 58, 29, 0, 364, 366, 5, 3, 0, 0, 365, 364, 1, 0, 0, 0, 365, 366, 1, 0, 0, 0, 366, 57, 1, 0, 0, 0, 367, 368, 5, 18, 0, 0, 368, 377, 3, 18, 9, 0, 369, 373, 5, 1, 0, 0, 370, 372, 3, 16, 8, 0, 371, 370, 1, 0, 0, 0, 372, 375, 1, 0, 0, 0, 373, 371, 1, 0, 0, 0, 373, 374, 1, 0, 0, 0, 374, 376, 1, 0, 0, 0, 375, 373, 1, 0, 0, 0, 376, 378, 5, 2, 0, 0, 377, 369, 1, 0, 0, 0, 377, 378, 1, 0, 0, 0, 378, 59, 1, 0, 0, 0, 379, 380, 5, 19, 0, 0, 380, 381, 5, 75, 0, 0, 381, 382, 3, 30, 15, 0, 382, 383, 5, 36, 0, 0, 383, 386, 3, 26, 13, 0, 384, 385, 5, 60, 0, 0, 385, 387, 5, 62, 0, 0, 386, 384, 1, 0, 0, 0, 386, 387, 1, 0, 0, 0, 387, 388, 1, 0, 0, 0, 388, 389, 5, 85, 0, 0, 389, 61, 1, 0, 0, 0, 390, 391, 5, 19, 0, 0, 391, 392, 5, 79, 0, 0, 392, 393, 5, 9, 0, 0, 393, 395, 5, 85, 0, 0, 394, 396, 3, 64, 32, 0, 395, 394, 1, 0, 0, 0, 396, 397, 1, 0, 0, 0, 397, 395, 1, 0, 0, 0, 397, 398, 1, 0, 0, 0, 398, 399, 1, 0, 0, 0, 399, 400, 5, 19, 0, 0, 400, 401, 5, 81, 0, 0, 401, 402, 5, 85, 0, 0, 402, 63, 1, 0, 0, 0, 403, 405, 5, 1, 0, 0, 404, 403, 1, 0, 0, 0, 404, 405, 1, 0, 0, 0, 405, 406, 1, 0, 0, 0, 406, 407, 5, 19, 0, 0, 407, 408, 5, 80, 0, 0, 408, 411, 5, 62, 0, 0, 409, 410, 5, 36, 0, 0, 410, 412, 3, 28, 14, 0, 411, 409, 1, 0, 0, 0, 411, 412, 1, 0, 0, 0, 412, 413, 1, 0, 0, 0, 413, 415, 5, 85, 0, 0, 414, 416, 5, 2, 0, 0, 415, 414, 1, 0, 0, 0, 415, 416, 1, 0, 0, 0, 416, 65, 1, 0, 0, 0, 417, 418, 5, 19, 0, 0, 418, 419, 5, 76, 0, 0, 419, 420, 5, 9, 0, 0, 420, 440, 5, 85, 0, 0, 421, 422, 5, 19, 0, 0, 422, 423, 5, 76, 0, 0, 423, 424, 5, 20, 0, 0, 424, 425, 3, 26, 13, 0, 425, 426, 5, 63, 0, 0, 426, 427, 5, 85, 0, 0, 427, 440, 1, 0, 0, 0, 428, 429, 5, 19, 0, 0, 429, 430, 5, 77, 0, 0, 430, 431, 5, 9, 0, 0, 431, 440, 5, 85, 0, 0, 432, 433, 5, 19, 0, 0, 433, 434, 5, 77, 0, 0, 434, 435, 5, 20, 0, 0, 435, 436, 3, 26, 13, 0, 436, 437, 5, 63, 0, 0, 437, 438, 5, 85, 0, 0, 438, 440, 1, 0, 0, 0, 439, 417, 1, 0, 0, 0, 439, 421, 1, 0, 0, 0, 439, 428, 1, 0, 0, 0, 439, 432, 1, 0, 0, 0, 440, 67, 1, 0, 0, 0, 441, 442, 5, 19, 0, 0, 442, 443, 5, 78, 0, 0, 443, 444, 5, 85, 0, 0, 444, 69, 1, 0, 0, 0, 445, 447, 3, 72, 36, 0, 446, 448, 3, 74, 37, 0, 447, 446, 1, 0, 0, 0, 447, 448, 1, 0, 0, 0, 448, 449, 1, 0, 0, 0, 449, 450, 5, 19, 0, 0, 450, 451, 5, 83, 0, 0, 451, 452, 5, 85, 0, 0, 452, 71, 1, 0, 0, 0, 453, 454, 5, 19, 0, 0, 454, 457, 5, 82, 0, 0, 455, 456, 5, 69, 0, 0, 456, 458, 3, 26, 13, 0, 457, 455, 1, 0, 0, 0, 457, 458, 1, 0, 0, 0, 458, 459, 1, 0, 0, 0, 459, 463, 5, 85, 0, 0, 460, 462, 3, 16, 8, 0, 461, 460, 1, 0, 0, 0, 462, 465, 1, 0, 0, 0, 463, 461, 1, 0, 0, 0, 463, 464, 1, 0, 0, 0, 464, 73, 1, 0, 0, 0, 465, 463, 1, 0, 0, 0, 466, 467, 5, 19, 0, 0, 467, 468, 5, 71, 0, 0, 468, 472, 5, 85, 0, 0, 469, 471, 3, 16, 8, 0, 470, 469, 1, 0, 0, 0, 471, 474, 1, 0, 0, 0, 472, 470, 1, 0, 0, 0, 472, 473, 1, 0, 0, 0, 473, 75, 1, 0, 0, 0, 474, 472, 1, 0, 0, 0, 475, 479, 5, 62, 0, 0, 476, 478, 3, 78, 39, 0, 477, 476, 1, 0, 0, 0, 478, 481, 1, 0, 0, 0, 479, 477, 1, 0, 0, 0, 479, 480, 1, 0, 0, 0, 480, 77, 1, 0, 0, 0, 481, 479, 1, 0, 0, 0, 482, 485, 3, 26, 13, 0, 483, 485, 5, 62, 0, 0, 484, 482, 1, 0, 0, 0, 484, 483, 1, 0, 0, 0, 485, 79, 1, 0, 0, 0, 52, 83, 89, 97, 99, 118, 125, 127, 132, 151, 155, 159, 164, 172, 178, 180, 194, 197, 209, 226, 228, 238, 245, 251, 257, 266, 270, 283, 293, 302, 323, 331, 333, 338, 343, 351, 355, 360, 365, 373, 377, 386, 397, 404, 411, 415, 439, 447, 457, 463, 472, 479, 484] \ No newline at end of file diff --git a/crates/compiler/src/parser/generated/YarnSpinnerParser.tokens b/crates/compiler/src/parser/generated/YarnSpinnerParser.tokens index 72d448475..5c13a89ae 100644 --- a/crates/compiler/src/parser/generated/YarnSpinnerParser.tokens +++ b/crates/compiler/src/parser/generated/YarnSpinnerParser.tokens @@ -4,111 +4,130 @@ BLANK_LINE_FOLLOWING_OPTION=3 WS=4 COMMENT=5 NEWLINE=6 -ID=7 -BODY_START=8 -HEADER_DELIMITER=9 -HASHTAG=10 -REST_OF_LINE=11 -BODY_WS=12 -BODY_END=13 -SHORTCUT_ARROW=14 -COMMAND_START=15 -EXPRESSION_START=16 -ESCAPED_ANY=17 -TEXT_ESCAPE=18 -TEXT_COMMENT=19 -TEXT=20 -UNESCAPABLE_CHARACTER=21 -TEXT_COMMANDHASHTAG_WS=22 -TEXT_COMMANDHASHTAG_COMMENT=23 -TEXT_COMMANDHASHTAG_ERROR=24 -HASHTAG_WS=25 -HASHTAG_TEXT=26 -EXPR_WS=27 -KEYWORD_TRUE=28 -KEYWORD_FALSE=29 -KEYWORD_NULL=30 -OPERATOR_ASSIGNMENT=31 -OPERATOR_LOGICAL_LESS_THAN_EQUALS=32 -OPERATOR_LOGICAL_GREATER_THAN_EQUALS=33 -OPERATOR_LOGICAL_EQUALS=34 -OPERATOR_LOGICAL_LESS=35 -OPERATOR_LOGICAL_GREATER=36 -OPERATOR_LOGICAL_NOT_EQUALS=37 -OPERATOR_LOGICAL_AND=38 -OPERATOR_LOGICAL_OR=39 -OPERATOR_LOGICAL_XOR=40 -OPERATOR_LOGICAL_NOT=41 -OPERATOR_MATHS_ADDITION_EQUALS=42 -OPERATOR_MATHS_SUBTRACTION_EQUALS=43 -OPERATOR_MATHS_MULTIPLICATION_EQUALS=44 -OPERATOR_MATHS_MODULUS_EQUALS=45 -OPERATOR_MATHS_DIVISION_EQUALS=46 -OPERATOR_MATHS_ADDITION=47 -OPERATOR_MATHS_SUBTRACTION=48 -OPERATOR_MATHS_MULTIPLICATION=49 -OPERATOR_MATHS_DIVISION=50 -OPERATOR_MATHS_MODULUS=51 -LPAREN=52 -RPAREN=53 -COMMA=54 -EXPRESSION_AS=55 -STRING=56 -FUNC_ID=57 -EXPRESSION_END=58 -VAR_ID=59 -DOT=60 -NUMBER=61 -COMMAND_NEWLINE=62 -COMMAND_WS=63 -COMMAND_IF=64 -COMMAND_ELSEIF=65 -COMMAND_ELSE=66 -COMMAND_SET=67 -COMMAND_ENDIF=68 -COMMAND_CALL=69 -COMMAND_DECLARE=70 -COMMAND_JUMP=71 -COMMAND_ENUM=72 -COMMAND_CASE=73 -COMMAND_ENDENUM=74 -COMMAND_LOCAL=75 -COMMAND_END=76 -COMMAND_TEXT_NEWLINE=77 -COMMAND_TEXT_END=78 -COMMAND_EXPRESSION_START=79 -COMMAND_TEXT=80 -COMMAND_ID_NEWLINE=81 -TYPE_STRING=82 -TYPE_NUMBER=83 -TYPE_BOOL=84 -'---'=8 -'#'=10 -'==='=13 -'->'=14 -'<<'=15 -'\\'=18 -'true'=28 -'false'=29 -'null'=30 -'+='=42 -'-='=43 -'*='=44 -'%='=45 -'/='=46 -'+'=47 -'-'=48 -'*'=49 -'/'=50 -'%'=51 -'('=52 -')'=53 -','=54 -'as'=55 -'string'=82 -'number'=83 -'bool'=84 -'}'=58 -'.'=60 -'endif'=68 -'{'=79 +HEADER_WHEN=7 +HEADER_TITLE=8 +ID=9 +BODY_START=10 +HEADER_DELIMITER=11 +HASHTAG=12 +HEADER_WHEN_UNKNOWN=13 +REST_OF_LINE=14 +BODY_WS=15 +BODY_END=16 +SHORTCUT_ARROW=17 +LINE_GROUP_ARROW=18 +COMMAND_START=19 +EXPRESSION_START=20 +ESCAPED_ANY=21 +TEXT_ESCAPE=22 +TEXT_COMMENT=23 +TEXT=24 +UNESCAPABLE_CHARACTER=25 +TEXT_COMMANDHASHTAG_WS=26 +TEXT_COMMANDHASHTAG_COMMENT=27 +TEXT_COMMANDHASHTAG_ERROR=28 +HASHTAG_WS=29 +HASHTAG_TEXT=30 +EXPR_WS=31 +EXPRESSION_WHEN_ALWAYS=32 +KEYWORD_TRUE=33 +KEYWORD_FALSE=34 +KEYWORD_NULL=35 +OPERATOR_ASSIGNMENT=36 +OPERATOR_LOGICAL_LESS_THAN_EQUALS=37 +OPERATOR_LOGICAL_GREATER_THAN_EQUALS=38 +OPERATOR_LOGICAL_EQUALS=39 +OPERATOR_LOGICAL_LESS=40 +OPERATOR_LOGICAL_GREATER=41 +OPERATOR_LOGICAL_NOT_EQUALS=42 +OPERATOR_LOGICAL_AND=43 +OPERATOR_LOGICAL_OR=44 +OPERATOR_LOGICAL_XOR=45 +OPERATOR_LOGICAL_NOT=46 +OPERATOR_MATHS_ADDITION_EQUALS=47 +OPERATOR_MATHS_SUBTRACTION_EQUALS=48 +OPERATOR_MATHS_MULTIPLICATION_EQUALS=49 +OPERATOR_MATHS_MODULUS_EQUALS=50 +OPERATOR_MATHS_DIVISION_EQUALS=51 +OPERATOR_MATHS_ADDITION=52 +OPERATOR_MATHS_SUBTRACTION=53 +OPERATOR_MATHS_MULTIPLICATION=54 +OPERATOR_MATHS_DIVISION=55 +OPERATOR_MATHS_MODULUS=56 +LPAREN=57 +RPAREN=58 +COMMA=59 +EXPRESSION_AS=60 +STRING=61 +FUNC_ID=62 +EXPRESSION_END=63 +VAR_ID=64 +DOT=65 +NUMBER=66 +COMMAND_NEWLINE=67 +COMMAND_WS=68 +COMMAND_IF=69 +COMMAND_ELSEIF=70 +COMMAND_ELSE=71 +COMMAND_SET=72 +COMMAND_ENDIF=73 +COMMAND_CALL=74 +COMMAND_DECLARE=75 +COMMAND_JUMP=76 +COMMAND_DETOUR=77 +COMMAND_RETURN=78 +COMMAND_ENUM=79 +COMMAND_CASE=80 +COMMAND_ENDENUM=81 +COMMAND_ONCE=82 +COMMAND_ENDONCE=83 +COMMAND_LOCAL=84 +COMMAND_END=85 +COMMAND_TEXT_NEWLINE=86 +COMMAND_EXPRESSION_START=87 +COMMAND_TEXT=88 +COMMAND_ID_WS=89 +COMMAND_ID_NEWLINE=90 +COMMAND_ID_OR_EXPRESSION_WS=91 +TYPE_STRING=92 +TYPE_NUMBER=93 +TYPE_BOOL=94 +'when'=7 +'title'=8 +'---'=10 +'#'=12 +'==='=16 +'->'=17 +'=>'=18 +'<<'=19 +'always'=32 +'true'=33 +'false'=34 +'null'=35 +'+='=47 +'-='=48 +'*='=49 +'%='=50 +'/='=51 +'+'=52 +'-'=53 +'*'=54 +'/'=55 +'%'=56 +'('=57 +')'=58 +','=59 +'as'=60 +'string'=92 +'number'=93 +'bool'=94 +'}'=63 +'.'=65 +'else'=71 +'endif'=73 +'return'=78 +'endenum'=81 +'once'=82 +'endonce'=83 +'local'=84 +'{'=87 diff --git a/crates/compiler/src/parser/generated/readme.md b/crates/compiler/src/parser/generated/readme.md index da0de5a93..26a1834dc 100644 --- a/crates/compiler/src/parser/generated/readme.md +++ b/crates/compiler/src/parser/generated/readme.md @@ -17,7 +17,7 @@ All files in this directory were autogenerated by ANTLR with minimal manual adju * Something goes wrong during generation with this type, resulting in the error `symbol type conflicts with generated code in target language or runtime` * Add the generated `mod`s to `generated.rs`, including lint allow attributes for `warnings`, `clippy` and `rustfmt` -* Disambiguate `visit_node` by explicitly using `antlr_rust::tree::VisitChildren::visit_node` (other variant would be `yarnspinnerparservisitor::YarnSpinnerParserVisitor::visit_node`) -* Replace `antlr_rust::tree::VisitChildren::visit_node(visitor, self);` by `YarnSpinnerParserVisitor::visit_node(visitor, self);`. The issue there is that `node` already means something in the +* Disambiguate `visit_node` by explicitly using `antlr4rust::tree::VisitChildren::visit_node` (other variant would be `yarnspinnerparservisitor::YarnSpinnerParserVisitor::visit_node`) +* Replace `antlr4rust::tree::VisitChildren::visit_node(visitor, self);` by `YarnSpinnerParserVisitor::visit_node(visitor, self);`. The issue there is that `node` already means something in the ANTLR world, thus there is an ambiguity when calling `visit_node`, which antlr4rust resolved the wrong way here, resulting in an infinite recursion * Add the `new_with_text` function to allow creating a context with a specific text, which is possible in the C# version of ANTLR. diff --git a/crates/compiler/src/parser/generated/yarnspinnerlexer.rs b/crates/compiler/src/parser/generated/yarnspinnerlexer.rs index 6f133d256..5dd8e86cf 100644 --- a/crates/compiler/src/parser/generated/yarnspinnerlexer.rs +++ b/crates/compiler/src/parser/generated/yarnspinnerlexer.rs @@ -1,4 +1,4 @@ -// Generated from third-party/YarnSpinner/YarnSpinner.Compiler/YarnSpinnerLexer.g4 by ANTLR 4.13.2 +// Generated from third-party/YarnSpinner/YarnSpinner.Compiler/Grammars/YarnSpinnerLexer.g4 by ANTLR 4.13.2 #![allow(dead_code)] #![allow(nonstandard_style)] #![allow(unused_imports)] @@ -36,106 +36,119 @@ use std::ops::{Deref, DerefMut}; pub const WS:i32=4; pub const COMMENT:i32=5; pub const NEWLINE:i32=6; - pub const ID:i32=7; - pub const BODY_START:i32=8; - pub const HEADER_DELIMITER:i32=9; - pub const HASHTAG:i32=10; - pub const REST_OF_LINE:i32=11; - pub const BODY_WS:i32=12; - pub const BODY_END:i32=13; - pub const SHORTCUT_ARROW:i32=14; - pub const COMMAND_START:i32=15; - pub const EXPRESSION_START:i32=16; - pub const ESCAPED_ANY:i32=17; - pub const TEXT_ESCAPE:i32=18; - pub const TEXT_COMMENT:i32=19; - pub const TEXT:i32=20; - pub const UNESCAPABLE_CHARACTER:i32=21; - pub const TEXT_COMMANDHASHTAG_WS:i32=22; - pub const TEXT_COMMANDHASHTAG_COMMENT:i32=23; - pub const TEXT_COMMANDHASHTAG_ERROR:i32=24; - pub const HASHTAG_WS:i32=25; - pub const HASHTAG_TEXT:i32=26; - pub const EXPR_WS:i32=27; - pub const KEYWORD_TRUE:i32=28; - pub const KEYWORD_FALSE:i32=29; - pub const KEYWORD_NULL:i32=30; - pub const OPERATOR_ASSIGNMENT:i32=31; - pub const OPERATOR_LOGICAL_LESS_THAN_EQUALS:i32=32; - pub const OPERATOR_LOGICAL_GREATER_THAN_EQUALS:i32=33; - pub const OPERATOR_LOGICAL_EQUALS:i32=34; - pub const OPERATOR_LOGICAL_LESS:i32=35; - pub const OPERATOR_LOGICAL_GREATER:i32=36; - pub const OPERATOR_LOGICAL_NOT_EQUALS:i32=37; - pub const OPERATOR_LOGICAL_AND:i32=38; - pub const OPERATOR_LOGICAL_OR:i32=39; - pub const OPERATOR_LOGICAL_XOR:i32=40; - pub const OPERATOR_LOGICAL_NOT:i32=41; - pub const OPERATOR_MATHS_ADDITION_EQUALS:i32=42; - pub const OPERATOR_MATHS_SUBTRACTION_EQUALS:i32=43; - pub const OPERATOR_MATHS_MULTIPLICATION_EQUALS:i32=44; - pub const OPERATOR_MATHS_MODULUS_EQUALS:i32=45; - pub const OPERATOR_MATHS_DIVISION_EQUALS:i32=46; - pub const OPERATOR_MATHS_ADDITION:i32=47; - pub const OPERATOR_MATHS_SUBTRACTION:i32=48; - pub const OPERATOR_MATHS_MULTIPLICATION:i32=49; - pub const OPERATOR_MATHS_DIVISION:i32=50; - pub const OPERATOR_MATHS_MODULUS:i32=51; - pub const LPAREN:i32=52; - pub const RPAREN:i32=53; - pub const COMMA:i32=54; - pub const EXPRESSION_AS:i32=55; - pub const STRING:i32=56; - pub const FUNC_ID:i32=57; - pub const EXPRESSION_END:i32=58; - pub const VAR_ID:i32=59; - pub const DOT:i32=60; - pub const NUMBER:i32=61; - pub const COMMAND_NEWLINE:i32=62; - pub const COMMAND_WS:i32=63; - pub const COMMAND_IF:i32=64; - pub const COMMAND_ELSEIF:i32=65; - pub const COMMAND_ELSE:i32=66; - pub const COMMAND_SET:i32=67; - pub const COMMAND_ENDIF:i32=68; - pub const COMMAND_CALL:i32=69; - pub const COMMAND_DECLARE:i32=70; - pub const COMMAND_JUMP:i32=71; - pub const COMMAND_ENUM:i32=72; - pub const COMMAND_CASE:i32=73; - pub const COMMAND_ENDENUM:i32=74; - pub const COMMAND_LOCAL:i32=75; - pub const COMMAND_END:i32=76; - pub const COMMAND_TEXT_NEWLINE:i32=77; - pub const COMMAND_TEXT_END:i32=78; - pub const COMMAND_EXPRESSION_START:i32=79; - pub const COMMAND_TEXT:i32=80; - pub const COMMAND_ID_NEWLINE:i32=81; - pub const TYPE_STRING:i32=82; - pub const TYPE_NUMBER:i32=83; - pub const TYPE_BOOL:i32=84; + pub const HEADER_WHEN:i32=7; + pub const HEADER_TITLE:i32=8; + pub const ID:i32=9; + pub const BODY_START:i32=10; + pub const HEADER_DELIMITER:i32=11; + pub const HASHTAG:i32=12; + pub const HEADER_WHEN_UNKNOWN:i32=13; + pub const REST_OF_LINE:i32=14; + pub const BODY_WS:i32=15; + pub const BODY_END:i32=16; + pub const SHORTCUT_ARROW:i32=17; + pub const LINE_GROUP_ARROW:i32=18; + pub const COMMAND_START:i32=19; + pub const EXPRESSION_START:i32=20; + pub const ESCAPED_ANY:i32=21; + pub const TEXT_ESCAPE:i32=22; + pub const TEXT_COMMENT:i32=23; + pub const TEXT:i32=24; + pub const UNESCAPABLE_CHARACTER:i32=25; + pub const TEXT_COMMANDHASHTAG_WS:i32=26; + pub const TEXT_COMMANDHASHTAG_COMMENT:i32=27; + pub const TEXT_COMMANDHASHTAG_ERROR:i32=28; + pub const HASHTAG_WS:i32=29; + pub const HASHTAG_TEXT:i32=30; + pub const EXPR_WS:i32=31; + pub const EXPRESSION_WHEN_ALWAYS:i32=32; + pub const KEYWORD_TRUE:i32=33; + pub const KEYWORD_FALSE:i32=34; + pub const KEYWORD_NULL:i32=35; + pub const OPERATOR_ASSIGNMENT:i32=36; + pub const OPERATOR_LOGICAL_LESS_THAN_EQUALS:i32=37; + pub const OPERATOR_LOGICAL_GREATER_THAN_EQUALS:i32=38; + pub const OPERATOR_LOGICAL_EQUALS:i32=39; + pub const OPERATOR_LOGICAL_LESS:i32=40; + pub const OPERATOR_LOGICAL_GREATER:i32=41; + pub const OPERATOR_LOGICAL_NOT_EQUALS:i32=42; + pub const OPERATOR_LOGICAL_AND:i32=43; + pub const OPERATOR_LOGICAL_OR:i32=44; + pub const OPERATOR_LOGICAL_XOR:i32=45; + pub const OPERATOR_LOGICAL_NOT:i32=46; + pub const OPERATOR_MATHS_ADDITION_EQUALS:i32=47; + pub const OPERATOR_MATHS_SUBTRACTION_EQUALS:i32=48; + pub const OPERATOR_MATHS_MULTIPLICATION_EQUALS:i32=49; + pub const OPERATOR_MATHS_MODULUS_EQUALS:i32=50; + pub const OPERATOR_MATHS_DIVISION_EQUALS:i32=51; + pub const OPERATOR_MATHS_ADDITION:i32=52; + pub const OPERATOR_MATHS_SUBTRACTION:i32=53; + pub const OPERATOR_MATHS_MULTIPLICATION:i32=54; + pub const OPERATOR_MATHS_DIVISION:i32=55; + pub const OPERATOR_MATHS_MODULUS:i32=56; + pub const LPAREN:i32=57; + pub const RPAREN:i32=58; + pub const COMMA:i32=59; + pub const EXPRESSION_AS:i32=60; + pub const STRING:i32=61; + pub const FUNC_ID:i32=62; + pub const EXPRESSION_END:i32=63; + pub const VAR_ID:i32=64; + pub const DOT:i32=65; + pub const NUMBER:i32=66; + pub const COMMAND_NEWLINE:i32=67; + pub const COMMAND_WS:i32=68; + pub const COMMAND_IF:i32=69; + pub const COMMAND_ELSEIF:i32=70; + pub const COMMAND_ELSE:i32=71; + pub const COMMAND_SET:i32=72; + pub const COMMAND_ENDIF:i32=73; + pub const COMMAND_CALL:i32=74; + pub const COMMAND_DECLARE:i32=75; + pub const COMMAND_JUMP:i32=76; + pub const COMMAND_DETOUR:i32=77; + pub const COMMAND_RETURN:i32=78; + pub const COMMAND_ENUM:i32=79; + pub const COMMAND_CASE:i32=80; + pub const COMMAND_ENDENUM:i32=81; + pub const COMMAND_ONCE:i32=82; + pub const COMMAND_ENDONCE:i32=83; + pub const COMMAND_LOCAL:i32=84; + pub const COMMAND_END:i32=85; + pub const COMMAND_TEXT_NEWLINE:i32=86; + pub const COMMAND_EXPRESSION_START:i32=87; + pub const COMMAND_TEXT:i32=88; + pub const COMMAND_ID_WS:i32=89; + pub const COMMAND_ID_NEWLINE:i32=90; + pub const COMMAND_ID_OR_EXPRESSION_WS:i32=91; + pub const TYPE_STRING:i32=92; + pub const TYPE_NUMBER:i32=93; + pub const TYPE_BOOL:i32=94; pub const channelNames: [&'static str;2+2] = [ "DEFAULT_TOKEN_CHANNEL", "HIDDEN", "WHITESPACE", "COMMENTS" ]; - pub const modeNames: [&'static str;12] = [ - "DEFAULT_MODE", "HeaderMode", "BodyMode", "TextMode", "TextEscapedMode", - "TextCommandOrHashtagMode", "HashtagMode", "ExpressionMode", "CommandMode", - "CommandTextMode", "CommandIDMode", "CommandIDOrExpressionMode" + pub const modeNames: [&'static str;14] = [ + "DEFAULT_MODE", "HeaderWhenMode", "HeaderTitleMode", "HeaderMode", "BodyMode", + "TextMode", "TextEscapedMode", "TextCommandOrHashtagMode", "HashtagMode", + "ExpressionMode", "CommandMode", "CommandTextMode", "CommandIDMode", "CommandIDOrExpressionMode" ]; - pub const ruleNames: [&'static str;111] = [ - "WS", "COMMENT", "NEWLINE", "ID", "IDENTIFIER_HEAD", "IDENTIFIER_CHARACTER", - "IDENTIFIER_CHARACTERS", "BODY_START", "HEADER_DELIMITER", "HASHTAG", - "REST_OF_LINE", "HEADER_NEWLINE", "BODY_WS", "BODY_NEWLINE", "BODY_COMMENT", - "BODY_END", "SHORTCUT_ARROW", "COMMAND_START", "BODY_HASHTAG", "EXPRESSION_START", + pub const ruleNames: [&'static str;129] = [ + "WS", "COMMENT", "NEWLINE", "HEADER_WHEN", "HEADER_TITLE", "ID", "IDENTIFIER_HEAD", + "IDENTIFIER_CHARACTER", "IDENTIFIER_CHARACTERS", "BODY_START", "HEADER_DELIMITER", + "HASHTAG", "HEADER_WHEN_DELIMITER", "HEADER_WHEN_UNKNOWN", "HEADER_TITLE_DELIMITER", + "HEADER_TITLE_ID", "HEADER_TITLE_NEWLINE", "REST_OF_LINE", "HEADER_NEWLINE", + "BODY_WS", "BODY_NEWLINE", "BODY_COMMENT", "BODY_END", "SHORTCUT_ARROW", + "LINE_GROUP_ARROW", "COMMAND_START", "BODY_HASHTAG", "EXPRESSION_START", "ESCAPED_BRACKET_START", "ESCAPED_ANY", "ANY", "TEXT_NEWLINE", "TEXT_ESCAPED_MARKUP_BRACKET", "TEXT_ESCAPE", "TEXT_HASHTAG", "TEXT_EXPRESSION_START", "TEXT_COMMAND_START", "TEXT_COMMENT", "TEXT", "TEXT_FRAG", "TEXT_ESCAPED_CHARACTER", "UNESCAPABLE_CHARACTER", "TEXT_COMMANDHASHTAG_WS", "TEXT_COMMANDHASHTAG_COMMENT", "TEXT_COMMANDHASHTAG_COMMAND_START", "TEXT_COMMANDHASHTAG_HASHTAG", "TEXT_COMMANDHASHTAG_NEWLINE", "TEXT_COMMANDHASHTAG_ERROR", - "HASHTAG_WS", "HASHTAG_TAG", "HASHTAG_TEXT", "EXPR_WS", "KEYWORD_TRUE", - "KEYWORD_FALSE", "KEYWORD_NULL", "OPERATOR_ASSIGNMENT", "OPERATOR_LOGICAL_LESS_THAN_EQUALS", + "HASHTAG_WS", "HASHTAG_TAG", "HASHTAG_TEXT", "EXPR_WS", "EXPRESSION_WHEN_ALWAYS", + "EXPRESSION_WHEN_ONCE", "EXPRESSION_WHEN_IF", "KEYWORD_TRUE", "KEYWORD_FALSE", + "KEYWORD_NULL", "OPERATOR_ASSIGNMENT", "OPERATOR_LOGICAL_LESS_THAN_EQUALS", "OPERATOR_LOGICAL_GREATER_THAN_EQUALS", "OPERATOR_LOGICAL_EQUALS", "OPERATOR_LOGICAL_LESS", "OPERATOR_LOGICAL_GREATER", "OPERATOR_LOGICAL_NOT_EQUALS", "OPERATOR_LOGICAL_AND", "OPERATOR_LOGICAL_OR", "OPERATOR_LOGICAL_XOR", "OPERATOR_LOGICAL_NOT", @@ -145,42 +158,48 @@ use std::ops::{Deref, DerefMut}; "OPERATOR_MATHS_MULTIPLICATION", "OPERATOR_MATHS_DIVISION", "OPERATOR_MATHS_MODULUS", "LPAREN", "RPAREN", "COMMA", "EXPRESSION_AS", "TYPE_STRING", "TYPE_NUMBER", "TYPE_BOOL", "STRING", "FUNC_ID", "EXPRESSION_END", "EXPRESSION_COMMAND_END", - "VAR_ID", "DOT", "NUMBER", "INT", "DIGIT", "COMMAND_NEWLINE", "COMMAND_WS", - "COMMAND_IF", "COMMAND_ELSEIF", "COMMAND_ELSE", "COMMAND_SET", "COMMAND_ENDIF", - "COMMAND_CALL", "COMMAND_DECLARE", "COMMAND_JUMP", "COMMAND_ENUM", "COMMAND_CASE", - "COMMAND_ENDENUM", "COMMAND_LOCAL", "COMMAND_END", "COMMAND_EXPRESSION_AT_START", + "VAR_ID", "DOT", "NUMBER", "EXPRESSION_NEWLINE", "INT", "DIGIT", "COMMAND_NEWLINE", + "COMMAND_WS", "COMMAND_IF", "COMMAND_ELSEIF", "COMMAND_ELSE", "COMMAND_SET", + "COMMAND_ENDIF", "COMMAND_CALL", "COMMAND_DECLARE", "COMMAND_JUMP", "COMMAND_DETOUR", + "COMMAND_RETURN", "COMMAND_ENUM", "COMMAND_CASE", "COMMAND_ENDENUM", "COMMAND_ONCE", + "COMMAND_ENDONCE", "COMMAND_LOCAL", "COMMAND_END", "COMMAND_EXPRESSION_AT_START", "COMMAND_ARBITRARY", "COMMAND_TEXT_NEWLINE", "COMMAND_TEXT_END", "COMMAND_EXPRESSION_START", - "COMMAND_TEXT", "COMMAND_ID_NEWLINE", "COMMAND_ID", "COMMAND_ID_END", - "COMMAND_ID_OR_EXPRESSION_ID", "COMMAND_ID_OR_EXPRESSION_START", "COMMAND_ID_OR_EXPRESSION_END" + "COMMAND_TEXT", "COMMAND_ID_WS", "COMMAND_ID_NEWLINE", "COMMAND_ID", "COMMAND_ID_END", + "COMMAND_ID_OR_EXPRESSION_WS", "COMMAND_ID_OR_EXPRESSION_ID", "COMMAND_ID_OR_EXPRESSION_START", + "COMMAND_ID_OR_EXPRESSION_END" ]; - pub const _LITERAL_NAMES: [Option<&'static str>;85] = [ - None, None, None, None, None, None, None, None, Some("'---'"), None, Some("'#'"), - None, None, Some("'==='"), Some("'->'"), Some("'<<'"), None, None, Some("'\\'"), - None, None, None, None, None, None, None, None, None, Some("'true'"), + pub const _LITERAL_NAMES: [Option<&'static str>;95] = [ + None, None, None, None, None, None, None, Some("'when'"), Some("'title'"), + None, Some("'---'"), None, Some("'#'"), None, None, None, Some("'==='"), + Some("'->'"), Some("'=>'"), Some("'<<'"), None, None, None, None, None, + None, None, None, None, None, None, None, Some("'always'"), Some("'true'"), Some("'false'"), Some("'null'"), None, None, None, None, None, None, None, None, None, None, None, Some("'+='"), Some("'-='"), Some("'*='"), Some("'%='"), Some("'/='"), Some("'+'"), Some("'-'"), Some("'*'"), Some("'/'"), Some("'%'"), Some("'('"), Some("')'"), Some("','"), Some("'as'"), None, None, Some("'}'"), - None, Some("'.'"), None, None, None, None, None, None, None, Some("'endif'"), - None, None, None, None, None, None, None, None, None, None, Some("'{'"), - None, None, Some("'string'"), Some("'number'"), Some("'bool'") + None, Some("'.'"), None, None, None, None, None, Some("'else'"), None, + Some("'endif'"), None, None, None, None, Some("'return'"), None, None, + Some("'endenum'"), Some("'once'"), Some("'endonce'"), Some("'local'"), + None, None, Some("'{'"), None, None, None, None, Some("'string'"), Some("'number'"), + Some("'bool'") ]; - pub const _SYMBOLIC_NAMES: [Option<&'static str>;85] = [ + pub const _SYMBOLIC_NAMES: [Option<&'static str>;95] = [ None, Some("INDENT"), Some("DEDENT"), Some("BLANK_LINE_FOLLOWING_OPTION"), - Some("WS"), Some("COMMENT"), Some("NEWLINE"), Some("ID"), Some("BODY_START"), - Some("HEADER_DELIMITER"), Some("HASHTAG"), Some("REST_OF_LINE"), Some("BODY_WS"), - Some("BODY_END"), Some("SHORTCUT_ARROW"), Some("COMMAND_START"), Some("EXPRESSION_START"), - Some("ESCAPED_ANY"), Some("TEXT_ESCAPE"), Some("TEXT_COMMENT"), Some("TEXT"), - Some("UNESCAPABLE_CHARACTER"), Some("TEXT_COMMANDHASHTAG_WS"), Some("TEXT_COMMANDHASHTAG_COMMENT"), - Some("TEXT_COMMANDHASHTAG_ERROR"), Some("HASHTAG_WS"), Some("HASHTAG_TEXT"), - Some("EXPR_WS"), Some("KEYWORD_TRUE"), Some("KEYWORD_FALSE"), Some("KEYWORD_NULL"), - Some("OPERATOR_ASSIGNMENT"), Some("OPERATOR_LOGICAL_LESS_THAN_EQUALS"), - Some("OPERATOR_LOGICAL_GREATER_THAN_EQUALS"), Some("OPERATOR_LOGICAL_EQUALS"), - Some("OPERATOR_LOGICAL_LESS"), Some("OPERATOR_LOGICAL_GREATER"), Some("OPERATOR_LOGICAL_NOT_EQUALS"), - Some("OPERATOR_LOGICAL_AND"), Some("OPERATOR_LOGICAL_OR"), Some("OPERATOR_LOGICAL_XOR"), - Some("OPERATOR_LOGICAL_NOT"), Some("OPERATOR_MATHS_ADDITION_EQUALS"), + Some("WS"), Some("COMMENT"), Some("NEWLINE"), Some("HEADER_WHEN"), Some("HEADER_TITLE"), + Some("ID"), Some("BODY_START"), Some("HEADER_DELIMITER"), Some("HASHTAG"), + Some("HEADER_WHEN_UNKNOWN"), Some("REST_OF_LINE"), Some("BODY_WS"), Some("BODY_END"), + Some("SHORTCUT_ARROW"), Some("LINE_GROUP_ARROW"), Some("COMMAND_START"), + Some("EXPRESSION_START"), Some("ESCAPED_ANY"), Some("TEXT_ESCAPE"), Some("TEXT_COMMENT"), + Some("TEXT"), Some("UNESCAPABLE_CHARACTER"), Some("TEXT_COMMANDHASHTAG_WS"), + Some("TEXT_COMMANDHASHTAG_COMMENT"), Some("TEXT_COMMANDHASHTAG_ERROR"), + Some("HASHTAG_WS"), Some("HASHTAG_TEXT"), Some("EXPR_WS"), Some("EXPRESSION_WHEN_ALWAYS"), + Some("KEYWORD_TRUE"), Some("KEYWORD_FALSE"), Some("KEYWORD_NULL"), Some("OPERATOR_ASSIGNMENT"), + Some("OPERATOR_LOGICAL_LESS_THAN_EQUALS"), Some("OPERATOR_LOGICAL_GREATER_THAN_EQUALS"), + Some("OPERATOR_LOGICAL_EQUALS"), Some("OPERATOR_LOGICAL_LESS"), Some("OPERATOR_LOGICAL_GREATER"), + Some("OPERATOR_LOGICAL_NOT_EQUALS"), Some("OPERATOR_LOGICAL_AND"), Some("OPERATOR_LOGICAL_OR"), + Some("OPERATOR_LOGICAL_XOR"), Some("OPERATOR_LOGICAL_NOT"), Some("OPERATOR_MATHS_ADDITION_EQUALS"), Some("OPERATOR_MATHS_SUBTRACTION_EQUALS"), Some("OPERATOR_MATHS_MULTIPLICATION_EQUALS"), Some("OPERATOR_MATHS_MODULUS_EQUALS"), Some("OPERATOR_MATHS_DIVISION_EQUALS"), Some("OPERATOR_MATHS_ADDITION"), Some("OPERATOR_MATHS_SUBTRACTION"), Some("OPERATOR_MATHS_MULTIPLICATION"), @@ -189,11 +208,13 @@ use std::ops::{Deref, DerefMut}; Some("FUNC_ID"), Some("EXPRESSION_END"), Some("VAR_ID"), Some("DOT"), Some("NUMBER"), Some("COMMAND_NEWLINE"), Some("COMMAND_WS"), Some("COMMAND_IF"), Some("COMMAND_ELSEIF"), Some("COMMAND_ELSE"), Some("COMMAND_SET"), Some("COMMAND_ENDIF"), - Some("COMMAND_CALL"), Some("COMMAND_DECLARE"), Some("COMMAND_JUMP"), Some("COMMAND_ENUM"), - Some("COMMAND_CASE"), Some("COMMAND_ENDENUM"), Some("COMMAND_LOCAL"), - Some("COMMAND_END"), Some("COMMAND_TEXT_NEWLINE"), Some("COMMAND_TEXT_END"), - Some("COMMAND_EXPRESSION_START"), Some("COMMAND_TEXT"), Some("COMMAND_ID_NEWLINE"), - Some("TYPE_STRING"), Some("TYPE_NUMBER"), Some("TYPE_BOOL") + Some("COMMAND_CALL"), Some("COMMAND_DECLARE"), Some("COMMAND_JUMP"), Some("COMMAND_DETOUR"), + Some("COMMAND_RETURN"), Some("COMMAND_ENUM"), Some("COMMAND_CASE"), Some("COMMAND_ENDENUM"), + Some("COMMAND_ONCE"), Some("COMMAND_ENDONCE"), Some("COMMAND_LOCAL"), + Some("COMMAND_END"), Some("COMMAND_TEXT_NEWLINE"), Some("COMMAND_EXPRESSION_START"), + Some("COMMAND_TEXT"), Some("COMMAND_ID_WS"), Some("COMMAND_ID_NEWLINE"), + Some("COMMAND_ID_OR_EXPRESSION_WS"), Some("TYPE_STRING"), Some("TYPE_NUMBER"), + Some("TYPE_BOOL") ]; lazy_static!{ static ref _shared_context_cache: Arc = Arc::new(PredictionContextCache::new()); @@ -273,9 +294,303 @@ impl YarnSpinnerLexerActions{ } impl<'input, Input:CharStream >> Actions<'input,BaseLexer<'input,YarnSpinnerLexerActions,Input,LocalTokenFactory<'input>>> for YarnSpinnerLexerActions{ + + fn action(_localctx: Option<&EmptyContext<'input,LocalTokenFactory<'input>> >, rule_index: i32, action_index: i32, + recog:&mut BaseLexer<'input,YarnSpinnerLexerActions,Input,LocalTokenFactory<'input>> + ){ + match rule_index { + 12 => + YarnSpinnerLexer::<'input>::HEADER_WHEN_DELIMITER_action(None, action_index, recog), + 93 => + YarnSpinnerLexer::<'input>::EXPRESSION_NEWLINE_action(None, action_index, recog), + _ => {} + } + } + fn sempred(_localctx: Option<&EmptyContext<'input,LocalTokenFactory<'input>> >, rule_index: i32, pred_index: i32, + recog:&mut BaseLexer<'input,YarnSpinnerLexerActions,Input,LocalTokenFactory<'input>> + ) -> bool { + match rule_index { + 52 => + YarnSpinnerLexer::<'input>::EXPRESSION_WHEN_ALWAYS_sempred(None, pred_index, recog), + 53 => + YarnSpinnerLexer::<'input>::EXPRESSION_WHEN_ONCE_sempred(None, pred_index, recog), + 54 => + YarnSpinnerLexer::<'input>::EXPRESSION_WHEN_IF_sempred(None, pred_index, recog), + 93 => + YarnSpinnerLexer::<'input>::EXPRESSION_NEWLINE_sempred(None, pred_index, recog), + 98 => + YarnSpinnerLexer::<'input>::COMMAND_IF_sempred(None, pred_index, recog), + 99 => + YarnSpinnerLexer::<'input>::COMMAND_ELSEIF_sempred(None, pred_index, recog), + 100 => + YarnSpinnerLexer::<'input>::COMMAND_ELSE_sempred(None, pred_index, recog), + 101 => + YarnSpinnerLexer::<'input>::COMMAND_SET_sempred(None, pred_index, recog), + 102 => + YarnSpinnerLexer::<'input>::COMMAND_ENDIF_sempred(None, pred_index, recog), + 103 => + YarnSpinnerLexer::<'input>::COMMAND_CALL_sempred(None, pred_index, recog), + 104 => + YarnSpinnerLexer::<'input>::COMMAND_DECLARE_sempred(None, pred_index, recog), + 105 => + YarnSpinnerLexer::<'input>::COMMAND_JUMP_sempred(None, pred_index, recog), + 106 => + YarnSpinnerLexer::<'input>::COMMAND_DETOUR_sempred(None, pred_index, recog), + 107 => + YarnSpinnerLexer::<'input>::COMMAND_RETURN_sempred(None, pred_index, recog), + 108 => + YarnSpinnerLexer::<'input>::COMMAND_ENUM_sempred(None, pred_index, recog), + 109 => + YarnSpinnerLexer::<'input>::COMMAND_CASE_sempred(None, pred_index, recog), + 110 => + YarnSpinnerLexer::<'input>::COMMAND_ENDENUM_sempred(None, pred_index, recog), + 111 => + YarnSpinnerLexer::<'input>::COMMAND_ONCE_sempred(None, pred_index, recog), + 112 => + YarnSpinnerLexer::<'input>::COMMAND_ENDONCE_sempred(None, pred_index, recog), + 113 => + YarnSpinnerLexer::<'input>::COMMAND_LOCAL_sempred(None, pred_index, recog), + _ => true + } + } + } - impl<'input, Input:CharStream >> YarnSpinnerLexer<'input,Input>{ +static mut in_when_clause: bool = false; + +fn SetInWhenClause(is: bool) { + unsafe { in_when_clause = is; } +} + +fn IsInWhenClause() -> bool { unsafe { in_when_clause } } +fn IsEndOfCommandKeyword() -> bool { true } + +impl<'input, Input:CharStream >> YarnSpinnerLexer<'input,Input>{ + + fn HEADER_WHEN_DELIMITER_action(_localctx: Option<&LexerContext<'input>>, action_index: i32, + recog:&mut ::Target + ) { + match action_index { + 0=>{ + SetInWhenClause(true); + }, + + _ => {} + } + } + + fn EXPRESSION_NEWLINE_action(_localctx: Option<&LexerContext<'input>>, action_index: i32, + recog:&mut ::Target + ) { + match action_index { + 1=>{ + SetInWhenClause(false); + }, + + _ => {} + } + } + fn EXPRESSION_WHEN_ALWAYS_sempred(_localctx: Option<&LexerContext<'input>>, pred_index:i32, + recog:&mut ::Target + ) -> bool { + match pred_index { + 0=>{ + IsInWhenClause() + } + _ => true + } + } + fn EXPRESSION_WHEN_ONCE_sempred(_localctx: Option<&LexerContext<'input>>, pred_index:i32, + recog:&mut ::Target + ) -> bool { + match pred_index { + 1=>{ + IsInWhenClause() + } + _ => true + } + } + fn EXPRESSION_WHEN_IF_sempred(_localctx: Option<&LexerContext<'input>>, pred_index:i32, + recog:&mut ::Target + ) -> bool { + match pred_index { + 2=>{ + IsInWhenClause() + } + _ => true + } + } + fn EXPRESSION_NEWLINE_sempred(_localctx: Option<&LexerContext<'input>>, pred_index:i32, + recog:&mut ::Target + ) -> bool { + match pred_index { + 3=>{ + IsInWhenClause() + } + _ => true + } + } + fn COMMAND_IF_sempred(_localctx: Option<&LexerContext<'input>>, pred_index:i32, + recog:&mut ::Target + ) -> bool { + match pred_index { + 4=>{ + IsEndOfCommandKeyword() + } + _ => true + } + } + fn COMMAND_ELSEIF_sempred(_localctx: Option<&LexerContext<'input>>, pred_index:i32, + recog:&mut ::Target + ) -> bool { + match pred_index { + 5=>{ + IsEndOfCommandKeyword() + } + _ => true + } + } + fn COMMAND_ELSE_sempred(_localctx: Option<&LexerContext<'input>>, pred_index:i32, + recog:&mut ::Target + ) -> bool { + match pred_index { + 6=>{ + IsEndOfCommandKeyword() + } + _ => true + } + } + fn COMMAND_SET_sempred(_localctx: Option<&LexerContext<'input>>, pred_index:i32, + recog:&mut ::Target + ) -> bool { + match pred_index { + 7=>{ + IsEndOfCommandKeyword() + } + _ => true + } + } + fn COMMAND_ENDIF_sempred(_localctx: Option<&LexerContext<'input>>, pred_index:i32, + recog:&mut ::Target + ) -> bool { + match pred_index { + 8=>{ + IsEndOfCommandKeyword() + } + _ => true + } + } + fn COMMAND_CALL_sempred(_localctx: Option<&LexerContext<'input>>, pred_index:i32, + recog:&mut ::Target + ) -> bool { + match pred_index { + 9=>{ + IsEndOfCommandKeyword() + } + _ => true + } + } + fn COMMAND_DECLARE_sempred(_localctx: Option<&LexerContext<'input>>, pred_index:i32, + recog:&mut ::Target + ) -> bool { + match pred_index { + 10=>{ + IsEndOfCommandKeyword() + } + _ => true + } + } + fn COMMAND_JUMP_sempred(_localctx: Option<&LexerContext<'input>>, pred_index:i32, + recog:&mut ::Target + ) -> bool { + match pred_index { + 11=>{ + IsEndOfCommandKeyword() + } + _ => true + } + } + fn COMMAND_DETOUR_sempred(_localctx: Option<&LexerContext<'input>>, pred_index:i32, + recog:&mut ::Target + ) -> bool { + match pred_index { + 12=>{ + IsEndOfCommandKeyword() + } + _ => true + } + } + fn COMMAND_RETURN_sempred(_localctx: Option<&LexerContext<'input>>, pred_index:i32, + recog:&mut ::Target + ) -> bool { + match pred_index { + 13=>{ + IsEndOfCommandKeyword() + } + _ => true + } + } + fn COMMAND_ENUM_sempred(_localctx: Option<&LexerContext<'input>>, pred_index:i32, + recog:&mut ::Target + ) -> bool { + match pred_index { + 14=>{ + IsEndOfCommandKeyword() + } + _ => true + } + } + fn COMMAND_CASE_sempred(_localctx: Option<&LexerContext<'input>>, pred_index:i32, + recog:&mut ::Target + ) -> bool { + match pred_index { + 15=>{ + IsEndOfCommandKeyword() + } + _ => true + } + } + fn COMMAND_ENDENUM_sempred(_localctx: Option<&LexerContext<'input>>, pred_index:i32, + recog:&mut ::Target + ) -> bool { + match pred_index { + 16=>{ + IsEndOfCommandKeyword() + } + _ => true + } + } + fn COMMAND_ONCE_sempred(_localctx: Option<&LexerContext<'input>>, pred_index:i32, + recog:&mut ::Target + ) -> bool { + match pred_index { + 17=>{ + IsEndOfCommandKeyword() + } + _ => true + } + } + fn COMMAND_ENDONCE_sempred(_localctx: Option<&LexerContext<'input>>, pred_index:i32, + recog:&mut ::Target + ) -> bool { + match pred_index { + 18=>{ + IsEndOfCommandKeyword() + } + _ => true + } + } + fn COMMAND_LOCAL_sempred(_localctx: Option<&LexerContext<'input>>, pred_index:i32, + recog:&mut ::Target + ) -> bool { + match pred_index { + 19=>{ + IsEndOfCommandKeyword() + } + _ => true + } + } + } @@ -334,397 +649,479 @@ impl<'input, Input:CharStream >> TokenSource<'input> for YarnSpinne Arc::new(dfa) }; static ref _serializedATN: Vec = vec![ - 4, 0, 84, 834, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, - 6, -1, 6, -1, 6, -1, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, - 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, - 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, - 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, - 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, - 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, - 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, - 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, - 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, - 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, - 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, - 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, - 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, - 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, 2, 68, 7, 68, 2, 69, - 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, 7, 72, 2, 73, 7, 73, 2, 74, - 7, 74, 2, 75, 7, 75, 2, 76, 7, 76, 2, 77, 7, 77, 2, 78, 7, 78, 2, 79, - 7, 79, 2, 80, 7, 80, 2, 81, 7, 81, 2, 82, 7, 82, 2, 83, 7, 83, 2, 84, - 7, 84, 2, 85, 7, 85, 2, 86, 7, 86, 2, 87, 7, 87, 2, 88, 7, 88, 2, 89, - 7, 89, 2, 90, 7, 90, 2, 91, 7, 91, 2, 92, 7, 92, 2, 93, 7, 93, 2, 94, - 7, 94, 2, 95, 7, 95, 2, 96, 7, 96, 2, 97, 7, 97, 2, 98, 7, 98, 2, 99, - 7, 99, 2, 100, 7, 100, 2, 101, 7, 101, 2, 102, 7, 102, 2, 103, 7, 103, - 2, 104, 7, 104, 2, 105, 7, 105, 2, 106, 7, 106, 2, 107, 7, 107, 2, 108, - 7, 108, 2, 109, 7, 109, 2, 110, 7, 110, 1, 0, 4, 0, 236, 8, 0, 11, 0, - 12, 0, 237, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 246, 8, 1, 10, - 1, 12, 1, 249, 9, 1, 1, 1, 1, 1, 1, 2, 3, 2, 254, 8, 2, 1, 2, 1, 2, 3, - 2, 258, 8, 2, 1, 2, 5, 2, 261, 8, 2, 10, 2, 12, 2, 264, 9, 2, 1, 2, 1, - 2, 1, 3, 1, 3, 3, 3, 270, 8, 3, 1, 4, 3, 4, 273, 8, 4, 1, 5, 1, 5, 3, - 5, 277, 8, 5, 1, 6, 4, 6, 280, 8, 6, 11, 6, 12, 6, 281, 1, 7, 1, 7, 1, - 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 5, 8, 292, 8, 8, 10, 8, 12, 8, 295, - 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 4, 10, 304, 8, 10, 11, - 10, 12, 10, 305, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, - 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, - 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, - 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, - 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, - 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, - 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, - 24, 1, 24, 1, 24, 1, 24, 3, 24, 379, 8, 24, 1, 24, 1, 24, 1, 25, 1, 25, - 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, - 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, - 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 4, 30, 411, 8, 30, 11, 30, - 12, 30, 412, 1, 30, 3, 30, 416, 8, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, - 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, - 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, - 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, - 38, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, - 41, 1, 42, 4, 42, 464, 8, 42, 11, 42, 12, 42, 465, 1, 42, 1, 42, 1, 43, - 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, - 1, 45, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 47, - 1, 47, 1, 47, 3, 47, 493, 8, 47, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, - 48, 500, 8, 48, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 3, 49, 507, 8, 49, - 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 3, 50, 515, 8, 50, 1, 51, 1, - 51, 1, 51, 3, 51, 520, 8, 51, 1, 52, 1, 52, 1, 52, 3, 52, 525, 8, 52, - 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 3, 53, 532, 8, 53, 1, 54, 1, 54, 1, - 54, 1, 54, 1, 54, 3, 54, 539, 8, 54, 1, 55, 1, 55, 1, 55, 1, 55, 3, 55, - 545, 8, 55, 1, 56, 1, 56, 1, 56, 1, 56, 3, 56, 551, 8, 56, 1, 57, 1, - 57, 1, 57, 1, 57, 3, 57, 557, 8, 57, 1, 58, 1, 58, 1, 58, 1, 59, 1, 59, - 1, 59, 1, 60, 1, 60, 1, 60, 1, 61, 1, 61, 1, 61, 1, 62, 1, 62, 1, 62, - 1, 63, 1, 63, 1, 64, 1, 64, 1, 65, 1, 65, 1, 66, 1, 66, 1, 67, 1, 67, - 1, 68, 1, 68, 1, 69, 1, 69, 1, 70, 1, 70, 1, 71, 1, 71, 1, 71, 1, 72, - 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 73, 1, 73, - 1, 73, 1, 73, 1, 73, 1, 73, 1, 73, 1, 73, 1, 73, 1, 74, 1, 74, 1, 74, - 1, 74, 1, 74, 1, 74, 1, 74, 1, 75, 1, 75, 1, 75, 1, 75, 5, 75, 622, 8, - 75, 10, 75, 12, 75, 625, 9, 75, 1, 75, 1, 75, 1, 76, 1, 76, 1, 77, 1, - 77, 1, 77, 1, 77, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, - 79, 1, 79, 1, 79, 1, 80, 1, 80, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 3, - 81, 652, 8, 81, 1, 82, 4, 82, 655, 8, 82, 11, 82, 12, 82, 656, 1, 83, - 1, 83, 1, 84, 1, 84, 1, 85, 1, 85, 1, 85, 1, 85, 1, 86, 1, 86, 1, 86, - 1, 86, 1, 86, 1, 86, 1, 86, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, - 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, - 1, 88, 3, 88, 691, 8, 88, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, - 89, 1, 89, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 91, 1, 91, 1, - 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 92, 1, 92, 1, 92, 1, - 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 93, 1, - 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 94, 1, 94, 1, - 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 95, 1, 95, 1, 95, 1, - 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 96, 1, 96, 1, 96, 1, 96, 1, - 96, 1, 96, 1, 96, 1, 96, 1, 96, 3, 96, 764, 8, 96, 1, 97, 1, 97, 1, 97, - 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, - 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 100, 1, 100, 1, 100, 1, - 100, 1, 100, 1, 101, 1, 101, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, - 1, 103, 1, 103, 1, 103, 1, 103, 1, 104, 4, 104, 802, 8, 104, 11, 104, - 12, 104, 803, 1, 105, 1, 105, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, + 4, 0, 94, 1011, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, + 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, + 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, + 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, + 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, + 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, + 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, + 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, + 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, + 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, + 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, + 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, + 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, + 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, + 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, 2, + 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, 7, 72, 2, + 73, 7, 73, 2, 74, 7, 74, 2, 75, 7, 75, 2, 76, 7, 76, 2, 77, 7, 77, 2, + 78, 7, 78, 2, 79, 7, 79, 2, 80, 7, 80, 2, 81, 7, 81, 2, 82, 7, 82, 2, + 83, 7, 83, 2, 84, 7, 84, 2, 85, 7, 85, 2, 86, 7, 86, 2, 87, 7, 87, 2, + 88, 7, 88, 2, 89, 7, 89, 2, 90, 7, 90, 2, 91, 7, 91, 2, 92, 7, 92, 2, + 93, 7, 93, 2, 94, 7, 94, 2, 95, 7, 95, 2, 96, 7, 96, 2, 97, 7, 97, 2, + 98, 7, 98, 2, 99, 7, 99, 2, 100, 7, 100, 2, 101, 7, 101, 2, 102, 7, 102, + 2, 103, 7, 103, 2, 104, 7, 104, 2, 105, 7, 105, 2, 106, 7, 106, 2, 107, + 7, 107, 2, 108, 7, 108, 2, 109, 7, 109, 2, 110, 7, 110, 2, 111, 7, 111, + 2, 112, 7, 112, 2, 113, 7, 113, 2, 114, 7, 114, 2, 115, 7, 115, 2, 116, + 7, 116, 2, 117, 7, 117, 2, 118, 7, 118, 2, 119, 7, 119, 2, 120, 7, 120, + 2, 121, 7, 121, 2, 122, 7, 122, 2, 123, 7, 123, 2, 124, 7, 124, 2, 125, + 7, 125, 2, 126, 7, 126, 2, 127, 7, 127, 2, 128, 7, 128, 1, 0, 4, 0, 274, + 8, 0, 11, 0, 12, 0, 275, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 284, + 8, 1, 10, 1, 12, 1, 287, 9, 1, 1, 1, 1, 1, 1, 2, 3, 2, 292, 8, 2, 1, + 2, 1, 2, 3, 2, 296, 8, 2, 1, 2, 5, 2, 299, 8, 2, 10, 2, 12, 2, 302, 9, + 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, + 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 3, 5, 323, 8, 5, 1, 6, + 3, 6, 326, 8, 6, 1, 7, 1, 7, 3, 7, 330, 8, 7, 1, 8, 4, 8, 333, 8, 8, + 11, 8, 12, 8, 334, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 3, 10, + 344, 8, 10, 1, 10, 1, 10, 3, 10, 348, 8, 10, 1, 10, 1, 10, 1, 11, 1, + 11, 1, 11, 1, 11, 1, 12, 3, 12, 357, 8, 12, 1, 12, 1, 12, 3, 12, 361, + 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, + 1, 14, 3, 14, 373, 8, 14, 1, 14, 1, 14, 3, 14, 377, 8, 14, 1, 14, 1, + 14, 1, 15, 3, 15, 382, 8, 15, 1, 15, 1, 15, 3, 15, 386, 8, 15, 1, 15, + 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 4, 17, 396, 8, 17, 11, + 17, 12, 17, 397, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, + 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, + 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, + 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, + 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, + 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, + 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, + 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 3, 32, 474, 8, 32, 1, 32, + 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, + 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, + 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 4, 38, + 506, 8, 38, 11, 38, 12, 38, 507, 1, 38, 3, 38, 511, 8, 38, 1, 39, 1, + 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, + 42, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, + 44, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 46, 1, + 46, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 1, 48, 1, + 49, 1, 49, 1, 49, 1, 49, 1, 50, 4, 50, 559, 8, 50, 11, 50, 12, 50, 560, + 1, 50, 1, 50, 1, 51, 1, 51, 1, 51, 1, 51, 1, 52, 1, 52, 1, 52, 1, 52, + 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, + 1, 53, 1, 53, 1, 53, 1, 53, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, + 1, 54, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 56, 1, 56, 1, 56, 1, 56, + 1, 56, 1, 56, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 58, 1, 58, 1, 58, + 3, 58, 613, 8, 58, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 3, 59, 620, 8, + 59, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 3, 60, 627, 8, 60, 1, 61, 1, 61, + 1, 61, 1, 61, 1, 61, 1, 61, 3, 61, 635, 8, 61, 1, 62, 1, 62, 1, 62, 3, + 62, 640, 8, 62, 1, 63, 1, 63, 1, 63, 3, 63, 645, 8, 63, 1, 64, 1, 64, + 1, 64, 1, 64, 1, 64, 3, 64, 652, 8, 64, 1, 65, 1, 65, 1, 65, 1, 65, 1, + 65, 3, 65, 659, 8, 65, 1, 66, 1, 66, 1, 66, 1, 66, 3, 66, 665, 8, 66, + 1, 67, 1, 67, 1, 67, 1, 67, 3, 67, 671, 8, 67, 1, 68, 1, 68, 1, 68, 1, + 68, 3, 68, 677, 8, 68, 1, 69, 1, 69, 1, 69, 1, 70, 1, 70, 1, 70, 1, 71, + 1, 71, 1, 71, 1, 72, 1, 72, 1, 72, 1, 73, 1, 73, 1, 73, 1, 74, 1, 74, + 1, 75, 1, 75, 1, 76, 1, 76, 1, 77, 1, 77, 1, 78, 1, 78, 1, 79, 1, 79, + 1, 80, 1, 80, 1, 81, 1, 81, 1, 82, 1, 82, 1, 82, 1, 83, 1, 83, 1, 83, + 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 84, 1, 84, 1, 84, 1, 84, + 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, + 1, 85, 1, 85, 1, 86, 1, 86, 1, 86, 1, 86, 5, 86, 742, 8, 86, 10, 86, + 12, 86, 745, 9, 86, 1, 86, 1, 86, 1, 87, 1, 87, 1, 88, 1, 88, 1, 88, + 1, 88, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 90, 1, 90, + 1, 90, 1, 91, 1, 91, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 3, 92, 772, 8, + 92, 1, 93, 4, 93, 775, 8, 93, 11, 93, 12, 93, 776, 1, 93, 1, 93, 1, 93, + 1, 93, 1, 93, 1, 93, 1, 94, 4, 94, 786, 8, 94, 11, 94, 12, 94, 787, 1, + 95, 1, 95, 1, 96, 1, 96, 1, 97, 1, 97, 1, 97, 1, 97, 1, 98, 1, 98, 1, + 98, 1, 98, 1, 98, 1, 98, 1, 98, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, + 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 100, 1, 100, 1, 100, 1, 100, + 1, 100, 1, 100, 1, 100, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, + 1, 101, 1, 101, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, + 1, 102, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, + 1, 103, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, + 1, 104, 1, 104, 1, 104, 1, 104, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, + 1, 105, 1, 105, 1, 105, 1, 105, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, + 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 108, 1, 108, 1, 108, - 1, 108, 1, 108, 1, 109, 1, 109, 1, 109, 1, 109, 1, 109, 1, 110, 1, 110, - 1, 110, 1, 110, 1, 110, 1, 110, 0, 0, 111, 12, 4, 14, 5, 16, 6, 18, 7, - 20, 0, 22, 0, 24, 0, 26, 8, 28, 9, 30, 10, 32, 11, 34, 0, 36, 12, 38, - 0, 40, 0, 42, 13, 44, 14, 46, 15, 48, 0, 50, 16, 52, 0, 54, 17, 56, 0, - 58, 0, 60, 0, 62, 18, 64, 0, 66, 0, 68, 0, 70, 19, 72, 20, 74, 0, 76, - 0, 78, 21, 80, 22, 82, 23, 84, 0, 86, 0, 88, 0, 90, 24, 92, 25, 94, 0, - 96, 26, 98, 27, 100, 28, 102, 29, 104, 30, 106, 31, 108, 32, 110, 33, - 112, 34, 114, 35, 116, 36, 118, 37, 120, 38, 122, 39, 124, 40, 126, 41, - 128, 42, 130, 43, 132, 44, 134, 45, 136, 46, 138, 47, 140, 48, 142, 49, - 144, 50, 146, 51, 148, 52, 150, 53, 152, 54, 154, 55, 156, 82, 158, 83, - 160, 84, 162, 56, 164, 57, 166, 58, 168, 0, 170, 59, 172, 60, 174, 61, - 176, 0, 178, 0, 180, 62, 182, 63, 184, 64, 186, 65, 188, 66, 190, 67, - 192, 68, 194, 69, 196, 70, 198, 71, 200, 72, 202, 73, 204, 74, 206, 75, - 208, 76, 210, 0, 212, 0, 214, 77, 216, 78, 218, 79, 220, 80, 222, 81, - 224, 0, 226, 0, 228, 0, 230, 0, 232, 0, 12, 0, 1, 2, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 14, 2, 0, 9, 9, 32, 32, 2, 0, 10, 10, 13, 13, 49, 0, 65, 90, - 95, 95, 97, 122, 168, 168, 170, 170, 173, 173, 175, 175, 178, 181, 183, - 186, 188, 190, 192, 214, 216, 246, 248, 767, 880, 5759, 5761, 6157, 6159, - 7615, 7680, 8191, 8203, 8205, 8234, 8238, 8255, 8256, 8276, 8276, 8288, - 8399, 8448, 8591, 9312, 9471, 10102, 10131, 11264, 11775, 11904, 12287, - 12292, 12295, 12321, 12335, 12337, 55295, 63744, 64829, 64832, 64975, - 65008, 65055, 65072, 65092, 65095, 65533, 65536, 131069, 131072, 196605, - 196608, 262141, 262144, 327677, 327680, 393213, 393216, 458749, 458752, - 524285, 524288, 589821, 589824, 655357, 655360, 720893, 720896, 786429, - 786432, 851965, 851968, 917501, 917504, 983037, 5, 0, 48, 57, 768, 879, - 7616, 7679, 8400, 8447, 65056, 65071, 1, 0, 32, 32, 2, 0, 47, 47, 60, - 60, 7, 0, 10, 10, 13, 13, 35, 35, 47, 47, 60, 60, 92, 92, 123, 123, 7, - 0, 35, 35, 47, 47, 60, 60, 62, 62, 92, 92, 123, 123, 125, 125, 5, 0, - 9, 10, 13, 13, 32, 32, 35, 36, 60, 60, 4, 0, 10, 10, 13, 13, 34, 34, - 92, 92, 2, 0, 34, 34, 92, 92, 1, 0, 48, 57, 10, 0, 9, 13, 32, 32, 133, - 133, 160, 160, 5760, 5760, 8192, 8202, 8232, 8233, 8239, 8239, 8287, - 8287, 12288, 12288, 4, 0, 10, 10, 13, 13, 62, 62, 123, 123, 849, 0, 12, - 1, 0, 0, 0, 0, 14, 1, 0, 0, 0, 0, 16, 1, 0, 0, 0, 0, 18, 1, 0, 0, 0, - 0, 26, 1, 0, 0, 0, 0, 28, 1, 0, 0, 0, 0, 30, 1, 0, 0, 0, 1, 32, 1, 0, - 0, 0, 1, 34, 1, 0, 0, 0, 2, 36, 1, 0, 0, 0, 2, 38, 1, 0, 0, 0, 2, 40, - 1, 0, 0, 0, 2, 42, 1, 0, 0, 0, 2, 44, 1, 0, 0, 0, 2, 46, 1, 0, 0, 0, - 2, 48, 1, 0, 0, 0, 2, 50, 1, 0, 0, 0, 2, 52, 1, 0, 0, 0, 2, 54, 1, 0, - 0, 0, 2, 56, 1, 0, 0, 0, 3, 58, 1, 0, 0, 0, 3, 60, 1, 0, 0, 0, 3, 62, - 1, 0, 0, 0, 3, 64, 1, 0, 0, 0, 3, 66, 1, 0, 0, 0, 3, 68, 1, 0, 0, 0, - 3, 70, 1, 0, 0, 0, 3, 72, 1, 0, 0, 0, 4, 76, 1, 0, 0, 0, 4, 78, 1, 0, - 0, 0, 5, 80, 1, 0, 0, 0, 5, 82, 1, 0, 0, 0, 5, 84, 1, 0, 0, 0, 5, 86, - 1, 0, 0, 0, 5, 88, 1, 0, 0, 0, 5, 90, 1, 0, 0, 0, 6, 92, 1, 0, 0, 0, - 6, 94, 1, 0, 0, 0, 6, 96, 1, 0, 0, 0, 7, 98, 1, 0, 0, 0, 7, 100, 1, 0, - 0, 0, 7, 102, 1, 0, 0, 0, 7, 104, 1, 0, 0, 0, 7, 106, 1, 0, 0, 0, 7, - 108, 1, 0, 0, 0, 7, 110, 1, 0, 0, 0, 7, 112, 1, 0, 0, 0, 7, 114, 1, 0, - 0, 0, 7, 116, 1, 0, 0, 0, 7, 118, 1, 0, 0, 0, 7, 120, 1, 0, 0, 0, 7, - 122, 1, 0, 0, 0, 7, 124, 1, 0, 0, 0, 7, 126, 1, 0, 0, 0, 7, 128, 1, 0, - 0, 0, 7, 130, 1, 0, 0, 0, 7, 132, 1, 0, 0, 0, 7, 134, 1, 0, 0, 0, 7, - 136, 1, 0, 0, 0, 7, 138, 1, 0, 0, 0, 7, 140, 1, 0, 0, 0, 7, 142, 1, 0, - 0, 0, 7, 144, 1, 0, 0, 0, 7, 146, 1, 0, 0, 0, 7, 148, 1, 0, 0, 0, 7, - 150, 1, 0, 0, 0, 7, 152, 1, 0, 0, 0, 7, 154, 1, 0, 0, 0, 7, 156, 1, 0, - 0, 0, 7, 158, 1, 0, 0, 0, 7, 160, 1, 0, 0, 0, 7, 162, 1, 0, 0, 0, 7, - 164, 1, 0, 0, 0, 7, 166, 1, 0, 0, 0, 7, 168, 1, 0, 0, 0, 7, 170, 1, 0, - 0, 0, 7, 172, 1, 0, 0, 0, 7, 174, 1, 0, 0, 0, 8, 180, 1, 0, 0, 0, 8, - 182, 1, 0, 0, 0, 8, 184, 1, 0, 0, 0, 8, 186, 1, 0, 0, 0, 8, 188, 1, 0, - 0, 0, 8, 190, 1, 0, 0, 0, 8, 192, 1, 0, 0, 0, 8, 194, 1, 0, 0, 0, 8, - 196, 1, 0, 0, 0, 8, 198, 1, 0, 0, 0, 8, 200, 1, 0, 0, 0, 8, 202, 1, 0, - 0, 0, 8, 204, 1, 0, 0, 0, 8, 206, 1, 0, 0, 0, 8, 208, 1, 0, 0, 0, 8, - 210, 1, 0, 0, 0, 8, 212, 1, 0, 0, 0, 9, 214, 1, 0, 0, 0, 9, 216, 1, 0, - 0, 0, 9, 218, 1, 0, 0, 0, 9, 220, 1, 0, 0, 0, 10, 222, 1, 0, 0, 0, 10, - 224, 1, 0, 0, 0, 10, 226, 1, 0, 0, 0, 11, 228, 1, 0, 0, 0, 11, 230, 1, - 0, 0, 0, 11, 232, 1, 0, 0, 0, 12, 235, 1, 0, 0, 0, 14, 241, 1, 0, 0, - 0, 16, 257, 1, 0, 0, 0, 18, 267, 1, 0, 0, 0, 20, 272, 1, 0, 0, 0, 22, - 276, 1, 0, 0, 0, 24, 279, 1, 0, 0, 0, 26, 283, 1, 0, 0, 0, 28, 289, 1, - 0, 0, 0, 30, 298, 1, 0, 0, 0, 32, 303, 1, 0, 0, 0, 34, 307, 1, 0, 0, - 0, 36, 313, 1, 0, 0, 0, 38, 317, 1, 0, 0, 0, 40, 322, 1, 0, 0, 0, 42, - 327, 1, 0, 0, 0, 44, 333, 1, 0, 0, 0, 46, 336, 1, 0, 0, 0, 48, 341, 1, - 0, 0, 0, 50, 347, 1, 0, 0, 0, 52, 352, 1, 0, 0, 0, 54, 358, 1, 0, 0, - 0, 56, 364, 1, 0, 0, 0, 58, 369, 1, 0, 0, 0, 60, 378, 1, 0, 0, 0, 62, - 382, 1, 0, 0, 0, 64, 387, 1, 0, 0, 0, 66, 393, 1, 0, 0, 0, 68, 398, 1, - 0, 0, 0, 70, 405, 1, 0, 0, 0, 72, 415, 1, 0, 0, 0, 74, 417, 1, 0, 0, - 0, 76, 419, 1, 0, 0, 0, 78, 424, 1, 0, 0, 0, 80, 428, 1, 0, 0, 0, 82, - 432, 1, 0, 0, 0, 84, 436, 1, 0, 0, 0, 86, 442, 1, 0, 0, 0, 88, 447, 1, - 0, 0, 0, 90, 452, 1, 0, 0, 0, 92, 454, 1, 0, 0, 0, 94, 458, 1, 0, 0, - 0, 96, 463, 1, 0, 0, 0, 98, 469, 1, 0, 0, 0, 100, 473, 1, 0, 0, 0, 102, - 478, 1, 0, 0, 0, 104, 484, 1, 0, 0, 0, 106, 492, 1, 0, 0, 0, 108, 499, - 1, 0, 0, 0, 110, 506, 1, 0, 0, 0, 112, 514, 1, 0, 0, 0, 114, 519, 1, - 0, 0, 0, 116, 524, 1, 0, 0, 0, 118, 531, 1, 0, 0, 0, 120, 538, 1, 0, - 0, 0, 122, 544, 1, 0, 0, 0, 124, 550, 1, 0, 0, 0, 126, 556, 1, 0, 0, - 0, 128, 558, 1, 0, 0, 0, 130, 561, 1, 0, 0, 0, 132, 564, 1, 0, 0, 0, - 134, 567, 1, 0, 0, 0, 136, 570, 1, 0, 0, 0, 138, 573, 1, 0, 0, 0, 140, - 575, 1, 0, 0, 0, 142, 577, 1, 0, 0, 0, 144, 579, 1, 0, 0, 0, 146, 581, - 1, 0, 0, 0, 148, 583, 1, 0, 0, 0, 150, 585, 1, 0, 0, 0, 152, 587, 1, - 0, 0, 0, 154, 589, 1, 0, 0, 0, 156, 592, 1, 0, 0, 0, 158, 601, 1, 0, - 0, 0, 160, 610, 1, 0, 0, 0, 162, 617, 1, 0, 0, 0, 164, 628, 1, 0, 0, - 0, 166, 630, 1, 0, 0, 0, 168, 634, 1, 0, 0, 0, 170, 641, 1, 0, 0, 0, - 172, 644, 1, 0, 0, 0, 174, 651, 1, 0, 0, 0, 176, 654, 1, 0, 0, 0, 178, - 658, 1, 0, 0, 0, 180, 660, 1, 0, 0, 0, 182, 662, 1, 0, 0, 0, 184, 666, - 1, 0, 0, 0, 186, 673, 1, 0, 0, 0, 188, 684, 1, 0, 0, 0, 190, 692, 1, - 0, 0, 0, 192, 700, 1, 0, 0, 0, 194, 706, 1, 0, 0, 0, 196, 715, 1, 0, - 0, 0, 198, 727, 1, 0, 0, 0, 200, 736, 1, 0, 0, 0, 202, 745, 1, 0, 0, - 0, 204, 754, 1, 0, 0, 0, 206, 765, 1, 0, 0, 0, 208, 773, 1, 0, 0, 0, - 210, 778, 1, 0, 0, 0, 212, 784, 1, 0, 0, 0, 214, 789, 1, 0, 0, 0, 216, - 791, 1, 0, 0, 0, 218, 796, 1, 0, 0, 0, 220, 801, 1, 0, 0, 0, 222, 805, - 1, 0, 0, 0, 224, 807, 1, 0, 0, 0, 226, 812, 1, 0, 0, 0, 228, 818, 1, - 0, 0, 0, 230, 823, 1, 0, 0, 0, 232, 828, 1, 0, 0, 0, 234, 236, 7, 0, - 0, 0, 235, 234, 1, 0, 0, 0, 236, 237, 1, 0, 0, 0, 237, 235, 1, 0, 0, - 0, 237, 238, 1, 0, 0, 0, 238, 239, 1, 0, 0, 0, 239, 240, 6, 0, 0, 0, - 240, 13, 1, 0, 0, 0, 241, 242, 5, 47, 0, 0, 242, 243, 5, 47, 0, 0, 243, - 247, 1, 0, 0, 0, 244, 246, 8, 1, 0, 0, 245, 244, 1, 0, 0, 0, 246, 249, - 1, 0, 0, 0, 247, 245, 1, 0, 0, 0, 247, 248, 1, 0, 0, 0, 248, 250, 1, - 0, 0, 0, 249, 247, 1, 0, 0, 0, 250, 251, 6, 1, 1, 0, 251, 15, 1, 0, 0, - 0, 252, 254, 5, 13, 0, 0, 253, 252, 1, 0, 0, 0, 253, 254, 1, 0, 0, 0, - 254, 255, 1, 0, 0, 0, 255, 258, 5, 10, 0, 0, 256, 258, 5, 13, 0, 0, 257, - 253, 1, 0, 0, 0, 257, 256, 1, 0, 0, 0, 258, 262, 1, 0, 0, 0, 259, 261, - 7, 0, 0, 0, 260, 259, 1, 0, 0, 0, 261, 264, 1, 0, 0, 0, 262, 260, 1, - 0, 0, 0, 262, 263, 1, 0, 0, 0, 263, 265, 1, 0, 0, 0, 264, 262, 1, 0, - 0, 0, 265, 266, 6, 2, 2, 0, 266, 17, 1, 0, 0, 0, 267, 269, 3, 20, 4, - 0, 268, 270, 3, 24, 6, 0, 269, 268, 1, 0, 0, 0, 269, 270, 1, 0, 0, 0, - 270, 19, 1, 0, 0, 0, 271, 273, 7, 2, 0, 0, 272, 271, 1, 0, 0, 0, 273, - 21, 1, 0, 0, 0, 274, 277, 7, 3, 0, 0, 275, 277, 3, 20, 4, 0, 276, 274, - 1, 0, 0, 0, 276, 275, 1, 0, 0, 0, 277, 23, 1, 0, 0, 0, 278, 280, 3, 22, - 5, 0, 279, 278, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, 281, 279, 1, 0, 0, - 0, 281, 282, 1, 0, 0, 0, 282, 25, 1, 0, 0, 0, 283, 284, 5, 45, 0, 0, - 284, 285, 5, 45, 0, 0, 285, 286, 5, 45, 0, 0, 286, 287, 1, 0, 0, 0, 287, - 288, 6, 7, 3, 0, 288, 27, 1, 0, 0, 0, 289, 293, 5, 58, 0, 0, 290, 292, - 7, 4, 0, 0, 291, 290, 1, 0, 0, 0, 292, 295, 1, 0, 0, 0, 293, 291, 1, - 0, 0, 0, 293, 294, 1, 0, 0, 0, 294, 296, 1, 0, 0, 0, 295, 293, 1, 0, - 0, 0, 296, 297, 6, 8, 4, 0, 297, 29, 1, 0, 0, 0, 298, 299, 5, 35, 0, - 0, 299, 300, 1, 0, 0, 0, 300, 301, 6, 9, 5, 0, 301, 31, 1, 0, 0, 0, 302, - 304, 8, 1, 0, 0, 303, 302, 1, 0, 0, 0, 304, 305, 1, 0, 0, 0, 305, 303, - 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 33, 1, 0, 0, 0, 307, 308, 3, 16, - 2, 0, 308, 309, 1, 0, 0, 0, 309, 310, 6, 11, 6, 0, 310, 311, 6, 11, 2, - 0, 311, 312, 6, 11, 7, 0, 312, 35, 1, 0, 0, 0, 313, 314, 3, 12, 0, 0, - 314, 315, 1, 0, 0, 0, 315, 316, 6, 12, 0, 0, 316, 37, 1, 0, 0, 0, 317, - 318, 3, 16, 2, 0, 318, 319, 1, 0, 0, 0, 319, 320, 6, 13, 6, 0, 320, 321, - 6, 13, 2, 0, 321, 39, 1, 0, 0, 0, 322, 323, 3, 14, 1, 0, 323, 324, 1, - 0, 0, 0, 324, 325, 6, 14, 8, 0, 325, 326, 6, 14, 1, 0, 326, 41, 1, 0, - 0, 0, 327, 328, 5, 61, 0, 0, 328, 329, 5, 61, 0, 0, 329, 330, 5, 61, - 0, 0, 330, 331, 1, 0, 0, 0, 331, 332, 6, 15, 7, 0, 332, 43, 1, 0, 0, - 0, 333, 334, 5, 45, 0, 0, 334, 335, 5, 62, 0, 0, 335, 45, 1, 0, 0, 0, - 336, 337, 5, 60, 0, 0, 337, 338, 5, 60, 0, 0, 338, 339, 1, 0, 0, 0, 339, - 340, 6, 17, 9, 0, 340, 47, 1, 0, 0, 0, 341, 342, 5, 35, 0, 0, 342, 343, - 1, 0, 0, 0, 343, 344, 6, 18, 10, 0, 344, 345, 6, 18, 11, 0, 345, 346, - 6, 18, 5, 0, 346, 49, 1, 0, 0, 0, 347, 348, 5, 123, 0, 0, 348, 349, 1, - 0, 0, 0, 349, 350, 6, 19, 12, 0, 350, 351, 6, 19, 13, 0, 351, 51, 1, - 0, 0, 0, 352, 353, 5, 92, 0, 0, 353, 354, 5, 91, 0, 0, 354, 355, 1, 0, - 0, 0, 355, 356, 6, 20, 14, 0, 356, 357, 6, 20, 12, 0, 357, 53, 1, 0, - 0, 0, 358, 359, 5, 92, 0, 0, 359, 360, 1, 0, 0, 0, 360, 361, 6, 21, 0, - 0, 361, 362, 6, 21, 12, 0, 362, 363, 6, 21, 15, 0, 363, 55, 1, 0, 0, - 0, 364, 365, 9, 0, 0, 0, 365, 366, 1, 0, 0, 0, 366, 367, 6, 22, 14, 0, - 367, 368, 6, 22, 12, 0, 368, 57, 1, 0, 0, 0, 369, 370, 3, 16, 2, 0, 370, - 371, 1, 0, 0, 0, 371, 372, 6, 23, 6, 0, 372, 373, 6, 23, 7, 0, 373, 59, - 1, 0, 0, 0, 374, 375, 5, 92, 0, 0, 375, 379, 5, 91, 0, 0, 376, 377, 5, - 92, 0, 0, 377, 379, 5, 93, 0, 0, 378, 374, 1, 0, 0, 0, 378, 376, 1, 0, - 0, 0, 379, 380, 1, 0, 0, 0, 380, 381, 6, 24, 14, 0, 381, 61, 1, 0, 0, - 0, 382, 383, 5, 92, 0, 0, 383, 384, 1, 0, 0, 0, 384, 385, 6, 25, 16, - 0, 385, 386, 6, 25, 15, 0, 386, 63, 1, 0, 0, 0, 387, 388, 3, 30, 9, 0, - 388, 389, 1, 0, 0, 0, 389, 390, 6, 26, 10, 0, 390, 391, 6, 26, 17, 0, - 391, 392, 6, 26, 5, 0, 392, 65, 1, 0, 0, 0, 393, 394, 5, 123, 0, 0, 394, - 395, 1, 0, 0, 0, 395, 396, 6, 27, 18, 0, 396, 397, 6, 27, 13, 0, 397, - 67, 1, 0, 0, 0, 398, 399, 5, 60, 0, 0, 399, 400, 5, 60, 0, 0, 400, 401, - 1, 0, 0, 0, 401, 402, 6, 28, 19, 0, 402, 403, 6, 28, 17, 0, 403, 404, - 6, 28, 9, 0, 404, 69, 1, 0, 0, 0, 405, 406, 3, 14, 1, 0, 406, 407, 1, - 0, 0, 0, 407, 408, 6, 29, 1, 0, 408, 71, 1, 0, 0, 0, 409, 411, 3, 74, - 31, 0, 410, 409, 1, 0, 0, 0, 411, 412, 1, 0, 0, 0, 412, 410, 1, 0, 0, - 0, 412, 413, 1, 0, 0, 0, 413, 416, 1, 0, 0, 0, 414, 416, 7, 5, 0, 0, - 415, 410, 1, 0, 0, 0, 415, 414, 1, 0, 0, 0, 416, 73, 1, 0, 0, 0, 417, - 418, 8, 6, 0, 0, 418, 75, 1, 0, 0, 0, 419, 420, 7, 7, 0, 0, 420, 421, - 1, 0, 0, 0, 421, 422, 6, 32, 14, 0, 422, 423, 6, 32, 7, 0, 423, 77, 1, - 0, 0, 0, 424, 425, 9, 0, 0, 0, 425, 426, 1, 0, 0, 0, 426, 427, 6, 33, - 7, 0, 427, 79, 1, 0, 0, 0, 428, 429, 3, 12, 0, 0, 429, 430, 1, 0, 0, - 0, 430, 431, 6, 34, 0, 0, 431, 81, 1, 0, 0, 0, 432, 433, 3, 14, 1, 0, - 433, 434, 1, 0, 0, 0, 434, 435, 6, 35, 1, 0, 435, 83, 1, 0, 0, 0, 436, - 437, 5, 60, 0, 0, 437, 438, 5, 60, 0, 0, 438, 439, 1, 0, 0, 0, 439, 440, - 6, 36, 19, 0, 440, 441, 6, 36, 9, 0, 441, 85, 1, 0, 0, 0, 442, 443, 5, - 35, 0, 0, 443, 444, 1, 0, 0, 0, 444, 445, 6, 37, 10, 0, 445, 446, 6, - 37, 5, 0, 446, 87, 1, 0, 0, 0, 447, 448, 3, 16, 2, 0, 448, 449, 1, 0, - 0, 0, 449, 450, 6, 38, 6, 0, 450, 451, 6, 38, 7, 0, 451, 89, 1, 0, 0, - 0, 452, 453, 9, 0, 0, 0, 453, 91, 1, 0, 0, 0, 454, 455, 3, 12, 0, 0, - 455, 456, 1, 0, 0, 0, 456, 457, 6, 40, 0, 0, 457, 93, 1, 0, 0, 0, 458, - 459, 3, 30, 9, 0, 459, 460, 1, 0, 0, 0, 460, 461, 6, 41, 10, 0, 461, - 95, 1, 0, 0, 0, 462, 464, 8, 8, 0, 0, 463, 462, 1, 0, 0, 0, 464, 465, - 1, 0, 0, 0, 465, 463, 1, 0, 0, 0, 465, 466, 1, 0, 0, 0, 466, 467, 1, - 0, 0, 0, 467, 468, 6, 42, 7, 0, 468, 97, 1, 0, 0, 0, 469, 470, 3, 12, - 0, 0, 470, 471, 1, 0, 0, 0, 471, 472, 6, 43, 0, 0, 472, 99, 1, 0, 0, - 0, 473, 474, 5, 116, 0, 0, 474, 475, 5, 114, 0, 0, 475, 476, 5, 117, - 0, 0, 476, 477, 5, 101, 0, 0, 477, 101, 1, 0, 0, 0, 478, 479, 5, 102, - 0, 0, 479, 480, 5, 97, 0, 0, 480, 481, 5, 108, 0, 0, 481, 482, 5, 115, - 0, 0, 482, 483, 5, 101, 0, 0, 483, 103, 1, 0, 0, 0, 484, 485, 5, 110, - 0, 0, 485, 486, 5, 117, 0, 0, 486, 487, 5, 108, 0, 0, 487, 488, 5, 108, - 0, 0, 488, 105, 1, 0, 0, 0, 489, 493, 5, 61, 0, 0, 490, 491, 5, 116, - 0, 0, 491, 493, 5, 111, 0, 0, 492, 489, 1, 0, 0, 0, 492, 490, 1, 0, 0, - 0, 493, 107, 1, 0, 0, 0, 494, 495, 5, 60, 0, 0, 495, 500, 5, 61, 0, 0, - 496, 497, 5, 108, 0, 0, 497, 498, 5, 116, 0, 0, 498, 500, 5, 101, 0, - 0, 499, 494, 1, 0, 0, 0, 499, 496, 1, 0, 0, 0, 500, 109, 1, 0, 0, 0, - 501, 502, 5, 62, 0, 0, 502, 507, 5, 61, 0, 0, 503, 504, 5, 103, 0, 0, - 504, 505, 5, 116, 0, 0, 505, 507, 5, 101, 0, 0, 506, 501, 1, 0, 0, 0, - 506, 503, 1, 0, 0, 0, 507, 111, 1, 0, 0, 0, 508, 509, 5, 61, 0, 0, 509, - 515, 5, 61, 0, 0, 510, 511, 5, 105, 0, 0, 511, 515, 5, 115, 0, 0, 512, - 513, 5, 101, 0, 0, 513, 515, 5, 113, 0, 0, 514, 508, 1, 0, 0, 0, 514, - 510, 1, 0, 0, 0, 514, 512, 1, 0, 0, 0, 515, 113, 1, 0, 0, 0, 516, 520, - 5, 60, 0, 0, 517, 518, 5, 108, 0, 0, 518, 520, 5, 116, 0, 0, 519, 516, - 1, 0, 0, 0, 519, 517, 1, 0, 0, 0, 520, 115, 1, 0, 0, 0, 521, 525, 5, - 62, 0, 0, 522, 523, 5, 103, 0, 0, 523, 525, 5, 116, 0, 0, 524, 521, 1, - 0, 0, 0, 524, 522, 1, 0, 0, 0, 525, 117, 1, 0, 0, 0, 526, 527, 5, 33, - 0, 0, 527, 532, 5, 61, 0, 0, 528, 529, 5, 110, 0, 0, 529, 530, 5, 101, - 0, 0, 530, 532, 5, 113, 0, 0, 531, 526, 1, 0, 0, 0, 531, 528, 1, 0, 0, - 0, 532, 119, 1, 0, 0, 0, 533, 534, 5, 97, 0, 0, 534, 535, 5, 110, 0, - 0, 535, 539, 5, 100, 0, 0, 536, 537, 5, 38, 0, 0, 537, 539, 5, 38, 0, - 0, 538, 533, 1, 0, 0, 0, 538, 536, 1, 0, 0, 0, 539, 121, 1, 0, 0, 0, - 540, 541, 5, 111, 0, 0, 541, 545, 5, 114, 0, 0, 542, 543, 5, 124, 0, - 0, 543, 545, 5, 124, 0, 0, 544, 540, 1, 0, 0, 0, 544, 542, 1, 0, 0, 0, - 545, 123, 1, 0, 0, 0, 546, 547, 5, 120, 0, 0, 547, 548, 5, 111, 0, 0, - 548, 551, 5, 114, 0, 0, 549, 551, 5, 94, 0, 0, 550, 546, 1, 0, 0, 0, - 550, 549, 1, 0, 0, 0, 551, 125, 1, 0, 0, 0, 552, 553, 5, 110, 0, 0, 553, - 554, 5, 111, 0, 0, 554, 557, 5, 116, 0, 0, 555, 557, 5, 33, 0, 0, 556, - 552, 1, 0, 0, 0, 556, 555, 1, 0, 0, 0, 557, 127, 1, 0, 0, 0, 558, 559, - 5, 43, 0, 0, 559, 560, 5, 61, 0, 0, 560, 129, 1, 0, 0, 0, 561, 562, 5, - 45, 0, 0, 562, 563, 5, 61, 0, 0, 563, 131, 1, 0, 0, 0, 564, 565, 5, 42, - 0, 0, 565, 566, 5, 61, 0, 0, 566, 133, 1, 0, 0, 0, 567, 568, 5, 37, 0, - 0, 568, 569, 5, 61, 0, 0, 569, 135, 1, 0, 0, 0, 570, 571, 5, 47, 0, 0, - 571, 572, 5, 61, 0, 0, 572, 137, 1, 0, 0, 0, 573, 574, 5, 43, 0, 0, 574, - 139, 1, 0, 0, 0, 575, 576, 5, 45, 0, 0, 576, 141, 1, 0, 0, 0, 577, 578, - 5, 42, 0, 0, 578, 143, 1, 0, 0, 0, 579, 580, 5, 47, 0, 0, 580, 145, 1, - 0, 0, 0, 581, 582, 5, 37, 0, 0, 582, 147, 1, 0, 0, 0, 583, 584, 5, 40, - 0, 0, 584, 149, 1, 0, 0, 0, 585, 586, 5, 41, 0, 0, 586, 151, 1, 0, 0, - 0, 587, 588, 5, 44, 0, 0, 588, 153, 1, 0, 0, 0, 589, 590, 5, 97, 0, 0, - 590, 591, 5, 115, 0, 0, 591, 155, 1, 0, 0, 0, 592, 593, 5, 115, 0, 0, - 593, 594, 5, 116, 0, 0, 594, 595, 5, 114, 0, 0, 595, 596, 5, 105, 0, - 0, 596, 597, 5, 110, 0, 0, 597, 598, 5, 103, 0, 0, 598, 599, 1, 0, 0, - 0, 599, 600, 6, 72, 20, 0, 600, 157, 1, 0, 0, 0, 601, 602, 5, 110, 0, - 0, 602, 603, 5, 117, 0, 0, 603, 604, 5, 109, 0, 0, 604, 605, 5, 98, 0, - 0, 605, 606, 5, 101, 0, 0, 606, 607, 5, 114, 0, 0, 607, 608, 1, 0, 0, - 0, 608, 609, 6, 73, 20, 0, 609, 159, 1, 0, 0, 0, 610, 611, 5, 98, 0, - 0, 611, 612, 5, 111, 0, 0, 612, 613, 5, 111, 0, 0, 613, 614, 5, 108, - 0, 0, 614, 615, 1, 0, 0, 0, 615, 616, 6, 74, 20, 0, 616, 161, 1, 0, 0, - 0, 617, 623, 5, 34, 0, 0, 618, 622, 8, 9, 0, 0, 619, 620, 5, 92, 0, 0, - 620, 622, 7, 10, 0, 0, 621, 618, 1, 0, 0, 0, 621, 619, 1, 0, 0, 0, 622, - 625, 1, 0, 0, 0, 623, 621, 1, 0, 0, 0, 623, 624, 1, 0, 0, 0, 624, 626, - 1, 0, 0, 0, 625, 623, 1, 0, 0, 0, 626, 627, 5, 34, 0, 0, 627, 163, 1, - 0, 0, 0, 628, 629, 3, 18, 3, 0, 629, 165, 1, 0, 0, 0, 630, 631, 5, 125, - 0, 0, 631, 632, 1, 0, 0, 0, 632, 633, 6, 77, 7, 0, 633, 167, 1, 0, 0, - 0, 634, 635, 5, 62, 0, 0, 635, 636, 5, 62, 0, 0, 636, 637, 1, 0, 0, 0, - 637, 638, 6, 78, 21, 0, 638, 639, 6, 78, 7, 0, 639, 640, 6, 78, 7, 0, - 640, 169, 1, 0, 0, 0, 641, 642, 5, 36, 0, 0, 642, 643, 3, 18, 3, 0, 643, - 171, 1, 0, 0, 0, 644, 645, 5, 46, 0, 0, 645, 173, 1, 0, 0, 0, 646, 652, - 3, 176, 82, 0, 647, 648, 3, 176, 82, 0, 648, 649, 5, 46, 0, 0, 649, 650, - 3, 176, 82, 0, 650, 652, 1, 0, 0, 0, 651, 646, 1, 0, 0, 0, 651, 647, - 1, 0, 0, 0, 652, 175, 1, 0, 0, 0, 653, 655, 3, 178, 83, 0, 654, 653, - 1, 0, 0, 0, 655, 656, 1, 0, 0, 0, 656, 654, 1, 0, 0, 0, 656, 657, 1, - 0, 0, 0, 657, 177, 1, 0, 0, 0, 658, 659, 7, 11, 0, 0, 659, 179, 1, 0, - 0, 0, 660, 661, 3, 16, 2, 0, 661, 181, 1, 0, 0, 0, 662, 663, 3, 12, 0, - 0, 663, 664, 1, 0, 0, 0, 664, 665, 6, 85, 0, 0, 665, 183, 1, 0, 0, 0, - 666, 667, 5, 105, 0, 0, 667, 668, 5, 102, 0, 0, 668, 669, 1, 0, 0, 0, - 669, 670, 7, 12, 0, 0, 670, 671, 1, 0, 0, 0, 671, 672, 6, 86, 13, 0, - 672, 185, 1, 0, 0, 0, 673, 674, 5, 101, 0, 0, 674, 675, 5, 108, 0, 0, - 675, 676, 5, 115, 0, 0, 676, 677, 5, 101, 0, 0, 677, 678, 5, 105, 0, - 0, 678, 679, 5, 102, 0, 0, 679, 680, 1, 0, 0, 0, 680, 681, 7, 12, 0, - 0, 681, 682, 1, 0, 0, 0, 682, 683, 6, 87, 13, 0, 683, 187, 1, 0, 0, 0, - 684, 685, 5, 101, 0, 0, 685, 686, 5, 108, 0, 0, 686, 687, 5, 115, 0, - 0, 687, 688, 5, 101, 0, 0, 688, 690, 1, 0, 0, 0, 689, 691, 7, 12, 0, - 0, 690, 689, 1, 0, 0, 0, 690, 691, 1, 0, 0, 0, 691, 189, 1, 0, 0, 0, - 692, 693, 5, 115, 0, 0, 693, 694, 5, 101, 0, 0, 694, 695, 5, 116, 0, - 0, 695, 696, 1, 0, 0, 0, 696, 697, 7, 12, 0, 0, 697, 698, 1, 0, 0, 0, - 698, 699, 6, 89, 13, 0, 699, 191, 1, 0, 0, 0, 700, 701, 5, 101, 0, 0, - 701, 702, 5, 110, 0, 0, 702, 703, 5, 100, 0, 0, 703, 704, 5, 105, 0, - 0, 704, 705, 5, 102, 0, 0, 705, 193, 1, 0, 0, 0, 706, 707, 5, 99, 0, - 0, 707, 708, 5, 97, 0, 0, 708, 709, 5, 108, 0, 0, 709, 710, 5, 108, 0, - 0, 710, 711, 1, 0, 0, 0, 711, 712, 7, 12, 0, 0, 712, 713, 1, 0, 0, 0, - 713, 714, 6, 91, 13, 0, 714, 195, 1, 0, 0, 0, 715, 716, 5, 100, 0, 0, - 716, 717, 5, 101, 0, 0, 717, 718, 5, 99, 0, 0, 718, 719, 5, 108, 0, 0, - 719, 720, 5, 97, 0, 0, 720, 721, 5, 114, 0, 0, 721, 722, 5, 101, 0, 0, - 722, 723, 1, 0, 0, 0, 723, 724, 7, 12, 0, 0, 724, 725, 1, 0, 0, 0, 725, - 726, 6, 92, 13, 0, 726, 197, 1, 0, 0, 0, 727, 728, 5, 106, 0, 0, 728, - 729, 5, 117, 0, 0, 729, 730, 5, 109, 0, 0, 730, 731, 5, 112, 0, 0, 731, - 732, 1, 0, 0, 0, 732, 733, 7, 12, 0, 0, 733, 734, 1, 0, 0, 0, 734, 735, - 6, 93, 22, 0, 735, 199, 1, 0, 0, 0, 736, 737, 5, 101, 0, 0, 737, 738, - 5, 110, 0, 0, 738, 739, 5, 117, 0, 0, 739, 740, 5, 109, 0, 0, 740, 741, - 1, 0, 0, 0, 741, 742, 7, 12, 0, 0, 742, 743, 1, 0, 0, 0, 743, 744, 6, - 94, 23, 0, 744, 201, 1, 0, 0, 0, 745, 746, 5, 99, 0, 0, 746, 747, 5, - 97, 0, 0, 747, 748, 5, 115, 0, 0, 748, 749, 5, 101, 0, 0, 749, 750, 1, - 0, 0, 0, 750, 751, 7, 12, 0, 0, 751, 752, 1, 0, 0, 0, 752, 753, 6, 95, - 23, 0, 753, 203, 1, 0, 0, 0, 754, 755, 5, 101, 0, 0, 755, 756, 5, 110, - 0, 0, 756, 757, 5, 100, 0, 0, 757, 758, 5, 101, 0, 0, 758, 759, 5, 110, - 0, 0, 759, 760, 5, 117, 0, 0, 760, 761, 5, 109, 0, 0, 761, 763, 1, 0, - 0, 0, 762, 764, 7, 12, 0, 0, 763, 762, 1, 0, 0, 0, 763, 764, 1, 0, 0, - 0, 764, 205, 1, 0, 0, 0, 765, 766, 5, 108, 0, 0, 766, 767, 5, 111, 0, - 0, 767, 768, 5, 99, 0, 0, 768, 769, 5, 97, 0, 0, 769, 770, 5, 108, 0, - 0, 770, 771, 1, 0, 0, 0, 771, 772, 7, 12, 0, 0, 772, 207, 1, 0, 0, 0, - 773, 774, 5, 62, 0, 0, 774, 775, 5, 62, 0, 0, 775, 776, 1, 0, 0, 0, 776, - 777, 6, 98, 7, 0, 777, 209, 1, 0, 0, 0, 778, 779, 5, 123, 0, 0, 779, - 780, 1, 0, 0, 0, 780, 781, 6, 99, 24, 0, 781, 782, 6, 99, 25, 0, 782, - 783, 6, 99, 13, 0, 783, 211, 1, 0, 0, 0, 784, 785, 9, 0, 0, 0, 785, 786, - 1, 0, 0, 0, 786, 787, 6, 100, 26, 0, 787, 788, 6, 100, 25, 0, 788, 213, - 1, 0, 0, 0, 789, 790, 3, 16, 2, 0, 790, 215, 1, 0, 0, 0, 791, 792, 5, - 62, 0, 0, 792, 793, 5, 62, 0, 0, 793, 794, 1, 0, 0, 0, 794, 795, 6, 102, - 7, 0, 795, 217, 1, 0, 0, 0, 796, 797, 5, 123, 0, 0, 797, 798, 1, 0, 0, - 0, 798, 799, 6, 103, 13, 0, 799, 219, 1, 0, 0, 0, 800, 802, 8, 13, 0, - 0, 801, 800, 1, 0, 0, 0, 802, 803, 1, 0, 0, 0, 803, 801, 1, 0, 0, 0, - 803, 804, 1, 0, 0, 0, 804, 221, 1, 0, 0, 0, 805, 806, 3, 16, 2, 0, 806, - 223, 1, 0, 0, 0, 807, 808, 3, 18, 3, 0, 808, 809, 1, 0, 0, 0, 809, 810, - 6, 106, 27, 0, 810, 811, 6, 106, 7, 0, 811, 225, 1, 0, 0, 0, 812, 813, - 5, 62, 0, 0, 813, 814, 5, 62, 0, 0, 814, 815, 1, 0, 0, 0, 815, 816, 6, - 107, 21, 0, 816, 817, 6, 107, 7, 0, 817, 227, 1, 0, 0, 0, 818, 819, 3, - 18, 3, 0, 819, 820, 1, 0, 0, 0, 820, 821, 6, 108, 27, 0, 821, 822, 6, - 108, 7, 0, 822, 229, 1, 0, 0, 0, 823, 824, 3, 50, 19, 0, 824, 825, 1, - 0, 0, 0, 825, 826, 6, 109, 18, 0, 826, 827, 6, 109, 28, 0, 827, 231, - 1, 0, 0, 0, 828, 829, 5, 62, 0, 0, 829, 830, 5, 62, 0, 0, 830, 831, 1, - 0, 0, 0, 831, 832, 6, 110, 21, 0, 832, 833, 6, 110, 7, 0, 833, 233, 1, - 0, 0, 0, 45, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 237, 247, 253, 257, - 262, 269, 272, 276, 281, 293, 305, 378, 412, 415, 465, 492, 499, 506, - 514, 519, 524, 531, 538, 544, 550, 556, 621, 623, 651, 656, 690, 763, - 803, 29, 0, 1, 0, 0, 3, 0, 0, 2, 0, 5, 2, 0, 5, 1, 0, 5, 6, 0, 7, 6, - 0, 4, 0, 0, 7, 5, 0, 5, 8, 0, 7, 10, 0, 5, 5, 0, 5, 3, 0, 5, 7, 0, 7, - 20, 0, 5, 4, 0, 6, 0, 0, 2, 5, 0, 7, 16, 0, 7, 15, 0, 7, 57, 0, 7, 76, - 0, 5, 11, 0, 5, 10, 0, 7, 79, 0, 2, 9, 0, 7, 80, 0, 7, 7, 0, 2, 7, 0 + 1, 108, 1, 108, 1, 108, 1, 108, 1, 108, 1, 108, 1, 109, 1, 109, 1, 109, + 1, 109, 1, 109, 1, 109, 1, 109, 1, 109, 1, 109, 1, 110, 1, 110, 1, 110, + 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 1, 111, 1, 111, + 1, 111, 1, 111, 1, 111, 1, 111, 1, 111, 1, 112, 1, 112, 1, 112, 1, 112, + 1, 112, 1, 112, 1, 112, 1, 112, 1, 112, 1, 112, 1, 113, 1, 113, 1, 113, + 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 114, 1, 114, 1, 114, 1, 114, + 1, 114, 1, 115, 1, 115, 1, 115, 1, 115, 1, 115, 1, 115, 1, 116, 1, 116, + 1, 116, 1, 116, 1, 116, 1, 117, 1, 117, 1, 118, 1, 118, 1, 118, 1, 118, + 1, 118, 1, 118, 1, 119, 1, 119, 1, 119, 1, 119, 1, 120, 4, 120, 971, + 8, 120, 11, 120, 12, 120, 972, 1, 121, 1, 121, 1, 121, 1, 121, 1, 122, + 1, 122, 1, 123, 1, 123, 1, 123, 1, 123, 1, 123, 1, 124, 1, 124, 1, 124, + 1, 124, 1, 124, 1, 124, 1, 125, 1, 125, 1, 125, 1, 125, 1, 126, 1, 126, + 1, 126, 1, 126, 1, 126, 1, 127, 1, 127, 1, 127, 1, 127, 1, 127, 1, 128, + 1, 128, 1, 128, 1, 128, 1, 128, 1, 128, 0, 0, 129, 14, 4, 16, 5, 18, + 6, 20, 7, 22, 8, 24, 9, 26, 0, 28, 0, 30, 0, 32, 10, 34, 11, 36, 12, + 38, 0, 40, 13, 42, 0, 44, 0, 46, 0, 48, 14, 50, 0, 52, 15, 54, 0, 56, + 0, 58, 16, 60, 17, 62, 18, 64, 19, 66, 0, 68, 20, 70, 0, 72, 21, 74, + 0, 76, 0, 78, 0, 80, 22, 82, 0, 84, 0, 86, 0, 88, 23, 90, 24, 92, 0, + 94, 0, 96, 25, 98, 26, 100, 27, 102, 0, 104, 0, 106, 0, 108, 28, 110, + 29, 112, 0, 114, 30, 116, 31, 118, 32, 120, 0, 122, 0, 124, 33, 126, + 34, 128, 35, 130, 36, 132, 37, 134, 38, 136, 39, 138, 40, 140, 41, 142, + 42, 144, 43, 146, 44, 148, 45, 150, 46, 152, 47, 154, 48, 156, 49, 158, + 50, 160, 51, 162, 52, 164, 53, 166, 54, 168, 55, 170, 56, 172, 57, 174, + 58, 176, 59, 178, 60, 180, 92, 182, 93, 184, 94, 186, 61, 188, 62, 190, + 63, 192, 0, 194, 64, 196, 65, 198, 66, 200, 0, 202, 0, 204, 0, 206, 67, + 208, 68, 210, 69, 212, 70, 214, 71, 216, 72, 218, 73, 220, 74, 222, 75, + 224, 76, 226, 77, 228, 78, 230, 79, 232, 80, 234, 81, 236, 82, 238, 83, + 240, 84, 242, 85, 244, 0, 246, 0, 248, 86, 250, 0, 252, 87, 254, 88, + 256, 89, 258, 90, 260, 0, 262, 0, 264, 91, 266, 0, 268, 0, 270, 0, 14, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 12, 2, 0, 9, 9, 32, 32, + 2, 0, 10, 10, 13, 13, 49, 0, 65, 90, 95, 95, 97, 122, 168, 168, 170, + 170, 173, 173, 175, 175, 178, 181, 183, 186, 188, 190, 192, 214, 216, + 246, 248, 767, 880, 5759, 5761, 6157, 6159, 7615, 7680, 8191, 8203, 8205, + 8234, 8238, 8255, 8256, 8276, 8276, 8288, 8399, 8448, 8591, 9312, 9471, + 10102, 10131, 11264, 11775, 11904, 12287, 12292, 12295, 12321, 12335, + 12337, 55295, 63744, 64829, 64832, 64975, 65008, 65055, 65072, 65092, + 65095, 65533, 65536, 131069, 131072, 196605, 196608, 262141, 262144, + 327677, 327680, 393213, 393216, 458749, 458752, 524285, 524288, 589821, + 589824, 655357, 655360, 720893, 720896, 786429, 786432, 851965, 851968, + 917501, 917504, 983037, 5, 0, 48, 57, 768, 879, 7616, 7679, 8400, 8447, + 65056, 65071, 2, 0, 47, 47, 60, 60, 7, 0, 10, 10, 13, 13, 35, 35, 47, + 47, 60, 60, 92, 92, 123, 123, 7, 0, 35, 35, 47, 47, 60, 60, 62, 62, 92, + 92, 123, 123, 125, 125, 5, 0, 9, 10, 13, 13, 32, 32, 35, 36, 60, 60, + 4, 0, 10, 10, 13, 13, 34, 34, 92, 92, 2, 0, 34, 34, 92, 92, 1, 0, 48, + 57, 4, 0, 10, 10, 13, 13, 62, 62, 123, 123, 1030, 0, 14, 1, 0, 0, 0, + 0, 16, 1, 0, 0, 0, 0, 18, 1, 0, 0, 0, 0, 20, 1, 0, 0, 0, 0, 22, 1, 0, + 0, 0, 0, 24, 1, 0, 0, 0, 0, 32, 1, 0, 0, 0, 0, 34, 1, 0, 0, 0, 0, 36, + 1, 0, 0, 0, 1, 38, 1, 0, 0, 0, 1, 40, 1, 0, 0, 0, 2, 42, 1, 0, 0, 0, + 2, 44, 1, 0, 0, 0, 2, 46, 1, 0, 0, 0, 3, 48, 1, 0, 0, 0, 3, 50, 1, 0, + 0, 0, 4, 52, 1, 0, 0, 0, 4, 54, 1, 0, 0, 0, 4, 56, 1, 0, 0, 0, 4, 58, + 1, 0, 0, 0, 4, 60, 1, 0, 0, 0, 4, 62, 1, 0, 0, 0, 4, 64, 1, 0, 0, 0, + 4, 66, 1, 0, 0, 0, 4, 68, 1, 0, 0, 0, 4, 70, 1, 0, 0, 0, 4, 72, 1, 0, + 0, 0, 4, 74, 1, 0, 0, 0, 5, 76, 1, 0, 0, 0, 5, 78, 1, 0, 0, 0, 5, 80, + 1, 0, 0, 0, 5, 82, 1, 0, 0, 0, 5, 84, 1, 0, 0, 0, 5, 86, 1, 0, 0, 0, + 5, 88, 1, 0, 0, 0, 5, 90, 1, 0, 0, 0, 6, 94, 1, 0, 0, 0, 6, 96, 1, 0, + 0, 0, 7, 98, 1, 0, 0, 0, 7, 100, 1, 0, 0, 0, 7, 102, 1, 0, 0, 0, 7, 104, + 1, 0, 0, 0, 7, 106, 1, 0, 0, 0, 7, 108, 1, 0, 0, 0, 8, 110, 1, 0, 0, + 0, 8, 112, 1, 0, 0, 0, 8, 114, 1, 0, 0, 0, 9, 116, 1, 0, 0, 0, 9, 118, + 1, 0, 0, 0, 9, 120, 1, 0, 0, 0, 9, 122, 1, 0, 0, 0, 9, 124, 1, 0, 0, + 0, 9, 126, 1, 0, 0, 0, 9, 128, 1, 0, 0, 0, 9, 130, 1, 0, 0, 0, 9, 132, + 1, 0, 0, 0, 9, 134, 1, 0, 0, 0, 9, 136, 1, 0, 0, 0, 9, 138, 1, 0, 0, + 0, 9, 140, 1, 0, 0, 0, 9, 142, 1, 0, 0, 0, 9, 144, 1, 0, 0, 0, 9, 146, + 1, 0, 0, 0, 9, 148, 1, 0, 0, 0, 9, 150, 1, 0, 0, 0, 9, 152, 1, 0, 0, + 0, 9, 154, 1, 0, 0, 0, 9, 156, 1, 0, 0, 0, 9, 158, 1, 0, 0, 0, 9, 160, + 1, 0, 0, 0, 9, 162, 1, 0, 0, 0, 9, 164, 1, 0, 0, 0, 9, 166, 1, 0, 0, + 0, 9, 168, 1, 0, 0, 0, 9, 170, 1, 0, 0, 0, 9, 172, 1, 0, 0, 0, 9, 174, + 1, 0, 0, 0, 9, 176, 1, 0, 0, 0, 9, 178, 1, 0, 0, 0, 9, 180, 1, 0, 0, + 0, 9, 182, 1, 0, 0, 0, 9, 184, 1, 0, 0, 0, 9, 186, 1, 0, 0, 0, 9, 188, + 1, 0, 0, 0, 9, 190, 1, 0, 0, 0, 9, 192, 1, 0, 0, 0, 9, 194, 1, 0, 0, + 0, 9, 196, 1, 0, 0, 0, 9, 198, 1, 0, 0, 0, 9, 200, 1, 0, 0, 0, 10, 206, + 1, 0, 0, 0, 10, 208, 1, 0, 0, 0, 10, 210, 1, 0, 0, 0, 10, 212, 1, 0, + 0, 0, 10, 214, 1, 0, 0, 0, 10, 216, 1, 0, 0, 0, 10, 218, 1, 0, 0, 0, + 10, 220, 1, 0, 0, 0, 10, 222, 1, 0, 0, 0, 10, 224, 1, 0, 0, 0, 10, 226, + 1, 0, 0, 0, 10, 228, 1, 0, 0, 0, 10, 230, 1, 0, 0, 0, 10, 232, 1, 0, + 0, 0, 10, 234, 1, 0, 0, 0, 10, 236, 1, 0, 0, 0, 10, 238, 1, 0, 0, 0, + 10, 240, 1, 0, 0, 0, 10, 242, 1, 0, 0, 0, 10, 244, 1, 0, 0, 0, 10, 246, + 1, 0, 0, 0, 11, 248, 1, 0, 0, 0, 11, 250, 1, 0, 0, 0, 11, 252, 1, 0, + 0, 0, 11, 254, 1, 0, 0, 0, 12, 256, 1, 0, 0, 0, 12, 258, 1, 0, 0, 0, + 12, 260, 1, 0, 0, 0, 12, 262, 1, 0, 0, 0, 13, 264, 1, 0, 0, 0, 13, 266, + 1, 0, 0, 0, 13, 268, 1, 0, 0, 0, 13, 270, 1, 0, 0, 0, 14, 273, 1, 0, + 0, 0, 16, 279, 1, 0, 0, 0, 18, 295, 1, 0, 0, 0, 20, 305, 1, 0, 0, 0, + 22, 312, 1, 0, 0, 0, 24, 320, 1, 0, 0, 0, 26, 325, 1, 0, 0, 0, 28, 329, + 1, 0, 0, 0, 30, 332, 1, 0, 0, 0, 32, 336, 1, 0, 0, 0, 34, 343, 1, 0, + 0, 0, 36, 351, 1, 0, 0, 0, 38, 356, 1, 0, 0, 0, 40, 367, 1, 0, 0, 0, + 42, 372, 1, 0, 0, 0, 44, 381, 1, 0, 0, 0, 46, 389, 1, 0, 0, 0, 48, 395, + 1, 0, 0, 0, 50, 399, 1, 0, 0, 0, 52, 405, 1, 0, 0, 0, 54, 409, 1, 0, + 0, 0, 56, 414, 1, 0, 0, 0, 58, 419, 1, 0, 0, 0, 60, 425, 1, 0, 0, 0, + 62, 428, 1, 0, 0, 0, 64, 431, 1, 0, 0, 0, 66, 436, 1, 0, 0, 0, 68, 442, + 1, 0, 0, 0, 70, 447, 1, 0, 0, 0, 72, 453, 1, 0, 0, 0, 74, 459, 1, 0, + 0, 0, 76, 464, 1, 0, 0, 0, 78, 473, 1, 0, 0, 0, 80, 477, 1, 0, 0, 0, + 82, 482, 1, 0, 0, 0, 84, 488, 1, 0, 0, 0, 86, 493, 1, 0, 0, 0, 88, 500, + 1, 0, 0, 0, 90, 510, 1, 0, 0, 0, 92, 512, 1, 0, 0, 0, 94, 514, 1, 0, + 0, 0, 96, 519, 1, 0, 0, 0, 98, 523, 1, 0, 0, 0, 100, 527, 1, 0, 0, 0, + 102, 531, 1, 0, 0, 0, 104, 537, 1, 0, 0, 0, 106, 542, 1, 0, 0, 0, 108, + 547, 1, 0, 0, 0, 110, 549, 1, 0, 0, 0, 112, 553, 1, 0, 0, 0, 114, 558, + 1, 0, 0, 0, 116, 564, 1, 0, 0, 0, 118, 568, 1, 0, 0, 0, 120, 577, 1, + 0, 0, 0, 122, 586, 1, 0, 0, 0, 124, 593, 1, 0, 0, 0, 126, 598, 1, 0, + 0, 0, 128, 604, 1, 0, 0, 0, 130, 612, 1, 0, 0, 0, 132, 619, 1, 0, 0, + 0, 134, 626, 1, 0, 0, 0, 136, 634, 1, 0, 0, 0, 138, 639, 1, 0, 0, 0, + 140, 644, 1, 0, 0, 0, 142, 651, 1, 0, 0, 0, 144, 658, 1, 0, 0, 0, 146, + 664, 1, 0, 0, 0, 148, 670, 1, 0, 0, 0, 150, 676, 1, 0, 0, 0, 152, 678, + 1, 0, 0, 0, 154, 681, 1, 0, 0, 0, 156, 684, 1, 0, 0, 0, 158, 687, 1, + 0, 0, 0, 160, 690, 1, 0, 0, 0, 162, 693, 1, 0, 0, 0, 164, 695, 1, 0, + 0, 0, 166, 697, 1, 0, 0, 0, 168, 699, 1, 0, 0, 0, 170, 701, 1, 0, 0, + 0, 172, 703, 1, 0, 0, 0, 174, 705, 1, 0, 0, 0, 176, 707, 1, 0, 0, 0, + 178, 709, 1, 0, 0, 0, 180, 712, 1, 0, 0, 0, 182, 721, 1, 0, 0, 0, 184, + 730, 1, 0, 0, 0, 186, 737, 1, 0, 0, 0, 188, 748, 1, 0, 0, 0, 190, 750, + 1, 0, 0, 0, 192, 754, 1, 0, 0, 0, 194, 761, 1, 0, 0, 0, 196, 764, 1, + 0, 0, 0, 198, 771, 1, 0, 0, 0, 200, 774, 1, 0, 0, 0, 202, 785, 1, 0, + 0, 0, 204, 789, 1, 0, 0, 0, 206, 791, 1, 0, 0, 0, 208, 793, 1, 0, 0, + 0, 210, 797, 1, 0, 0, 0, 212, 804, 1, 0, 0, 0, 214, 815, 1, 0, 0, 0, + 216, 822, 1, 0, 0, 0, 218, 830, 1, 0, 0, 0, 220, 838, 1, 0, 0, 0, 222, + 847, 1, 0, 0, 0, 224, 859, 1, 0, 0, 0, 226, 868, 1, 0, 0, 0, 228, 879, + 1, 0, 0, 0, 230, 888, 1, 0, 0, 0, 232, 897, 1, 0, 0, 0, 234, 906, 1, + 0, 0, 0, 236, 916, 1, 0, 0, 0, 238, 923, 1, 0, 0, 0, 240, 933, 1, 0, + 0, 0, 242, 941, 1, 0, 0, 0, 244, 946, 1, 0, 0, 0, 246, 952, 1, 0, 0, + 0, 248, 957, 1, 0, 0, 0, 250, 959, 1, 0, 0, 0, 252, 965, 1, 0, 0, 0, + 254, 970, 1, 0, 0, 0, 256, 974, 1, 0, 0, 0, 258, 978, 1, 0, 0, 0, 260, + 980, 1, 0, 0, 0, 262, 985, 1, 0, 0, 0, 264, 991, 1, 0, 0, 0, 266, 995, + 1, 0, 0, 0, 268, 1000, 1, 0, 0, 0, 270, 1005, 1, 0, 0, 0, 272, 274, 7, + 0, 0, 0, 273, 272, 1, 0, 0, 0, 274, 275, 1, 0, 0, 0, 275, 273, 1, 0, + 0, 0, 275, 276, 1, 0, 0, 0, 276, 277, 1, 0, 0, 0, 277, 278, 6, 0, 0, + 0, 278, 15, 1, 0, 0, 0, 279, 280, 5, 47, 0, 0, 280, 281, 5, 47, 0, 0, + 281, 285, 1, 0, 0, 0, 282, 284, 8, 1, 0, 0, 283, 282, 1, 0, 0, 0, 284, + 287, 1, 0, 0, 0, 285, 283, 1, 0, 0, 0, 285, 286, 1, 0, 0, 0, 286, 288, + 1, 0, 0, 0, 287, 285, 1, 0, 0, 0, 288, 289, 6, 1, 1, 0, 289, 17, 1, 0, + 0, 0, 290, 292, 5, 13, 0, 0, 291, 290, 1, 0, 0, 0, 291, 292, 1, 0, 0, + 0, 292, 293, 1, 0, 0, 0, 293, 296, 5, 10, 0, 0, 294, 296, 5, 13, 0, 0, + 295, 291, 1, 0, 0, 0, 295, 294, 1, 0, 0, 0, 296, 300, 1, 0, 0, 0, 297, + 299, 7, 0, 0, 0, 298, 297, 1, 0, 0, 0, 299, 302, 1, 0, 0, 0, 300, 298, + 1, 0, 0, 0, 300, 301, 1, 0, 0, 0, 301, 303, 1, 0, 0, 0, 302, 300, 1, + 0, 0, 0, 303, 304, 6, 2, 2, 0, 304, 19, 1, 0, 0, 0, 305, 306, 5, 119, + 0, 0, 306, 307, 5, 104, 0, 0, 307, 308, 5, 101, 0, 0, 308, 309, 5, 110, + 0, 0, 309, 310, 1, 0, 0, 0, 310, 311, 6, 3, 3, 0, 311, 21, 1, 0, 0, 0, + 312, 313, 5, 116, 0, 0, 313, 314, 5, 105, 0, 0, 314, 315, 5, 116, 0, + 0, 315, 316, 5, 108, 0, 0, 316, 317, 5, 101, 0, 0, 317, 318, 1, 0, 0, + 0, 318, 319, 6, 4, 4, 0, 319, 23, 1, 0, 0, 0, 320, 322, 3, 26, 6, 0, + 321, 323, 3, 30, 8, 0, 322, 321, 1, 0, 0, 0, 322, 323, 1, 0, 0, 0, 323, + 25, 1, 0, 0, 0, 324, 326, 7, 2, 0, 0, 325, 324, 1, 0, 0, 0, 326, 27, + 1, 0, 0, 0, 327, 330, 7, 3, 0, 0, 328, 330, 3, 26, 6, 0, 329, 327, 1, + 0, 0, 0, 329, 328, 1, 0, 0, 0, 330, 29, 1, 0, 0, 0, 331, 333, 3, 28, + 7, 0, 332, 331, 1, 0, 0, 0, 333, 334, 1, 0, 0, 0, 334, 332, 1, 0, 0, + 0, 334, 335, 1, 0, 0, 0, 335, 31, 1, 0, 0, 0, 336, 337, 5, 45, 0, 0, + 337, 338, 5, 45, 0, 0, 338, 339, 5, 45, 0, 0, 339, 340, 1, 0, 0, 0, 340, + 341, 6, 9, 5, 0, 341, 33, 1, 0, 0, 0, 342, 344, 3, 14, 0, 0, 343, 342, + 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, 344, 345, 1, 0, 0, 0, 345, 347, 5, + 58, 0, 0, 346, 348, 3, 14, 0, 0, 347, 346, 1, 0, 0, 0, 347, 348, 1, 0, + 0, 0, 348, 349, 1, 0, 0, 0, 349, 350, 6, 10, 6, 0, 350, 35, 1, 0, 0, + 0, 351, 352, 5, 35, 0, 0, 352, 353, 1, 0, 0, 0, 353, 354, 6, 11, 7, 0, + 354, 37, 1, 0, 0, 0, 355, 357, 3, 14, 0, 0, 356, 355, 1, 0, 0, 0, 356, + 357, 1, 0, 0, 0, 357, 358, 1, 0, 0, 0, 358, 360, 5, 58, 0, 0, 359, 361, + 3, 14, 0, 0, 360, 359, 1, 0, 0, 0, 360, 361, 1, 0, 0, 0, 361, 362, 1, + 0, 0, 0, 362, 363, 6, 12, 8, 0, 363, 364, 1, 0, 0, 0, 364, 365, 6, 12, + 9, 0, 365, 366, 6, 12, 10, 0, 366, 39, 1, 0, 0, 0, 367, 368, 9, 0, 0, + 0, 368, 369, 1, 0, 0, 0, 369, 370, 6, 13, 11, 0, 370, 41, 1, 0, 0, 0, + 371, 373, 3, 14, 0, 0, 372, 371, 1, 0, 0, 0, 372, 373, 1, 0, 0, 0, 373, + 374, 1, 0, 0, 0, 374, 376, 5, 58, 0, 0, 375, 377, 3, 14, 0, 0, 376, 375, + 1, 0, 0, 0, 376, 377, 1, 0, 0, 0, 377, 378, 1, 0, 0, 0, 378, 379, 6, + 14, 9, 0, 379, 43, 1, 0, 0, 0, 380, 382, 3, 14, 0, 0, 381, 380, 1, 0, + 0, 0, 381, 382, 1, 0, 0, 0, 382, 383, 1, 0, 0, 0, 383, 385, 3, 24, 5, + 0, 384, 386, 3, 14, 0, 0, 385, 384, 1, 0, 0, 0, 385, 386, 1, 0, 0, 0, + 386, 387, 1, 0, 0, 0, 387, 388, 6, 15, 12, 0, 388, 45, 1, 0, 0, 0, 389, + 390, 3, 18, 2, 0, 390, 391, 1, 0, 0, 0, 391, 392, 6, 16, 13, 0, 392, + 393, 6, 16, 11, 0, 393, 47, 1, 0, 0, 0, 394, 396, 8, 1, 0, 0, 395, 394, + 1, 0, 0, 0, 396, 397, 1, 0, 0, 0, 397, 395, 1, 0, 0, 0, 397, 398, 1, + 0, 0, 0, 398, 49, 1, 0, 0, 0, 399, 400, 3, 18, 2, 0, 400, 401, 1, 0, + 0, 0, 401, 402, 6, 18, 13, 0, 402, 403, 6, 18, 2, 0, 403, 404, 6, 18, + 11, 0, 404, 51, 1, 0, 0, 0, 405, 406, 3, 14, 0, 0, 406, 407, 1, 0, 0, + 0, 407, 408, 6, 19, 0, 0, 408, 53, 1, 0, 0, 0, 409, 410, 3, 18, 2, 0, + 410, 411, 1, 0, 0, 0, 411, 412, 6, 20, 13, 0, 412, 413, 6, 20, 2, 0, + 413, 55, 1, 0, 0, 0, 414, 415, 3, 16, 1, 0, 415, 416, 1, 0, 0, 0, 416, + 417, 6, 21, 14, 0, 417, 418, 6, 21, 1, 0, 418, 57, 1, 0, 0, 0, 419, 420, + 5, 61, 0, 0, 420, 421, 5, 61, 0, 0, 421, 422, 5, 61, 0, 0, 422, 423, + 1, 0, 0, 0, 423, 424, 6, 22, 11, 0, 424, 59, 1, 0, 0, 0, 425, 426, 5, + 45, 0, 0, 426, 427, 5, 62, 0, 0, 427, 61, 1, 0, 0, 0, 428, 429, 5, 61, + 0, 0, 429, 430, 5, 62, 0, 0, 430, 63, 1, 0, 0, 0, 431, 432, 5, 60, 0, + 0, 432, 433, 5, 60, 0, 0, 433, 434, 1, 0, 0, 0, 434, 435, 6, 25, 15, + 0, 435, 65, 1, 0, 0, 0, 436, 437, 5, 35, 0, 0, 437, 438, 1, 0, 0, 0, + 438, 439, 6, 26, 16, 0, 439, 440, 6, 26, 17, 0, 440, 441, 6, 26, 7, 0, + 441, 67, 1, 0, 0, 0, 442, 443, 5, 123, 0, 0, 443, 444, 1, 0, 0, 0, 444, + 445, 6, 27, 18, 0, 445, 446, 6, 27, 19, 0, 446, 69, 1, 0, 0, 0, 447, + 448, 5, 92, 0, 0, 448, 449, 5, 91, 0, 0, 449, 450, 1, 0, 0, 0, 450, 451, + 6, 28, 20, 0, 451, 452, 6, 28, 18, 0, 452, 71, 1, 0, 0, 0, 453, 454, + 5, 92, 0, 0, 454, 455, 1, 0, 0, 0, 455, 456, 6, 29, 0, 0, 456, 457, 6, + 29, 18, 0, 457, 458, 6, 29, 21, 0, 458, 73, 1, 0, 0, 0, 459, 460, 9, + 0, 0, 0, 460, 461, 1, 0, 0, 0, 461, 462, 6, 30, 20, 0, 462, 463, 6, 30, + 18, 0, 463, 75, 1, 0, 0, 0, 464, 465, 3, 18, 2, 0, 465, 466, 1, 0, 0, + 0, 466, 467, 6, 31, 13, 0, 467, 468, 6, 31, 11, 0, 468, 77, 1, 0, 0, + 0, 469, 470, 5, 92, 0, 0, 470, 474, 5, 91, 0, 0, 471, 472, 5, 92, 0, + 0, 472, 474, 5, 93, 0, 0, 473, 469, 1, 0, 0, 0, 473, 471, 1, 0, 0, 0, + 474, 475, 1, 0, 0, 0, 475, 476, 6, 32, 20, 0, 476, 79, 1, 0, 0, 0, 477, + 478, 5, 92, 0, 0, 478, 479, 1, 0, 0, 0, 479, 480, 6, 33, 0, 0, 480, 481, + 6, 33, 21, 0, 481, 81, 1, 0, 0, 0, 482, 483, 3, 36, 11, 0, 483, 484, + 1, 0, 0, 0, 484, 485, 6, 34, 16, 0, 485, 486, 6, 34, 22, 0, 486, 487, + 6, 34, 7, 0, 487, 83, 1, 0, 0, 0, 488, 489, 5, 123, 0, 0, 489, 490, 1, + 0, 0, 0, 490, 491, 6, 35, 23, 0, 491, 492, 6, 35, 19, 0, 492, 85, 1, + 0, 0, 0, 493, 494, 5, 60, 0, 0, 494, 495, 5, 60, 0, 0, 495, 496, 1, 0, + 0, 0, 496, 497, 6, 36, 24, 0, 497, 498, 6, 36, 22, 0, 498, 499, 6, 36, + 15, 0, 499, 87, 1, 0, 0, 0, 500, 501, 3, 16, 1, 0, 501, 502, 1, 0, 0, + 0, 502, 503, 6, 37, 1, 0, 503, 89, 1, 0, 0, 0, 504, 506, 3, 92, 39, 0, + 505, 504, 1, 0, 0, 0, 506, 507, 1, 0, 0, 0, 507, 505, 1, 0, 0, 0, 507, + 508, 1, 0, 0, 0, 508, 511, 1, 0, 0, 0, 509, 511, 7, 4, 0, 0, 510, 505, + 1, 0, 0, 0, 510, 509, 1, 0, 0, 0, 511, 91, 1, 0, 0, 0, 512, 513, 8, 5, + 0, 0, 513, 93, 1, 0, 0, 0, 514, 515, 7, 6, 0, 0, 515, 516, 1, 0, 0, 0, + 516, 517, 6, 40, 20, 0, 517, 518, 6, 40, 11, 0, 518, 95, 1, 0, 0, 0, + 519, 520, 9, 0, 0, 0, 520, 521, 1, 0, 0, 0, 521, 522, 6, 41, 11, 0, 522, + 97, 1, 0, 0, 0, 523, 524, 3, 14, 0, 0, 524, 525, 1, 0, 0, 0, 525, 526, + 6, 42, 0, 0, 526, 99, 1, 0, 0, 0, 527, 528, 3, 16, 1, 0, 528, 529, 1, + 0, 0, 0, 529, 530, 6, 43, 1, 0, 530, 101, 1, 0, 0, 0, 531, 532, 5, 60, + 0, 0, 532, 533, 5, 60, 0, 0, 533, 534, 1, 0, 0, 0, 534, 535, 6, 44, 24, + 0, 535, 536, 6, 44, 15, 0, 536, 103, 1, 0, 0, 0, 537, 538, 5, 35, 0, + 0, 538, 539, 1, 0, 0, 0, 539, 540, 6, 45, 16, 0, 540, 541, 6, 45, 7, + 0, 541, 105, 1, 0, 0, 0, 542, 543, 3, 18, 2, 0, 543, 544, 1, 0, 0, 0, + 544, 545, 6, 46, 13, 0, 545, 546, 6, 46, 11, 0, 546, 107, 1, 0, 0, 0, + 547, 548, 9, 0, 0, 0, 548, 109, 1, 0, 0, 0, 549, 550, 3, 14, 0, 0, 550, + 551, 1, 0, 0, 0, 551, 552, 6, 48, 0, 0, 552, 111, 1, 0, 0, 0, 553, 554, + 3, 36, 11, 0, 554, 555, 1, 0, 0, 0, 555, 556, 6, 49, 16, 0, 556, 113, + 1, 0, 0, 0, 557, 559, 8, 7, 0, 0, 558, 557, 1, 0, 0, 0, 559, 560, 1, + 0, 0, 0, 560, 558, 1, 0, 0, 0, 560, 561, 1, 0, 0, 0, 561, 562, 1, 0, + 0, 0, 562, 563, 6, 50, 11, 0, 563, 115, 1, 0, 0, 0, 564, 565, 3, 14, + 0, 0, 565, 566, 1, 0, 0, 0, 566, 567, 6, 51, 0, 0, 567, 117, 1, 0, 0, + 0, 568, 569, 5, 97, 0, 0, 569, 570, 5, 108, 0, 0, 570, 571, 5, 119, 0, + 0, 571, 572, 5, 97, 0, 0, 572, 573, 5, 121, 0, 0, 573, 574, 5, 115, 0, + 0, 574, 575, 1, 0, 0, 0, 575, 576, 4, 52, 0, 0, 576, 119, 1, 0, 0, 0, + 577, 578, 5, 111, 0, 0, 578, 579, 5, 110, 0, 0, 579, 580, 5, 99, 0, 0, + 580, 581, 5, 101, 0, 0, 581, 582, 1, 0, 0, 0, 582, 583, 4, 53, 1, 0, + 583, 584, 1, 0, 0, 0, 584, 585, 6, 53, 25, 0, 585, 121, 1, 0, 0, 0, 586, + 587, 5, 105, 0, 0, 587, 588, 5, 102, 0, 0, 588, 589, 1, 0, 0, 0, 589, + 590, 4, 54, 2, 0, 590, 591, 1, 0, 0, 0, 591, 592, 6, 54, 26, 0, 592, + 123, 1, 0, 0, 0, 593, 594, 5, 116, 0, 0, 594, 595, 5, 114, 0, 0, 595, + 596, 5, 117, 0, 0, 596, 597, 5, 101, 0, 0, 597, 125, 1, 0, 0, 0, 598, + 599, 5, 102, 0, 0, 599, 600, 5, 97, 0, 0, 600, 601, 5, 108, 0, 0, 601, + 602, 5, 115, 0, 0, 602, 603, 5, 101, 0, 0, 603, 127, 1, 0, 0, 0, 604, + 605, 5, 110, 0, 0, 605, 606, 5, 117, 0, 0, 606, 607, 5, 108, 0, 0, 607, + 608, 5, 108, 0, 0, 608, 129, 1, 0, 0, 0, 609, 613, 5, 61, 0, 0, 610, + 611, 5, 116, 0, 0, 611, 613, 5, 111, 0, 0, 612, 609, 1, 0, 0, 0, 612, + 610, 1, 0, 0, 0, 613, 131, 1, 0, 0, 0, 614, 615, 5, 60, 0, 0, 615, 620, + 5, 61, 0, 0, 616, 617, 5, 108, 0, 0, 617, 618, 5, 116, 0, 0, 618, 620, + 5, 101, 0, 0, 619, 614, 1, 0, 0, 0, 619, 616, 1, 0, 0, 0, 620, 133, 1, + 0, 0, 0, 621, 622, 5, 62, 0, 0, 622, 627, 5, 61, 0, 0, 623, 624, 5, 103, + 0, 0, 624, 625, 5, 116, 0, 0, 625, 627, 5, 101, 0, 0, 626, 621, 1, 0, + 0, 0, 626, 623, 1, 0, 0, 0, 627, 135, 1, 0, 0, 0, 628, 629, 5, 61, 0, + 0, 629, 635, 5, 61, 0, 0, 630, 631, 5, 105, 0, 0, 631, 635, 5, 115, 0, + 0, 632, 633, 5, 101, 0, 0, 633, 635, 5, 113, 0, 0, 634, 628, 1, 0, 0, + 0, 634, 630, 1, 0, 0, 0, 634, 632, 1, 0, 0, 0, 635, 137, 1, 0, 0, 0, + 636, 640, 5, 60, 0, 0, 637, 638, 5, 108, 0, 0, 638, 640, 5, 116, 0, 0, + 639, 636, 1, 0, 0, 0, 639, 637, 1, 0, 0, 0, 640, 139, 1, 0, 0, 0, 641, + 645, 5, 62, 0, 0, 642, 643, 5, 103, 0, 0, 643, 645, 5, 116, 0, 0, 644, + 641, 1, 0, 0, 0, 644, 642, 1, 0, 0, 0, 645, 141, 1, 0, 0, 0, 646, 647, + 5, 33, 0, 0, 647, 652, 5, 61, 0, 0, 648, 649, 5, 110, 0, 0, 649, 650, + 5, 101, 0, 0, 650, 652, 5, 113, 0, 0, 651, 646, 1, 0, 0, 0, 651, 648, + 1, 0, 0, 0, 652, 143, 1, 0, 0, 0, 653, 654, 5, 97, 0, 0, 654, 655, 5, + 110, 0, 0, 655, 659, 5, 100, 0, 0, 656, 657, 5, 38, 0, 0, 657, 659, 5, + 38, 0, 0, 658, 653, 1, 0, 0, 0, 658, 656, 1, 0, 0, 0, 659, 145, 1, 0, + 0, 0, 660, 661, 5, 111, 0, 0, 661, 665, 5, 114, 0, 0, 662, 663, 5, 124, + 0, 0, 663, 665, 5, 124, 0, 0, 664, 660, 1, 0, 0, 0, 664, 662, 1, 0, 0, + 0, 665, 147, 1, 0, 0, 0, 666, 667, 5, 120, 0, 0, 667, 668, 5, 111, 0, + 0, 668, 671, 5, 114, 0, 0, 669, 671, 5, 94, 0, 0, 670, 666, 1, 0, 0, + 0, 670, 669, 1, 0, 0, 0, 671, 149, 1, 0, 0, 0, 672, 673, 5, 110, 0, 0, + 673, 674, 5, 111, 0, 0, 674, 677, 5, 116, 0, 0, 675, 677, 5, 33, 0, 0, + 676, 672, 1, 0, 0, 0, 676, 675, 1, 0, 0, 0, 677, 151, 1, 0, 0, 0, 678, + 679, 5, 43, 0, 0, 679, 680, 5, 61, 0, 0, 680, 153, 1, 0, 0, 0, 681, 682, + 5, 45, 0, 0, 682, 683, 5, 61, 0, 0, 683, 155, 1, 0, 0, 0, 684, 685, 5, + 42, 0, 0, 685, 686, 5, 61, 0, 0, 686, 157, 1, 0, 0, 0, 687, 688, 5, 37, + 0, 0, 688, 689, 5, 61, 0, 0, 689, 159, 1, 0, 0, 0, 690, 691, 5, 47, 0, + 0, 691, 692, 5, 61, 0, 0, 692, 161, 1, 0, 0, 0, 693, 694, 5, 43, 0, 0, + 694, 163, 1, 0, 0, 0, 695, 696, 5, 45, 0, 0, 696, 165, 1, 0, 0, 0, 697, + 698, 5, 42, 0, 0, 698, 167, 1, 0, 0, 0, 699, 700, 5, 47, 0, 0, 700, 169, + 1, 0, 0, 0, 701, 702, 5, 37, 0, 0, 702, 171, 1, 0, 0, 0, 703, 704, 5, + 40, 0, 0, 704, 173, 1, 0, 0, 0, 705, 706, 5, 41, 0, 0, 706, 175, 1, 0, + 0, 0, 707, 708, 5, 44, 0, 0, 708, 177, 1, 0, 0, 0, 709, 710, 5, 97, 0, + 0, 710, 711, 5, 115, 0, 0, 711, 179, 1, 0, 0, 0, 712, 713, 5, 115, 0, + 0, 713, 714, 5, 116, 0, 0, 714, 715, 5, 114, 0, 0, 715, 716, 5, 105, + 0, 0, 716, 717, 5, 110, 0, 0, 717, 718, 5, 103, 0, 0, 718, 719, 1, 0, + 0, 0, 719, 720, 6, 83, 27, 0, 720, 181, 1, 0, 0, 0, 721, 722, 5, 110, + 0, 0, 722, 723, 5, 117, 0, 0, 723, 724, 5, 109, 0, 0, 724, 725, 5, 98, + 0, 0, 725, 726, 5, 101, 0, 0, 726, 727, 5, 114, 0, 0, 727, 728, 1, 0, + 0, 0, 728, 729, 6, 84, 27, 0, 729, 183, 1, 0, 0, 0, 730, 731, 5, 98, + 0, 0, 731, 732, 5, 111, 0, 0, 732, 733, 5, 111, 0, 0, 733, 734, 5, 108, + 0, 0, 734, 735, 1, 0, 0, 0, 735, 736, 6, 85, 27, 0, 736, 185, 1, 0, 0, + 0, 737, 743, 5, 34, 0, 0, 738, 742, 8, 8, 0, 0, 739, 740, 5, 92, 0, 0, + 740, 742, 7, 9, 0, 0, 741, 738, 1, 0, 0, 0, 741, 739, 1, 0, 0, 0, 742, + 745, 1, 0, 0, 0, 743, 741, 1, 0, 0, 0, 743, 744, 1, 0, 0, 0, 744, 746, + 1, 0, 0, 0, 745, 743, 1, 0, 0, 0, 746, 747, 5, 34, 0, 0, 747, 187, 1, + 0, 0, 0, 748, 749, 3, 24, 5, 0, 749, 189, 1, 0, 0, 0, 750, 751, 5, 125, + 0, 0, 751, 752, 1, 0, 0, 0, 752, 753, 6, 88, 11, 0, 753, 191, 1, 0, 0, + 0, 754, 755, 5, 62, 0, 0, 755, 756, 5, 62, 0, 0, 756, 757, 1, 0, 0, 0, + 757, 758, 6, 89, 28, 0, 758, 759, 6, 89, 11, 0, 759, 760, 6, 89, 11, + 0, 760, 193, 1, 0, 0, 0, 761, 762, 5, 36, 0, 0, 762, 763, 3, 24, 5, 0, + 763, 195, 1, 0, 0, 0, 764, 765, 5, 46, 0, 0, 765, 197, 1, 0, 0, 0, 766, + 772, 3, 202, 94, 0, 767, 768, 3, 202, 94, 0, 768, 769, 5, 46, 0, 0, 769, + 770, 3, 202, 94, 0, 770, 772, 1, 0, 0, 0, 771, 766, 1, 0, 0, 0, 771, + 767, 1, 0, 0, 0, 772, 199, 1, 0, 0, 0, 773, 775, 7, 1, 0, 0, 774, 773, + 1, 0, 0, 0, 775, 776, 1, 0, 0, 0, 776, 774, 1, 0, 0, 0, 776, 777, 1, + 0, 0, 0, 777, 778, 1, 0, 0, 0, 778, 779, 4, 93, 3, 0, 779, 780, 6, 93, + 29, 0, 780, 781, 1, 0, 0, 0, 781, 782, 6, 93, 13, 0, 782, 783, 6, 93, + 11, 0, 783, 201, 1, 0, 0, 0, 784, 786, 3, 204, 95, 0, 785, 784, 1, 0, + 0, 0, 786, 787, 1, 0, 0, 0, 787, 785, 1, 0, 0, 0, 787, 788, 1, 0, 0, + 0, 788, 203, 1, 0, 0, 0, 789, 790, 7, 10, 0, 0, 790, 205, 1, 0, 0, 0, + 791, 792, 3, 18, 2, 0, 792, 207, 1, 0, 0, 0, 793, 794, 3, 14, 0, 0, 794, + 795, 1, 0, 0, 0, 795, 796, 6, 97, 0, 0, 796, 209, 1, 0, 0, 0, 797, 798, + 5, 105, 0, 0, 798, 799, 5, 102, 0, 0, 799, 800, 1, 0, 0, 0, 800, 801, + 4, 98, 4, 0, 801, 802, 1, 0, 0, 0, 802, 803, 6, 98, 19, 0, 803, 211, + 1, 0, 0, 0, 804, 805, 5, 101, 0, 0, 805, 806, 5, 108, 0, 0, 806, 807, + 5, 115, 0, 0, 807, 808, 5, 101, 0, 0, 808, 809, 5, 105, 0, 0, 809, 810, + 5, 102, 0, 0, 810, 811, 1, 0, 0, 0, 811, 812, 4, 99, 5, 0, 812, 813, + 1, 0, 0, 0, 813, 814, 6, 99, 19, 0, 814, 213, 1, 0, 0, 0, 815, 816, 5, + 101, 0, 0, 816, 817, 5, 108, 0, 0, 817, 818, 5, 115, 0, 0, 818, 819, + 5, 101, 0, 0, 819, 820, 1, 0, 0, 0, 820, 821, 4, 100, 6, 0, 821, 215, + 1, 0, 0, 0, 822, 823, 5, 115, 0, 0, 823, 824, 5, 101, 0, 0, 824, 825, + 5, 116, 0, 0, 825, 826, 1, 0, 0, 0, 826, 827, 4, 101, 7, 0, 827, 828, + 1, 0, 0, 0, 828, 829, 6, 101, 19, 0, 829, 217, 1, 0, 0, 0, 830, 831, + 5, 101, 0, 0, 831, 832, 5, 110, 0, 0, 832, 833, 5, 100, 0, 0, 833, 834, + 5, 105, 0, 0, 834, 835, 5, 102, 0, 0, 835, 836, 1, 0, 0, 0, 836, 837, + 4, 102, 8, 0, 837, 219, 1, 0, 0, 0, 838, 839, 5, 99, 0, 0, 839, 840, + 5, 97, 0, 0, 840, 841, 5, 108, 0, 0, 841, 842, 5, 108, 0, 0, 842, 843, + 1, 0, 0, 0, 843, 844, 4, 103, 9, 0, 844, 845, 1, 0, 0, 0, 845, 846, 6, + 103, 19, 0, 846, 221, 1, 0, 0, 0, 847, 848, 5, 100, 0, 0, 848, 849, 5, + 101, 0, 0, 849, 850, 5, 99, 0, 0, 850, 851, 5, 108, 0, 0, 851, 852, 5, + 97, 0, 0, 852, 853, 5, 114, 0, 0, 853, 854, 5, 101, 0, 0, 854, 855, 1, + 0, 0, 0, 855, 856, 4, 104, 10, 0, 856, 857, 1, 0, 0, 0, 857, 858, 6, + 104, 19, 0, 858, 223, 1, 0, 0, 0, 859, 860, 5, 106, 0, 0, 860, 861, 5, + 117, 0, 0, 861, 862, 5, 109, 0, 0, 862, 863, 5, 112, 0, 0, 863, 864, + 1, 0, 0, 0, 864, 865, 4, 105, 11, 0, 865, 866, 1, 0, 0, 0, 866, 867, + 6, 105, 30, 0, 867, 225, 1, 0, 0, 0, 868, 869, 5, 100, 0, 0, 869, 870, + 5, 101, 0, 0, 870, 871, 5, 116, 0, 0, 871, 872, 5, 111, 0, 0, 872, 873, + 5, 117, 0, 0, 873, 874, 5, 114, 0, 0, 874, 875, 1, 0, 0, 0, 875, 876, + 4, 106, 12, 0, 876, 877, 1, 0, 0, 0, 877, 878, 6, 106, 30, 0, 878, 227, + 1, 0, 0, 0, 879, 880, 5, 114, 0, 0, 880, 881, 5, 101, 0, 0, 881, 882, + 5, 116, 0, 0, 882, 883, 5, 117, 0, 0, 883, 884, 5, 114, 0, 0, 884, 885, + 5, 110, 0, 0, 885, 886, 1, 0, 0, 0, 886, 887, 4, 107, 13, 0, 887, 229, + 1, 0, 0, 0, 888, 889, 5, 101, 0, 0, 889, 890, 5, 110, 0, 0, 890, 891, + 5, 117, 0, 0, 891, 892, 5, 109, 0, 0, 892, 893, 1, 0, 0, 0, 893, 894, + 4, 108, 14, 0, 894, 895, 1, 0, 0, 0, 895, 896, 6, 108, 31, 0, 896, 231, + 1, 0, 0, 0, 897, 898, 5, 99, 0, 0, 898, 899, 5, 97, 0, 0, 899, 900, 5, + 115, 0, 0, 900, 901, 5, 101, 0, 0, 901, 902, 1, 0, 0, 0, 902, 903, 4, + 109, 15, 0, 903, 904, 1, 0, 0, 0, 904, 905, 6, 109, 19, 0, 905, 233, + 1, 0, 0, 0, 906, 907, 5, 101, 0, 0, 907, 908, 5, 110, 0, 0, 908, 909, + 5, 100, 0, 0, 909, 910, 5, 101, 0, 0, 910, 911, 5, 110, 0, 0, 911, 912, + 5, 117, 0, 0, 912, 913, 5, 109, 0, 0, 913, 914, 1, 0, 0, 0, 914, 915, + 4, 110, 16, 0, 915, 235, 1, 0, 0, 0, 916, 917, 5, 111, 0, 0, 917, 918, + 5, 110, 0, 0, 918, 919, 5, 99, 0, 0, 919, 920, 5, 101, 0, 0, 920, 921, + 1, 0, 0, 0, 921, 922, 4, 111, 17, 0, 922, 237, 1, 0, 0, 0, 923, 924, + 5, 101, 0, 0, 924, 925, 5, 110, 0, 0, 925, 926, 5, 100, 0, 0, 926, 927, + 5, 111, 0, 0, 927, 928, 5, 110, 0, 0, 928, 929, 5, 99, 0, 0, 929, 930, + 5, 101, 0, 0, 930, 931, 1, 0, 0, 0, 931, 932, 4, 112, 18, 0, 932, 239, + 1, 0, 0, 0, 933, 934, 5, 108, 0, 0, 934, 935, 5, 111, 0, 0, 935, 936, + 5, 99, 0, 0, 936, 937, 5, 97, 0, 0, 937, 938, 5, 108, 0, 0, 938, 939, + 1, 0, 0, 0, 939, 940, 4, 113, 19, 0, 940, 241, 1, 0, 0, 0, 941, 942, + 5, 62, 0, 0, 942, 943, 5, 62, 0, 0, 943, 944, 1, 0, 0, 0, 944, 945, 6, + 114, 11, 0, 945, 243, 1, 0, 0, 0, 946, 947, 5, 123, 0, 0, 947, 948, 1, + 0, 0, 0, 948, 949, 6, 115, 32, 0, 949, 950, 6, 115, 33, 0, 950, 951, + 6, 115, 19, 0, 951, 245, 1, 0, 0, 0, 952, 953, 9, 0, 0, 0, 953, 954, + 1, 0, 0, 0, 954, 955, 6, 116, 34, 0, 955, 956, 6, 116, 33, 0, 956, 247, + 1, 0, 0, 0, 957, 958, 3, 18, 2, 0, 958, 249, 1, 0, 0, 0, 959, 960, 5, + 62, 0, 0, 960, 961, 5, 62, 0, 0, 961, 962, 1, 0, 0, 0, 962, 963, 6, 118, + 28, 0, 963, 964, 6, 118, 11, 0, 964, 251, 1, 0, 0, 0, 965, 966, 5, 123, + 0, 0, 966, 967, 1, 0, 0, 0, 967, 968, 6, 119, 19, 0, 968, 253, 1, 0, + 0, 0, 969, 971, 8, 11, 0, 0, 970, 969, 1, 0, 0, 0, 971, 972, 1, 0, 0, + 0, 972, 970, 1, 0, 0, 0, 972, 973, 1, 0, 0, 0, 973, 255, 1, 0, 0, 0, + 974, 975, 3, 14, 0, 0, 975, 976, 1, 0, 0, 0, 976, 977, 6, 121, 0, 0, + 977, 257, 1, 0, 0, 0, 978, 979, 3, 18, 2, 0, 979, 259, 1, 0, 0, 0, 980, + 981, 3, 24, 5, 0, 981, 982, 1, 0, 0, 0, 982, 983, 6, 123, 12, 0, 983, + 984, 6, 123, 11, 0, 984, 261, 1, 0, 0, 0, 985, 986, 5, 62, 0, 0, 986, + 987, 5, 62, 0, 0, 987, 988, 1, 0, 0, 0, 988, 989, 6, 124, 28, 0, 989, + 990, 6, 124, 11, 0, 990, 263, 1, 0, 0, 0, 991, 992, 3, 14, 0, 0, 992, + 993, 1, 0, 0, 0, 993, 994, 6, 125, 0, 0, 994, 265, 1, 0, 0, 0, 995, 996, + 3, 24, 5, 0, 996, 997, 1, 0, 0, 0, 997, 998, 6, 126, 12, 0, 998, 999, + 6, 126, 11, 0, 999, 267, 1, 0, 0, 0, 1000, 1001, 3, 68, 27, 0, 1001, + 1002, 1, 0, 0, 0, 1002, 1003, 6, 127, 23, 0, 1003, 1004, 6, 127, 10, + 0, 1004, 269, 1, 0, 0, 0, 1005, 1006, 5, 62, 0, 0, 1006, 1007, 5, 62, + 0, 0, 1007, 1008, 1, 0, 0, 0, 1008, 1009, 6, 128, 28, 0, 1009, 1010, + 6, 128, 11, 0, 1010, 271, 1, 0, 0, 0, 53, 0, 1, 2, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 275, 285, 291, 295, 300, 322, 325, 329, 334, 343, + 347, 356, 360, 372, 376, 381, 385, 397, 473, 507, 510, 560, 612, 619, + 626, 634, 639, 644, 651, 658, 664, 670, 676, 741, 743, 771, 776, 787, + 972, 35, 0, 1, 0, 0, 3, 0, 0, 2, 0, 5, 1, 0, 5, 2, 0, 5, 4, 0, 5, 3, + 0, 5, 8, 0, 1, 12, 0, 7, 11, 0, 2, 9, 0, 4, 0, 0, 7, 9, 0, 7, 6, 0, 7, + 5, 0, 5, 10, 0, 7, 12, 0, 5, 7, 0, 5, 5, 0, 5, 9, 0, 7, 24, 0, 5, 6, + 0, 2, 7, 0, 7, 20, 0, 7, 19, 0, 7, 82, 0, 7, 69, 0, 7, 62, 0, 7, 85, + 0, 1, 93, 1, 5, 13, 0, 5, 12, 0, 7, 87, 0, 2, 11, 0, 7, 88, 0 ]; } \ No newline at end of file diff --git a/crates/compiler/src/parser/generated/yarnspinnerparser.rs b/crates/compiler/src/parser/generated/yarnspinnerparser.rs index a7d56a9ca..4ba0951eb 100644 --- a/crates/compiler/src/parser/generated/yarnspinnerparser.rs +++ b/crates/compiler/src/parser/generated/yarnspinnerparser.rs @@ -1,4 +1,4 @@ -// Generated from third-party/YarnSpinner/YarnSpinner.Compiler/YarnSpinnerParser.g4 by ANTLR 4.13.2 +// Generated from third-party/YarnSpinner/YarnSpinner.Compiler/Grammars/YarnSpinnerParser.g4 by ANTLR 4.13.2 #![allow(dead_code)] #![allow(non_snake_case)] #![allow(non_upper_case_globals)] @@ -6,7 +6,7 @@ #![allow(unused_imports)] #![allow(unused_mut)] #![allow(unused_braces)] -use antlr4rust::PredictionContextCache; +use antlr4rust::{CoerceTo, PredictionContextCache}; use antlr4rust::parser::{Parser, BaseParser, ParserRecog, ParserNodeType}; use antlr4rust::token_stream::TokenStream; use antlr4rust::TokenSource; @@ -20,7 +20,7 @@ use antlr4rust::atn::{ATN, INVALID_ALT}; use antlr4rust::error_strategy::{ErrorStrategy, DefaultErrorStrategy}; use antlr4rust::parser_rule_context::{BaseParserRuleContext, ParserRuleContext,cast,cast_mut}; use antlr4rust::tree::*; -use antlr4rust::token::{TOKEN_EOF,OwningToken,Token}; +use antlr4rust::token::{TOKEN_EOF, OwningToken, Token, CommonToken}; use antlr4rust::int_stream::EOF; use antlr4rust::vocabulary::{Vocabulary,VocabularyImpl}; use antlr4rust::token_factory::{CommonTokenFactory,TokenFactory, TokenAware}; @@ -36,156 +36,191 @@ use std::rc::Rc; use std::convert::TryFrom; use std::cell::RefCell; use std::ops::{DerefMut, Deref}; -use std::borrow::{Borrow,BorrowMut}; +use std::borrow::{Borrow, BorrowMut, Cow}; use std::any::{Any,TypeId}; - - pub const YarnSpinnerParser_INDENT:i32=1; - pub const YarnSpinnerParser_DEDENT:i32=2; - pub const YarnSpinnerParser_BLANK_LINE_FOLLOWING_OPTION:i32=3; - pub const YarnSpinnerParser_WS:i32=4; - pub const YarnSpinnerParser_COMMENT:i32=5; - pub const YarnSpinnerParser_NEWLINE:i32=6; - pub const YarnSpinnerParser_ID:i32=7; - pub const YarnSpinnerParser_BODY_START:i32=8; - pub const YarnSpinnerParser_HEADER_DELIMITER:i32=9; - pub const YarnSpinnerParser_HASHTAG:i32=10; - pub const YarnSpinnerParser_REST_OF_LINE:i32=11; - pub const YarnSpinnerParser_BODY_WS:i32=12; - pub const YarnSpinnerParser_BODY_END:i32=13; - pub const YarnSpinnerParser_SHORTCUT_ARROW:i32=14; - pub const YarnSpinnerParser_COMMAND_START:i32=15; - pub const YarnSpinnerParser_EXPRESSION_START:i32=16; - pub const YarnSpinnerParser_ESCAPED_ANY:i32=17; - pub const YarnSpinnerParser_TEXT_ESCAPE:i32=18; - pub const YarnSpinnerParser_TEXT_COMMENT:i32=19; - pub const YarnSpinnerParser_TEXT:i32=20; - pub const YarnSpinnerParser_UNESCAPABLE_CHARACTER:i32=21; - pub const YarnSpinnerParser_TEXT_COMMANDHASHTAG_WS:i32=22; - pub const YarnSpinnerParser_TEXT_COMMANDHASHTAG_COMMENT:i32=23; - pub const YarnSpinnerParser_TEXT_COMMANDHASHTAG_ERROR:i32=24; - pub const YarnSpinnerParser_HASHTAG_WS:i32=25; - pub const YarnSpinnerParser_HASHTAG_TEXT:i32=26; - pub const YarnSpinnerParser_EXPR_WS:i32=27; - pub const YarnSpinnerParser_KEYWORD_TRUE:i32=28; - pub const YarnSpinnerParser_KEYWORD_FALSE:i32=29; - pub const YarnSpinnerParser_KEYWORD_NULL:i32=30; - pub const YarnSpinnerParser_OPERATOR_ASSIGNMENT:i32=31; - pub const YarnSpinnerParser_OPERATOR_LOGICAL_LESS_THAN_EQUALS:i32=32; - pub const YarnSpinnerParser_OPERATOR_LOGICAL_GREATER_THAN_EQUALS:i32=33; - pub const YarnSpinnerParser_OPERATOR_LOGICAL_EQUALS:i32=34; - pub const YarnSpinnerParser_OPERATOR_LOGICAL_LESS:i32=35; - pub const YarnSpinnerParser_OPERATOR_LOGICAL_GREATER:i32=36; - pub const YarnSpinnerParser_OPERATOR_LOGICAL_NOT_EQUALS:i32=37; - pub const YarnSpinnerParser_OPERATOR_LOGICAL_AND:i32=38; - pub const YarnSpinnerParser_OPERATOR_LOGICAL_OR:i32=39; - pub const YarnSpinnerParser_OPERATOR_LOGICAL_XOR:i32=40; - pub const YarnSpinnerParser_OPERATOR_LOGICAL_NOT:i32=41; - pub const YarnSpinnerParser_OPERATOR_MATHS_ADDITION_EQUALS:i32=42; - pub const YarnSpinnerParser_OPERATOR_MATHS_SUBTRACTION_EQUALS:i32=43; - pub const YarnSpinnerParser_OPERATOR_MATHS_MULTIPLICATION_EQUALS:i32=44; - pub const YarnSpinnerParser_OPERATOR_MATHS_MODULUS_EQUALS:i32=45; - pub const YarnSpinnerParser_OPERATOR_MATHS_DIVISION_EQUALS:i32=46; - pub const YarnSpinnerParser_OPERATOR_MATHS_ADDITION:i32=47; - pub const YarnSpinnerParser_OPERATOR_MATHS_SUBTRACTION:i32=48; - pub const YarnSpinnerParser_OPERATOR_MATHS_MULTIPLICATION:i32=49; - pub const YarnSpinnerParser_OPERATOR_MATHS_DIVISION:i32=50; - pub const YarnSpinnerParser_OPERATOR_MATHS_MODULUS:i32=51; - pub const YarnSpinnerParser_LPAREN:i32=52; - pub const YarnSpinnerParser_RPAREN:i32=53; - pub const YarnSpinnerParser_COMMA:i32=54; - pub const YarnSpinnerParser_EXPRESSION_AS:i32=55; - pub const YarnSpinnerParser_STRING:i32=56; - pub const YarnSpinnerParser_FUNC_ID:i32=57; - pub const YarnSpinnerParser_EXPRESSION_END:i32=58; - pub const YarnSpinnerParser_VAR_ID:i32=59; - pub const YarnSpinnerParser_DOT:i32=60; - pub const YarnSpinnerParser_NUMBER:i32=61; - pub const YarnSpinnerParser_COMMAND_NEWLINE:i32=62; - pub const YarnSpinnerParser_COMMAND_WS:i32=63; - pub const YarnSpinnerParser_COMMAND_IF:i32=64; - pub const YarnSpinnerParser_COMMAND_ELSEIF:i32=65; - pub const YarnSpinnerParser_COMMAND_ELSE:i32=66; - pub const YarnSpinnerParser_COMMAND_SET:i32=67; - pub const YarnSpinnerParser_COMMAND_ENDIF:i32=68; - pub const YarnSpinnerParser_COMMAND_CALL:i32=69; - pub const YarnSpinnerParser_COMMAND_DECLARE:i32=70; - pub const YarnSpinnerParser_COMMAND_JUMP:i32=71; - pub const YarnSpinnerParser_COMMAND_ENUM:i32=72; - pub const YarnSpinnerParser_COMMAND_CASE:i32=73; - pub const YarnSpinnerParser_COMMAND_ENDENUM:i32=74; - pub const YarnSpinnerParser_COMMAND_LOCAL:i32=75; - pub const YarnSpinnerParser_COMMAND_END:i32=76; - pub const YarnSpinnerParser_COMMAND_TEXT_NEWLINE:i32=77; - pub const YarnSpinnerParser_COMMAND_TEXT_END:i32=78; - pub const YarnSpinnerParser_COMMAND_EXPRESSION_START:i32=79; - pub const YarnSpinnerParser_COMMAND_TEXT:i32=80; - pub const YarnSpinnerParser_COMMAND_ID_NEWLINE:i32=81; - pub const YarnSpinnerParser_TYPE_STRING:i32=82; - pub const YarnSpinnerParser_TYPE_NUMBER:i32=83; - pub const YarnSpinnerParser_TYPE_BOOL:i32=84; +use std::mem; +use antlr4rust::common_token_stream::CommonTokenStream; +use crate::prelude::ContextRefExt; + +pub const YarnSpinnerParser_INDENT:i32=1; + pub const YarnSpinnerParser_DEDENT:i32=2; + pub const YarnSpinnerParser_BLANK_LINE_FOLLOWING_OPTION:i32=3; + pub const YarnSpinnerParser_WS:i32=4; + pub const YarnSpinnerParser_COMMENT:i32=5; + pub const YarnSpinnerParser_NEWLINE:i32=6; + pub const YarnSpinnerParser_HEADER_WHEN:i32=7; + pub const YarnSpinnerParser_HEADER_TITLE:i32=8; + pub const YarnSpinnerParser_ID:i32=9; + pub const YarnSpinnerParser_BODY_START:i32=10; + pub const YarnSpinnerParser_HEADER_DELIMITER:i32=11; + pub const YarnSpinnerParser_HASHTAG:i32=12; + pub const YarnSpinnerParser_HEADER_WHEN_UNKNOWN:i32=13; + pub const YarnSpinnerParser_REST_OF_LINE:i32=14; + pub const YarnSpinnerParser_BODY_WS:i32=15; + pub const YarnSpinnerParser_BODY_END:i32=16; + pub const YarnSpinnerParser_SHORTCUT_ARROW:i32=17; + pub const YarnSpinnerParser_LINE_GROUP_ARROW:i32=18; + pub const YarnSpinnerParser_COMMAND_START:i32=19; + pub const YarnSpinnerParser_EXPRESSION_START:i32=20; + pub const YarnSpinnerParser_ESCAPED_ANY:i32=21; + pub const YarnSpinnerParser_TEXT_ESCAPE:i32=22; + pub const YarnSpinnerParser_TEXT_COMMENT:i32=23; + pub const YarnSpinnerParser_TEXT:i32=24; + pub const YarnSpinnerParser_UNESCAPABLE_CHARACTER:i32=25; + pub const YarnSpinnerParser_TEXT_COMMANDHASHTAG_WS:i32=26; + pub const YarnSpinnerParser_TEXT_COMMANDHASHTAG_COMMENT:i32=27; + pub const YarnSpinnerParser_TEXT_COMMANDHASHTAG_ERROR:i32=28; + pub const YarnSpinnerParser_HASHTAG_WS:i32=29; + pub const YarnSpinnerParser_HASHTAG_TEXT:i32=30; + pub const YarnSpinnerParser_EXPR_WS:i32=31; + pub const YarnSpinnerParser_EXPRESSION_WHEN_ALWAYS:i32=32; + pub const YarnSpinnerParser_KEYWORD_TRUE:i32=33; + pub const YarnSpinnerParser_KEYWORD_FALSE:i32=34; + pub const YarnSpinnerParser_KEYWORD_NULL:i32=35; + pub const YarnSpinnerParser_OPERATOR_ASSIGNMENT:i32=36; + pub const YarnSpinnerParser_OPERATOR_LOGICAL_LESS_THAN_EQUALS:i32=37; + pub const YarnSpinnerParser_OPERATOR_LOGICAL_GREATER_THAN_EQUALS:i32=38; + pub const YarnSpinnerParser_OPERATOR_LOGICAL_EQUALS:i32=39; + pub const YarnSpinnerParser_OPERATOR_LOGICAL_LESS:i32=40; + pub const YarnSpinnerParser_OPERATOR_LOGICAL_GREATER:i32=41; + pub const YarnSpinnerParser_OPERATOR_LOGICAL_NOT_EQUALS:i32=42; + pub const YarnSpinnerParser_OPERATOR_LOGICAL_AND:i32=43; + pub const YarnSpinnerParser_OPERATOR_LOGICAL_OR:i32=44; + pub const YarnSpinnerParser_OPERATOR_LOGICAL_XOR:i32=45; + pub const YarnSpinnerParser_OPERATOR_LOGICAL_NOT:i32=46; + pub const YarnSpinnerParser_OPERATOR_MATHS_ADDITION_EQUALS:i32=47; + pub const YarnSpinnerParser_OPERATOR_MATHS_SUBTRACTION_EQUALS:i32=48; + pub const YarnSpinnerParser_OPERATOR_MATHS_MULTIPLICATION_EQUALS:i32=49; + pub const YarnSpinnerParser_OPERATOR_MATHS_MODULUS_EQUALS:i32=50; + pub const YarnSpinnerParser_OPERATOR_MATHS_DIVISION_EQUALS:i32=51; + pub const YarnSpinnerParser_OPERATOR_MATHS_ADDITION:i32=52; + pub const YarnSpinnerParser_OPERATOR_MATHS_SUBTRACTION:i32=53; + pub const YarnSpinnerParser_OPERATOR_MATHS_MULTIPLICATION:i32=54; + pub const YarnSpinnerParser_OPERATOR_MATHS_DIVISION:i32=55; + pub const YarnSpinnerParser_OPERATOR_MATHS_MODULUS:i32=56; + pub const YarnSpinnerParser_LPAREN:i32=57; + pub const YarnSpinnerParser_RPAREN:i32=58; + pub const YarnSpinnerParser_COMMA:i32=59; + pub const YarnSpinnerParser_EXPRESSION_AS:i32=60; + pub const YarnSpinnerParser_STRING:i32=61; + pub const YarnSpinnerParser_FUNC_ID:i32=62; + pub const YarnSpinnerParser_EXPRESSION_END:i32=63; + pub const YarnSpinnerParser_VAR_ID:i32=64; + pub const YarnSpinnerParser_DOT:i32=65; + pub const YarnSpinnerParser_NUMBER:i32=66; + pub const YarnSpinnerParser_COMMAND_NEWLINE:i32=67; + pub const YarnSpinnerParser_COMMAND_WS:i32=68; + pub const YarnSpinnerParser_COMMAND_IF:i32=69; + pub const YarnSpinnerParser_COMMAND_ELSEIF:i32=70; + pub const YarnSpinnerParser_COMMAND_ELSE:i32=71; + pub const YarnSpinnerParser_COMMAND_SET:i32=72; + pub const YarnSpinnerParser_COMMAND_ENDIF:i32=73; + pub const YarnSpinnerParser_COMMAND_CALL:i32=74; + pub const YarnSpinnerParser_COMMAND_DECLARE:i32=75; + pub const YarnSpinnerParser_COMMAND_JUMP:i32=76; + pub const YarnSpinnerParser_COMMAND_DETOUR:i32=77; + pub const YarnSpinnerParser_COMMAND_RETURN:i32=78; + pub const YarnSpinnerParser_COMMAND_ENUM:i32=79; + pub const YarnSpinnerParser_COMMAND_CASE:i32=80; + pub const YarnSpinnerParser_COMMAND_ENDENUM:i32=81; + pub const YarnSpinnerParser_COMMAND_ONCE:i32=82; + pub const YarnSpinnerParser_COMMAND_ENDONCE:i32=83; + pub const YarnSpinnerParser_COMMAND_LOCAL:i32=84; + pub const YarnSpinnerParser_COMMAND_END:i32=85; + pub const YarnSpinnerParser_COMMAND_TEXT_NEWLINE:i32=86; + pub const YarnSpinnerParser_COMMAND_EXPRESSION_START:i32=87; + pub const YarnSpinnerParser_COMMAND_TEXT:i32=88; + pub const YarnSpinnerParser_COMMAND_ID_WS:i32=89; + pub const YarnSpinnerParser_COMMAND_ID_NEWLINE:i32=90; + pub const YarnSpinnerParser_COMMAND_ID_OR_EXPRESSION_WS:i32=91; + pub const YarnSpinnerParser_TYPE_STRING:i32=92; + pub const YarnSpinnerParser_TYPE_NUMBER:i32=93; + pub const YarnSpinnerParser_TYPE_BOOL:i32=94; pub const YarnSpinnerParser_EOF:i32=EOF; pub const RULE_dialogue:usize = 0; pub const RULE_file_hashtag:usize = 1; pub const RULE_node:usize = 2; - pub const RULE_header:usize = 3; - pub const RULE_body:usize = 4; - pub const RULE_statement:usize = 5; - pub const RULE_line_statement:usize = 6; - pub const RULE_line_formatted_text:usize = 7; - pub const RULE_hashtag:usize = 8; - pub const RULE_line_condition:usize = 9; - pub const RULE_expression:usize = 10; - pub const RULE_value:usize = 11; - pub const RULE_variable:usize = 12; - pub const RULE_function_call:usize = 13; - pub const RULE_if_statement:usize = 14; - pub const RULE_if_clause:usize = 15; - pub const RULE_else_if_clause:usize = 16; - pub const RULE_else_clause:usize = 17; - pub const RULE_set_statement:usize = 18; - pub const RULE_call_statement:usize = 19; - pub const RULE_command_statement:usize = 20; - pub const RULE_command_formatted_text:usize = 21; - pub const RULE_shortcut_option_statement:usize = 22; - pub const RULE_shortcut_option:usize = 23; - pub const RULE_declare_statement:usize = 24; - pub const RULE_jump_statement:usize = 25; - pub const ruleNames: [&'static str; 26] = [ - "dialogue", "file_hashtag", "node", "header", "body", "statement", "line_statement", - "line_formatted_text", "hashtag", "line_condition", "expression", "value", - "variable", "function_call", "if_statement", "if_clause", "else_if_clause", + pub const RULE_title_header:usize = 3; + pub const RULE_when_header:usize = 4; + pub const RULE_header:usize = 5; + pub const RULE_header_when_expression:usize = 6; + pub const RULE_body:usize = 7; + pub const RULE_statement:usize = 8; + pub const RULE_line_statement:usize = 9; + pub const RULE_line_formatted_text:usize = 10; + pub const RULE_hashtag:usize = 11; + pub const RULE_line_condition:usize = 12; + pub const RULE_expression:usize = 13; + pub const RULE_value:usize = 14; + pub const RULE_variable:usize = 15; + pub const RULE_function_call:usize = 16; + pub const RULE_typeMemberReference:usize = 17; + pub const RULE_if_statement:usize = 18; + pub const RULE_if_clause:usize = 19; + pub const RULE_else_if_clause:usize = 20; + pub const RULE_else_clause:usize = 21; + pub const RULE_set_statement:usize = 22; + pub const RULE_call_statement:usize = 23; + pub const RULE_command_statement:usize = 24; + pub const RULE_command_formatted_text:usize = 25; + pub const RULE_shortcut_option_statement:usize = 26; + pub const RULE_shortcut_option:usize = 27; + pub const RULE_line_group_statement:usize = 28; + pub const RULE_line_group_item:usize = 29; + pub const RULE_declare_statement:usize = 30; + pub const RULE_enum_statement:usize = 31; + pub const RULE_enum_case_statement:usize = 32; + pub const RULE_jump_statement:usize = 33; + pub const RULE_return_statement:usize = 34; + pub const RULE_once_statement:usize = 35; + pub const RULE_once_primary_clause:usize = 36; + pub const RULE_once_alternate_clause:usize = 37; + pub const RULE_structured_command:usize = 38; + pub const RULE_structured_command_value:usize = 39; + pub const ruleNames: [&'static str; 40] = [ + "dialogue", "file_hashtag", "node", "title_header", "when_header", "header", + "header_when_expression", "body", "statement", "line_statement", "line_formatted_text", + "hashtag", "line_condition", "expression", "value", "variable", "function_call", + "typeMemberReference", "if_statement", "if_clause", "else_if_clause", "else_clause", "set_statement", "call_statement", "command_statement", "command_formatted_text", "shortcut_option_statement", "shortcut_option", - "declare_statement", "jump_statement" + "line_group_statement", "line_group_item", "declare_statement", "enum_statement", + "enum_case_statement", "jump_statement", "return_statement", "once_statement", + "once_primary_clause", "once_alternate_clause", "structured_command", + "structured_command_value" ]; - pub const _LITERAL_NAMES: [Option<&'static str>;85] = [ - None, None, None, None, None, None, None, None, Some("'---'"), None, Some("'#'"), - None, None, Some("'==='"), Some("'->'"), Some("'<<'"), None, None, Some("'\\'"), - None, None, None, None, None, None, None, None, None, Some("'true'"), + pub const _LITERAL_NAMES: [Option<&'static str>;95] = [ + None, None, None, None, None, None, None, Some("'when'"), Some("'title'"), + None, Some("'---'"), None, Some("'#'"), None, None, None, Some("'==='"), + Some("'->'"), Some("'=>'"), Some("'<<'"), None, None, None, None, None, + None, None, None, None, None, None, None, Some("'always'"), Some("'true'"), Some("'false'"), Some("'null'"), None, None, None, None, None, None, None, None, None, None, None, Some("'+='"), Some("'-='"), Some("'*='"), Some("'%='"), Some("'/='"), Some("'+'"), Some("'-'"), Some("'*'"), Some("'/'"), Some("'%'"), Some("'('"), Some("')'"), Some("','"), Some("'as'"), None, None, Some("'}'"), - None, Some("'.'"), None, None, None, None, None, None, None, Some("'endif'"), - None, None, None, None, None, None, None, None, None, None, Some("'{'"), - None, None, Some("'string'"), Some("'number'"), Some("'bool'") + None, Some("'.'"), None, None, None, None, None, Some("'else'"), None, + Some("'endif'"), None, None, None, None, Some("'return'"), None, None, + Some("'endenum'"), Some("'once'"), Some("'endonce'"), Some("'local'"), + None, None, Some("'{'"), None, None, None, None, Some("'string'"), Some("'number'"), + Some("'bool'") ]; - pub const _SYMBOLIC_NAMES: [Option<&'static str>;85] = [ + pub const _SYMBOLIC_NAMES: [Option<&'static str>;95] = [ None, Some("INDENT"), Some("DEDENT"), Some("BLANK_LINE_FOLLOWING_OPTION"), - Some("WS"), Some("COMMENT"), Some("NEWLINE"), Some("ID"), Some("BODY_START"), - Some("HEADER_DELIMITER"), Some("HASHTAG"), Some("REST_OF_LINE"), Some("BODY_WS"), - Some("BODY_END"), Some("SHORTCUT_ARROW"), Some("COMMAND_START"), Some("EXPRESSION_START"), - Some("ESCAPED_ANY"), Some("TEXT_ESCAPE"), Some("TEXT_COMMENT"), Some("TEXT"), - Some("UNESCAPABLE_CHARACTER"), Some("TEXT_COMMANDHASHTAG_WS"), Some("TEXT_COMMANDHASHTAG_COMMENT"), - Some("TEXT_COMMANDHASHTAG_ERROR"), Some("HASHTAG_WS"), Some("HASHTAG_TEXT"), - Some("EXPR_WS"), Some("KEYWORD_TRUE"), Some("KEYWORD_FALSE"), Some("KEYWORD_NULL"), - Some("OPERATOR_ASSIGNMENT"), Some("OPERATOR_LOGICAL_LESS_THAN_EQUALS"), - Some("OPERATOR_LOGICAL_GREATER_THAN_EQUALS"), Some("OPERATOR_LOGICAL_EQUALS"), - Some("OPERATOR_LOGICAL_LESS"), Some("OPERATOR_LOGICAL_GREATER"), Some("OPERATOR_LOGICAL_NOT_EQUALS"), - Some("OPERATOR_LOGICAL_AND"), Some("OPERATOR_LOGICAL_OR"), Some("OPERATOR_LOGICAL_XOR"), - Some("OPERATOR_LOGICAL_NOT"), Some("OPERATOR_MATHS_ADDITION_EQUALS"), + Some("WS"), Some("COMMENT"), Some("NEWLINE"), Some("HEADER_WHEN"), Some("HEADER_TITLE"), + Some("ID"), Some("BODY_START"), Some("HEADER_DELIMITER"), Some("HASHTAG"), + Some("HEADER_WHEN_UNKNOWN"), Some("REST_OF_LINE"), Some("BODY_WS"), Some("BODY_END"), + Some("SHORTCUT_ARROW"), Some("LINE_GROUP_ARROW"), Some("COMMAND_START"), + Some("EXPRESSION_START"), Some("ESCAPED_ANY"), Some("TEXT_ESCAPE"), Some("TEXT_COMMENT"), + Some("TEXT"), Some("UNESCAPABLE_CHARACTER"), Some("TEXT_COMMANDHASHTAG_WS"), + Some("TEXT_COMMANDHASHTAG_COMMENT"), Some("TEXT_COMMANDHASHTAG_ERROR"), + Some("HASHTAG_WS"), Some("HASHTAG_TEXT"), Some("EXPR_WS"), Some("EXPRESSION_WHEN_ALWAYS"), + Some("KEYWORD_TRUE"), Some("KEYWORD_FALSE"), Some("KEYWORD_NULL"), Some("OPERATOR_ASSIGNMENT"), + Some("OPERATOR_LOGICAL_LESS_THAN_EQUALS"), Some("OPERATOR_LOGICAL_GREATER_THAN_EQUALS"), + Some("OPERATOR_LOGICAL_EQUALS"), Some("OPERATOR_LOGICAL_LESS"), Some("OPERATOR_LOGICAL_GREATER"), + Some("OPERATOR_LOGICAL_NOT_EQUALS"), Some("OPERATOR_LOGICAL_AND"), Some("OPERATOR_LOGICAL_OR"), + Some("OPERATOR_LOGICAL_XOR"), Some("OPERATOR_LOGICAL_NOT"), Some("OPERATOR_MATHS_ADDITION_EQUALS"), Some("OPERATOR_MATHS_SUBTRACTION_EQUALS"), Some("OPERATOR_MATHS_MULTIPLICATION_EQUALS"), Some("OPERATOR_MATHS_MODULUS_EQUALS"), Some("OPERATOR_MATHS_DIVISION_EQUALS"), Some("OPERATOR_MATHS_ADDITION"), Some("OPERATOR_MATHS_SUBTRACTION"), Some("OPERATOR_MATHS_MULTIPLICATION"), @@ -194,11 +229,13 @@ use std::any::{Any,TypeId}; Some("FUNC_ID"), Some("EXPRESSION_END"), Some("VAR_ID"), Some("DOT"), Some("NUMBER"), Some("COMMAND_NEWLINE"), Some("COMMAND_WS"), Some("COMMAND_IF"), Some("COMMAND_ELSEIF"), Some("COMMAND_ELSE"), Some("COMMAND_SET"), Some("COMMAND_ENDIF"), - Some("COMMAND_CALL"), Some("COMMAND_DECLARE"), Some("COMMAND_JUMP"), Some("COMMAND_ENUM"), - Some("COMMAND_CASE"), Some("COMMAND_ENDENUM"), Some("COMMAND_LOCAL"), - Some("COMMAND_END"), Some("COMMAND_TEXT_NEWLINE"), Some("COMMAND_TEXT_END"), - Some("COMMAND_EXPRESSION_START"), Some("COMMAND_TEXT"), Some("COMMAND_ID_NEWLINE"), - Some("TYPE_STRING"), Some("TYPE_NUMBER"), Some("TYPE_BOOL") + Some("COMMAND_CALL"), Some("COMMAND_DECLARE"), Some("COMMAND_JUMP"), Some("COMMAND_DETOUR"), + Some("COMMAND_RETURN"), Some("COMMAND_ENUM"), Some("COMMAND_CASE"), Some("COMMAND_ENDENUM"), + Some("COMMAND_ONCE"), Some("COMMAND_ENDONCE"), Some("COMMAND_LOCAL"), + Some("COMMAND_END"), Some("COMMAND_TEXT_NEWLINE"), Some("COMMAND_EXPRESSION_START"), + Some("COMMAND_TEXT"), Some("COMMAND_ID_WS"), Some("COMMAND_ID_NEWLINE"), + Some("COMMAND_ID_OR_EXPRESSION_WS"), Some("TYPE_STRING"), Some("TYPE_NUMBER"), + Some("TYPE_BOOL") ]; lazy_static!{ static ref _shared_context_cache: Arc = Arc::new(PredictionContextCache::new()); @@ -354,7 +391,7 @@ impl<'input,I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'i recog:&mut BaseParserType<'input,I> )->bool{ match rule_index { - 10 => YarnSpinnerParser::<'input,I>::expression_sempred(_localctx.and_then(|x|x.downcast_ref()), pred_index, recog), + 13 => YarnSpinnerParser::<'input,I>::expression_sempred(_localctx.and_then(|x|x.downcast_ref()), pred_index, recog), _ => true } } @@ -475,39 +512,39 @@ where recog.base.enter_outer_alt(None, 1)?; { { - recog.base.set_state(55); + recog.base.set_state(83); recog.err_handler.sync(&mut recog.base)?; _la = recog.base.input.la(1); while _la==YarnSpinnerParser_HASHTAG { { { /*InvokeRule file_hashtag*/ - recog.base.set_state(52); + recog.base.set_state(80); recog.file_hashtag()?; } } - recog.base.set_state(57); + recog.base.set_state(85); recog.err_handler.sync(&mut recog.base)?; _la = recog.base.input.la(1); } } - recog.base.set_state(59); + recog.base.set_state(87); recog.err_handler.sync(&mut recog.base)?; _la = recog.base.input.la(1); loop { { { /*InvokeRule node*/ - recog.base.set_state(58); + recog.base.set_state(86); recog.node()?; } } - recog.base.set_state(61); + recog.base.set_state(89); recog.err_handler.sync(&mut recog.base)?; _la = recog.base.input.la(1); - if !(_la==YarnSpinnerParser_ID) {break} + if !((((_la) & !0x3f) == 0 && ((1usize << _la) & 896) != 0)) {break} } } Ok(()) @@ -612,10 +649,10 @@ where //recog.base.enter_outer_alt(_localctx.clone(), 1)?; recog.base.enter_outer_alt(None, 1)?; { - recog.base.set_state(63); + recog.base.set_state(91); recog.base.match_token(YarnSpinnerParser_HASHTAG,&mut recog.err_handler)?; - recog.base.set_state(64); + recog.base.set_state(92); let tmp = recog.base.match_token(YarnSpinnerParser_HASHTAG_TEXT,&mut recog.err_handler)?; cast_mut::<_,File_hashtagContext >(&mut _localctx).text = Some(tmp.clone()); @@ -664,6 +701,7 @@ impl<'input,'a> Listenable + 'a> for NodeC } impl<'input,'a> Visitable + 'a> for NodeContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { YarnSpinnerParserVisitor::visit_node(visitor, self); } @@ -704,9 +742,46 @@ fn BODY_END(&self) -> Option Vec>> where Self:Sized{ - self.children_of_type() + let mut all = self.children_of_type(); + + for title in self.title_header_all() { + let mut ctx = HeaderContextExt::new(self.get_parent(), 0); + + cast_mut::<_,HeaderContext>(&mut ctx).header_key = Some(Box::new(CommonToken { + token_type: 0, + channel: 0, + start: 0, + stop: 0, + token_index: Default::default(), + line: 0, + column: 0, + text: Cow::from("title"), + read_only: false, + })); + cast_mut::<_,HeaderContext>(&mut ctx).header_value = title.title.clone(); + cast_mut::<_,HeaderContext>(&mut ctx).exception = title.exception.clone(); + + all.push(ctx); + } + + all } fn header(&self, i: usize) -> Option>> where Self:Sized{ + match self.header_all().get(i) { + Some(h) => Some(h.to_owned()), + None => None + } +} +fn when_header_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +fn when_header(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) +} +fn title_header_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +fn title_header(&self, i: usize) -> Option>> where Self:Sized{ self.child_of_type(i) } @@ -731,31 +806,60 @@ where //recog.base.enter_outer_alt(_localctx.clone(), 1)?; recog.base.enter_outer_alt(None, 1)?; { - recog.base.set_state(67); + recog.base.set_state(97); recog.err_handler.sync(&mut recog.base)?; _la = recog.base.input.la(1); loop { { - { - /*InvokeRule header*/ - recog.base.set_state(66); - recog.header()?; + recog.base.set_state(97); + recog.err_handler.sync(&mut recog.base)?; + match recog.base.input.la(1) { + YarnSpinnerParser_ID + => { + { + /*InvokeRule header*/ + recog.base.set_state(94); + recog.header()?; + + } + } + + YarnSpinnerParser_HEADER_WHEN + => { + { + /*InvokeRule when_header*/ + recog.base.set_state(95); + recog.when_header()?; + + } + } + + YarnSpinnerParser_HEADER_TITLE + => { + { + /*InvokeRule title_header*/ + recog.base.set_state(96); + recog.title_header()?; + + } + } + _ => Err(ANTLRError::NoAltError(NoViableAltError::new(&mut recog.base)))? } } - recog.base.set_state(69); + recog.base.set_state(99); recog.err_handler.sync(&mut recog.base)?; _la = recog.base.input.la(1); - if !(_la==YarnSpinnerParser_ID) {break} + if !((((_la) & !0x3f) == 0 && ((1usize << _la) & 896) != 0)) {break} } - recog.base.set_state(71); + recog.base.set_state(101); recog.base.match_token(YarnSpinnerParser_BODY_START,&mut recog.err_handler)?; /*InvokeRule body*/ - recog.base.set_state(72); + recog.base.set_state(102); recog.body()?; - recog.base.set_state(73); + recog.base.set_state(103); recog.base.match_token(YarnSpinnerParser_BODY_END,&mut recog.err_handler)?; } @@ -775,53 +879,52 @@ where Ok(_localctx) } } -//------------------- header ---------------- -pub type HeaderContextAll<'input> = HeaderContext<'input>; +//------------------- title_header ---------------- +pub type Title_headerContextAll<'input> = Title_headerContext<'input>; -pub type HeaderContext<'input> = BaseParserRuleContext<'input,HeaderContextExt<'input>>; +pub type Title_headerContext<'input> = BaseParserRuleContext<'input,Title_headerContextExt<'input>>; #[derive(Clone)] -pub struct HeaderContextExt<'input>{ - pub header_key: Option>, - pub header_value: Option>, +pub struct Title_headerContextExt<'input>{ + pub title: Option>, ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for HeaderContext<'input>{} +impl<'input> YarnSpinnerParserContext<'input> for Title_headerContext<'input>{} -impl<'input,'a> Listenable + 'a> for HeaderContext<'input>{ +impl<'input,'a> Listenable + 'a> for Title_headerContext<'input>{ fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { listener.enter_every_rule(self)?; - listener.enter_header(self); + listener.enter_title_header(self); Ok(()) } fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_header(self); + listener.exit_title_header(self); listener.exit_every_rule(self)?; Ok(()) } } -impl<'input,'a> Visitable + 'a> for HeaderContext<'input>{ +impl<'input,'a> Visitable + 'a> for Title_headerContext<'input>{ fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_header(self); + visitor.visit_title_header(self); } } -impl<'input> CustomRuleContext<'input> for HeaderContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for Title_headerContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_header } - //fn type_rule_index() -> usize where Self: Sized { RULE_header } + fn get_rule_index(&self) -> usize { RULE_title_header } + //fn type_rule_index() -> usize where Self: Sized { RULE_title_header } } -antlr4rust::tid!{HeaderContextExt<'a>} +antlr4rust::tid!{Title_headerContextExt<'a>} -impl<'input> HeaderContextExt<'input>{ - fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { +impl<'input> Title_headerContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { Rc::new( - BaseParserRuleContext::new_parser_ctx(parent, invoking_state,HeaderContextExt{ - header_key: None, header_value: None, + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Title_headerContextExt{ + title: None, ph:PhantomData }), @@ -829,65 +932,62 @@ impl<'input> HeaderContextExt<'input>{ } } -pub trait HeaderContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ +pub trait Title_headerContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ +/// Retrieves first TerminalNode corresponding to token HEADER_TITLE +/// Returns `None` if there is no child corresponding to token HEADER_TITLE +fn HEADER_TITLE(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_HEADER_TITLE, 0) +} /// Retrieves first TerminalNode corresponding to token HEADER_DELIMITER /// Returns `None` if there is no child corresponding to token HEADER_DELIMITER fn HEADER_DELIMITER(&self) -> Option>> where Self:Sized{ self.get_token(YarnSpinnerParser_HEADER_DELIMITER, 0) } +/// Retrieves first TerminalNode corresponding to token NEWLINE +/// Returns `None` if there is no child corresponding to token NEWLINE +fn NEWLINE(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_NEWLINE, 0) +} /// Retrieves first TerminalNode corresponding to token ID /// Returns `None` if there is no child corresponding to token ID fn ID(&self) -> Option>> where Self:Sized{ self.get_token(YarnSpinnerParser_ID, 0) } -/// Retrieves first TerminalNode corresponding to token REST_OF_LINE -/// Returns `None` if there is no child corresponding to token REST_OF_LINE -fn REST_OF_LINE(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_REST_OF_LINE, 0) -} } -impl<'input> HeaderContextAttrs<'input> for HeaderContext<'input>{} +impl<'input> Title_headerContextAttrs<'input> for Title_headerContext<'input>{} impl<'input, I> YarnSpinnerParser<'input, I> where I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, { - pub fn header(&mut self,) - -> Result>,ANTLRError> { + pub fn title_header(&mut self,) + -> Result>,ANTLRError> { let mut recog = self; let _parentctx = recog.ctx.take(); - let mut _localctx = HeaderContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog.base.enter_rule(_localctx.clone(), 6, RULE_header); - let mut _localctx: Rc = _localctx; - let mut _la: i32 = -1; + let mut _localctx = Title_headerContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 6, RULE_title_header); + let mut _localctx: Rc = _localctx; let result: Result<(), ANTLRError> = (|| { //recog.base.enter_outer_alt(_localctx.clone(), 1)?; recog.base.enter_outer_alt(None, 1)?; { - recog.base.set_state(75); - let tmp = recog.base.match_token(YarnSpinnerParser_ID,&mut recog.err_handler)?; - cast_mut::<_,HeaderContext >(&mut _localctx).header_key = Some(tmp.clone()); - + recog.base.set_state(105); + recog.base.match_token(YarnSpinnerParser_HEADER_TITLE,&mut recog.err_handler)?; - recog.base.set_state(76); + recog.base.set_state(106); recog.base.match_token(YarnSpinnerParser_HEADER_DELIMITER,&mut recog.err_handler)?; - recog.base.set_state(78); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - if _la==YarnSpinnerParser_REST_OF_LINE { - { - recog.base.set_state(77); - let tmp = recog.base.match_token(YarnSpinnerParser_REST_OF_LINE,&mut recog.err_handler)?; - cast_mut::<_,HeaderContext >(&mut _localctx).header_value = Some(tmp.clone()); - + recog.base.set_state(107); + let tmp = recog.base.match_token(YarnSpinnerParser_ID,&mut recog.err_handler)?; + cast_mut::<_,Title_headerContext >(&mut _localctx).title = Some(tmp.clone()); + - } - } + recog.base.set_state(108); + recog.base.match_token(YarnSpinnerParser_NEWLINE,&mut recog.err_handler)?; } Ok(()) @@ -906,50 +1006,52 @@ where Ok(_localctx) } } -//------------------- body ---------------- -pub type BodyContextAll<'input> = BodyContext<'input>; +//------------------- when_header ---------------- +pub type When_headerContextAll<'input> = When_headerContext<'input>; -pub type BodyContext<'input> = BaseParserRuleContext<'input,BodyContextExt<'input>>; +pub type When_headerContext<'input> = BaseParserRuleContext<'input,When_headerContextExt<'input>>; #[derive(Clone)] -pub struct BodyContextExt<'input>{ +pub struct When_headerContextExt<'input>{ + pub header_expression: Option>>, ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for BodyContext<'input>{} +impl<'input> YarnSpinnerParserContext<'input> for When_headerContext<'input>{} -impl<'input,'a> Listenable + 'a> for BodyContext<'input>{ +impl<'input,'a> Listenable + 'a> for When_headerContext<'input>{ fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { listener.enter_every_rule(self)?; - listener.enter_body(self); + listener.enter_when_header(self); Ok(()) } fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_body(self); + listener.exit_when_header(self); listener.exit_every_rule(self)?; Ok(()) } } -impl<'input,'a> Visitable + 'a> for BodyContext<'input>{ +impl<'input,'a> Visitable + 'a> for When_headerContext<'input>{ fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_body(self); + visitor.visit_when_header(self); } } -impl<'input> CustomRuleContext<'input> for BodyContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for When_headerContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_body } - //fn type_rule_index() -> usize where Self: Sized { RULE_body } + fn get_rule_index(&self) -> usize { RULE_when_header } + //fn type_rule_index() -> usize where Self: Sized { RULE_when_header } } -antlr4rust::tid!{BodyContextExt<'a>} +antlr4rust::tid!{When_headerContextExt<'a>} -impl<'input> BodyContextExt<'input>{ - fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { +impl<'input> When_headerContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { Rc::new( - BaseParserRuleContext::new_parser_ctx(parent, invoking_state,BodyContextExt{ + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,When_headerContextExt{ + header_expression: None, ph:PhantomData }), @@ -957,52 +1059,62 @@ impl<'input> BodyContextExt<'input>{ } } -pub trait BodyContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ +pub trait When_headerContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ -fn statement_all(&self) -> Vec>> where Self:Sized{ - self.children_of_type() +/// Retrieves first TerminalNode corresponding to token HEADER_WHEN +/// Returns `None` if there is no child corresponding to token HEADER_WHEN +fn HEADER_WHEN(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_HEADER_WHEN, 0) } -fn statement(&self, i: usize) -> Option>> where Self:Sized{ - self.child_of_type(i) +/// Retrieves first TerminalNode corresponding to token HEADER_DELIMITER +/// Returns `None` if there is no child corresponding to token HEADER_DELIMITER +fn HEADER_DELIMITER(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_HEADER_DELIMITER, 0) +} +/// Retrieves first TerminalNode corresponding to token NEWLINE +/// Returns `None` if there is no child corresponding to token NEWLINE +fn NEWLINE(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_NEWLINE, 0) +} +fn header_when_expression(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) } } -impl<'input> BodyContextAttrs<'input> for BodyContext<'input>{} +impl<'input> When_headerContextAttrs<'input> for When_headerContext<'input>{} impl<'input, I> YarnSpinnerParser<'input, I> where I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, { - pub fn body(&mut self,) - -> Result>,ANTLRError> { + pub fn when_header(&mut self,) + -> Result>,ANTLRError> { let mut recog = self; let _parentctx = recog.ctx.take(); - let mut _localctx = BodyContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog.base.enter_rule(_localctx.clone(), 8, RULE_body); - let mut _localctx: Rc = _localctx; - let mut _la: i32 = -1; + let mut _localctx = When_headerContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 8, RULE_when_header); + let mut _localctx: Rc = _localctx; let result: Result<(), ANTLRError> = (|| { //recog.base.enter_outer_alt(_localctx.clone(), 1)?; recog.base.enter_outer_alt(None, 1)?; { - recog.base.set_state(83); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - while (((_la) & !0x3f) == 0 && ((1usize << _la) & 1163266) != 0) { - { - { - /*InvokeRule statement*/ - recog.base.set_state(80); - recog.statement()?; + recog.base.set_state(110); + recog.base.match_token(YarnSpinnerParser_HEADER_WHEN,&mut recog.err_handler)?; + + recog.base.set_state(111); + recog.base.match_token(YarnSpinnerParser_HEADER_DELIMITER,&mut recog.err_handler)?; + + /*InvokeRule header_when_expression*/ + recog.base.set_state(112); + let tmp = recog.header_when_expression()?; + cast_mut::<_,When_headerContext >(&mut _localctx).header_expression = Some(tmp.clone()); + + + recog.base.set_state(113); + recog.base.match_token(YarnSpinnerParser_NEWLINE,&mut recog.err_handler)?; - } - } - recog.base.set_state(85); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - } } Ok(()) })(); @@ -1020,50 +1132,53 @@ where Ok(_localctx) } } -//------------------- statement ---------------- -pub type StatementContextAll<'input> = StatementContext<'input>; +//------------------- header ---------------- +pub type HeaderContextAll<'input> = HeaderContext<'input>; -pub type StatementContext<'input> = BaseParserRuleContext<'input,StatementContextExt<'input>>; +pub type HeaderContext<'input> = BaseParserRuleContext<'input,HeaderContextExt<'input>>; #[derive(Clone)] -pub struct StatementContextExt<'input>{ +pub struct HeaderContextExt<'input>{ + pub header_key: Option>, + pub header_value: Option>, ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for StatementContext<'input>{} +impl<'input> YarnSpinnerParserContext<'input> for HeaderContext<'input>{} -impl<'input,'a> Listenable + 'a> for StatementContext<'input>{ +impl<'input,'a> Listenable + 'a> for HeaderContext<'input>{ fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { listener.enter_every_rule(self)?; - listener.enter_statement(self); + listener.enter_header(self); Ok(()) } fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_statement(self); + listener.exit_header(self); listener.exit_every_rule(self)?; Ok(()) } } -impl<'input,'a> Visitable + 'a> for StatementContext<'input>{ +impl<'input,'a> Visitable + 'a> for HeaderContext<'input>{ fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_statement(self); + visitor.visit_header(self); } } -impl<'input> CustomRuleContext<'input> for StatementContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for HeaderContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_statement } - //fn type_rule_index() -> usize where Self: Sized { RULE_statement } + fn get_rule_index(&self) -> usize { RULE_header } + //fn type_rule_index() -> usize where Self: Sized { RULE_header } } -antlr4rust::tid!{StatementContextExt<'a>} +antlr4rust::tid!{HeaderContextExt<'a>} -impl<'input> StatementContextExt<'input>{ - fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { +impl<'input> HeaderContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { Rc::new( - BaseParserRuleContext::new_parser_ctx(parent, invoking_state,StatementContextExt{ + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,HeaderContextExt{ + header_key: None, header_value: None, ph:PhantomData }), @@ -1071,188 +1186,66 @@ impl<'input> StatementContextExt<'input>{ } } -pub trait StatementContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ +pub trait HeaderContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ -fn line_statement(&self) -> Option>> where Self:Sized{ - self.child_of_type(0) -} -fn if_statement(&self) -> Option>> where Self:Sized{ - self.child_of_type(0) -} -fn set_statement(&self) -> Option>> where Self:Sized{ - self.child_of_type(0) -} -fn shortcut_option_statement(&self) -> Option>> where Self:Sized{ - self.child_of_type(0) -} -fn call_statement(&self) -> Option>> where Self:Sized{ - self.child_of_type(0) -} -fn command_statement(&self) -> Option>> where Self:Sized{ - self.child_of_type(0) -} -fn declare_statement(&self) -> Option>> where Self:Sized{ - self.child_of_type(0) -} -fn jump_statement(&self) -> Option>> where Self:Sized{ - self.child_of_type(0) -} -/// Retrieves first TerminalNode corresponding to token INDENT -/// Returns `None` if there is no child corresponding to token INDENT -fn INDENT(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_INDENT, 0) -} -/// Retrieves first TerminalNode corresponding to token DEDENT -/// Returns `None` if there is no child corresponding to token DEDENT -fn DEDENT(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_DEDENT, 0) +/// Retrieves first TerminalNode corresponding to token HEADER_DELIMITER +/// Returns `None` if there is no child corresponding to token HEADER_DELIMITER +fn HEADER_DELIMITER(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_HEADER_DELIMITER, 0) } -fn statement_all(&self) -> Vec>> where Self:Sized{ - self.children_of_type() +/// Retrieves first TerminalNode corresponding to token ID +/// Returns `None` if there is no child corresponding to token ID +fn ID(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_ID, 0) } -fn statement(&self, i: usize) -> Option>> where Self:Sized{ - self.child_of_type(i) +/// Retrieves first TerminalNode corresponding to token REST_OF_LINE +/// Returns `None` if there is no child corresponding to token REST_OF_LINE +fn REST_OF_LINE(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_REST_OF_LINE, 0) } } -impl<'input> StatementContextAttrs<'input> for StatementContext<'input>{} +impl<'input> HeaderContextAttrs<'input> for HeaderContext<'input>{} impl<'input, I> YarnSpinnerParser<'input, I> where I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, { - pub fn statement(&mut self,) - -> Result>,ANTLRError> { + pub fn header(&mut self,) + -> Result>,ANTLRError> { let mut recog = self; let _parentctx = recog.ctx.take(); - let mut _localctx = StatementContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog.base.enter_rule(_localctx.clone(), 10, RULE_statement); - let mut _localctx: Rc = _localctx; + let mut _localctx = HeaderContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 10, RULE_header); + let mut _localctx: Rc = _localctx; let mut _la: i32 = -1; let result: Result<(), ANTLRError> = (|| { - recog.base.set_state(102); - recog.err_handler.sync(&mut recog.base)?; - match recog.interpreter.adaptive_predict(6,&mut recog.base)? { - 1 =>{ - //recog.base.enter_outer_alt(_localctx.clone(), 1)?; - recog.base.enter_outer_alt(None, 1)?; - { - /*InvokeRule line_statement*/ - recog.base.set_state(86); - recog.line_statement()?; - - } - } - , - 2 =>{ - //recog.base.enter_outer_alt(_localctx.clone(), 2)?; - recog.base.enter_outer_alt(None, 2)?; - { - /*InvokeRule if_statement*/ - recog.base.set_state(87); - recog.if_statement()?; - - } - } - , - 3 =>{ - //recog.base.enter_outer_alt(_localctx.clone(), 3)?; - recog.base.enter_outer_alt(None, 3)?; - { - /*InvokeRule set_statement*/ - recog.base.set_state(88); - recog.set_statement()?; - - } - } - , - 4 =>{ - //recog.base.enter_outer_alt(_localctx.clone(), 4)?; - recog.base.enter_outer_alt(None, 4)?; - { - /*InvokeRule shortcut_option_statement*/ - recog.base.set_state(89); - recog.shortcut_option_statement()?; - - } - } - , - 5 =>{ - //recog.base.enter_outer_alt(_localctx.clone(), 5)?; - recog.base.enter_outer_alt(None, 5)?; - { - /*InvokeRule call_statement*/ - recog.base.set_state(90); - recog.call_statement()?; - - } - } - , - 6 =>{ - //recog.base.enter_outer_alt(_localctx.clone(), 6)?; - recog.base.enter_outer_alt(None, 6)?; - { - /*InvokeRule command_statement*/ - recog.base.set_state(91); - recog.command_statement()?; - - } - } - , - 7 =>{ - //recog.base.enter_outer_alt(_localctx.clone(), 7)?; - recog.base.enter_outer_alt(None, 7)?; - { - /*InvokeRule declare_statement*/ - recog.base.set_state(92); - recog.declare_statement()?; - - } - } - , - 8 =>{ - //recog.base.enter_outer_alt(_localctx.clone(), 8)?; - recog.base.enter_outer_alt(None, 8)?; - { - /*InvokeRule jump_statement*/ - recog.base.set_state(93); - recog.jump_statement()?; - - } - } - , - 9 =>{ - //recog.base.enter_outer_alt(_localctx.clone(), 9)?; - recog.base.enter_outer_alt(None, 9)?; - { - recog.base.set_state(94); - recog.base.match_token(YarnSpinnerParser_INDENT,&mut recog.err_handler)?; + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(115); + let tmp = recog.base.match_token(YarnSpinnerParser_ID,&mut recog.err_handler)?; + cast_mut::<_,HeaderContext >(&mut _localctx).header_key = Some(tmp.clone()); + - recog.base.set_state(98); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - while (((_la) & !0x3f) == 0 && ((1usize << _la) & 1163266) != 0) { - { - { - /*InvokeRule statement*/ - recog.base.set_state(95); - recog.statement()?; + recog.base.set_state(116); + recog.base.match_token(YarnSpinnerParser_HEADER_DELIMITER,&mut recog.err_handler)?; - } - } - recog.base.set_state(100); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - } - recog.base.set_state(101); - recog.base.match_token(YarnSpinnerParser_DEDENT,&mut recog.err_handler)?; + recog.base.set_state(118); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + if _la==YarnSpinnerParser_REST_OF_LINE { + { + recog.base.set_state(117); + let tmp = recog.base.match_token(YarnSpinnerParser_REST_OF_LINE,&mut recog.err_handler)?; + cast_mut::<_,HeaderContext >(&mut _localctx).header_value = Some(tmp.clone()); + - } } + } - _ => {} } Ok(()) })(); @@ -1270,50 +1263,53 @@ where Ok(_localctx) } } -//------------------- line_statement ---------------- -pub type Line_statementContextAll<'input> = Line_statementContext<'input>; +//------------------- header_when_expression ---------------- +pub type Header_when_expressionContextAll<'input> = Header_when_expressionContext<'input>; -pub type Line_statementContext<'input> = BaseParserRuleContext<'input,Line_statementContextExt<'input>>; +pub type Header_when_expressionContext<'input> = BaseParserRuleContext<'input,Header_when_expressionContextExt<'input>>; #[derive(Clone)] -pub struct Line_statementContextExt<'input>{ +pub struct Header_when_expressionContextExt<'input>{ + pub always: Option>, + pub once: Option>, ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for Line_statementContext<'input>{} +impl<'input> YarnSpinnerParserContext<'input> for Header_when_expressionContext<'input>{} -impl<'input,'a> Listenable + 'a> for Line_statementContext<'input>{ +impl<'input,'a> Listenable + 'a> for Header_when_expressionContext<'input>{ fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { listener.enter_every_rule(self)?; - listener.enter_line_statement(self); + listener.enter_header_when_expression(self); Ok(()) } fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_line_statement(self); + listener.exit_header_when_expression(self); listener.exit_every_rule(self)?; Ok(()) } } -impl<'input,'a> Visitable + 'a> for Line_statementContext<'input>{ +impl<'input,'a> Visitable + 'a> for Header_when_expressionContext<'input>{ fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_line_statement(self); + visitor.visit_header_when_expression(self); } } -impl<'input> CustomRuleContext<'input> for Line_statementContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for Header_when_expressionContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_line_statement } - //fn type_rule_index() -> usize where Self: Sized { RULE_line_statement } + fn get_rule_index(&self) -> usize { RULE_header_when_expression } + //fn type_rule_index() -> usize where Self: Sized { RULE_header_when_expression } } -antlr4rust::tid!{Line_statementContextExt<'a>} +antlr4rust::tid!{Header_when_expressionContextExt<'a>} -impl<'input> Line_statementContextExt<'input>{ - fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { +impl<'input> Header_when_expressionContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { Rc::new( - BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Line_statementContextExt{ + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Header_when_expressionContextExt{ + always: None, once: None, ph:PhantomData }), @@ -1321,82 +1317,107 @@ impl<'input> Line_statementContextExt<'input>{ } } -pub trait Line_statementContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ +pub trait Header_when_expressionContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ -fn line_formatted_text(&self) -> Option>> where Self:Sized{ +fn expression(&self) -> Option>> where Self:Sized{ self.child_of_type(0) } -/// Retrieves first TerminalNode corresponding to token NEWLINE -/// Returns `None` if there is no child corresponding to token NEWLINE -fn NEWLINE(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_NEWLINE, 0) -} -fn line_condition(&self) -> Option>> where Self:Sized{ - self.child_of_type(0) +/// Retrieves first TerminalNode corresponding to token EXPRESSION_WHEN_ALWAYS +/// Returns `None` if there is no child corresponding to token EXPRESSION_WHEN_ALWAYS +fn EXPRESSION_WHEN_ALWAYS(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_EXPRESSION_WHEN_ALWAYS, 0) } -fn hashtag_all(&self) -> Vec>> where Self:Sized{ - self.children_of_type() +/// Retrieves first TerminalNode corresponding to token COMMAND_ONCE +/// Returns `None` if there is no child corresponding to token COMMAND_ONCE +fn COMMAND_ONCE(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_ONCE, 0) } -fn hashtag(&self, i: usize) -> Option>> where Self:Sized{ - self.child_of_type(i) +/// Retrieves first TerminalNode corresponding to token COMMAND_IF +/// Returns `None` if there is no child corresponding to token COMMAND_IF +fn COMMAND_IF(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_IF, 0) } } -impl<'input> Line_statementContextAttrs<'input> for Line_statementContext<'input>{} +impl<'input> Header_when_expressionContextAttrs<'input> for Header_when_expressionContext<'input>{} impl<'input, I> YarnSpinnerParser<'input, I> where I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, { - pub fn line_statement(&mut self,) - -> Result>,ANTLRError> { + pub fn header_when_expression(&mut self,) + -> Result>,ANTLRError> { let mut recog = self; let _parentctx = recog.ctx.take(); - let mut _localctx = Line_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog.base.enter_rule(_localctx.clone(), 12, RULE_line_statement); - let mut _localctx: Rc = _localctx; + let mut _localctx = Header_when_expressionContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 12, RULE_header_when_expression); + let mut _localctx: Rc = _localctx; let mut _la: i32 = -1; let result: Result<(), ANTLRError> = (|| { - //recog.base.enter_outer_alt(_localctx.clone(), 1)?; - recog.base.enter_outer_alt(None, 1)?; - { - /*InvokeRule line_formatted_text*/ - recog.base.set_state(104); - recog.line_formatted_text()?; - - recog.base.set_state(106); + recog.base.set_state(127); recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - if _la==YarnSpinnerParser_COMMAND_START { - { - /*InvokeRule line_condition*/ - recog.base.set_state(105); - recog.line_condition()?; + match recog.base.input.la(1) { + YarnSpinnerParser_KEYWORD_TRUE |YarnSpinnerParser_KEYWORD_FALSE |YarnSpinnerParser_OPERATOR_LOGICAL_NOT | + YarnSpinnerParser_OPERATOR_MATHS_SUBTRACTION |YarnSpinnerParser_LPAREN | + YarnSpinnerParser_STRING |YarnSpinnerParser_FUNC_ID |YarnSpinnerParser_VAR_ID | + YarnSpinnerParser_DOT |YarnSpinnerParser_NUMBER + => { + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + /*InvokeRule expression*/ + recog.base.set_state(120); + recog.expression_rec(0)?; + } } - } - recog.base.set_state(111); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - while _la==YarnSpinnerParser_HASHTAG { - { - { - /*InvokeRule hashtag*/ - recog.base.set_state(108); - recog.hashtag()?; + YarnSpinnerParser_EXPRESSION_WHEN_ALWAYS + => { + //recog.base.enter_outer_alt(_localctx.clone(), 2)?; + recog.base.enter_outer_alt(None, 2)?; + { + { + recog.base.set_state(121); + let tmp = recog.base.match_token(YarnSpinnerParser_EXPRESSION_WHEN_ALWAYS,&mut recog.err_handler)?; + cast_mut::<_,Header_when_expressionContext >(&mut _localctx).always = Some(tmp.clone()); + + } + } } + + YarnSpinnerParser_COMMAND_ONCE + => { + //recog.base.enter_outer_alt(_localctx.clone(), 3)?; + recog.base.enter_outer_alt(None, 3)?; + { + recog.base.set_state(122); + let tmp = recog.base.match_token(YarnSpinnerParser_COMMAND_ONCE,&mut recog.err_handler)?; + cast_mut::<_,Header_when_expressionContext >(&mut _localctx).once = Some(tmp.clone()); + + + recog.base.set_state(125); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + if _la==YarnSpinnerParser_COMMAND_IF { + { + recog.base.set_state(123); + recog.base.match_token(YarnSpinnerParser_COMMAND_IF,&mut recog.err_handler)?; + + /*InvokeRule expression*/ + recog.base.set_state(124); + recog.expression_rec(0)?; + + } + } + + } } - recog.base.set_state(113); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - } - recog.base.set_state(114); - recog.base.match_token(YarnSpinnerParser_NEWLINE,&mut recog.err_handler)?; + _ => Err(ANTLRError::NoAltError(NoViableAltError::new(&mut recog.base)))? } Ok(()) })(); @@ -1414,50 +1435,50 @@ where Ok(_localctx) } } -//------------------- line_formatted_text ---------------- -pub type Line_formatted_textContextAll<'input> = Line_formatted_textContext<'input>; +//------------------- body ---------------- +pub type BodyContextAll<'input> = BodyContext<'input>; -pub type Line_formatted_textContext<'input> = BaseParserRuleContext<'input,Line_formatted_textContextExt<'input>>; +pub type BodyContext<'input> = BaseParserRuleContext<'input,BodyContextExt<'input>>; #[derive(Clone)] -pub struct Line_formatted_textContextExt<'input>{ +pub struct BodyContextExt<'input>{ ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for Line_formatted_textContext<'input>{} +impl<'input> YarnSpinnerParserContext<'input> for BodyContext<'input>{} -impl<'input,'a> Listenable + 'a> for Line_formatted_textContext<'input>{ +impl<'input,'a> Listenable + 'a> for BodyContext<'input>{ fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { listener.enter_every_rule(self)?; - listener.enter_line_formatted_text(self); + listener.enter_body(self); Ok(()) } fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_line_formatted_text(self); + listener.exit_body(self); listener.exit_every_rule(self)?; Ok(()) } } -impl<'input,'a> Visitable + 'a> for Line_formatted_textContext<'input>{ +impl<'input,'a> Visitable + 'a> for BodyContext<'input>{ fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_line_formatted_text(self); + visitor.visit_body(self); } } -impl<'input> CustomRuleContext<'input> for Line_formatted_textContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for BodyContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_line_formatted_text } - //fn type_rule_index() -> usize where Self: Sized { RULE_line_formatted_text } + fn get_rule_index(&self) -> usize { RULE_body } + //fn type_rule_index() -> usize where Self: Sized { RULE_body } } -antlr4rust::tid!{Line_formatted_textContextExt<'a>} +antlr4rust::tid!{BodyContextExt<'a>} -impl<'input> Line_formatted_textContextExt<'input>{ - fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { +impl<'input> BodyContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { Rc::new( - BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Line_formatted_textContextExt{ + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,BodyContextExt{ ph:PhantomData }), @@ -1465,122 +1486,51 @@ impl<'input> Line_formatted_textContextExt<'input>{ } } -pub trait Line_formatted_textContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ +pub trait BodyContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ -/// Retrieves all `TerminalNode`s corresponding to token EXPRESSION_START in current rule -fn EXPRESSION_START_all(&self) -> Vec>> where Self:Sized{ +fn statement_all(&self) -> Vec>> where Self:Sized{ self.children_of_type() } -/// Retrieves 'i's TerminalNode corresponding to token EXPRESSION_START, starting from 0. -/// Returns `None` if number of children corresponding to token EXPRESSION_START is less or equal than `i`. -fn EXPRESSION_START(&self, i: usize) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_EXPRESSION_START, i) -} -fn expression_all(&self) -> Vec>> where Self:Sized{ - self.children_of_type() -} -fn expression(&self, i: usize) -> Option>> where Self:Sized{ +fn statement(&self, i: usize) -> Option>> where Self:Sized{ self.child_of_type(i) } -/// Retrieves all `TerminalNode`s corresponding to token EXPRESSION_END in current rule -fn EXPRESSION_END_all(&self) -> Vec>> where Self:Sized{ - self.children_of_type() -} -/// Retrieves 'i's TerminalNode corresponding to token EXPRESSION_END, starting from 0. -/// Returns `None` if number of children corresponding to token EXPRESSION_END is less or equal than `i`. -fn EXPRESSION_END(&self, i: usize) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_EXPRESSION_END, i) -} -/// Retrieves all `TerminalNode`s corresponding to token TEXT in current rule -fn TEXT_all(&self) -> Vec>> where Self:Sized{ - self.children_of_type() -} -/// Retrieves 'i's TerminalNode corresponding to token TEXT, starting from 0. -/// Returns `None` if number of children corresponding to token TEXT is less or equal than `i`. -fn TEXT(&self, i: usize) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_TEXT, i) -} } -impl<'input> Line_formatted_textContextAttrs<'input> for Line_formatted_textContext<'input>{} +impl<'input> BodyContextAttrs<'input> for BodyContext<'input>{} impl<'input, I> YarnSpinnerParser<'input, I> where I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, { - pub fn line_formatted_text(&mut self,) - -> Result>,ANTLRError> { + pub fn body(&mut self,) + -> Result>,ANTLRError> { let mut recog = self; let _parentctx = recog.ctx.take(); - let mut _localctx = Line_formatted_textContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog.base.enter_rule(_localctx.clone(), 14, RULE_line_formatted_text); - let mut _localctx: Rc = _localctx; + let mut _localctx = BodyContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 14, RULE_body); + let mut _localctx: Rc = _localctx; let mut _la: i32 = -1; let result: Result<(), ANTLRError> = (|| { - let mut _alt: i32; //recog.base.enter_outer_alt(_localctx.clone(), 1)?; recog.base.enter_outer_alt(None, 1)?; { - recog.base.set_state(125); + recog.base.set_state(132); recog.err_handler.sync(&mut recog.base)?; _la = recog.base.input.la(1); - loop { + while (((_la) & !0x3f) == 0 && ((1usize << _la) & 18743298) != 0) { { - recog.base.set_state(125); - recog.err_handler.sync(&mut recog.base)?; - match recog.base.input.la(1) { - YarnSpinnerParser_TEXT - => { - { - recog.base.set_state(117); - recog.err_handler.sync(&mut recog.base)?; - _alt = 1; - loop { - match _alt { - x if x == 1=> - { - { - recog.base.set_state(116); - recog.base.match_token(YarnSpinnerParser_TEXT,&mut recog.err_handler)?; - - } - } - - _ => Err(ANTLRError::NoAltError(NoViableAltError::new(&mut recog.base)))? - } - recog.base.set_state(119); - recog.err_handler.sync(&mut recog.base)?; - _alt = recog.interpreter.adaptive_predict(9,&mut recog.base)?; - if _alt==2 || _alt==INVALID_ALT { break } - } - } - } - - YarnSpinnerParser_EXPRESSION_START - => { - { - recog.base.set_state(121); - recog.base.match_token(YarnSpinnerParser_EXPRESSION_START,&mut recog.err_handler)?; - - /*InvokeRule expression*/ - recog.base.set_state(122); - recog.expression_rec(0)?; - - recog.base.set_state(123); - recog.base.match_token(YarnSpinnerParser_EXPRESSION_END,&mut recog.err_handler)?; - - } - } + { + /*InvokeRule statement*/ + recog.base.set_state(129); + recog.statement()?; - _ => Err(ANTLRError::NoAltError(NoViableAltError::new(&mut recog.base)))? } } - recog.base.set_state(127); + recog.base.set_state(134); recog.err_handler.sync(&mut recog.base)?; _la = recog.base.input.la(1); - if !(_la==YarnSpinnerParser_EXPRESSION_START || _la==YarnSpinnerParser_TEXT) {break} } } Ok(()) @@ -1599,70 +1549,50 @@ where Ok(_localctx) } } -//------------------- hashtag ---------------- -pub type HashtagContextAll<'input> = HashtagContext<'input>; +//------------------- statement ---------------- +pub type StatementContextAll<'input> = StatementContext<'input>; -pub type HashtagContext<'input> = BaseParserRuleContext<'input,HashtagContextExt<'input>>; +pub type StatementContext<'input> = BaseParserRuleContext<'input,StatementContextExt<'input>>; #[derive(Clone)] -pub struct HashtagContextExt<'input>{ - pub text: Option>, +pub struct StatementContextExt<'input>{ ph:PhantomData<&'input str> } -// Manually injected after generation. -impl<'input> HashtagContextExt<'input> { - pub fn new_with_text( - parent: Option + 'input>>, - invoking_state: i32, - text: impl Into>>, - ) -> Rc> { - Rc::new(BaseParserRuleContext::new_parser_ctx( - parent, - invoking_state, - HashtagContextExt { - text: text.into(), - ph: PhantomData, - }, - )) - } -} - -impl<'input> YarnSpinnerParserContext<'input> for HashtagContext<'input>{} +impl<'input> YarnSpinnerParserContext<'input> for StatementContext<'input>{} -impl<'input,'a> Listenable + 'a> for HashtagContext<'input>{ +impl<'input,'a> Listenable + 'a> for StatementContext<'input>{ fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { listener.enter_every_rule(self)?; - listener.enter_hashtag(self); + listener.enter_statement(self); Ok(()) } fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_hashtag(self); + listener.exit_statement(self); listener.exit_every_rule(self)?; Ok(()) } } -impl<'input,'a> Visitable + 'a> for HashtagContext<'input>{ +impl<'input,'a> Visitable + 'a> for StatementContext<'input>{ fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_hashtag(self); + visitor.visit_statement(self); } } -impl<'input> CustomRuleContext<'input> for HashtagContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for StatementContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_hashtag } - //fn type_rule_index() -> usize where Self: Sized { RULE_hashtag } + fn get_rule_index(&self) -> usize { RULE_statement } + //fn type_rule_index() -> usize where Self: Sized { RULE_statement } } -antlr4rust::tid!{HashtagContextExt<'a>} +antlr4rust::tid!{StatementContextExt<'a>} -impl<'input> HashtagContextExt<'input>{ - fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { +impl<'input> StatementContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { Rc::new( - BaseParserRuleContext::new_parser_ctx(parent, invoking_state,HashtagContextExt{ - text: None, + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,StatementContextExt{ ph:PhantomData }), @@ -1670,108 +1600,305 @@ impl<'input> HashtagContextExt<'input>{ } } -pub trait HashtagContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ +pub trait StatementContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ -/// Retrieves first TerminalNode corresponding to token HASHTAG -/// Returns `None` if there is no child corresponding to token HASHTAG -fn HASHTAG(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_HASHTAG, 0) +fn line_statement(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) } -/// Retrieves first TerminalNode corresponding to token HASHTAG_TEXT -/// Returns `None` if there is no child corresponding to token HASHTAG_TEXT -fn HASHTAG_TEXT(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_HASHTAG_TEXT, 0) +fn if_statement(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +fn set_statement(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +fn shortcut_option_statement(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +fn call_statement(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +fn command_statement(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +fn declare_statement(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +fn enum_statement(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +fn jump_statement(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +fn return_statement(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +fn line_group_statement(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +fn once_statement(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +/// Retrieves first TerminalNode corresponding to token INDENT +/// Returns `None` if there is no child corresponding to token INDENT +fn INDENT(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_INDENT, 0) +} +/// Retrieves first TerminalNode corresponding to token DEDENT +/// Returns `None` if there is no child corresponding to token DEDENT +fn DEDENT(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_DEDENT, 0) +} +fn statement_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +fn statement(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) } } -impl<'input> HashtagContextAttrs<'input> for HashtagContext<'input>{} +impl<'input> StatementContextAttrs<'input> for StatementContext<'input>{} impl<'input, I> YarnSpinnerParser<'input, I> where I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, { - pub fn hashtag(&mut self,) - -> Result>,ANTLRError> { + pub fn statement(&mut self,) + -> Result>,ANTLRError> { let mut recog = self; let _parentctx = recog.ctx.take(); - let mut _localctx = HashtagContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog.base.enter_rule(_localctx.clone(), 16, RULE_hashtag); - let mut _localctx: Rc = _localctx; + let mut _localctx = StatementContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 16, RULE_statement); + let mut _localctx: Rc = _localctx; + let mut _la: i32 = -1; let result: Result<(), ANTLRError> = (|| { - //recog.base.enter_outer_alt(_localctx.clone(), 1)?; - recog.base.enter_outer_alt(None, 1)?; - { - recog.base.set_state(129); - recog.base.match_token(YarnSpinnerParser_HASHTAG,&mut recog.err_handler)?; - - recog.base.set_state(130); - let tmp = recog.base.match_token(YarnSpinnerParser_HASHTAG_TEXT,&mut recog.err_handler)?; - cast_mut::<_,HashtagContext >(&mut _localctx).text = Some(tmp.clone()); - - - } - Ok(()) - })(); - match result { - Ok(_)=>{}, - Err(e @ ANTLRError::FallThrough(_)) => return Err(e), - Err(ref re) => { - //_localctx.exception = re; - recog.err_handler.report_error(&mut recog.base, re); - recog.err_handler.recover(&mut recog.base, re)?; - } - } - recog.base.exit_rule()?; - - Ok(_localctx) - } -} -//------------------- line_condition ---------------- -pub type Line_conditionContextAll<'input> = Line_conditionContext<'input>; + recog.base.set_state(155); + recog.err_handler.sync(&mut recog.base)?; + match recog.interpreter.adaptive_predict(9,&mut recog.base)? { + 1 =>{ + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + /*InvokeRule line_statement*/ + recog.base.set_state(135); + recog.line_statement()?; + } + } + , + 2 =>{ + //recog.base.enter_outer_alt(_localctx.clone(), 2)?; + recog.base.enter_outer_alt(None, 2)?; + { + /*InvokeRule if_statement*/ + recog.base.set_state(136); + recog.if_statement()?; -pub type Line_conditionContext<'input> = BaseParserRuleContext<'input,Line_conditionContextExt<'input>>; + } + } + , + 3 =>{ + //recog.base.enter_outer_alt(_localctx.clone(), 3)?; + recog.base.enter_outer_alt(None, 3)?; + { + /*InvokeRule set_statement*/ + recog.base.set_state(137); + recog.set_statement()?; -#[derive(Clone)] -pub struct Line_conditionContextExt<'input>{ -ph:PhantomData<&'input str> + } + } + , + 4 =>{ + //recog.base.enter_outer_alt(_localctx.clone(), 4)?; + recog.base.enter_outer_alt(None, 4)?; + { + /*InvokeRule shortcut_option_statement*/ + recog.base.set_state(138); + recog.shortcut_option_statement()?; + + } + } + , + 5 =>{ + //recog.base.enter_outer_alt(_localctx.clone(), 5)?; + recog.base.enter_outer_alt(None, 5)?; + { + /*InvokeRule call_statement*/ + recog.base.set_state(139); + recog.call_statement()?; + + } + } + , + 6 =>{ + //recog.base.enter_outer_alt(_localctx.clone(), 6)?; + recog.base.enter_outer_alt(None, 6)?; + { + /*InvokeRule command_statement*/ + recog.base.set_state(140); + recog.command_statement()?; + + } + } + , + 7 =>{ + //recog.base.enter_outer_alt(_localctx.clone(), 7)?; + recog.base.enter_outer_alt(None, 7)?; + { + /*InvokeRule declare_statement*/ + recog.base.set_state(141); + recog.declare_statement()?; + + } + } + , + 8 =>{ + //recog.base.enter_outer_alt(_localctx.clone(), 8)?; + recog.base.enter_outer_alt(None, 8)?; + { + /*InvokeRule enum_statement*/ + recog.base.set_state(142); + recog.enum_statement()?; + + } + } + , + 9 =>{ + //recog.base.enter_outer_alt(_localctx.clone(), 9)?; + recog.base.enter_outer_alt(None, 9)?; + { + /*InvokeRule jump_statement*/ + recog.base.set_state(143); + recog.jump_statement()?; + + } + } + , + 10 =>{ + //recog.base.enter_outer_alt(_localctx.clone(), 10)?; + recog.base.enter_outer_alt(None, 10)?; + { + /*InvokeRule return_statement*/ + recog.base.set_state(144); + recog.return_statement()?; + + } + } + , + 11 =>{ + //recog.base.enter_outer_alt(_localctx.clone(), 11)?; + recog.base.enter_outer_alt(None, 11)?; + { + /*InvokeRule line_group_statement*/ + recog.base.set_state(145); + recog.line_group_statement()?; + + } + } + , + 12 =>{ + //recog.base.enter_outer_alt(_localctx.clone(), 12)?; + recog.base.enter_outer_alt(None, 12)?; + { + /*InvokeRule once_statement*/ + recog.base.set_state(146); + recog.once_statement()?; + + } + } + , + 13 =>{ + //recog.base.enter_outer_alt(_localctx.clone(), 13)?; + recog.base.enter_outer_alt(None, 13)?; + { + recog.base.set_state(147); + recog.base.match_token(YarnSpinnerParser_INDENT,&mut recog.err_handler)?; + + recog.base.set_state(151); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + while (((_la) & !0x3f) == 0 && ((1usize << _la) & 18743298) != 0) { + { + { + /*InvokeRule statement*/ + recog.base.set_state(148); + recog.statement()?; + + } + } + recog.base.set_state(153); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + } + recog.base.set_state(154); + recog.base.match_token(YarnSpinnerParser_DEDENT,&mut recog.err_handler)?; + + } + } + + _ => {} + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) + } } +//------------------- line_statement ---------------- +pub type Line_statementContextAll<'input> = Line_statementContext<'input>; -impl<'input> YarnSpinnerParserContext<'input> for Line_conditionContext<'input>{} -impl<'input,'a> Listenable + 'a> for Line_conditionContext<'input>{ +pub type Line_statementContext<'input> = BaseParserRuleContext<'input,Line_statementContextExt<'input>>; + +#[derive(Clone)] +pub struct Line_statementContextExt<'input>{ +ph:PhantomData<&'input str> +} + +impl<'input> YarnSpinnerParserContext<'input> for Line_statementContext<'input>{} + +impl<'input,'a> Listenable + 'a> for Line_statementContext<'input>{ fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { listener.enter_every_rule(self)?; - listener.enter_line_condition(self); + listener.enter_line_statement(self); Ok(()) } fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_line_condition(self); + listener.exit_line_statement(self); listener.exit_every_rule(self)?; Ok(()) } } -impl<'input,'a> Visitable + 'a> for Line_conditionContext<'input>{ +impl<'input,'a> Visitable + 'a> for Line_statementContext<'input>{ fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_line_condition(self); + visitor.visit_line_statement(self); } } -impl<'input> CustomRuleContext<'input> for Line_conditionContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for Line_statementContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_line_condition } - //fn type_rule_index() -> usize where Self: Sized { RULE_line_condition } + fn get_rule_index(&self) -> usize { RULE_line_statement } + //fn type_rule_index() -> usize where Self: Sized { RULE_line_statement } } -antlr4rust::tid!{Line_conditionContextExt<'a>} +antlr4rust::tid!{Line_statementContextExt<'a>} -impl<'input> Line_conditionContextExt<'input>{ - fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { +impl<'input> Line_statementContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { Rc::new( - BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Line_conditionContextExt{ + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Line_statementContextExt{ ph:PhantomData }), @@ -1779,59 +1906,81 @@ impl<'input> Line_conditionContextExt<'input>{ } } -pub trait Line_conditionContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ +pub trait Line_statementContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ -/// Retrieves first TerminalNode corresponding to token COMMAND_START -/// Returns `None` if there is no child corresponding to token COMMAND_START -fn COMMAND_START(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_COMMAND_START, 0) +fn line_formatted_text(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) } -/// Retrieves first TerminalNode corresponding to token COMMAND_IF -/// Returns `None` if there is no child corresponding to token COMMAND_IF -fn COMMAND_IF(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_COMMAND_IF, 0) +/// Retrieves first TerminalNode corresponding to token NEWLINE +/// Returns `None` if there is no child corresponding to token NEWLINE +fn NEWLINE(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_NEWLINE, 0) } -fn expression(&self) -> Option>> where Self:Sized{ +fn line_condition(&self) -> Option>> where Self:Sized{ self.child_of_type(0) } -/// Retrieves first TerminalNode corresponding to token COMMAND_END -/// Returns `None` if there is no child corresponding to token COMMAND_END -fn COMMAND_END(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_COMMAND_END, 0) +fn hashtag_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +fn hashtag(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) } } -impl<'input> Line_conditionContextAttrs<'input> for Line_conditionContext<'input>{} +impl<'input> Line_statementContextAttrs<'input> for Line_statementContext<'input>{} impl<'input, I> YarnSpinnerParser<'input, I> where I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, { - pub fn line_condition(&mut self,) - -> Result>,ANTLRError> { + pub fn line_statement(&mut self,) + -> Result>,ANTLRError> { let mut recog = self; let _parentctx = recog.ctx.take(); - let mut _localctx = Line_conditionContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog.base.enter_rule(_localctx.clone(), 18, RULE_line_condition); - let mut _localctx: Rc = _localctx; + let mut _localctx = Line_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 18, RULE_line_statement); + let mut _localctx: Rc = _localctx; + let mut _la: i32 = -1; let result: Result<(), ANTLRError> = (|| { //recog.base.enter_outer_alt(_localctx.clone(), 1)?; recog.base.enter_outer_alt(None, 1)?; { - recog.base.set_state(132); - recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; + /*InvokeRule line_formatted_text*/ + recog.base.set_state(157); + recog.line_formatted_text()?; - recog.base.set_state(133); - recog.base.match_token(YarnSpinnerParser_COMMAND_IF,&mut recog.err_handler)?; + recog.base.set_state(159); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + if _la==YarnSpinnerParser_COMMAND_START { + { + /*InvokeRule line_condition*/ + recog.base.set_state(158); + recog.line_condition()?; - /*InvokeRule expression*/ - recog.base.set_state(134); - recog.expression_rec(0)?; + } + } - recog.base.set_state(135); - recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; + recog.base.set_state(164); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + while _la==YarnSpinnerParser_HASHTAG { + { + { + /*InvokeRule hashtag*/ + recog.base.set_state(161); + recog.hashtag()?; + + } + } + recog.base.set_state(166); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + } + recog.base.set_state(167); + recog.base.match_token(YarnSpinnerParser_NEWLINE,&mut recog.err_handler)?; } Ok(()) @@ -1850,345 +1999,473 @@ where Ok(_localctx) } } -//------------------- expression ---------------- -#[derive(Debug)] -pub enum ExpressionContextAll<'input>{ - ExpParensContext(ExpParensContext<'input>), - ExpMultDivModContext(ExpMultDivModContext<'input>), - ExpComparisonContext(ExpComparisonContext<'input>), - ExpNegativeContext(ExpNegativeContext<'input>), - ExpAndOrXorContext(ExpAndOrXorContext<'input>), - ExpAddSubContext(ExpAddSubContext<'input>), - ExpNotContext(ExpNotContext<'input>), - ExpValueContext(ExpValueContext<'input>), - ExpEqualityContext(ExpEqualityContext<'input>), -Error(ExpressionContext<'input>) -} -antlr4rust::tid!{ExpressionContextAll<'a>} +//------------------- line_formatted_text ---------------- +pub type Line_formatted_textContextAll<'input> = Line_formatted_textContext<'input>; -impl<'input> antlr4rust::parser_rule_context::DerefSeal for ExpressionContextAll<'input>{} -impl<'input> YarnSpinnerParserContext<'input> for ExpressionContextAll<'input>{} - -impl<'input> Deref for ExpressionContextAll<'input>{ - type Target = dyn ExpressionContextAttrs<'input> + 'input; - fn deref(&self) -> &Self::Target{ - use ExpressionContextAll::*; - match self{ - ExpParensContext(inner) => inner, - ExpMultDivModContext(inner) => inner, - ExpComparisonContext(inner) => inner, - ExpNegativeContext(inner) => inner, - ExpAndOrXorContext(inner) => inner, - ExpAddSubContext(inner) => inner, - ExpNotContext(inner) => inner, - ExpValueContext(inner) => inner, - ExpEqualityContext(inner) => inner, -Error(inner) => inner - } - } -} -impl<'input,'a> Visitable + 'a> for ExpressionContextAll<'input>{ - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { self.deref().accept(visitor) } -} -impl<'input,'a> Listenable + 'a> for ExpressionContextAll<'input>{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { self.deref().enter(listener) } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { self.deref().exit(listener) } -} - - - -pub type ExpressionContext<'input> = BaseParserRuleContext<'input,ExpressionContextExt<'input>>; +pub type Line_formatted_textContext<'input> = BaseParserRuleContext<'input,Line_formatted_textContextExt<'input>>; #[derive(Clone)] -pub struct ExpressionContextExt<'input>{ +pub struct Line_formatted_textContextExt<'input>{ ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for ExpressionContext<'input>{} +impl<'input> YarnSpinnerParserContext<'input> for Line_formatted_textContext<'input>{} -impl<'input,'a> Listenable + 'a> for ExpressionContext<'input>{ +impl<'input,'a> Listenable + 'a> for Line_formatted_textContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_line_formatted_text(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_line_formatted_text(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input,'a> Visitable + 'a> for ExpressionContext<'input>{ +impl<'input,'a> Visitable + 'a> for Line_formatted_textContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_line_formatted_text(self); + } } -impl<'input> CustomRuleContext<'input> for ExpressionContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for Line_formatted_textContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_expression } - //fn type_rule_index() -> usize where Self: Sized { RULE_expression } + fn get_rule_index(&self) -> usize { RULE_line_formatted_text } + //fn type_rule_index() -> usize where Self: Sized { RULE_line_formatted_text } } -antlr4rust::tid!{ExpressionContextExt<'a>} +antlr4rust::tid!{Line_formatted_textContextExt<'a>} -impl<'input> ExpressionContextExt<'input>{ - fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { +impl<'input> Line_formatted_textContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { Rc::new( - ExpressionContextAll::Error( - BaseParserRuleContext::new_parser_ctx(parent, invoking_state,ExpressionContextExt{ + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Line_formatted_textContextExt{ ph:PhantomData }), ) - ) } } -pub trait ExpressionContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ +pub trait Line_formatted_textContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ +/// Retrieves all `TerminalNode`s corresponding to token EXPRESSION_START in current rule +fn EXPRESSION_START_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +/// Retrieves 'i's TerminalNode corresponding to token EXPRESSION_START, starting from 0. +/// Returns `None` if number of children corresponding to token EXPRESSION_START is less or equal than `i`. +fn EXPRESSION_START(&self, i: usize) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_EXPRESSION_START, i) +} +fn expression_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +fn expression(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) +} +/// Retrieves all `TerminalNode`s corresponding to token EXPRESSION_END in current rule +fn EXPRESSION_END_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +/// Retrieves 'i's TerminalNode corresponding to token EXPRESSION_END, starting from 0. +/// Returns `None` if number of children corresponding to token EXPRESSION_END is less or equal than `i`. +fn EXPRESSION_END(&self, i: usize) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_EXPRESSION_END, i) +} +/// Retrieves all `TerminalNode`s corresponding to token TEXT in current rule +fn TEXT_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +/// Retrieves 'i's TerminalNode corresponding to token TEXT, starting from 0. +/// Returns `None` if number of children corresponding to token TEXT is less or equal than `i`. +fn TEXT(&self, i: usize) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_TEXT, i) +} } -impl<'input> ExpressionContextAttrs<'input> for ExpressionContext<'input>{} +impl<'input> Line_formatted_textContextAttrs<'input> for Line_formatted_textContext<'input>{} -pub type ExpParensContext<'input> = BaseParserRuleContext<'input,ExpParensContextExt<'input>>; +impl<'input, I> YarnSpinnerParser<'input, I> +where + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + pub fn line_formatted_text(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = Line_formatted_textContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 20, RULE_line_formatted_text); + let mut _localctx: Rc = _localctx; + let mut _la: i32 = -1; + let result: Result<(), ANTLRError> = (|| { -pub trait ExpParensContextAttrs<'input>: YarnSpinnerParserContext<'input>{ - /// Retrieves first TerminalNode corresponding to token LPAREN - /// Returns `None` if there is no child corresponding to token LPAREN - fn LPAREN(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_LPAREN, 0) - } - fn expression(&self) -> Option>> where Self:Sized{ - self.child_of_type(0) - } - /// Retrieves first TerminalNode corresponding to token RPAREN - /// Returns `None` if there is no child corresponding to token RPAREN - fn RPAREN(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_RPAREN, 0) + let mut _alt: i32; + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(178); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + loop { + { + recog.base.set_state(178); + recog.err_handler.sync(&mut recog.base)?; + match recog.base.input.la(1) { + YarnSpinnerParser_TEXT + => { + { + recog.base.set_state(170); + recog.err_handler.sync(&mut recog.base)?; + _alt = 1; + loop { + match _alt { + x if x == 1=> + { + { + recog.base.set_state(169); + recog.base.match_token(YarnSpinnerParser_TEXT,&mut recog.err_handler)?; + + } + } + + _ => Err(ANTLRError::NoAltError(NoViableAltError::new(&mut recog.base)))? + } + recog.base.set_state(172); + recog.err_handler.sync(&mut recog.base)?; + _alt = recog.interpreter.adaptive_predict(12,&mut recog.base)?; + if _alt==2 || _alt==INVALID_ALT { break } + } + } + } + + YarnSpinnerParser_EXPRESSION_START + => { + { + recog.base.set_state(174); + recog.base.match_token(YarnSpinnerParser_EXPRESSION_START,&mut recog.err_handler)?; + + /*InvokeRule expression*/ + recog.base.set_state(175); + recog.expression_rec(0)?; + + recog.base.set_state(176); + recog.base.match_token(YarnSpinnerParser_EXPRESSION_END,&mut recog.err_handler)?; + + } + } + + _ => Err(ANTLRError::NoAltError(NoViableAltError::new(&mut recog.base)))? + } + } + recog.base.set_state(180); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + if !(_la==YarnSpinnerParser_EXPRESSION_START || _la==YarnSpinnerParser_TEXT) {break} + } + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) } } +//------------------- hashtag ---------------- +pub type HashtagContextAll<'input> = HashtagContext<'input>; -impl<'input> ExpParensContextAttrs<'input> for ExpParensContext<'input>{} -pub struct ExpParensContextExt<'input>{ - base:ExpressionContextExt<'input>, - ph:PhantomData<&'input str> -} +pub type HashtagContext<'input> = BaseParserRuleContext<'input,HashtagContextExt<'input>>; -antlr4rust::tid!{ExpParensContextExt<'a>} +#[derive(Clone)] +pub struct HashtagContextExt<'input>{ + pub text: Option>, +ph:PhantomData<&'input str> +} -impl<'input> YarnSpinnerParserContext<'input> for ExpParensContext<'input>{} +impl<'input> YarnSpinnerParserContext<'input> for HashtagContext<'input>{} -impl<'input,'a> Listenable + 'a> for ExpParensContext<'input>{ - fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.enter_every_rule(self)?; - listener.enter_expParens(self); - Ok(()) - } - fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_expParens(self); - listener.exit_every_rule(self)?; - Ok(()) - } +impl<'input,'a> Listenable + 'a> for HashtagContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_hashtag(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_hashtag(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input,'a> Visitable + 'a> for ExpParensContext<'input>{ +impl<'input,'a> Visitable + 'a> for HashtagContext<'input>{ fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_expParens(self); + visitor.visit_hashtag(self); } } -impl<'input> CustomRuleContext<'input> for ExpParensContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for HashtagContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_expression } - //fn type_rule_index() -> usize where Self: Sized { RULE_expression } -} - -impl<'input> Borrow> for ExpParensContext<'input>{ - fn borrow(&self) -> &ExpressionContextExt<'input> { &self.base } -} -impl<'input> BorrowMut> for ExpParensContext<'input>{ - fn borrow_mut(&mut self) -> &mut ExpressionContextExt<'input> { &mut self.base } + fn get_rule_index(&self) -> usize { RULE_hashtag } + //fn type_rule_index() -> usize where Self: Sized { RULE_hashtag } } +antlr4rust::tid!{HashtagContextExt<'a>} -impl<'input> ExpressionContextAttrs<'input> for ExpParensContext<'input> {} +impl<'input> HashtagContextExt<'input>{ + pub fn new_with_text( + parent: Option + 'input>>, + invoking_state: i32, + text: impl Into>> + ) -> Rc> { + Rc::new(BaseParserRuleContext::new_parser_ctx( + parent, + invoking_state, + HashtagContextExt { + text: text.into(), + ph: PhantomData, + }, + )) + } -impl<'input> ExpParensContextExt<'input>{ - fn new(ctx: &dyn ExpressionContextAttrs<'input>) -> Rc> { + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { Rc::new( - ExpressionContextAll::ExpParensContext( - BaseParserRuleContext::copy_from(ctx,ExpParensContextExt{ - base: ctx.borrow().clone(), - ph:PhantomData - }) - ) + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,HashtagContextExt{ + text: None, + + ph:PhantomData + }), ) } } -pub type ExpMultDivModContext<'input> = BaseParserRuleContext<'input,ExpMultDivModContextExt<'input>>; +pub trait HashtagContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ -pub trait ExpMultDivModContextAttrs<'input>: YarnSpinnerParserContext<'input>{ - fn expression_all(&self) -> Vec>> where Self:Sized{ - self.children_of_type() - } - fn expression(&self, i: usize) -> Option>> where Self:Sized{ - self.child_of_type(i) - } - /// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_MULTIPLICATION - /// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_MULTIPLICATION - fn OPERATOR_MATHS_MULTIPLICATION(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_OPERATOR_MATHS_MULTIPLICATION, 0) - } - /// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_DIVISION - /// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_DIVISION - fn OPERATOR_MATHS_DIVISION(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_OPERATOR_MATHS_DIVISION, 0) - } - /// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_MODULUS - /// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_MODULUS - fn OPERATOR_MATHS_MODULUS(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_OPERATOR_MATHS_MODULUS, 0) - } +/// Retrieves first TerminalNode corresponding to token HASHTAG +/// Returns `None` if there is no child corresponding to token HASHTAG +fn HASHTAG(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_HASHTAG, 0) +} +/// Retrieves first TerminalNode corresponding to token HASHTAG_TEXT +/// Returns `None` if there is no child corresponding to token HASHTAG_TEXT +fn HASHTAG_TEXT(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_HASHTAG_TEXT, 0) } -impl<'input> ExpMultDivModContextAttrs<'input> for ExpMultDivModContext<'input>{} - -pub struct ExpMultDivModContextExt<'input>{ - base:ExpressionContextExt<'input>, - pub op: Option>, - ph:PhantomData<&'input str> } -antlr4rust::tid!{ExpMultDivModContextExt<'a>} +impl<'input> HashtagContextAttrs<'input> for HashtagContext<'input>{} -impl<'input> YarnSpinnerParserContext<'input> for ExpMultDivModContext<'input>{} +impl<'input, I> YarnSpinnerParser<'input, I> +where + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + pub fn hashtag(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = HashtagContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 22, RULE_hashtag); + let mut _localctx: Rc = _localctx; + let result: Result<(), ANTLRError> = (|| { -impl<'input,'a> Listenable + 'a> for ExpMultDivModContext<'input>{ - fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.enter_every_rule(self)?; - listener.enter_expMultDivMod(self); - Ok(()) - } - fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_expMultDivMod(self); - listener.exit_every_rule(self)?; - Ok(()) + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(182); + recog.base.match_token(YarnSpinnerParser_HASHTAG,&mut recog.err_handler)?; + + recog.base.set_state(183); + let tmp = recog.base.match_token(YarnSpinnerParser_HASHTAG_TEXT,&mut recog.err_handler)?; + cast_mut::<_,HashtagContext >(&mut _localctx).text = Some(tmp.clone()); + + + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) } } +//------------------- line_condition ---------------- +#[derive(Debug)] +pub enum Line_conditionContextAll<'input>{ + LineOnceConditionContext(LineOnceConditionContext<'input>), + LineConditionContext(LineConditionContext<'input>), +Error(Line_conditionContext<'input>) +} +antlr4rust::tid!{Line_conditionContextAll<'a>} -impl<'input,'a> Visitable + 'a> for ExpMultDivModContext<'input>{ - fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_expMultDivMod(self); +impl<'input> antlr4rust::parser_rule_context::DerefSeal for Line_conditionContextAll<'input>{} + +impl<'input> YarnSpinnerParserContext<'input> for Line_conditionContextAll<'input>{} + +impl<'input> Deref for Line_conditionContextAll<'input>{ + type Target = dyn Line_conditionContextAttrs<'input> + 'input; + fn deref(&self) -> &Self::Target{ + use Line_conditionContextAll::*; + match self{ + LineOnceConditionContext(inner) => inner, + LineConditionContext(inner) => inner, +Error(inner) => inner + } } } +impl<'input,'a> Visitable + 'a> for Line_conditionContextAll<'input>{ + fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { self.deref().accept(visitor) } +} +impl<'input,'a> Listenable + 'a> for Line_conditionContextAll<'input>{ + fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { self.deref().enter(listener) } + fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { self.deref().exit(listener) } +} -impl<'input> CustomRuleContext<'input> for ExpMultDivModContextExt<'input>{ - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_expression } - //fn type_rule_index() -> usize where Self: Sized { RULE_expression } + + +pub type Line_conditionContext<'input> = BaseParserRuleContext<'input,Line_conditionContextExt<'input>>; + +#[derive(Clone)] +pub struct Line_conditionContextExt<'input>{ +ph:PhantomData<&'input str> } -impl<'input> Borrow> for ExpMultDivModContext<'input>{ - fn borrow(&self) -> &ExpressionContextExt<'input> { &self.base } +impl<'input> YarnSpinnerParserContext<'input> for Line_conditionContext<'input>{} + +impl<'input,'a> Listenable + 'a> for Line_conditionContext<'input>{ } -impl<'input> BorrowMut> for ExpMultDivModContext<'input>{ - fn borrow_mut(&mut self) -> &mut ExpressionContextExt<'input> { &mut self.base } + +impl<'input,'a> Visitable + 'a> for Line_conditionContext<'input>{ } -impl<'input> ExpressionContextAttrs<'input> for ExpMultDivModContext<'input> {} +impl<'input> CustomRuleContext<'input> for Line_conditionContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_line_condition } + //fn type_rule_index() -> usize where Self: Sized { RULE_line_condition } +} +antlr4rust::tid!{Line_conditionContextExt<'a>} -impl<'input> ExpMultDivModContextExt<'input>{ - fn new(ctx: &dyn ExpressionContextAttrs<'input>) -> Rc> { +impl<'input> Line_conditionContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { Rc::new( - ExpressionContextAll::ExpMultDivModContext( - BaseParserRuleContext::copy_from(ctx,ExpMultDivModContextExt{ - op:None, - base: ctx.borrow().clone(), - ph:PhantomData - }) - ) + Line_conditionContextAll::Error( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Line_conditionContextExt{ + + ph:PhantomData + }), + ) ) } } -pub type ExpComparisonContext<'input> = BaseParserRuleContext<'input,ExpComparisonContextExt<'input>>; +pub trait Line_conditionContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ -pub trait ExpComparisonContextAttrs<'input>: YarnSpinnerParserContext<'input>{ - fn expression_all(&self) -> Vec>> where Self:Sized{ - self.children_of_type() - } - fn expression(&self, i: usize) -> Option>> where Self:Sized{ - self.child_of_type(i) + +} + +impl<'input> Line_conditionContextAttrs<'input> for Line_conditionContext<'input>{} + +pub type LineOnceConditionContext<'input> = BaseParserRuleContext<'input,LineOnceConditionContextExt<'input>>; + +pub trait LineOnceConditionContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + /// Retrieves first TerminalNode corresponding to token COMMAND_START + /// Returns `None` if there is no child corresponding to token COMMAND_START + fn COMMAND_START(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_START, 0) } - /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_LESS_THAN_EQUALS - /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_LESS_THAN_EQUALS - fn OPERATOR_LOGICAL_LESS_THAN_EQUALS(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_OPERATOR_LOGICAL_LESS_THAN_EQUALS, 0) + /// Retrieves first TerminalNode corresponding to token COMMAND_ONCE + /// Returns `None` if there is no child corresponding to token COMMAND_ONCE + fn COMMAND_ONCE(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_ONCE, 0) } - /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_GREATER_THAN_EQUALS - /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_GREATER_THAN_EQUALS - fn OPERATOR_LOGICAL_GREATER_THAN_EQUALS(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_OPERATOR_LOGICAL_GREATER_THAN_EQUALS, 0) + /// Retrieves first TerminalNode corresponding to token COMMAND_END + /// Returns `None` if there is no child corresponding to token COMMAND_END + fn COMMAND_END(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_END, 0) } - /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_LESS - /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_LESS - fn OPERATOR_LOGICAL_LESS(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_OPERATOR_LOGICAL_LESS, 0) + /// Retrieves first TerminalNode corresponding to token COMMAND_IF + /// Returns `None` if there is no child corresponding to token COMMAND_IF + fn COMMAND_IF(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_IF, 0) } - /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_GREATER - /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_GREATER - fn OPERATOR_LOGICAL_GREATER(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_OPERATOR_LOGICAL_GREATER, 0) + fn expression(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) } } -impl<'input> ExpComparisonContextAttrs<'input> for ExpComparisonContext<'input>{} +impl<'input> LineOnceConditionContextAttrs<'input> for LineOnceConditionContext<'input>{} -pub struct ExpComparisonContextExt<'input>{ - base:ExpressionContextExt<'input>, - pub op: Option>, +pub struct LineOnceConditionContextExt<'input>{ + base:Line_conditionContextExt<'input>, ph:PhantomData<&'input str> } -antlr4rust::tid!{ExpComparisonContextExt<'a>} +antlr4rust::tid!{LineOnceConditionContextExt<'a>} -impl<'input> YarnSpinnerParserContext<'input> for ExpComparisonContext<'input>{} +impl<'input> YarnSpinnerParserContext<'input> for LineOnceConditionContext<'input>{} -impl<'input,'a> Listenable + 'a> for ExpComparisonContext<'input>{ +impl<'input,'a> Listenable + 'a> for LineOnceConditionContext<'input>{ fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { listener.enter_every_rule(self)?; - listener.enter_expComparison(self); + listener.enter_lineOnceCondition(self); Ok(()) } fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_expComparison(self); + listener.exit_lineOnceCondition(self); listener.exit_every_rule(self)?; Ok(()) } } -impl<'input,'a> Visitable + 'a> for ExpComparisonContext<'input>{ +impl<'input,'a> Visitable + 'a> for LineOnceConditionContext<'input>{ fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_expComparison(self); + visitor.visit_lineOnceCondition(self); } } -impl<'input> CustomRuleContext<'input> for ExpComparisonContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for LineOnceConditionContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_expression } - //fn type_rule_index() -> usize where Self: Sized { RULE_expression } + fn get_rule_index(&self) -> usize { RULE_line_condition } + //fn type_rule_index() -> usize where Self: Sized { RULE_line_condition } } -impl<'input> Borrow> for ExpComparisonContext<'input>{ - fn borrow(&self) -> &ExpressionContextExt<'input> { &self.base } +impl<'input> Borrow> for LineOnceConditionContext<'input>{ + fn borrow(&self) -> &Line_conditionContextExt<'input> { &self.base } } -impl<'input> BorrowMut> for ExpComparisonContext<'input>{ - fn borrow_mut(&mut self) -> &mut ExpressionContextExt<'input> { &mut self.base } +impl<'input> BorrowMut> for LineOnceConditionContext<'input>{ + fn borrow_mut(&mut self) -> &mut Line_conditionContextExt<'input> { &mut self.base } } -impl<'input> ExpressionContextAttrs<'input> for ExpComparisonContext<'input> {} +impl<'input> Line_conditionContextAttrs<'input> for LineOnceConditionContext<'input> {} -impl<'input> ExpComparisonContextExt<'input>{ - fn new(ctx: &dyn ExpressionContextAttrs<'input>) -> Rc> { +impl<'input> LineOnceConditionContextExt<'input>{ + fn new(ctx: &dyn Line_conditionContextAttrs<'input>) -> Rc> { Rc::new( - ExpressionContextAll::ExpComparisonContext( - BaseParserRuleContext::copy_from(ctx,ExpComparisonContextExt{ - op:None, + Line_conditionContextAll::LineOnceConditionContext( + BaseParserRuleContext::copy_from(ctx,LineOnceConditionContextExt{ base: ctx.borrow().clone(), ph:PhantomData }) @@ -2197,72 +2474,80 @@ impl<'input> ExpComparisonContextExt<'input>{ } } -pub type ExpNegativeContext<'input> = BaseParserRuleContext<'input,ExpNegativeContextExt<'input>>; +pub type LineConditionContext<'input> = BaseParserRuleContext<'input,LineConditionContextExt<'input>>; -pub trait ExpNegativeContextAttrs<'input>: YarnSpinnerParserContext<'input>{ +pub trait LineConditionContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + /// Retrieves first TerminalNode corresponding to token COMMAND_START + /// Returns `None` if there is no child corresponding to token COMMAND_START + fn COMMAND_START(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_START, 0) + } + /// Retrieves first TerminalNode corresponding to token COMMAND_IF + /// Returns `None` if there is no child corresponding to token COMMAND_IF + fn COMMAND_IF(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_IF, 0) + } fn expression(&self) -> Option>> where Self:Sized{ self.child_of_type(0) } - /// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_SUBTRACTION - /// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_SUBTRACTION - fn OPERATOR_MATHS_SUBTRACTION(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_OPERATOR_MATHS_SUBTRACTION, 0) + /// Retrieves first TerminalNode corresponding to token COMMAND_END + /// Returns `None` if there is no child corresponding to token COMMAND_END + fn COMMAND_END(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_END, 0) } } -impl<'input> ExpNegativeContextAttrs<'input> for ExpNegativeContext<'input>{} +impl<'input> LineConditionContextAttrs<'input> for LineConditionContext<'input>{} -pub struct ExpNegativeContextExt<'input>{ - base:ExpressionContextExt<'input>, - pub op: Option>, +pub struct LineConditionContextExt<'input>{ + base:Line_conditionContextExt<'input>, ph:PhantomData<&'input str> } -antlr4rust::tid!{ExpNegativeContextExt<'a>} +antlr4rust::tid!{LineConditionContextExt<'a>} -impl<'input> YarnSpinnerParserContext<'input> for ExpNegativeContext<'input>{} +impl<'input> YarnSpinnerParserContext<'input> for LineConditionContext<'input>{} -impl<'input,'a> Listenable + 'a> for ExpNegativeContext<'input>{ +impl<'input,'a> Listenable + 'a> for LineConditionContext<'input>{ fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { listener.enter_every_rule(self)?; - listener.enter_expNegative(self); + listener.enter_lineCondition(self); Ok(()) } fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_expNegative(self); + listener.exit_lineCondition(self); listener.exit_every_rule(self)?; Ok(()) } } -impl<'input,'a> Visitable + 'a> for ExpNegativeContext<'input>{ +impl<'input,'a> Visitable + 'a> for LineConditionContext<'input>{ fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_expNegative(self); + visitor.visit_lineCondition(self); } } -impl<'input> CustomRuleContext<'input> for ExpNegativeContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for LineConditionContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_expression } - //fn type_rule_index() -> usize where Self: Sized { RULE_expression } + fn get_rule_index(&self) -> usize { RULE_line_condition } + //fn type_rule_index() -> usize where Self: Sized { RULE_line_condition } } -impl<'input> Borrow> for ExpNegativeContext<'input>{ - fn borrow(&self) -> &ExpressionContextExt<'input> { &self.base } +impl<'input> Borrow> for LineConditionContext<'input>{ + fn borrow(&self) -> &Line_conditionContextExt<'input> { &self.base } } -impl<'input> BorrowMut> for ExpNegativeContext<'input>{ - fn borrow_mut(&mut self) -> &mut ExpressionContextExt<'input> { &mut self.base } +impl<'input> BorrowMut> for LineConditionContext<'input>{ + fn borrow_mut(&mut self) -> &mut Line_conditionContextExt<'input> { &mut self.base } } -impl<'input> ExpressionContextAttrs<'input> for ExpNegativeContext<'input> {} +impl<'input> Line_conditionContextAttrs<'input> for LineConditionContext<'input> {} -impl<'input> ExpNegativeContextExt<'input>{ - fn new(ctx: &dyn ExpressionContextAttrs<'input>) -> Rc> { +impl<'input> LineConditionContextExt<'input>{ + fn new(ctx: &dyn Line_conditionContextAttrs<'input>) -> Rc> { Rc::new( - ExpressionContextAll::ExpNegativeContext( - BaseParserRuleContext::copy_from(ctx,ExpNegativeContextExt{ - op:None, + Line_conditionContextAll::LineConditionContext( + BaseParserRuleContext::copy_from(ctx,LineConditionContextExt{ base: ctx.borrow().clone(), ph:PhantomData }) @@ -2271,85 +2556,254 @@ impl<'input> ExpNegativeContextExt<'input>{ } } -pub type ExpAndOrXorContext<'input> = BaseParserRuleContext<'input,ExpAndOrXorContextExt<'input>>; +impl<'input, I> YarnSpinnerParser<'input, I> +where + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + pub fn line_condition(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = Line_conditionContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 24, RULE_line_condition); + let mut _localctx: Rc = _localctx; + let mut _la: i32 = -1; + let result: Result<(), ANTLRError> = (|| { -pub trait ExpAndOrXorContextAttrs<'input>: YarnSpinnerParserContext<'input>{ - fn expression_all(&self) -> Vec>> where Self:Sized{ - self.children_of_type() + recog.base.set_state(197); + recog.err_handler.sync(&mut recog.base)?; + match recog.interpreter.adaptive_predict(16,&mut recog.base)? { + 1 =>{ + let tmp = LineConditionContextExt::new(&**_localctx); + recog.base.enter_outer_alt(Some(tmp.clone()), 1)?; + _localctx = tmp; + { + recog.base.set_state(185); + recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; + + recog.base.set_state(186); + recog.base.match_token(YarnSpinnerParser_COMMAND_IF,&mut recog.err_handler)?; + + /*InvokeRule expression*/ + recog.base.set_state(187); + recog.expression_rec(0)?; + + recog.base.set_state(188); + recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; + + } + } + , + 2 =>{ + let tmp = LineOnceConditionContextExt::new(&**_localctx); + recog.base.enter_outer_alt(Some(tmp.clone()), 2)?; + _localctx = tmp; + { + recog.base.set_state(190); + recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; + + recog.base.set_state(191); + recog.base.match_token(YarnSpinnerParser_COMMAND_ONCE,&mut recog.err_handler)?; + + recog.base.set_state(194); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + if _la==YarnSpinnerParser_COMMAND_IF { + { + recog.base.set_state(192); + recog.base.match_token(YarnSpinnerParser_COMMAND_IF,&mut recog.err_handler)?; + + /*InvokeRule expression*/ + recog.base.set_state(193); + recog.expression_rec(0)?; + + } + } + + recog.base.set_state(196); + recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; + + } + } + + _ => {} + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) } - fn expression(&self, i: usize) -> Option>> where Self:Sized{ - self.child_of_type(i) +} +//------------------- expression ---------------- +#[derive(Debug)] +pub enum ExpressionContextAll<'input>{ + ExpParensContext(ExpParensContext<'input>), + ExpMultDivModContext(ExpMultDivModContext<'input>), + ExpComparisonContext(ExpComparisonContext<'input>), + ExpNegativeContext(ExpNegativeContext<'input>), + ExpAndOrXorContext(ExpAndOrXorContext<'input>), + ExpAddSubContext(ExpAddSubContext<'input>), + ExpNotContext(ExpNotContext<'input>), + ExpValueContext(ExpValueContext<'input>), + ExpEqualityContext(ExpEqualityContext<'input>), +Error(ExpressionContext<'input>) +} +antlr4rust::tid!{ExpressionContextAll<'a>} + +impl<'input> antlr4rust::parser_rule_context::DerefSeal for ExpressionContextAll<'input>{} + +impl<'input> YarnSpinnerParserContext<'input> for ExpressionContextAll<'input>{} + +impl<'input> Deref for ExpressionContextAll<'input>{ + type Target = dyn ExpressionContextAttrs<'input> + 'input; + fn deref(&self) -> &Self::Target{ + use ExpressionContextAll::*; + match self{ + ExpParensContext(inner) => inner, + ExpMultDivModContext(inner) => inner, + ExpComparisonContext(inner) => inner, + ExpNegativeContext(inner) => inner, + ExpAndOrXorContext(inner) => inner, + ExpAddSubContext(inner) => inner, + ExpNotContext(inner) => inner, + ExpValueContext(inner) => inner, + ExpEqualityContext(inner) => inner, +Error(inner) => inner + } } - /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_AND - /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_AND - fn OPERATOR_LOGICAL_AND(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_OPERATOR_LOGICAL_AND, 0) +} +impl<'input,'a> Visitable + 'a> for ExpressionContextAll<'input>{ + fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { self.deref().accept(visitor) } +} +impl<'input,'a> Listenable + 'a> for ExpressionContextAll<'input>{ + fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { self.deref().enter(listener) } + fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { self.deref().exit(listener) } +} + + + +pub type ExpressionContext<'input> = BaseParserRuleContext<'input,ExpressionContextExt<'input>>; + +#[derive(Clone)] +pub struct ExpressionContextExt<'input>{ +ph:PhantomData<&'input str> +} + +impl<'input> YarnSpinnerParserContext<'input> for ExpressionContext<'input>{} + +impl<'input,'a> Listenable + 'a> for ExpressionContext<'input>{ +} + +impl<'input,'a> Visitable + 'a> for ExpressionContext<'input>{ +} + +impl<'input> CustomRuleContext<'input> for ExpressionContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_expression } + //fn type_rule_index() -> usize where Self: Sized { RULE_expression } +} +antlr4rust::tid!{ExpressionContextExt<'a>} + +impl<'input> ExpressionContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + ExpressionContextAll::Error( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,ExpressionContextExt{ + + ph:PhantomData + }), + ) + ) } - /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_OR - /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_OR - fn OPERATOR_LOGICAL_OR(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_OPERATOR_LOGICAL_OR, 0) +} + +pub trait ExpressionContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ + + +} + +impl<'input> ExpressionContextAttrs<'input> for ExpressionContext<'input>{} + +pub type ExpParensContext<'input> = BaseParserRuleContext<'input,ExpParensContextExt<'input>>; + +pub trait ExpParensContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + /// Retrieves first TerminalNode corresponding to token LPAREN + /// Returns `None` if there is no child corresponding to token LPAREN + fn LPAREN(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_LPAREN, 0) } - /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_XOR - /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_XOR - fn OPERATOR_LOGICAL_XOR(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_OPERATOR_LOGICAL_XOR, 0) + fn expression(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) + } + /// Retrieves first TerminalNode corresponding to token RPAREN + /// Returns `None` if there is no child corresponding to token RPAREN + fn RPAREN(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_RPAREN, 0) } } -impl<'input> ExpAndOrXorContextAttrs<'input> for ExpAndOrXorContext<'input>{} +impl<'input> ExpParensContextAttrs<'input> for ExpParensContext<'input>{} -pub struct ExpAndOrXorContextExt<'input>{ +pub struct ExpParensContextExt<'input>{ base:ExpressionContextExt<'input>, - pub op: Option>, ph:PhantomData<&'input str> } -antlr4rust::tid!{ExpAndOrXorContextExt<'a>} +antlr4rust::tid!{ExpParensContextExt<'a>} -impl<'input> YarnSpinnerParserContext<'input> for ExpAndOrXorContext<'input>{} +impl<'input> YarnSpinnerParserContext<'input> for ExpParensContext<'input>{} -impl<'input,'a> Listenable + 'a> for ExpAndOrXorContext<'input>{ +impl<'input,'a> Listenable + 'a> for ExpParensContext<'input>{ fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { listener.enter_every_rule(self)?; - listener.enter_expAndOrXor(self); + listener.enter_expParens(self); Ok(()) } fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_expAndOrXor(self); + listener.exit_expParens(self); listener.exit_every_rule(self)?; Ok(()) } } -impl<'input,'a> Visitable + 'a> for ExpAndOrXorContext<'input>{ +impl<'input,'a> Visitable + 'a> for ExpParensContext<'input>{ fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_expAndOrXor(self); + visitor.visit_expParens(self); } } -impl<'input> CustomRuleContext<'input> for ExpAndOrXorContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for ExpParensContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; fn get_rule_index(&self) -> usize { RULE_expression } //fn type_rule_index() -> usize where Self: Sized { RULE_expression } } -impl<'input> Borrow> for ExpAndOrXorContext<'input>{ +impl<'input> Borrow> for ExpParensContext<'input>{ fn borrow(&self) -> &ExpressionContextExt<'input> { &self.base } } -impl<'input> BorrowMut> for ExpAndOrXorContext<'input>{ +impl<'input> BorrowMut> for ExpParensContext<'input>{ fn borrow_mut(&mut self) -> &mut ExpressionContextExt<'input> { &mut self.base } } -impl<'input> ExpressionContextAttrs<'input> for ExpAndOrXorContext<'input> {} +impl<'input> ExpressionContextAttrs<'input> for ExpParensContext<'input> {} -impl<'input> ExpAndOrXorContextExt<'input>{ +impl<'input> ExpParensContextExt<'input>{ fn new(ctx: &dyn ExpressionContextAttrs<'input>) -> Rc> { Rc::new( - ExpressionContextAll::ExpAndOrXorContext( - BaseParserRuleContext::copy_from(ctx,ExpAndOrXorContextExt{ - op:None, + ExpressionContextAll::ExpParensContext( + BaseParserRuleContext::copy_from(ctx,ExpParensContextExt{ base: ctx.borrow().clone(), ph:PhantomData }) @@ -2358,79 +2812,84 @@ impl<'input> ExpAndOrXorContextExt<'input>{ } } -pub type ExpAddSubContext<'input> = BaseParserRuleContext<'input,ExpAddSubContextExt<'input>>; +pub type ExpMultDivModContext<'input> = BaseParserRuleContext<'input,ExpMultDivModContextExt<'input>>; -pub trait ExpAddSubContextAttrs<'input>: YarnSpinnerParserContext<'input>{ +pub trait ExpMultDivModContextAttrs<'input>: YarnSpinnerParserContext<'input>{ fn expression_all(&self) -> Vec>> where Self:Sized{ self.children_of_type() } fn expression(&self, i: usize) -> Option>> where Self:Sized{ self.child_of_type(i) } - /// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_ADDITION - /// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_ADDITION - fn OPERATOR_MATHS_ADDITION(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_OPERATOR_MATHS_ADDITION, 0) - } - /// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_SUBTRACTION - /// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_SUBTRACTION - fn OPERATOR_MATHS_SUBTRACTION(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_OPERATOR_MATHS_SUBTRACTION, 0) + /// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_MULTIPLICATION + /// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_MULTIPLICATION + fn OPERATOR_MATHS_MULTIPLICATION(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_MATHS_MULTIPLICATION, 0) } -} - -impl<'input> ExpAddSubContextAttrs<'input> for ExpAddSubContext<'input>{} + /// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_DIVISION + /// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_DIVISION + fn OPERATOR_MATHS_DIVISION(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_MATHS_DIVISION, 0) + } + /// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_MODULUS + /// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_MODULUS + fn OPERATOR_MATHS_MODULUS(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_MATHS_MODULUS, 0) + } +} -pub struct ExpAddSubContextExt<'input>{ +impl<'input> ExpMultDivModContextAttrs<'input> for ExpMultDivModContext<'input>{} + +pub struct ExpMultDivModContextExt<'input>{ base:ExpressionContextExt<'input>, pub op: Option>, ph:PhantomData<&'input str> } -antlr4rust::tid!{ExpAddSubContextExt<'a>} +antlr4rust::tid!{ExpMultDivModContextExt<'a>} -impl<'input> YarnSpinnerParserContext<'input> for ExpAddSubContext<'input>{} +impl<'input> YarnSpinnerParserContext<'input> for ExpMultDivModContext<'input>{} -impl<'input,'a> Listenable + 'a> for ExpAddSubContext<'input>{ +impl<'input,'a> Listenable + 'a> for ExpMultDivModContext<'input>{ fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { listener.enter_every_rule(self)?; - listener.enter_expAddSub(self); + listener.enter_expMultDivMod(self); Ok(()) } fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_expAddSub(self); + listener.exit_expMultDivMod(self); listener.exit_every_rule(self)?; Ok(()) } } -impl<'input,'a> Visitable + 'a> for ExpAddSubContext<'input>{ +impl<'input,'a> Visitable + 'a> for ExpMultDivModContext<'input>{ fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_expAddSub(self); + visitor.visit_expMultDivMod(self); } } -impl<'input> CustomRuleContext<'input> for ExpAddSubContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for ExpMultDivModContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; fn get_rule_index(&self) -> usize { RULE_expression } //fn type_rule_index() -> usize where Self: Sized { RULE_expression } } -impl<'input> Borrow> for ExpAddSubContext<'input>{ +impl<'input> Borrow> for ExpMultDivModContext<'input>{ fn borrow(&self) -> &ExpressionContextExt<'input> { &self.base } } -impl<'input> BorrowMut> for ExpAddSubContext<'input>{ +impl<'input> BorrowMut> for ExpMultDivModContext<'input>{ fn borrow_mut(&mut self) -> &mut ExpressionContextExt<'input> { &mut self.base } } -impl<'input> ExpressionContextAttrs<'input> for ExpAddSubContext<'input> {} +impl<'input> ExpressionContextAttrs<'input> for ExpMultDivModContext<'input> {} -impl<'input> ExpAddSubContextExt<'input>{ +impl<'input> ExpMultDivModContextExt<'input>{ fn new(ctx: &dyn ExpressionContextAttrs<'input>) -> Rc> { Rc::new( - ExpressionContextAll::ExpAddSubContext( - BaseParserRuleContext::copy_from(ctx,ExpAddSubContextExt{ + ExpressionContextAll::ExpMultDivModContext( + BaseParserRuleContext::copy_from(ctx,ExpMultDivModContextExt{ op:None, base: ctx.borrow().clone(), ph:PhantomData @@ -2440,71 +2899,89 @@ impl<'input> ExpAddSubContextExt<'input>{ } } -pub type ExpNotContext<'input> = BaseParserRuleContext<'input,ExpNotContextExt<'input>>; +pub type ExpComparisonContext<'input> = BaseParserRuleContext<'input,ExpComparisonContextExt<'input>>; -pub trait ExpNotContextAttrs<'input>: YarnSpinnerParserContext<'input>{ - fn expression(&self) -> Option>> where Self:Sized{ - self.child_of_type(0) +pub trait ExpComparisonContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + fn expression_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() } - /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_NOT - /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_NOT - fn OPERATOR_LOGICAL_NOT(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_OPERATOR_LOGICAL_NOT, 0) + fn expression(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) + } + /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_LESS_THAN_EQUALS + /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_LESS_THAN_EQUALS + fn OPERATOR_LOGICAL_LESS_THAN_EQUALS(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_LOGICAL_LESS_THAN_EQUALS, 0) + } + /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_GREATER_THAN_EQUALS + /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_GREATER_THAN_EQUALS + fn OPERATOR_LOGICAL_GREATER_THAN_EQUALS(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_LOGICAL_GREATER_THAN_EQUALS, 0) + } + /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_LESS + /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_LESS + fn OPERATOR_LOGICAL_LESS(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_LOGICAL_LESS, 0) + } + /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_GREATER + /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_GREATER + fn OPERATOR_LOGICAL_GREATER(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_LOGICAL_GREATER, 0) } } -impl<'input> ExpNotContextAttrs<'input> for ExpNotContext<'input>{} +impl<'input> ExpComparisonContextAttrs<'input> for ExpComparisonContext<'input>{} -pub struct ExpNotContextExt<'input>{ +pub struct ExpComparisonContextExt<'input>{ base:ExpressionContextExt<'input>, pub op: Option>, ph:PhantomData<&'input str> } -antlr4rust::tid!{ExpNotContextExt<'a>} +antlr4rust::tid!{ExpComparisonContextExt<'a>} -impl<'input> YarnSpinnerParserContext<'input> for ExpNotContext<'input>{} +impl<'input> YarnSpinnerParserContext<'input> for ExpComparisonContext<'input>{} -impl<'input,'a> Listenable + 'a> for ExpNotContext<'input>{ +impl<'input,'a> Listenable + 'a> for ExpComparisonContext<'input>{ fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { listener.enter_every_rule(self)?; - listener.enter_expNot(self); + listener.enter_expComparison(self); Ok(()) } fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_expNot(self); + listener.exit_expComparison(self); listener.exit_every_rule(self)?; Ok(()) } } -impl<'input,'a> Visitable + 'a> for ExpNotContext<'input>{ +impl<'input,'a> Visitable + 'a> for ExpComparisonContext<'input>{ fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_expNot(self); + visitor.visit_expComparison(self); } } -impl<'input> CustomRuleContext<'input> for ExpNotContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for ExpComparisonContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; fn get_rule_index(&self) -> usize { RULE_expression } //fn type_rule_index() -> usize where Self: Sized { RULE_expression } } -impl<'input> Borrow> for ExpNotContext<'input>{ +impl<'input> Borrow> for ExpComparisonContext<'input>{ fn borrow(&self) -> &ExpressionContextExt<'input> { &self.base } } -impl<'input> BorrowMut> for ExpNotContext<'input>{ +impl<'input> BorrowMut> for ExpComparisonContext<'input>{ fn borrow_mut(&mut self) -> &mut ExpressionContextExt<'input> { &mut self.base } } -impl<'input> ExpressionContextAttrs<'input> for ExpNotContext<'input> {} +impl<'input> ExpressionContextAttrs<'input> for ExpComparisonContext<'input> {} -impl<'input> ExpNotContextExt<'input>{ +impl<'input> ExpComparisonContextExt<'input>{ fn new(ctx: &dyn ExpressionContextAttrs<'input>) -> Rc> { Rc::new( - ExpressionContextAll::ExpNotContext( - BaseParserRuleContext::copy_from(ctx,ExpNotContextExt{ + ExpressionContextAll::ExpComparisonContext( + BaseParserRuleContext::copy_from(ctx,ExpComparisonContextExt{ op:None, base: ctx.borrow().clone(), ph:PhantomData @@ -2514,65 +2991,72 @@ impl<'input> ExpNotContextExt<'input>{ } } -pub type ExpValueContext<'input> = BaseParserRuleContext<'input,ExpValueContextExt<'input>>; +pub type ExpNegativeContext<'input> = BaseParserRuleContext<'input,ExpNegativeContextExt<'input>>; -pub trait ExpValueContextAttrs<'input>: YarnSpinnerParserContext<'input>{ - fn value(&self) -> Option>> where Self:Sized{ +pub trait ExpNegativeContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + fn expression(&self) -> Option>> where Self:Sized{ self.child_of_type(0) } + /// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_SUBTRACTION + /// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_SUBTRACTION + fn OPERATOR_MATHS_SUBTRACTION(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_MATHS_SUBTRACTION, 0) + } } -impl<'input> ExpValueContextAttrs<'input> for ExpValueContext<'input>{} +impl<'input> ExpNegativeContextAttrs<'input> for ExpNegativeContext<'input>{} -pub struct ExpValueContextExt<'input>{ +pub struct ExpNegativeContextExt<'input>{ base:ExpressionContextExt<'input>, + pub op: Option>, ph:PhantomData<&'input str> } -antlr4rust::tid!{ExpValueContextExt<'a>} +antlr4rust::tid!{ExpNegativeContextExt<'a>} -impl<'input> YarnSpinnerParserContext<'input> for ExpValueContext<'input>{} +impl<'input> YarnSpinnerParserContext<'input> for ExpNegativeContext<'input>{} -impl<'input,'a> Listenable + 'a> for ExpValueContext<'input>{ +impl<'input,'a> Listenable + 'a> for ExpNegativeContext<'input>{ fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { listener.enter_every_rule(self)?; - listener.enter_expValue(self); + listener.enter_expNegative(self); Ok(()) } fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_expValue(self); + listener.exit_expNegative(self); listener.exit_every_rule(self)?; Ok(()) } } -impl<'input,'a> Visitable + 'a> for ExpValueContext<'input>{ +impl<'input,'a> Visitable + 'a> for ExpNegativeContext<'input>{ fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_expValue(self); + visitor.visit_expNegative(self); } } -impl<'input> CustomRuleContext<'input> for ExpValueContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for ExpNegativeContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; fn get_rule_index(&self) -> usize { RULE_expression } //fn type_rule_index() -> usize where Self: Sized { RULE_expression } } -impl<'input> Borrow> for ExpValueContext<'input>{ +impl<'input> Borrow> for ExpNegativeContext<'input>{ fn borrow(&self) -> &ExpressionContextExt<'input> { &self.base } } -impl<'input> BorrowMut> for ExpValueContext<'input>{ +impl<'input> BorrowMut> for ExpNegativeContext<'input>{ fn borrow_mut(&mut self) -> &mut ExpressionContextExt<'input> { &mut self.base } } -impl<'input> ExpressionContextAttrs<'input> for ExpValueContext<'input> {} +impl<'input> ExpressionContextAttrs<'input> for ExpNegativeContext<'input> {} -impl<'input> ExpValueContextExt<'input>{ +impl<'input> ExpNegativeContextExt<'input>{ fn new(ctx: &dyn ExpressionContextAttrs<'input>) -> Rc> { Rc::new( - ExpressionContextAll::ExpValueContext( - BaseParserRuleContext::copy_from(ctx,ExpValueContextExt{ + ExpressionContextAll::ExpNegativeContext( + BaseParserRuleContext::copy_from(ctx,ExpNegativeContextExt{ + op:None, base: ctx.borrow().clone(), ph:PhantomData }) @@ -2581,79 +3065,84 @@ impl<'input> ExpValueContextExt<'input>{ } } -pub type ExpEqualityContext<'input> = BaseParserRuleContext<'input,ExpEqualityContextExt<'input>>; +pub type ExpAndOrXorContext<'input> = BaseParserRuleContext<'input,ExpAndOrXorContextExt<'input>>; -pub trait ExpEqualityContextAttrs<'input>: YarnSpinnerParserContext<'input>{ +pub trait ExpAndOrXorContextAttrs<'input>: YarnSpinnerParserContext<'input>{ fn expression_all(&self) -> Vec>> where Self:Sized{ self.children_of_type() } fn expression(&self, i: usize) -> Option>> where Self:Sized{ self.child_of_type(i) } - /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_EQUALS - /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_EQUALS - fn OPERATOR_LOGICAL_EQUALS(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_OPERATOR_LOGICAL_EQUALS, 0) + /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_AND + /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_AND + fn OPERATOR_LOGICAL_AND(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_LOGICAL_AND, 0) } - /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_NOT_EQUALS - /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_NOT_EQUALS - fn OPERATOR_LOGICAL_NOT_EQUALS(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_OPERATOR_LOGICAL_NOT_EQUALS, 0) + /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_OR + /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_OR + fn OPERATOR_LOGICAL_OR(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_LOGICAL_OR, 0) + } + /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_XOR + /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_XOR + fn OPERATOR_LOGICAL_XOR(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_LOGICAL_XOR, 0) } } -impl<'input> ExpEqualityContextAttrs<'input> for ExpEqualityContext<'input>{} +impl<'input> ExpAndOrXorContextAttrs<'input> for ExpAndOrXorContext<'input>{} -pub struct ExpEqualityContextExt<'input>{ +pub struct ExpAndOrXorContextExt<'input>{ base:ExpressionContextExt<'input>, pub op: Option>, ph:PhantomData<&'input str> } -antlr4rust::tid!{ExpEqualityContextExt<'a>} +antlr4rust::tid!{ExpAndOrXorContextExt<'a>} -impl<'input> YarnSpinnerParserContext<'input> for ExpEqualityContext<'input>{} +impl<'input> YarnSpinnerParserContext<'input> for ExpAndOrXorContext<'input>{} -impl<'input,'a> Listenable + 'a> for ExpEqualityContext<'input>{ +impl<'input,'a> Listenable + 'a> for ExpAndOrXorContext<'input>{ fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { listener.enter_every_rule(self)?; - listener.enter_expEquality(self); + listener.enter_expAndOrXor(self); Ok(()) } fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_expEquality(self); + listener.exit_expAndOrXor(self); listener.exit_every_rule(self)?; Ok(()) } } -impl<'input,'a> Visitable + 'a> for ExpEqualityContext<'input>{ +impl<'input,'a> Visitable + 'a> for ExpAndOrXorContext<'input>{ fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_expEquality(self); + visitor.visit_expAndOrXor(self); } } -impl<'input> CustomRuleContext<'input> for ExpEqualityContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for ExpAndOrXorContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; fn get_rule_index(&self) -> usize { RULE_expression } //fn type_rule_index() -> usize where Self: Sized { RULE_expression } } -impl<'input> Borrow> for ExpEqualityContext<'input>{ +impl<'input> Borrow> for ExpAndOrXorContext<'input>{ fn borrow(&self) -> &ExpressionContextExt<'input> { &self.base } } -impl<'input> BorrowMut> for ExpEqualityContext<'input>{ +impl<'input> BorrowMut> for ExpAndOrXorContext<'input>{ fn borrow_mut(&mut self) -> &mut ExpressionContextExt<'input> { &mut self.base } } -impl<'input> ExpressionContextAttrs<'input> for ExpEqualityContext<'input> {} +impl<'input> ExpressionContextAttrs<'input> for ExpAndOrXorContext<'input> {} -impl<'input> ExpEqualityContextExt<'input>{ +impl<'input> ExpAndOrXorContextExt<'input>{ fn new(ctx: &dyn ExpressionContextAttrs<'input>) -> Rc> { Rc::new( - ExpressionContextAll::ExpEqualityContext( - BaseParserRuleContext::copy_from(ctx,ExpEqualityContextExt{ + ExpressionContextAll::ExpAndOrXorContext( + BaseParserRuleContext::copy_from(ctx,ExpAndOrXorContextExt{ op:None, base: ctx.borrow().clone(), ph:PhantomData @@ -2663,982 +3152,2872 @@ impl<'input> ExpEqualityContextExt<'input>{ } } -impl<'input, I> YarnSpinnerParser<'input, I> -where - I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, -{ - pub fn expression(&mut self,) - -> Result>,ANTLRError> { - self.expression_rec(0) +pub type ExpAddSubContext<'input> = BaseParserRuleContext<'input,ExpAddSubContextExt<'input>>; + +pub trait ExpAddSubContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + fn expression_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() } + fn expression(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) + } + /// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_ADDITION + /// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_ADDITION + fn OPERATOR_MATHS_ADDITION(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_MATHS_ADDITION, 0) + } + /// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_SUBTRACTION + /// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_SUBTRACTION + fn OPERATOR_MATHS_SUBTRACTION(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_MATHS_SUBTRACTION, 0) + } +} - fn expression_rec(&mut self, _p: i32) - -> Result>,ANTLRError> { - let recog = self; - let _parentctx = recog.ctx.take(); - let _parentState = recog.base.get_state(); - let mut _localctx = ExpressionContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog.base.enter_recursion_rule(_localctx.clone(), 20, RULE_expression, _p); - let mut _localctx: Rc = _localctx; - let mut _prevctx = _localctx.clone(); - let _startState = 20; - let mut _la: i32 = -1; - let result: Result<(), ANTLRError> = (|| { - let mut _alt: i32; - //recog.base.enter_outer_alt(_localctx.clone(), 1)?; - recog.base.enter_outer_alt(None, 1)?; - { - recog.base.set_state(147); - recog.err_handler.sync(&mut recog.base)?; - match recog.base.input.la(1) { - YarnSpinnerParser_LPAREN - => { +impl<'input> ExpAddSubContextAttrs<'input> for ExpAddSubContext<'input>{} + +pub struct ExpAddSubContextExt<'input>{ + base:ExpressionContextExt<'input>, + pub op: Option>, + ph:PhantomData<&'input str> +} + +antlr4rust::tid!{ExpAddSubContextExt<'a>} + +impl<'input> YarnSpinnerParserContext<'input> for ExpAddSubContext<'input>{} + +impl<'input,'a> Listenable + 'a> for ExpAddSubContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_expAddSub(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_expAddSub(self); + listener.exit_every_rule(self)?; + Ok(()) + } +} + +impl<'input,'a> Visitable + 'a> for ExpAddSubContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_expAddSub(self); + } +} + +impl<'input> CustomRuleContext<'input> for ExpAddSubContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_expression } + //fn type_rule_index() -> usize where Self: Sized { RULE_expression } +} + +impl<'input> Borrow> for ExpAddSubContext<'input>{ + fn borrow(&self) -> &ExpressionContextExt<'input> { &self.base } +} +impl<'input> BorrowMut> for ExpAddSubContext<'input>{ + fn borrow_mut(&mut self) -> &mut ExpressionContextExt<'input> { &mut self.base } +} + +impl<'input> ExpressionContextAttrs<'input> for ExpAddSubContext<'input> {} + +impl<'input> ExpAddSubContextExt<'input>{ + fn new(ctx: &dyn ExpressionContextAttrs<'input>) -> Rc> { + Rc::new( + ExpressionContextAll::ExpAddSubContext( + BaseParserRuleContext::copy_from(ctx,ExpAddSubContextExt{ + op:None, + base: ctx.borrow().clone(), + ph:PhantomData + }) + ) + ) + } +} + +pub type ExpNotContext<'input> = BaseParserRuleContext<'input,ExpNotContextExt<'input>>; + +pub trait ExpNotContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + fn expression(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) + } + /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_NOT + /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_NOT + fn OPERATOR_LOGICAL_NOT(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_LOGICAL_NOT, 0) + } +} + +impl<'input> ExpNotContextAttrs<'input> for ExpNotContext<'input>{} + +pub struct ExpNotContextExt<'input>{ + base:ExpressionContextExt<'input>, + pub op: Option>, + ph:PhantomData<&'input str> +} + +antlr4rust::tid!{ExpNotContextExt<'a>} + +impl<'input> YarnSpinnerParserContext<'input> for ExpNotContext<'input>{} + +impl<'input,'a> Listenable + 'a> for ExpNotContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_expNot(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_expNot(self); + listener.exit_every_rule(self)?; + Ok(()) + } +} + +impl<'input,'a> Visitable + 'a> for ExpNotContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_expNot(self); + } +} + +impl<'input> CustomRuleContext<'input> for ExpNotContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_expression } + //fn type_rule_index() -> usize where Self: Sized { RULE_expression } +} + +impl<'input> Borrow> for ExpNotContext<'input>{ + fn borrow(&self) -> &ExpressionContextExt<'input> { &self.base } +} +impl<'input> BorrowMut> for ExpNotContext<'input>{ + fn borrow_mut(&mut self) -> &mut ExpressionContextExt<'input> { &mut self.base } +} + +impl<'input> ExpressionContextAttrs<'input> for ExpNotContext<'input> {} + +impl<'input> ExpNotContextExt<'input>{ + fn new(ctx: &dyn ExpressionContextAttrs<'input>) -> Rc> { + Rc::new( + ExpressionContextAll::ExpNotContext( + BaseParserRuleContext::copy_from(ctx,ExpNotContextExt{ + op:None, + base: ctx.borrow().clone(), + ph:PhantomData + }) + ) + ) + } +} + +pub type ExpValueContext<'input> = BaseParserRuleContext<'input,ExpValueContextExt<'input>>; + +pub trait ExpValueContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + fn value(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) + } +} + +impl<'input> ExpValueContextAttrs<'input> for ExpValueContext<'input>{} + +pub struct ExpValueContextExt<'input>{ + base:ExpressionContextExt<'input>, + ph:PhantomData<&'input str> +} + +antlr4rust::tid!{ExpValueContextExt<'a>} + +impl<'input> YarnSpinnerParserContext<'input> for ExpValueContext<'input>{} + +impl<'input,'a> Listenable + 'a> for ExpValueContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_expValue(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_expValue(self); + listener.exit_every_rule(self)?; + Ok(()) + } +} + +impl<'input,'a> Visitable + 'a> for ExpValueContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_expValue(self); + } +} + +impl<'input> CustomRuleContext<'input> for ExpValueContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_expression } + //fn type_rule_index() -> usize where Self: Sized { RULE_expression } +} + +impl<'input> Borrow> for ExpValueContext<'input>{ + fn borrow(&self) -> &ExpressionContextExt<'input> { &self.base } +} +impl<'input> BorrowMut> for ExpValueContext<'input>{ + fn borrow_mut(&mut self) -> &mut ExpressionContextExt<'input> { &mut self.base } +} + +impl<'input> ExpressionContextAttrs<'input> for ExpValueContext<'input> {} + +impl<'input> ExpValueContextExt<'input>{ + fn new(ctx: &dyn ExpressionContextAttrs<'input>) -> Rc> { + Rc::new( + ExpressionContextAll::ExpValueContext( + BaseParserRuleContext::copy_from(ctx,ExpValueContextExt{ + base: ctx.borrow().clone(), + ph:PhantomData + }) + ) + ) + } +} + +pub type ExpEqualityContext<'input> = BaseParserRuleContext<'input,ExpEqualityContextExt<'input>>; + +pub trait ExpEqualityContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + fn expression_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() + } + fn expression(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) + } + /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_EQUALS + /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_EQUALS + fn OPERATOR_LOGICAL_EQUALS(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_LOGICAL_EQUALS, 0) + } + /// Retrieves first TerminalNode corresponding to token OPERATOR_LOGICAL_NOT_EQUALS + /// Returns `None` if there is no child corresponding to token OPERATOR_LOGICAL_NOT_EQUALS + fn OPERATOR_LOGICAL_NOT_EQUALS(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_LOGICAL_NOT_EQUALS, 0) + } +} + +impl<'input> ExpEqualityContextAttrs<'input> for ExpEqualityContext<'input>{} + +pub struct ExpEqualityContextExt<'input>{ + base:ExpressionContextExt<'input>, + pub op: Option>, + ph:PhantomData<&'input str> +} + +antlr4rust::tid!{ExpEqualityContextExt<'a>} + +impl<'input> YarnSpinnerParserContext<'input> for ExpEqualityContext<'input>{} + +impl<'input,'a> Listenable + 'a> for ExpEqualityContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_expEquality(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_expEquality(self); + listener.exit_every_rule(self)?; + Ok(()) + } +} + +impl<'input,'a> Visitable + 'a> for ExpEqualityContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_expEquality(self); + } +} + +impl<'input> CustomRuleContext<'input> for ExpEqualityContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_expression } + //fn type_rule_index() -> usize where Self: Sized { RULE_expression } +} + +impl<'input> Borrow> for ExpEqualityContext<'input>{ + fn borrow(&self) -> &ExpressionContextExt<'input> { &self.base } +} +impl<'input> BorrowMut> for ExpEqualityContext<'input>{ + fn borrow_mut(&mut self) -> &mut ExpressionContextExt<'input> { &mut self.base } +} + +impl<'input> ExpressionContextAttrs<'input> for ExpEqualityContext<'input> {} + +impl<'input> ExpEqualityContextExt<'input>{ + fn new(ctx: &dyn ExpressionContextAttrs<'input>) -> Rc> { + Rc::new( + ExpressionContextAll::ExpEqualityContext( + BaseParserRuleContext::copy_from(ctx,ExpEqualityContextExt{ + op:None, + base: ctx.borrow().clone(), + ph:PhantomData + }) + ) + ) + } +} + +impl<'input, I> YarnSpinnerParser<'input, I> +where + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + pub fn expression(&mut self,) + -> Result>,ANTLRError> { + self.expression_rec(0) + } + + fn expression_rec(&mut self, _p: i32) + -> Result>,ANTLRError> { + let recog = self; + let _parentctx = recog.ctx.take(); + let _parentState = recog.base.get_state(); + let mut _localctx = ExpressionContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_recursion_rule(_localctx.clone(), 26, RULE_expression, _p); + let mut _localctx: Rc = _localctx; + let mut _prevctx = _localctx.clone(); + let _startState = 26; + let mut _la: i32 = -1; + let result: Result<(), ANTLRError> = (|| { + let mut _alt: i32; + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(209); + recog.err_handler.sync(&mut recog.base)?; + match recog.base.input.la(1) { + YarnSpinnerParser_LPAREN + => { + { + let mut tmp = ExpParensContextExt::new(&**_localctx); + recog.ctx = Some(tmp.clone()); + _localctx = tmp; + _prevctx = _localctx.clone(); + + recog.base.set_state(200); + recog.base.match_token(YarnSpinnerParser_LPAREN,&mut recog.err_handler)?; + + /*InvokeRule expression*/ + recog.base.set_state(201); + recog.expression_rec(0)?; + + recog.base.set_state(202); + recog.base.match_token(YarnSpinnerParser_RPAREN,&mut recog.err_handler)?; + + } + } + + YarnSpinnerParser_OPERATOR_MATHS_SUBTRACTION + => { + { + let mut tmp = ExpNegativeContextExt::new(&**_localctx); + recog.ctx = Some(tmp.clone()); + _localctx = tmp; + _prevctx = _localctx.clone(); + recog.base.set_state(204); + let tmp = recog.base.match_token(YarnSpinnerParser_OPERATOR_MATHS_SUBTRACTION,&mut recog.err_handler)?; + if let ExpressionContextAll::ExpNegativeContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ + ctx.op = Some(tmp.clone()); } else {unreachable!("cant cast");} + + /*InvokeRule expression*/ + recog.base.set_state(205); + recog.expression_rec(8)?; + + } + } + + YarnSpinnerParser_OPERATOR_LOGICAL_NOT + => { + { + let mut tmp = ExpNotContextExt::new(&**_localctx); + recog.ctx = Some(tmp.clone()); + _localctx = tmp; + _prevctx = _localctx.clone(); + recog.base.set_state(206); + let tmp = recog.base.match_token(YarnSpinnerParser_OPERATOR_LOGICAL_NOT,&mut recog.err_handler)?; + if let ExpressionContextAll::ExpNotContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ + ctx.op = Some(tmp.clone()); } else {unreachable!("cant cast");} + + /*InvokeRule expression*/ + recog.base.set_state(207); + recog.expression_rec(7)?; + + } + } + + YarnSpinnerParser_KEYWORD_TRUE |YarnSpinnerParser_KEYWORD_FALSE |YarnSpinnerParser_STRING | + YarnSpinnerParser_FUNC_ID |YarnSpinnerParser_VAR_ID |YarnSpinnerParser_DOT | + YarnSpinnerParser_NUMBER + => { + { + let mut tmp = ExpValueContextExt::new(&**_localctx); + recog.ctx = Some(tmp.clone()); + _localctx = tmp; + _prevctx = _localctx.clone(); + /*InvokeRule value*/ + recog.base.set_state(208); + recog.value()?; + + } + } + + _ => Err(ANTLRError::NoAltError(NoViableAltError::new(&mut recog.base)))? + } + let tmp = recog.input.lt(-1).cloned(); + recog.ctx.as_ref().unwrap().set_stop(tmp); + recog.base.set_state(228); + recog.err_handler.sync(&mut recog.base)?; + _alt = recog.interpreter.adaptive_predict(19,&mut recog.base)?; + while { _alt!=2 && _alt!=INVALID_ALT } { + if _alt==1 { + recog.trigger_exit_rule_event()?; + _prevctx = _localctx.clone(); + { + recog.base.set_state(226); + recog.err_handler.sync(&mut recog.base)?; + match recog.interpreter.adaptive_predict(18,&mut recog.base)? { + 1 =>{ + { + /*recRuleLabeledAltStartAction*/ + let mut tmp = ExpMultDivModContextExt::new(&**ExpressionContextExt::new(_parentctx.clone(), _parentState)); + recog.push_new_recursion_context(tmp.clone(), _startState, RULE_expression)?; + _localctx = tmp; + recog.base.set_state(211); + if !({let _localctx = Some(_localctx.clone()); + recog.precpred(None, 6)}) { + Err(FailedPredicateError::new(&mut recog.base, Some("recog.precpred(None, 6)".to_owned()), None))?; + } + recog.base.set_state(212); + if let ExpressionContextAll::ExpMultDivModContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ + ctx.op = recog.base.input.lt(1).cloned(); } else {unreachable!("cant cast");} + _la = recog.base.input.la(1); + if { !(((((_la - 54)) & !0x3f) == 0 && ((1usize << (_la - 54)) & 7) != 0)) } { + let tmp = recog.err_handler.recover_inline(&mut recog.base)?; + if let ExpressionContextAll::ExpMultDivModContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ + ctx.op = Some(tmp.clone()); } else {unreachable!("cant cast");} + + } + else { + if recog.base.input.la(1)==TOKEN_EOF { recog.base.matched_eof = true }; + recog.err_handler.report_match(&mut recog.base); + recog.base.consume(&mut recog.err_handler); + } + /*InvokeRule expression*/ + recog.base.set_state(213); + recog.expression_rec(7)?; + + } + } + , + 2 =>{ + { + /*recRuleLabeledAltStartAction*/ + let mut tmp = ExpAddSubContextExt::new(&**ExpressionContextExt::new(_parentctx.clone(), _parentState)); + recog.push_new_recursion_context(tmp.clone(), _startState, RULE_expression)?; + _localctx = tmp; + recog.base.set_state(214); + if !({let _localctx = Some(_localctx.clone()); + recog.precpred(None, 5)}) { + Err(FailedPredicateError::new(&mut recog.base, Some("recog.precpred(None, 5)".to_owned()), None))?; + } + recog.base.set_state(215); + if let ExpressionContextAll::ExpAddSubContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ + ctx.op = recog.base.input.lt(1).cloned(); } else {unreachable!("cant cast");} + _la = recog.base.input.la(1); + if { !(_la==YarnSpinnerParser_OPERATOR_MATHS_ADDITION || _la==YarnSpinnerParser_OPERATOR_MATHS_SUBTRACTION) } { + let tmp = recog.err_handler.recover_inline(&mut recog.base)?; + if let ExpressionContextAll::ExpAddSubContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ + ctx.op = Some(tmp.clone()); } else {unreachable!("cant cast");} + + } + else { + if recog.base.input.la(1)==TOKEN_EOF { recog.base.matched_eof = true }; + recog.err_handler.report_match(&mut recog.base); + recog.base.consume(&mut recog.err_handler); + } + /*InvokeRule expression*/ + recog.base.set_state(216); + recog.expression_rec(6)?; + + } + } + , + 3 =>{ + { + /*recRuleLabeledAltStartAction*/ + let mut tmp = ExpComparisonContextExt::new(&**ExpressionContextExt::new(_parentctx.clone(), _parentState)); + recog.push_new_recursion_context(tmp.clone(), _startState, RULE_expression)?; + _localctx = tmp; + recog.base.set_state(217); + if !({let _localctx = Some(_localctx.clone()); + recog.precpred(None, 4)}) { + Err(FailedPredicateError::new(&mut recog.base, Some("recog.precpred(None, 4)".to_owned()), None))?; + } + recog.base.set_state(218); + if let ExpressionContextAll::ExpComparisonContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ + ctx.op = recog.base.input.lt(1).cloned(); } else {unreachable!("cant cast");} + _la = recog.base.input.la(1); + if { !(((((_la - 37)) & !0x3f) == 0 && ((1usize << (_la - 37)) & 27) != 0)) } { + let tmp = recog.err_handler.recover_inline(&mut recog.base)?; + if let ExpressionContextAll::ExpComparisonContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ + ctx.op = Some(tmp.clone()); } else {unreachable!("cant cast");} + + } + else { + if recog.base.input.la(1)==TOKEN_EOF { recog.base.matched_eof = true }; + recog.err_handler.report_match(&mut recog.base); + recog.base.consume(&mut recog.err_handler); + } + /*InvokeRule expression*/ + recog.base.set_state(219); + recog.expression_rec(5)?; + + } + } + , + 4 =>{ + { + /*recRuleLabeledAltStartAction*/ + let mut tmp = ExpEqualityContextExt::new(&**ExpressionContextExt::new(_parentctx.clone(), _parentState)); + recog.push_new_recursion_context(tmp.clone(), _startState, RULE_expression)?; + _localctx = tmp; + recog.base.set_state(220); + if !({let _localctx = Some(_localctx.clone()); + recog.precpred(None, 3)}) { + Err(FailedPredicateError::new(&mut recog.base, Some("recog.precpred(None, 3)".to_owned()), None))?; + } + recog.base.set_state(221); + if let ExpressionContextAll::ExpEqualityContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ + ctx.op = recog.base.input.lt(1).cloned(); } else {unreachable!("cant cast");} + _la = recog.base.input.la(1); + if { !(_la==YarnSpinnerParser_OPERATOR_LOGICAL_EQUALS || _la==YarnSpinnerParser_OPERATOR_LOGICAL_NOT_EQUALS) } { + let tmp = recog.err_handler.recover_inline(&mut recog.base)?; + if let ExpressionContextAll::ExpEqualityContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ + ctx.op = Some(tmp.clone()); } else {unreachable!("cant cast");} + + } + else { + if recog.base.input.la(1)==TOKEN_EOF { recog.base.matched_eof = true }; + recog.err_handler.report_match(&mut recog.base); + recog.base.consume(&mut recog.err_handler); + } + /*InvokeRule expression*/ + recog.base.set_state(222); + recog.expression_rec(4)?; + + } + } + , + 5 =>{ + { + /*recRuleLabeledAltStartAction*/ + let mut tmp = ExpAndOrXorContextExt::new(&**ExpressionContextExt::new(_parentctx.clone(), _parentState)); + recog.push_new_recursion_context(tmp.clone(), _startState, RULE_expression)?; + _localctx = tmp; + recog.base.set_state(223); + if !({let _localctx = Some(_localctx.clone()); + recog.precpred(None, 2)}) { + Err(FailedPredicateError::new(&mut recog.base, Some("recog.precpred(None, 2)".to_owned()), None))?; + } + recog.base.set_state(224); + if let ExpressionContextAll::ExpAndOrXorContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ + ctx.op = recog.base.input.lt(1).cloned(); } else {unreachable!("cant cast");} + _la = recog.base.input.la(1); + if { !(((((_la - 43)) & !0x3f) == 0 && ((1usize << (_la - 43)) & 7) != 0)) } { + let tmp = recog.err_handler.recover_inline(&mut recog.base)?; + if let ExpressionContextAll::ExpAndOrXorContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ + ctx.op = Some(tmp.clone()); } else {unreachable!("cant cast");} + + } + else { + if recog.base.input.la(1)==TOKEN_EOF { recog.base.matched_eof = true }; + recog.err_handler.report_match(&mut recog.base); + recog.base.consume(&mut recog.err_handler); + } + /*InvokeRule expression*/ + recog.base.set_state(225); + recog.expression_rec(3)?; + + } + } + + _ => {} + } + } + } + recog.base.set_state(230); + recog.err_handler.sync(&mut recog.base)?; + _alt = recog.interpreter.adaptive_predict(19,&mut recog.base)?; + } + } + Ok(()) + })(); + match result { + Ok(_) => {}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re)=>{ + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?;} + } + recog.base.unroll_recursion_context(_parentctx)?; + + Ok(_localctx) + } +} +//------------------- value ---------------- +#[derive(Debug)] +pub enum ValueContextAll<'input>{ + ValueNumberContext(ValueNumberContext<'input>), + ValueTrueContext(ValueTrueContext<'input>), + ValueFalseContext(ValueFalseContext<'input>), + ValueFuncContext(ValueFuncContext<'input>), + ValueVarContext(ValueVarContext<'input>), + ValueStringContext(ValueStringContext<'input>), + ValueTypeMemberReferenceContext(ValueTypeMemberReferenceContext<'input>), +Error(ValueContext<'input>) +} +antlr4rust::tid!{ValueContextAll<'a>} + +impl<'input> antlr4rust::parser_rule_context::DerefSeal for ValueContextAll<'input>{} + +impl<'input> YarnSpinnerParserContext<'input> for ValueContextAll<'input>{} + +impl<'input> Deref for ValueContextAll<'input>{ + type Target = dyn ValueContextAttrs<'input> + 'input; + fn deref(&self) -> &Self::Target{ + use ValueContextAll::*; + match self{ + ValueNumberContext(inner) => inner, + ValueTrueContext(inner) => inner, + ValueFalseContext(inner) => inner, + ValueFuncContext(inner) => inner, + ValueVarContext(inner) => inner, + ValueStringContext(inner) => inner, + ValueTypeMemberReferenceContext(inner) => inner, +Error(inner) => inner + } + } +} +impl<'input,'a> Visitable + 'a> for ValueContextAll<'input>{ + fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { self.deref().accept(visitor) } +} +impl<'input,'a> Listenable + 'a> for ValueContextAll<'input>{ + fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { self.deref().enter(listener) } + fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { self.deref().exit(listener) } +} + + + +pub type ValueContext<'input> = BaseParserRuleContext<'input,ValueContextExt<'input>>; + +#[derive(Clone)] +pub struct ValueContextExt<'input>{ +ph:PhantomData<&'input str> +} + +impl<'input> YarnSpinnerParserContext<'input> for ValueContext<'input>{} + +impl<'input,'a> Listenable + 'a> for ValueContext<'input>{ +} + +impl<'input,'a> Visitable + 'a> for ValueContext<'input>{ +} + +impl<'input> CustomRuleContext<'input> for ValueContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_value } + //fn type_rule_index() -> usize where Self: Sized { RULE_value } +} +antlr4rust::tid!{ValueContextExt<'a>} + +impl<'input> ValueContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + ValueContextAll::Error( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,ValueContextExt{ + + ph:PhantomData + }), + ) + ) + } +} + +pub trait ValueContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ + + +} + +impl<'input> ValueContextAttrs<'input> for ValueContext<'input>{} + +pub type ValueNumberContext<'input> = BaseParserRuleContext<'input,ValueNumberContextExt<'input>>; + +pub trait ValueNumberContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + /// Retrieves first TerminalNode corresponding to token NUMBER + /// Returns `None` if there is no child corresponding to token NUMBER + fn NUMBER(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_NUMBER, 0) + } +} + +impl<'input> ValueNumberContextAttrs<'input> for ValueNumberContext<'input>{} + +pub struct ValueNumberContextExt<'input>{ + base:ValueContextExt<'input>, + ph:PhantomData<&'input str> +} + +antlr4rust::tid!{ValueNumberContextExt<'a>} + +impl<'input> YarnSpinnerParserContext<'input> for ValueNumberContext<'input>{} + +impl<'input,'a> Listenable + 'a> for ValueNumberContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_valueNumber(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_valueNumber(self); + listener.exit_every_rule(self)?; + Ok(()) + } +} + +impl<'input,'a> Visitable + 'a> for ValueNumberContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_valueNumber(self); + } +} + +impl<'input> CustomRuleContext<'input> for ValueNumberContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_value } + //fn type_rule_index() -> usize where Self: Sized { RULE_value } +} + +impl<'input> Borrow> for ValueNumberContext<'input>{ + fn borrow(&self) -> &ValueContextExt<'input> { &self.base } +} +impl<'input> BorrowMut> for ValueNumberContext<'input>{ + fn borrow_mut(&mut self) -> &mut ValueContextExt<'input> { &mut self.base } +} + +impl<'input> ValueContextAttrs<'input> for ValueNumberContext<'input> {} + +impl<'input> ValueNumberContextExt<'input>{ + fn new(ctx: &dyn ValueContextAttrs<'input>) -> Rc> { + Rc::new( + ValueContextAll::ValueNumberContext( + BaseParserRuleContext::copy_from(ctx,ValueNumberContextExt{ + base: ctx.borrow().clone(), + ph:PhantomData + }) + ) + ) + } +} + +pub type ValueTrueContext<'input> = BaseParserRuleContext<'input,ValueTrueContextExt<'input>>; + +pub trait ValueTrueContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + /// Retrieves first TerminalNode corresponding to token KEYWORD_TRUE + /// Returns `None` if there is no child corresponding to token KEYWORD_TRUE + fn KEYWORD_TRUE(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_KEYWORD_TRUE, 0) + } +} + +impl<'input> ValueTrueContextAttrs<'input> for ValueTrueContext<'input>{} + +pub struct ValueTrueContextExt<'input>{ + base:ValueContextExt<'input>, + ph:PhantomData<&'input str> +} + +antlr4rust::tid!{ValueTrueContextExt<'a>} + +impl<'input> YarnSpinnerParserContext<'input> for ValueTrueContext<'input>{} + +impl<'input,'a> Listenable + 'a> for ValueTrueContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_valueTrue(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_valueTrue(self); + listener.exit_every_rule(self)?; + Ok(()) + } +} + +impl<'input,'a> Visitable + 'a> for ValueTrueContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_valueTrue(self); + } +} + +impl<'input> CustomRuleContext<'input> for ValueTrueContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_value } + //fn type_rule_index() -> usize where Self: Sized { RULE_value } +} + +impl<'input> Borrow> for ValueTrueContext<'input>{ + fn borrow(&self) -> &ValueContextExt<'input> { &self.base } +} +impl<'input> BorrowMut> for ValueTrueContext<'input>{ + fn borrow_mut(&mut self) -> &mut ValueContextExt<'input> { &mut self.base } +} + +impl<'input> ValueContextAttrs<'input> for ValueTrueContext<'input> {} + +impl<'input> ValueTrueContextExt<'input>{ + fn new(ctx: &dyn ValueContextAttrs<'input>) -> Rc> { + Rc::new( + ValueContextAll::ValueTrueContext( + BaseParserRuleContext::copy_from(ctx,ValueTrueContextExt{ + base: ctx.borrow().clone(), + ph:PhantomData + }) + ) + ) + } +} + +pub type ValueFalseContext<'input> = BaseParserRuleContext<'input,ValueFalseContextExt<'input>>; + +pub trait ValueFalseContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + /// Retrieves first TerminalNode corresponding to token KEYWORD_FALSE + /// Returns `None` if there is no child corresponding to token KEYWORD_FALSE + fn KEYWORD_FALSE(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_KEYWORD_FALSE, 0) + } +} + +impl<'input> ValueFalseContextAttrs<'input> for ValueFalseContext<'input>{} + +pub struct ValueFalseContextExt<'input>{ + base:ValueContextExt<'input>, + ph:PhantomData<&'input str> +} + +antlr4rust::tid!{ValueFalseContextExt<'a>} + +impl<'input> YarnSpinnerParserContext<'input> for ValueFalseContext<'input>{} + +impl<'input,'a> Listenable + 'a> for ValueFalseContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_valueFalse(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_valueFalse(self); + listener.exit_every_rule(self)?; + Ok(()) + } +} + +impl<'input,'a> Visitable + 'a> for ValueFalseContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_valueFalse(self); + } +} + +impl<'input> CustomRuleContext<'input> for ValueFalseContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_value } + //fn type_rule_index() -> usize where Self: Sized { RULE_value } +} + +impl<'input> Borrow> for ValueFalseContext<'input>{ + fn borrow(&self) -> &ValueContextExt<'input> { &self.base } +} +impl<'input> BorrowMut> for ValueFalseContext<'input>{ + fn borrow_mut(&mut self) -> &mut ValueContextExt<'input> { &mut self.base } +} + +impl<'input> ValueContextAttrs<'input> for ValueFalseContext<'input> {} + +impl<'input> ValueFalseContextExt<'input>{ + fn new(ctx: &dyn ValueContextAttrs<'input>) -> Rc> { + Rc::new( + ValueContextAll::ValueFalseContext( + BaseParserRuleContext::copy_from(ctx,ValueFalseContextExt{ + base: ctx.borrow().clone(), + ph:PhantomData + }) + ) + ) + } +} + +pub type ValueFuncContext<'input> = BaseParserRuleContext<'input,ValueFuncContextExt<'input>>; + +pub trait ValueFuncContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + fn function_call(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) + } +} + +impl<'input> ValueFuncContextAttrs<'input> for ValueFuncContext<'input>{} + +pub struct ValueFuncContextExt<'input>{ + base:ValueContextExt<'input>, + ph:PhantomData<&'input str> +} + +antlr4rust::tid!{ValueFuncContextExt<'a>} + +impl<'input> YarnSpinnerParserContext<'input> for ValueFuncContext<'input>{} + +impl<'input,'a> Listenable + 'a> for ValueFuncContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_valueFunc(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_valueFunc(self); + listener.exit_every_rule(self)?; + Ok(()) + } +} + +impl<'input,'a> Visitable + 'a> for ValueFuncContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_valueFunc(self); + } +} + +impl<'input> CustomRuleContext<'input> for ValueFuncContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_value } + //fn type_rule_index() -> usize where Self: Sized { RULE_value } +} + +impl<'input> Borrow> for ValueFuncContext<'input>{ + fn borrow(&self) -> &ValueContextExt<'input> { &self.base } +} +impl<'input> BorrowMut> for ValueFuncContext<'input>{ + fn borrow_mut(&mut self) -> &mut ValueContextExt<'input> { &mut self.base } +} + +impl<'input> ValueContextAttrs<'input> for ValueFuncContext<'input> {} + +impl<'input> ValueFuncContextExt<'input>{ + fn new(ctx: &dyn ValueContextAttrs<'input>) -> Rc> { + Rc::new( + ValueContextAll::ValueFuncContext( + BaseParserRuleContext::copy_from(ctx,ValueFuncContextExt{ + base: ctx.borrow().clone(), + ph:PhantomData + }) + ) + ) + } +} + +pub type ValueVarContext<'input> = BaseParserRuleContext<'input,ValueVarContextExt<'input>>; + +pub trait ValueVarContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + fn variable(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) + } +} + +impl<'input> ValueVarContextAttrs<'input> for ValueVarContext<'input>{} + +pub struct ValueVarContextExt<'input>{ + base:ValueContextExt<'input>, + ph:PhantomData<&'input str> +} + +antlr4rust::tid!{ValueVarContextExt<'a>} + +impl<'input> YarnSpinnerParserContext<'input> for ValueVarContext<'input>{} + +impl<'input,'a> Listenable + 'a> for ValueVarContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_valueVar(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_valueVar(self); + listener.exit_every_rule(self)?; + Ok(()) + } +} + +impl<'input,'a> Visitable + 'a> for ValueVarContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_valueVar(self); + } +} + +impl<'input> CustomRuleContext<'input> for ValueVarContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_value } + //fn type_rule_index() -> usize where Self: Sized { RULE_value } +} + +impl<'input> Borrow> for ValueVarContext<'input>{ + fn borrow(&self) -> &ValueContextExt<'input> { &self.base } +} +impl<'input> BorrowMut> for ValueVarContext<'input>{ + fn borrow_mut(&mut self) -> &mut ValueContextExt<'input> { &mut self.base } +} + +impl<'input> ValueContextAttrs<'input> for ValueVarContext<'input> {} + +impl<'input> ValueVarContextExt<'input>{ + fn new(ctx: &dyn ValueContextAttrs<'input>) -> Rc> { + Rc::new( + ValueContextAll::ValueVarContext( + BaseParserRuleContext::copy_from(ctx,ValueVarContextExt{ + base: ctx.borrow().clone(), + ph:PhantomData + }) + ) + ) + } +} + +pub type ValueStringContext<'input> = BaseParserRuleContext<'input,ValueStringContextExt<'input>>; + +pub trait ValueStringContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + /// Retrieves first TerminalNode corresponding to token STRING + /// Returns `None` if there is no child corresponding to token STRING + fn STRING(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_STRING, 0) + } +} + +impl<'input> ValueStringContextAttrs<'input> for ValueStringContext<'input>{} + +pub struct ValueStringContextExt<'input>{ + base:ValueContextExt<'input>, + ph:PhantomData<&'input str> +} + +antlr4rust::tid!{ValueStringContextExt<'a>} + +impl<'input> YarnSpinnerParserContext<'input> for ValueStringContext<'input>{} + +impl<'input,'a> Listenable + 'a> for ValueStringContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_valueString(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_valueString(self); + listener.exit_every_rule(self)?; + Ok(()) + } +} + +impl<'input,'a> Visitable + 'a> for ValueStringContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_valueString(self); + } +} + +impl<'input> CustomRuleContext<'input> for ValueStringContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_value } + //fn type_rule_index() -> usize where Self: Sized { RULE_value } +} + +impl<'input> Borrow> for ValueStringContext<'input>{ + fn borrow(&self) -> &ValueContextExt<'input> { &self.base } +} +impl<'input> BorrowMut> for ValueStringContext<'input>{ + fn borrow_mut(&mut self) -> &mut ValueContextExt<'input> { &mut self.base } +} + +impl<'input> ValueContextAttrs<'input> for ValueStringContext<'input> {} + +impl<'input> ValueStringContextExt<'input>{ + fn new(ctx: &dyn ValueContextAttrs<'input>) -> Rc> { + Rc::new( + ValueContextAll::ValueStringContext( + BaseParserRuleContext::copy_from(ctx,ValueStringContextExt{ + base: ctx.borrow().clone(), + ph:PhantomData + }) + ) + ) + } +} + +pub type ValueTypeMemberReferenceContext<'input> = BaseParserRuleContext<'input,ValueTypeMemberReferenceContextExt<'input>>; + +pub trait ValueTypeMemberReferenceContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + fn typeMemberReference(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) + } +} + +impl<'input> ValueTypeMemberReferenceContextAttrs<'input> for ValueTypeMemberReferenceContext<'input>{} + +pub struct ValueTypeMemberReferenceContextExt<'input>{ + base:ValueContextExt<'input>, + ph:PhantomData<&'input str> +} + +antlr4rust::tid!{ValueTypeMemberReferenceContextExt<'a>} + +impl<'input> YarnSpinnerParserContext<'input> for ValueTypeMemberReferenceContext<'input>{} + +impl<'input,'a> Listenable + 'a> for ValueTypeMemberReferenceContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_valueTypeMemberReference(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_valueTypeMemberReference(self); + listener.exit_every_rule(self)?; + Ok(()) + } +} + +impl<'input,'a> Visitable + 'a> for ValueTypeMemberReferenceContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_valueTypeMemberReference(self); + } +} + +impl<'input> CustomRuleContext<'input> for ValueTypeMemberReferenceContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_value } + //fn type_rule_index() -> usize where Self: Sized { RULE_value } +} + +impl<'input> Borrow> for ValueTypeMemberReferenceContext<'input>{ + fn borrow(&self) -> &ValueContextExt<'input> { &self.base } +} +impl<'input> BorrowMut> for ValueTypeMemberReferenceContext<'input>{ + fn borrow_mut(&mut self) -> &mut ValueContextExt<'input> { &mut self.base } +} + +impl<'input> ValueContextAttrs<'input> for ValueTypeMemberReferenceContext<'input> {} + +impl<'input> ValueTypeMemberReferenceContextExt<'input>{ + fn new(ctx: &dyn ValueContextAttrs<'input>) -> Rc> { + Rc::new( + ValueContextAll::ValueTypeMemberReferenceContext( + BaseParserRuleContext::copy_from(ctx,ValueTypeMemberReferenceContextExt{ + base: ctx.borrow().clone(), + ph:PhantomData + }) + ) + ) + } +} + +impl<'input, I> YarnSpinnerParser<'input, I> +where + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + pub fn value(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = ValueContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 28, RULE_value); + let mut _localctx: Rc = _localctx; + let result: Result<(), ANTLRError> = (|| { + + recog.base.set_state(238); + recog.err_handler.sync(&mut recog.base)?; + match recog.interpreter.adaptive_predict(20,&mut recog.base)? { + 1 =>{ + let tmp = ValueNumberContextExt::new(&**_localctx); + recog.base.enter_outer_alt(Some(tmp.clone()), 1)?; + _localctx = tmp; + { + recog.base.set_state(231); + recog.base.match_token(YarnSpinnerParser_NUMBER,&mut recog.err_handler)?; + + } + } + , + 2 =>{ + let tmp = ValueTrueContextExt::new(&**_localctx); + recog.base.enter_outer_alt(Some(tmp.clone()), 2)?; + _localctx = tmp; + { + recog.base.set_state(232); + recog.base.match_token(YarnSpinnerParser_KEYWORD_TRUE,&mut recog.err_handler)?; + + } + } + , + 3 =>{ + let tmp = ValueFalseContextExt::new(&**_localctx); + recog.base.enter_outer_alt(Some(tmp.clone()), 3)?; + _localctx = tmp; + { + recog.base.set_state(233); + recog.base.match_token(YarnSpinnerParser_KEYWORD_FALSE,&mut recog.err_handler)?; + + } + } + , + 4 =>{ + let tmp = ValueVarContextExt::new(&**_localctx); + recog.base.enter_outer_alt(Some(tmp.clone()), 4)?; + _localctx = tmp; + { + /*InvokeRule variable*/ + recog.base.set_state(234); + recog.variable()?; + + } + } + , + 5 =>{ + let tmp = ValueStringContextExt::new(&**_localctx); + recog.base.enter_outer_alt(Some(tmp.clone()), 5)?; + _localctx = tmp; + { + recog.base.set_state(235); + recog.base.match_token(YarnSpinnerParser_STRING,&mut recog.err_handler)?; + + } + } + , + 6 =>{ + let tmp = ValueFuncContextExt::new(&**_localctx); + recog.base.enter_outer_alt(Some(tmp.clone()), 6)?; + _localctx = tmp; + { + /*InvokeRule function_call*/ + recog.base.set_state(236); + recog.function_call()?; + + } + } + , + 7 =>{ + let tmp = ValueTypeMemberReferenceContextExt::new(&**_localctx); + recog.base.enter_outer_alt(Some(tmp.clone()), 7)?; + _localctx = tmp; + { + /*InvokeRule typeMemberReference*/ + recog.base.set_state(237); + recog.typeMemberReference()?; + + } + } + + _ => {} + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) + } +} +//------------------- variable ---------------- +pub type VariableContextAll<'input> = VariableContext<'input>; + + +pub type VariableContext<'input> = BaseParserRuleContext<'input,VariableContextExt<'input>>; + +#[derive(Clone)] +pub struct VariableContextExt<'input>{ +ph:PhantomData<&'input str> +} + +impl<'input> YarnSpinnerParserContext<'input> for VariableContext<'input>{} + +impl<'input,'a> Listenable + 'a> for VariableContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_variable(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_variable(self); + listener.exit_every_rule(self)?; + Ok(()) + } +} + +impl<'input,'a> Visitable + 'a> for VariableContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_variable(self); + } +} + +impl<'input> CustomRuleContext<'input> for VariableContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_variable } + //fn type_rule_index() -> usize where Self: Sized { RULE_variable } +} +antlr4rust::tid!{VariableContextExt<'a>} + +impl<'input> VariableContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,VariableContextExt{ + + ph:PhantomData + }), + ) + } +} + +pub trait VariableContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ + +/// Retrieves first TerminalNode corresponding to token VAR_ID +/// Returns `None` if there is no child corresponding to token VAR_ID +fn VAR_ID(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_VAR_ID, 0) +} + +} + +impl<'input> VariableContextAttrs<'input> for VariableContext<'input>{} + +impl<'input, I> YarnSpinnerParser<'input, I> +where + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + pub fn variable(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = VariableContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 30, RULE_variable); + let mut _localctx: Rc = _localctx; + let result: Result<(), ANTLRError> = (|| { + + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(240); + recog.base.match_token(YarnSpinnerParser_VAR_ID,&mut recog.err_handler)?; + + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) + } +} +//------------------- function_call ---------------- +pub type Function_callContextAll<'input> = Function_callContext<'input>; + + +pub type Function_callContext<'input> = BaseParserRuleContext<'input,Function_callContextExt<'input>>; + +#[derive(Clone)] +pub struct Function_callContextExt<'input>{ +ph:PhantomData<&'input str> +} + +impl<'input> YarnSpinnerParserContext<'input> for Function_callContext<'input>{} + +impl<'input,'a> Listenable + 'a> for Function_callContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_function_call(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_function_call(self); + listener.exit_every_rule(self)?; + Ok(()) + } +} + +impl<'input,'a> Visitable + 'a> for Function_callContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_function_call(self); + } +} + +impl<'input> CustomRuleContext<'input> for Function_callContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_function_call } + //fn type_rule_index() -> usize where Self: Sized { RULE_function_call } +} +antlr4rust::tid!{Function_callContextExt<'a>} + +impl<'input> Function_callContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Function_callContextExt{ + + ph:PhantomData + }), + ) + } +} + +pub trait Function_callContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ + +/// Retrieves first TerminalNode corresponding to token FUNC_ID +/// Returns `None` if there is no child corresponding to token FUNC_ID +fn FUNC_ID(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_FUNC_ID, 0) +} +/// Retrieves first TerminalNode corresponding to token LPAREN +/// Returns `None` if there is no child corresponding to token LPAREN +fn LPAREN(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_LPAREN, 0) +} +/// Retrieves first TerminalNode corresponding to token RPAREN +/// Returns `None` if there is no child corresponding to token RPAREN +fn RPAREN(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_RPAREN, 0) +} +fn expression_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +fn expression(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) +} +/// Retrieves all `TerminalNode`s corresponding to token COMMA in current rule +fn COMMA_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +/// Retrieves 'i's TerminalNode corresponding to token COMMA, starting from 0. +/// Returns `None` if number of children corresponding to token COMMA is less or equal than `i`. +fn COMMA(&self, i: usize) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMA, i) +} + +} + +impl<'input> Function_callContextAttrs<'input> for Function_callContext<'input>{} + +impl<'input, I> YarnSpinnerParser<'input, I> +where + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + pub fn function_call(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = Function_callContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 32, RULE_function_call); + let mut _localctx: Rc = _localctx; + let mut _la: i32 = -1; + let result: Result<(), ANTLRError> = (|| { + + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(242); + recog.base.match_token(YarnSpinnerParser_FUNC_ID,&mut recog.err_handler)?; + + recog.base.set_state(243); + recog.base.match_token(YarnSpinnerParser_LPAREN,&mut recog.err_handler)?; + + recog.base.set_state(245); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + if ((((_la - 33)) & !0x3f) == 0 && ((1usize << (_la - 33)) & 2970624003) != 0) || _la==YarnSpinnerParser_DOT || _la==YarnSpinnerParser_NUMBER { + { + /*InvokeRule expression*/ + recog.base.set_state(244); + recog.expression_rec(0)?; + + } + } + + recog.base.set_state(251); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + while _la==YarnSpinnerParser_COMMA { + { + { + recog.base.set_state(247); + recog.base.match_token(YarnSpinnerParser_COMMA,&mut recog.err_handler)?; + + /*InvokeRule expression*/ + recog.base.set_state(248); + recog.expression_rec(0)?; + + } + } + recog.base.set_state(253); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + } + recog.base.set_state(254); + recog.base.match_token(YarnSpinnerParser_RPAREN,&mut recog.err_handler)?; + + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) + } +} +//------------------- typeMemberReference ---------------- +pub type TypeMemberReferenceContextAll<'input> = TypeMemberReferenceContext<'input>; + + +pub type TypeMemberReferenceContext<'input> = BaseParserRuleContext<'input,TypeMemberReferenceContextExt<'input>>; + +#[derive(Clone)] +pub struct TypeMemberReferenceContextExt<'input>{ + pub typeName: Option>, + pub memberName: Option>, +ph:PhantomData<&'input str> +} + +impl<'input> YarnSpinnerParserContext<'input> for TypeMemberReferenceContext<'input>{} + +impl<'input,'a> Listenable + 'a> for TypeMemberReferenceContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_typeMemberReference(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_typeMemberReference(self); + listener.exit_every_rule(self)?; + Ok(()) + } +} + +impl<'input,'a> Visitable + 'a> for TypeMemberReferenceContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_typeMemberReference(self); + } +} + +impl<'input> CustomRuleContext<'input> for TypeMemberReferenceContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_typeMemberReference } + //fn type_rule_index() -> usize where Self: Sized { RULE_typeMemberReference } +} +antlr4rust::tid!{TypeMemberReferenceContextExt<'a>} + +impl<'input> TypeMemberReferenceContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,TypeMemberReferenceContextExt{ + typeName: None, memberName: None, + + ph:PhantomData + }), + ) + } +} + +pub trait TypeMemberReferenceContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ + +/// Retrieves first TerminalNode corresponding to token DOT +/// Returns `None` if there is no child corresponding to token DOT +fn DOT(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_DOT, 0) +} +/// Retrieves all `TerminalNode`s corresponding to token FUNC_ID in current rule +fn FUNC_ID_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +/// Retrieves 'i's TerminalNode corresponding to token FUNC_ID, starting from 0. +/// Returns `None` if number of children corresponding to token FUNC_ID is less or equal than `i`. +fn FUNC_ID(&self, i: usize) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_FUNC_ID, i) +} + +} + +impl<'input> TypeMemberReferenceContextAttrs<'input> for TypeMemberReferenceContext<'input>{} + +impl<'input, I> YarnSpinnerParser<'input, I> +where + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + pub fn typeMemberReference(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = TypeMemberReferenceContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 34, RULE_typeMemberReference); + let mut _localctx: Rc = _localctx; + let mut _la: i32 = -1; + let result: Result<(), ANTLRError> = (|| { + + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(257); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + if _la==YarnSpinnerParser_FUNC_ID { + { + recog.base.set_state(256); + let tmp = recog.base.match_token(YarnSpinnerParser_FUNC_ID,&mut recog.err_handler)?; + cast_mut::<_,TypeMemberReferenceContext >(&mut _localctx).typeName = Some(tmp.clone()); + + + } + } + + recog.base.set_state(259); + recog.base.match_token(YarnSpinnerParser_DOT,&mut recog.err_handler)?; + + recog.base.set_state(260); + let tmp = recog.base.match_token(YarnSpinnerParser_FUNC_ID,&mut recog.err_handler)?; + cast_mut::<_,TypeMemberReferenceContext >(&mut _localctx).memberName = Some(tmp.clone()); + + + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) + } +} +//------------------- if_statement ---------------- +pub type If_statementContextAll<'input> = If_statementContext<'input>; + + +pub type If_statementContext<'input> = BaseParserRuleContext<'input,If_statementContextExt<'input>>; + +#[derive(Clone)] +pub struct If_statementContextExt<'input>{ +ph:PhantomData<&'input str> +} + +impl<'input> YarnSpinnerParserContext<'input> for If_statementContext<'input>{} + +impl<'input,'a> Listenable + 'a> for If_statementContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_if_statement(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_if_statement(self); + listener.exit_every_rule(self)?; + Ok(()) + } +} + +impl<'input,'a> Visitable + 'a> for If_statementContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_if_statement(self); + } +} + +impl<'input> CustomRuleContext<'input> for If_statementContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_if_statement } + //fn type_rule_index() -> usize where Self: Sized { RULE_if_statement } +} +antlr4rust::tid!{If_statementContextExt<'a>} + +impl<'input> If_statementContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,If_statementContextExt{ + + ph:PhantomData + }), + ) + } +} + +pub trait If_statementContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ + +fn if_clause(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +/// Retrieves first TerminalNode corresponding to token COMMAND_START +/// Returns `None` if there is no child corresponding to token COMMAND_START +fn COMMAND_START(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_START, 0) +} +/// Retrieves first TerminalNode corresponding to token COMMAND_ENDIF +/// Returns `None` if there is no child corresponding to token COMMAND_ENDIF +fn COMMAND_ENDIF(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_ENDIF, 0) +} +/// Retrieves first TerminalNode corresponding to token COMMAND_END +/// Returns `None` if there is no child corresponding to token COMMAND_END +fn COMMAND_END(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_END, 0) +} +fn else_if_clause_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +fn else_if_clause(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) +} +fn else_clause(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} + +} + +impl<'input> If_statementContextAttrs<'input> for If_statementContext<'input>{} + +impl<'input, I> YarnSpinnerParser<'input, I> +where + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + pub fn if_statement(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = If_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 36, RULE_if_statement); + let mut _localctx: Rc = _localctx; + let result: Result<(), ANTLRError> = (|| { + + let mut _alt: i32; + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + /*InvokeRule if_clause*/ + recog.base.set_state(262); + recog.if_clause()?; + + recog.base.set_state(266); + recog.err_handler.sync(&mut recog.base)?; + _alt = recog.interpreter.adaptive_predict(24,&mut recog.base)?; + while { _alt!=2 && _alt!=INVALID_ALT } { + if _alt==1 { { - let mut tmp = ExpParensContextExt::new(&**_localctx); - recog.ctx = Some(tmp.clone()); - _localctx = tmp; - _prevctx = _localctx.clone(); + { + /*InvokeRule else_if_clause*/ + recog.base.set_state(263); + recog.else_if_clause()?; - recog.base.set_state(138); - recog.base.match_token(YarnSpinnerParser_LPAREN,&mut recog.err_handler)?; + } + } + } + recog.base.set_state(268); + recog.err_handler.sync(&mut recog.base)?; + _alt = recog.interpreter.adaptive_predict(24,&mut recog.base)?; + } + recog.base.set_state(270); + recog.err_handler.sync(&mut recog.base)?; + match recog.interpreter.adaptive_predict(25,&mut recog.base)? { + x if x == 1=>{ + { + /*InvokeRule else_clause*/ + recog.base.set_state(269); + recog.else_clause()?; + + } + } + + _ => {} + } + recog.base.set_state(272); + recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; + + recog.base.set_state(273); + recog.base.match_token(YarnSpinnerParser_COMMAND_ENDIF,&mut recog.err_handler)?; + + recog.base.set_state(274); + recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; + + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) + } +} +//------------------- if_clause ---------------- +pub type If_clauseContextAll<'input> = If_clauseContext<'input>; + + +pub type If_clauseContext<'input> = BaseParserRuleContext<'input,If_clauseContextExt<'input>>; + +#[derive(Clone)] +pub struct If_clauseContextExt<'input>{ +ph:PhantomData<&'input str> +} + +impl<'input> YarnSpinnerParserContext<'input> for If_clauseContext<'input>{} + +impl<'input,'a> Listenable + 'a> for If_clauseContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_if_clause(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_if_clause(self); + listener.exit_every_rule(self)?; + Ok(()) + } +} + +impl<'input,'a> Visitable + 'a> for If_clauseContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_if_clause(self); + } +} + +impl<'input> CustomRuleContext<'input> for If_clauseContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_if_clause } + //fn type_rule_index() -> usize where Self: Sized { RULE_if_clause } +} +antlr4rust::tid!{If_clauseContextExt<'a>} - /*InvokeRule expression*/ - recog.base.set_state(139); - recog.expression_rec(0)?; +impl<'input> If_clauseContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,If_clauseContextExt{ - recog.base.set_state(140); - recog.base.match_token(YarnSpinnerParser_RPAREN,&mut recog.err_handler)?; + ph:PhantomData + }), + ) + } +} - } - } +pub trait If_clauseContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ - YarnSpinnerParser_OPERATOR_MATHS_SUBTRACTION - => { - { - let mut tmp = ExpNegativeContextExt::new(&**_localctx); - recog.ctx = Some(tmp.clone()); - _localctx = tmp; - _prevctx = _localctx.clone(); - recog.base.set_state(142); - let tmp = recog.base.match_token(YarnSpinnerParser_OPERATOR_MATHS_SUBTRACTION,&mut recog.err_handler)?; - if let ExpressionContextAll::ExpNegativeContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ - ctx.op = Some(tmp.clone()); } else {unreachable!("cant cast");} +/// Retrieves first TerminalNode corresponding to token COMMAND_START +/// Returns `None` if there is no child corresponding to token COMMAND_START +fn COMMAND_START(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_START, 0) +} +/// Retrieves first TerminalNode corresponding to token COMMAND_IF +/// Returns `None` if there is no child corresponding to token COMMAND_IF +fn COMMAND_IF(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_IF, 0) +} +fn expression(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +/// Retrieves first TerminalNode corresponding to token COMMAND_END +/// Returns `None` if there is no child corresponding to token COMMAND_END +fn COMMAND_END(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_END, 0) +} +fn statement_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +fn statement(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) +} - /*InvokeRule expression*/ - recog.base.set_state(143); - recog.expression_rec(8)?; +} - } - } +impl<'input> If_clauseContextAttrs<'input> for If_clauseContext<'input>{} - YarnSpinnerParser_OPERATOR_LOGICAL_NOT - => { - { - let mut tmp = ExpNotContextExt::new(&**_localctx); - recog.ctx = Some(tmp.clone()); - _localctx = tmp; - _prevctx = _localctx.clone(); - recog.base.set_state(144); - let tmp = recog.base.match_token(YarnSpinnerParser_OPERATOR_LOGICAL_NOT,&mut recog.err_handler)?; - if let ExpressionContextAll::ExpNotContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ - ctx.op = Some(tmp.clone()); } else {unreachable!("cant cast");} +impl<'input, I> YarnSpinnerParser<'input, I> +where + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + pub fn if_clause(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = If_clauseContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 38, RULE_if_clause); + let mut _localctx: Rc = _localctx; + let result: Result<(), ANTLRError> = (|| { - /*InvokeRule expression*/ - recog.base.set_state(145); - recog.expression_rec(7)?; + let mut _alt: i32; + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(276); + recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; - } - } + recog.base.set_state(277); + recog.base.match_token(YarnSpinnerParser_COMMAND_IF,&mut recog.err_handler)?; - YarnSpinnerParser_KEYWORD_TRUE |YarnSpinnerParser_KEYWORD_FALSE |YarnSpinnerParser_KEYWORD_NULL | - YarnSpinnerParser_STRING |YarnSpinnerParser_FUNC_ID |YarnSpinnerParser_VAR_ID | - YarnSpinnerParser_NUMBER - => { - { - let mut tmp = ExpValueContextExt::new(&**_localctx); - recog.ctx = Some(tmp.clone()); - _localctx = tmp; - _prevctx = _localctx.clone(); - /*InvokeRule value*/ - recog.base.set_state(146); - recog.value()?; + /*InvokeRule expression*/ + recog.base.set_state(278); + recog.expression_rec(0)?; - } - } + recog.base.set_state(279); + recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; - _ => Err(ANTLRError::NoAltError(NoViableAltError::new(&mut recog.base)))? - } - let tmp = recog.input.lt(-1).cloned(); - recog.ctx.as_ref().unwrap().set_stop(tmp); - recog.base.set_state(166); + recog.base.set_state(283); recog.err_handler.sync(&mut recog.base)?; - _alt = recog.interpreter.adaptive_predict(14,&mut recog.base)?; + _alt = recog.interpreter.adaptive_predict(26,&mut recog.base)?; while { _alt!=2 && _alt!=INVALID_ALT } { if _alt==1 { - recog.trigger_exit_rule_event()?; - _prevctx = _localctx.clone(); { - recog.base.set_state(164); - recog.err_handler.sync(&mut recog.base)?; - match recog.interpreter.adaptive_predict(13,&mut recog.base)? { - 1 =>{ - { - /*recRuleLabeledAltStartAction*/ - let mut tmp = ExpMultDivModContextExt::new(&**ExpressionContextExt::new(_parentctx.clone(), _parentState)); - recog.push_new_recursion_context(tmp.clone(), _startState, RULE_expression)?; - _localctx = tmp; - recog.base.set_state(149); - if !({let _localctx = Some(_localctx.clone()); - recog.precpred(None, 6)}) { - Err(FailedPredicateError::new(&mut recog.base, Some("recog.precpred(None, 6)".to_owned()), None))?; - } - recog.base.set_state(150); - if let ExpressionContextAll::ExpMultDivModContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ - ctx.op = recog.base.input.lt(1).cloned(); } else {unreachable!("cant cast");} - _la = recog.base.input.la(1); - if { !(((((_la - 49)) & !0x3f) == 0 && ((1usize << (_la - 49)) & 7) != 0)) } { - let tmp = recog.err_handler.recover_inline(&mut recog.base)?; - if let ExpressionContextAll::ExpMultDivModContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ - ctx.op = Some(tmp.clone()); } else {unreachable!("cant cast");} + { + /*InvokeRule statement*/ + recog.base.set_state(280); + recog.statement()?; - } - else { - if recog.base.input.la(1)==TOKEN_EOF { recog.base.matched_eof = true }; - recog.err_handler.report_match(&mut recog.base); - recog.base.consume(&mut recog.err_handler); - } - /*InvokeRule expression*/ - recog.base.set_state(151); - recog.expression_rec(7)?; + } + } + } + recog.base.set_state(285); + recog.err_handler.sync(&mut recog.base)?; + _alt = recog.interpreter.adaptive_predict(26,&mut recog.base)?; + } + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; - } - } - , - 2 =>{ - { - /*recRuleLabeledAltStartAction*/ - let mut tmp = ExpAddSubContextExt::new(&**ExpressionContextExt::new(_parentctx.clone(), _parentState)); - recog.push_new_recursion_context(tmp.clone(), _startState, RULE_expression)?; - _localctx = tmp; - recog.base.set_state(152); - if !({let _localctx = Some(_localctx.clone()); - recog.precpred(None, 5)}) { - Err(FailedPredicateError::new(&mut recog.base, Some("recog.precpred(None, 5)".to_owned()), None))?; - } - recog.base.set_state(153); - if let ExpressionContextAll::ExpAddSubContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ - ctx.op = recog.base.input.lt(1).cloned(); } else {unreachable!("cant cast");} - _la = recog.base.input.la(1); - if { !(_la==YarnSpinnerParser_OPERATOR_MATHS_ADDITION || _la==YarnSpinnerParser_OPERATOR_MATHS_SUBTRACTION) } { - let tmp = recog.err_handler.recover_inline(&mut recog.base)?; - if let ExpressionContextAll::ExpAddSubContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ - ctx.op = Some(tmp.clone()); } else {unreachable!("cant cast");} + Ok(_localctx) + } +} +//------------------- else_if_clause ---------------- +pub type Else_if_clauseContextAll<'input> = Else_if_clauseContext<'input>; + + +pub type Else_if_clauseContext<'input> = BaseParserRuleContext<'input,Else_if_clauseContextExt<'input>>; + +#[derive(Clone)] +pub struct Else_if_clauseContextExt<'input>{ +ph:PhantomData<&'input str> +} + +impl<'input> YarnSpinnerParserContext<'input> for Else_if_clauseContext<'input>{} + +impl<'input,'a> Listenable + 'a> for Else_if_clauseContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_else_if_clause(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_else_if_clause(self); + listener.exit_every_rule(self)?; + Ok(()) + } +} + +impl<'input,'a> Visitable + 'a> for Else_if_clauseContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_else_if_clause(self); + } +} + +impl<'input> CustomRuleContext<'input> for Else_if_clauseContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_else_if_clause } + //fn type_rule_index() -> usize where Self: Sized { RULE_else_if_clause } +} +antlr4rust::tid!{Else_if_clauseContextExt<'a>} + +impl<'input> Else_if_clauseContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Else_if_clauseContextExt{ + + ph:PhantomData + }), + ) + } +} + +pub trait Else_if_clauseContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ + +/// Retrieves first TerminalNode corresponding to token COMMAND_START +/// Returns `None` if there is no child corresponding to token COMMAND_START +fn COMMAND_START(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_START, 0) +} +/// Retrieves first TerminalNode corresponding to token COMMAND_ELSEIF +/// Returns `None` if there is no child corresponding to token COMMAND_ELSEIF +fn COMMAND_ELSEIF(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_ELSEIF, 0) +} +fn expression(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +/// Retrieves first TerminalNode corresponding to token COMMAND_END +/// Returns `None` if there is no child corresponding to token COMMAND_END +fn COMMAND_END(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_END, 0) +} +fn statement_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +fn statement(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) +} - } - else { - if recog.base.input.la(1)==TOKEN_EOF { recog.base.matched_eof = true }; - recog.err_handler.report_match(&mut recog.base); - recog.base.consume(&mut recog.err_handler); - } - /*InvokeRule expression*/ - recog.base.set_state(154); - recog.expression_rec(6)?; +} - } - } - , - 3 =>{ - { - /*recRuleLabeledAltStartAction*/ - let mut tmp = ExpComparisonContextExt::new(&**ExpressionContextExt::new(_parentctx.clone(), _parentState)); - recog.push_new_recursion_context(tmp.clone(), _startState, RULE_expression)?; - _localctx = tmp; - recog.base.set_state(155); - if !({let _localctx = Some(_localctx.clone()); - recog.precpred(None, 4)}) { - Err(FailedPredicateError::new(&mut recog.base, Some("recog.precpred(None, 4)".to_owned()), None))?; - } - recog.base.set_state(156); - if let ExpressionContextAll::ExpComparisonContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ - ctx.op = recog.base.input.lt(1).cloned(); } else {unreachable!("cant cast");} - _la = recog.base.input.la(1); - if { !(((((_la - 32)) & !0x3f) == 0 && ((1usize << (_la - 32)) & 27) != 0)) } { - let tmp = recog.err_handler.recover_inline(&mut recog.base)?; - if let ExpressionContextAll::ExpComparisonContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ - ctx.op = Some(tmp.clone()); } else {unreachable!("cant cast");} +impl<'input> Else_if_clauseContextAttrs<'input> for Else_if_clauseContext<'input>{} - } - else { - if recog.base.input.la(1)==TOKEN_EOF { recog.base.matched_eof = true }; - recog.err_handler.report_match(&mut recog.base); - recog.base.consume(&mut recog.err_handler); - } - /*InvokeRule expression*/ - recog.base.set_state(157); - recog.expression_rec(5)?; +impl<'input, I> YarnSpinnerParser<'input, I> +where + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + pub fn else_if_clause(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = Else_if_clauseContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 40, RULE_else_if_clause); + let mut _localctx: Rc = _localctx; + let result: Result<(), ANTLRError> = (|| { - } - } - , - 4 =>{ - { - /*recRuleLabeledAltStartAction*/ - let mut tmp = ExpEqualityContextExt::new(&**ExpressionContextExt::new(_parentctx.clone(), _parentState)); - recog.push_new_recursion_context(tmp.clone(), _startState, RULE_expression)?; - _localctx = tmp; - recog.base.set_state(158); - if !({let _localctx = Some(_localctx.clone()); - recog.precpred(None, 3)}) { - Err(FailedPredicateError::new(&mut recog.base, Some("recog.precpred(None, 3)".to_owned()), None))?; - } - recog.base.set_state(159); - if let ExpressionContextAll::ExpEqualityContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ - ctx.op = recog.base.input.lt(1).cloned(); } else {unreachable!("cant cast");} - _la = recog.base.input.la(1); - if { !(_la==YarnSpinnerParser_OPERATOR_LOGICAL_EQUALS || _la==YarnSpinnerParser_OPERATOR_LOGICAL_NOT_EQUALS) } { - let tmp = recog.err_handler.recover_inline(&mut recog.base)?; - if let ExpressionContextAll::ExpEqualityContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ - ctx.op = Some(tmp.clone()); } else {unreachable!("cant cast");} + let mut _alt: i32; + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(286); + recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; - } - else { - if recog.base.input.la(1)==TOKEN_EOF { recog.base.matched_eof = true }; - recog.err_handler.report_match(&mut recog.base); - recog.base.consume(&mut recog.err_handler); - } - /*InvokeRule expression*/ - recog.base.set_state(160); - recog.expression_rec(4)?; + recog.base.set_state(287); + recog.base.match_token(YarnSpinnerParser_COMMAND_ELSEIF,&mut recog.err_handler)?; - } - } - , - 5 =>{ - { - /*recRuleLabeledAltStartAction*/ - let mut tmp = ExpAndOrXorContextExt::new(&**ExpressionContextExt::new(_parentctx.clone(), _parentState)); - recog.push_new_recursion_context(tmp.clone(), _startState, RULE_expression)?; - _localctx = tmp; - recog.base.set_state(161); - if !({let _localctx = Some(_localctx.clone()); - recog.precpred(None, 2)}) { - Err(FailedPredicateError::new(&mut recog.base, Some("recog.precpred(None, 2)".to_owned()), None))?; - } - recog.base.set_state(162); - if let ExpressionContextAll::ExpAndOrXorContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ - ctx.op = recog.base.input.lt(1).cloned(); } else {unreachable!("cant cast");} - _la = recog.base.input.la(1); - if { !(((((_la - 38)) & !0x3f) == 0 && ((1usize << (_la - 38)) & 7) != 0)) } { - let tmp = recog.err_handler.recover_inline(&mut recog.base)?; - if let ExpressionContextAll::ExpAndOrXorContext(ctx) = cast_mut::<_,ExpressionContextAll >(&mut _localctx){ - ctx.op = Some(tmp.clone()); } else {unreachable!("cant cast");} + /*InvokeRule expression*/ + recog.base.set_state(288); + recog.expression_rec(0)?; - } - else { - if recog.base.input.la(1)==TOKEN_EOF { recog.base.matched_eof = true }; - recog.err_handler.report_match(&mut recog.base); - recog.base.consume(&mut recog.err_handler); - } - /*InvokeRule expression*/ - recog.base.set_state(163); - recog.expression_rec(3)?; + recog.base.set_state(289); + recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; - } - } + recog.base.set_state(293); + recog.err_handler.sync(&mut recog.base)?; + _alt = recog.interpreter.adaptive_predict(27,&mut recog.base)?; + while { _alt!=2 && _alt!=INVALID_ALT } { + if _alt==1 { + { + { + /*InvokeRule statement*/ + recog.base.set_state(290); + recog.statement()?; - _ => {} } } } - recog.base.set_state(168); + recog.base.set_state(295); recog.err_handler.sync(&mut recog.base)?; - _alt = recog.interpreter.adaptive_predict(14,&mut recog.base)?; + _alt = recog.interpreter.adaptive_predict(27,&mut recog.base)?; } } Ok(()) })(); match result { - Ok(_) => {}, + Ok(_)=>{}, Err(e @ ANTLRError::FallThrough(_)) => return Err(e), - Err(ref re)=>{ - //_localctx.exception = re; - recog.err_handler.report_error(&mut recog.base, re); - recog.err_handler.recover(&mut recog.base, re)?;} + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } } - recog.base.unroll_recursion_context(_parentctx)?; + recog.base.exit_rule()?; Ok(_localctx) } } -//------------------- value ---------------- -#[derive(Debug)] -pub enum ValueContextAll<'input>{ - ValueNullContext(ValueNullContext<'input>), - ValueNumberContext(ValueNumberContext<'input>), - ValueTrueContext(ValueTrueContext<'input>), - ValueFalseContext(ValueFalseContext<'input>), - ValueFuncContext(ValueFuncContext<'input>), - ValueVarContext(ValueVarContext<'input>), - ValueStringContext(ValueStringContext<'input>), -Error(ValueContext<'input>) +//------------------- else_clause ---------------- +pub type Else_clauseContextAll<'input> = Else_clauseContext<'input>; + + +pub type Else_clauseContext<'input> = BaseParserRuleContext<'input,Else_clauseContextExt<'input>>; + +#[derive(Clone)] +pub struct Else_clauseContextExt<'input>{ +ph:PhantomData<&'input str> } -antlr4rust::tid!{ValueContextAll<'a>} -impl<'input> antlr4rust::parser_rule_context::DerefSeal for ValueContextAll<'input>{} +impl<'input> YarnSpinnerParserContext<'input> for Else_clauseContext<'input>{} + +impl<'input,'a> Listenable + 'a> for Else_clauseContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_else_clause(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_else_clause(self); + listener.exit_every_rule(self)?; + Ok(()) + } +} + +impl<'input,'a> Visitable + 'a> for Else_clauseContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_else_clause(self); + } +} + +impl<'input> CustomRuleContext<'input> for Else_clauseContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_else_clause } + //fn type_rule_index() -> usize where Self: Sized { RULE_else_clause } +} +antlr4rust::tid!{Else_clauseContextExt<'a>} + +impl<'input> Else_clauseContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Else_clauseContextExt{ + + ph:PhantomData + }), + ) + } +} + +pub trait Else_clauseContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ + +/// Retrieves first TerminalNode corresponding to token COMMAND_START +/// Returns `None` if there is no child corresponding to token COMMAND_START +fn COMMAND_START(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_START, 0) +} +/// Retrieves first TerminalNode corresponding to token COMMAND_ELSE +/// Returns `None` if there is no child corresponding to token COMMAND_ELSE +fn COMMAND_ELSE(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_ELSE, 0) +} +/// Retrieves first TerminalNode corresponding to token COMMAND_END +/// Returns `None` if there is no child corresponding to token COMMAND_END +fn COMMAND_END(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_END, 0) +} +fn statement_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +fn statement(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) +} + +} + +impl<'input> Else_clauseContextAttrs<'input> for Else_clauseContext<'input>{} + +impl<'input, I> YarnSpinnerParser<'input, I> +where + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + pub fn else_clause(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = Else_clauseContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 42, RULE_else_clause); + let mut _localctx: Rc = _localctx; + let result: Result<(), ANTLRError> = (|| { + + let mut _alt: i32; + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(296); + recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; + + recog.base.set_state(297); + recog.base.match_token(YarnSpinnerParser_COMMAND_ELSE,&mut recog.err_handler)?; -impl<'input> YarnSpinnerParserContext<'input> for ValueContextAll<'input>{} + recog.base.set_state(298); + recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; -impl<'input> Deref for ValueContextAll<'input>{ - type Target = dyn ValueContextAttrs<'input> + 'input; - fn deref(&self) -> &Self::Target{ - use ValueContextAll::*; - match self{ - ValueNullContext(inner) => inner, - ValueNumberContext(inner) => inner, - ValueTrueContext(inner) => inner, - ValueFalseContext(inner) => inner, - ValueFuncContext(inner) => inner, - ValueVarContext(inner) => inner, - ValueStringContext(inner) => inner, -Error(inner) => inner + recog.base.set_state(302); + recog.err_handler.sync(&mut recog.base)?; + _alt = recog.interpreter.adaptive_predict(28,&mut recog.base)?; + while { _alt!=2 && _alt!=INVALID_ALT } { + if _alt==1 { + { + { + /*InvokeRule statement*/ + recog.base.set_state(299); + recog.statement()?; + + } + } + } + recog.base.set_state(304); + recog.err_handler.sync(&mut recog.base)?; + _alt = recog.interpreter.adaptive_predict(28,&mut recog.base)?; + } + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } } + recog.base.exit_rule()?; + + Ok(_localctx) } } -impl<'input,'a> Visitable + 'a> for ValueContextAll<'input>{ - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { self.deref().accept(visitor) } -} -impl<'input,'a> Listenable + 'a> for ValueContextAll<'input>{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { self.deref().enter(listener) } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { self.deref().exit(listener) } -} - +//------------------- set_statement ---------------- +pub type Set_statementContextAll<'input> = Set_statementContext<'input>; -pub type ValueContext<'input> = BaseParserRuleContext<'input,ValueContextExt<'input>>; +pub type Set_statementContext<'input> = BaseParserRuleContext<'input,Set_statementContextExt<'input>>; #[derive(Clone)] -pub struct ValueContextExt<'input>{ +pub struct Set_statementContextExt<'input>{ + pub op: Option>, ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for ValueContext<'input>{} +impl<'input> YarnSpinnerParserContext<'input> for Set_statementContext<'input>{} -impl<'input,'a> Listenable + 'a> for ValueContext<'input>{ +impl<'input,'a> Listenable + 'a> for Set_statementContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_set_statement(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_set_statement(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input,'a> Visitable + 'a> for ValueContext<'input>{ +impl<'input,'a> Visitable + 'a> for Set_statementContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_set_statement(self); + } } -impl<'input> CustomRuleContext<'input> for ValueContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for Set_statementContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_value } - //fn type_rule_index() -> usize where Self: Sized { RULE_value } + fn get_rule_index(&self) -> usize { RULE_set_statement } + //fn type_rule_index() -> usize where Self: Sized { RULE_set_statement } } -antlr4rust::tid!{ValueContextExt<'a>} +antlr4rust::tid!{Set_statementContextExt<'a>} -impl<'input> ValueContextExt<'input>{ - fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { +impl<'input> Set_statementContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { Rc::new( - ValueContextAll::Error( - BaseParserRuleContext::new_parser_ctx(parent, invoking_state,ValueContextExt{ + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Set_statementContextExt{ + op: None, ph:PhantomData }), ) - ) } } -pub trait ValueContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ - +pub trait Set_statementContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ +/// Retrieves first TerminalNode corresponding to token COMMAND_START +/// Returns `None` if there is no child corresponding to token COMMAND_START +fn COMMAND_START(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_START, 0) } - -impl<'input> ValueContextAttrs<'input> for ValueContext<'input>{} - -pub type ValueNullContext<'input> = BaseParserRuleContext<'input,ValueNullContextExt<'input>>; - -pub trait ValueNullContextAttrs<'input>: YarnSpinnerParserContext<'input>{ - /// Retrieves first TerminalNode corresponding to token KEYWORD_NULL - /// Returns `None` if there is no child corresponding to token KEYWORD_NULL - fn KEYWORD_NULL(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_KEYWORD_NULL, 0) - } +/// Retrieves first TerminalNode corresponding to token COMMAND_SET +/// Returns `None` if there is no child corresponding to token COMMAND_SET +fn COMMAND_SET(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_SET, 0) } - -impl<'input> ValueNullContextAttrs<'input> for ValueNullContext<'input>{} - -pub struct ValueNullContextExt<'input>{ - base:ValueContextExt<'input>, - ph:PhantomData<&'input str> +fn variable(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) } - -antlr4rust::tid!{ValueNullContextExt<'a>} - -impl<'input> YarnSpinnerParserContext<'input> for ValueNullContext<'input>{} - -impl<'input,'a> Listenable + 'a> for ValueNullContext<'input>{ - fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.enter_every_rule(self)?; - listener.enter_valueNull(self); - Ok(()) - } - fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_valueNull(self); - listener.exit_every_rule(self)?; - Ok(()) - } +fn expression(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) } - -impl<'input,'a> Visitable + 'a> for ValueNullContext<'input>{ - fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_valueNull(self); - } +/// Retrieves first TerminalNode corresponding to token COMMAND_END +/// Returns `None` if there is no child corresponding to token COMMAND_END +fn COMMAND_END(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_END, 0) } - -impl<'input> CustomRuleContext<'input> for ValueNullContextExt<'input>{ - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_value } - //fn type_rule_index() -> usize where Self: Sized { RULE_value } +/// Retrieves first TerminalNode corresponding to token OPERATOR_ASSIGNMENT +/// Returns `None` if there is no child corresponding to token OPERATOR_ASSIGNMENT +fn OPERATOR_ASSIGNMENT(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_ASSIGNMENT, 0) } - -impl<'input> Borrow> for ValueNullContext<'input>{ - fn borrow(&self) -> &ValueContextExt<'input> { &self.base } +/// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_MULTIPLICATION_EQUALS +/// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_MULTIPLICATION_EQUALS +fn OPERATOR_MATHS_MULTIPLICATION_EQUALS(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_MATHS_MULTIPLICATION_EQUALS, 0) } -impl<'input> BorrowMut> for ValueNullContext<'input>{ - fn borrow_mut(&mut self) -> &mut ValueContextExt<'input> { &mut self.base } +/// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_DIVISION_EQUALS +/// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_DIVISION_EQUALS +fn OPERATOR_MATHS_DIVISION_EQUALS(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_MATHS_DIVISION_EQUALS, 0) } - -impl<'input> ValueContextAttrs<'input> for ValueNullContext<'input> {} - -impl<'input> ValueNullContextExt<'input>{ - fn new(ctx: &dyn ValueContextAttrs<'input>) -> Rc> { - Rc::new( - ValueContextAll::ValueNullContext( - BaseParserRuleContext::copy_from(ctx,ValueNullContextExt{ - base: ctx.borrow().clone(), - ph:PhantomData - }) - ) - ) - } +/// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_MODULUS_EQUALS +/// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_MODULUS_EQUALS +fn OPERATOR_MATHS_MODULUS_EQUALS(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_MATHS_MODULUS_EQUALS, 0) } - -pub type ValueNumberContext<'input> = BaseParserRuleContext<'input,ValueNumberContextExt<'input>>; - -pub trait ValueNumberContextAttrs<'input>: YarnSpinnerParserContext<'input>{ - /// Retrieves first TerminalNode corresponding to token NUMBER - /// Returns `None` if there is no child corresponding to token NUMBER - fn NUMBER(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_NUMBER, 0) - } +/// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_ADDITION_EQUALS +/// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_ADDITION_EQUALS +fn OPERATOR_MATHS_ADDITION_EQUALS(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_MATHS_ADDITION_EQUALS, 0) +} +/// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_SUBTRACTION_EQUALS +/// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_SUBTRACTION_EQUALS +fn OPERATOR_MATHS_SUBTRACTION_EQUALS(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_MATHS_SUBTRACTION_EQUALS, 0) } -impl<'input> ValueNumberContextAttrs<'input> for ValueNumberContext<'input>{} - -pub struct ValueNumberContextExt<'input>{ - base:ValueContextExt<'input>, - ph:PhantomData<&'input str> } -antlr4rust::tid!{ValueNumberContextExt<'a>} +impl<'input> Set_statementContextAttrs<'input> for Set_statementContext<'input>{} -impl<'input> YarnSpinnerParserContext<'input> for ValueNumberContext<'input>{} +impl<'input, I> YarnSpinnerParser<'input, I> +where + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + pub fn set_statement(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = Set_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 44, RULE_set_statement); + let mut _localctx: Rc = _localctx; + let mut _la: i32 = -1; + let result: Result<(), ANTLRError> = (|| { -impl<'input,'a> Listenable + 'a> for ValueNumberContext<'input>{ - fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.enter_every_rule(self)?; - listener.enter_valueNumber(self); - Ok(()) - } - fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_valueNumber(self); - listener.exit_every_rule(self)?; - Ok(()) - } -} + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(305); + recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; -impl<'input,'a> Visitable + 'a> for ValueNumberContext<'input>{ - fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_valueNumber(self); - } -} + recog.base.set_state(306); + recog.base.match_token(YarnSpinnerParser_COMMAND_SET,&mut recog.err_handler)?; -impl<'input> CustomRuleContext<'input> for ValueNumberContextExt<'input>{ - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_value } - //fn type_rule_index() -> usize where Self: Sized { RULE_value } -} + /*InvokeRule variable*/ + recog.base.set_state(307); + recog.variable()?; -impl<'input> Borrow> for ValueNumberContext<'input>{ - fn borrow(&self) -> &ValueContextExt<'input> { &self.base } -} -impl<'input> BorrowMut> for ValueNumberContext<'input>{ - fn borrow_mut(&mut self) -> &mut ValueContextExt<'input> { &mut self.base } -} + recog.base.set_state(308); + cast_mut::<_,Set_statementContext >(&mut _localctx).op = recog.base.input.lt(1).cloned(); + + _la = recog.base.input.la(1); + if { !(((((_la - 36)) & !0x3f) == 0 && ((1usize << (_la - 36)) & 63489) != 0)) } { + let tmp = recog.err_handler.recover_inline(&mut recog.base)?; + cast_mut::<_,Set_statementContext >(&mut _localctx).op = Some(tmp.clone()); + -impl<'input> ValueContextAttrs<'input> for ValueNumberContext<'input> {} + } + else { + if recog.base.input.la(1)==TOKEN_EOF { recog.base.matched_eof = true }; + recog.err_handler.report_match(&mut recog.base); + recog.base.consume(&mut recog.err_handler); + } + /*InvokeRule expression*/ + recog.base.set_state(309); + recog.expression_rec(0)?; -impl<'input> ValueNumberContextExt<'input>{ - fn new(ctx: &dyn ValueContextAttrs<'input>) -> Rc> { - Rc::new( - ValueContextAll::ValueNumberContext( - BaseParserRuleContext::copy_from(ctx,ValueNumberContextExt{ - base: ctx.borrow().clone(), - ph:PhantomData - }) - ) - ) - } -} + recog.base.set_state(310); + recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; -pub type ValueTrueContext<'input> = BaseParserRuleContext<'input,ValueTrueContextExt<'input>>; + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; -pub trait ValueTrueContextAttrs<'input>: YarnSpinnerParserContext<'input>{ - /// Retrieves first TerminalNode corresponding to token KEYWORD_TRUE - /// Returns `None` if there is no child corresponding to token KEYWORD_TRUE - fn KEYWORD_TRUE(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_KEYWORD_TRUE, 0) + Ok(_localctx) } } +//------------------- call_statement ---------------- +pub type Call_statementContextAll<'input> = Call_statementContext<'input>; -impl<'input> ValueTrueContextAttrs<'input> for ValueTrueContext<'input>{} -pub struct ValueTrueContextExt<'input>{ - base:ValueContextExt<'input>, - ph:PhantomData<&'input str> -} +pub type Call_statementContext<'input> = BaseParserRuleContext<'input,Call_statementContextExt<'input>>; -antlr4rust::tid!{ValueTrueContextExt<'a>} +#[derive(Clone)] +pub struct Call_statementContextExt<'input>{ +ph:PhantomData<&'input str> +} -impl<'input> YarnSpinnerParserContext<'input> for ValueTrueContext<'input>{} +impl<'input> YarnSpinnerParserContext<'input> for Call_statementContext<'input>{} -impl<'input,'a> Listenable + 'a> for ValueTrueContext<'input>{ - fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.enter_every_rule(self)?; - listener.enter_valueTrue(self); - Ok(()) - } - fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_valueTrue(self); - listener.exit_every_rule(self)?; - Ok(()) - } +impl<'input,'a> Listenable + 'a> for Call_statementContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_call_statement(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_call_statement(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input,'a> Visitable + 'a> for ValueTrueContext<'input>{ +impl<'input,'a> Visitable + 'a> for Call_statementContext<'input>{ fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_valueTrue(self); + visitor.visit_call_statement(self); } } -impl<'input> CustomRuleContext<'input> for ValueTrueContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for Call_statementContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_value } - //fn type_rule_index() -> usize where Self: Sized { RULE_value } -} - -impl<'input> Borrow> for ValueTrueContext<'input>{ - fn borrow(&self) -> &ValueContextExt<'input> { &self.base } -} -impl<'input> BorrowMut> for ValueTrueContext<'input>{ - fn borrow_mut(&mut self) -> &mut ValueContextExt<'input> { &mut self.base } + fn get_rule_index(&self) -> usize { RULE_call_statement } + //fn type_rule_index() -> usize where Self: Sized { RULE_call_statement } } +antlr4rust::tid!{Call_statementContextExt<'a>} -impl<'input> ValueContextAttrs<'input> for ValueTrueContext<'input> {} - -impl<'input> ValueTrueContextExt<'input>{ - fn new(ctx: &dyn ValueContextAttrs<'input>) -> Rc> { +impl<'input> Call_statementContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { Rc::new( - ValueContextAll::ValueTrueContext( - BaseParserRuleContext::copy_from(ctx,ValueTrueContextExt{ - base: ctx.borrow().clone(), - ph:PhantomData - }) - ) + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Call_statementContextExt{ + + ph:PhantomData + }), ) } } -pub type ValueFalseContext<'input> = BaseParserRuleContext<'input,ValueFalseContextExt<'input>>; +pub trait Call_statementContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ -pub trait ValueFalseContextAttrs<'input>: YarnSpinnerParserContext<'input>{ - /// Retrieves first TerminalNode corresponding to token KEYWORD_FALSE - /// Returns `None` if there is no child corresponding to token KEYWORD_FALSE - fn KEYWORD_FALSE(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_KEYWORD_FALSE, 0) - } +/// Retrieves first TerminalNode corresponding to token COMMAND_START +/// Returns `None` if there is no child corresponding to token COMMAND_START +fn COMMAND_START(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_START, 0) +} +/// Retrieves first TerminalNode corresponding to token COMMAND_CALL +/// Returns `None` if there is no child corresponding to token COMMAND_CALL +fn COMMAND_CALL(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_CALL, 0) +} +fn function_call(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +/// Retrieves first TerminalNode corresponding to token COMMAND_END +/// Returns `None` if there is no child corresponding to token COMMAND_END +fn COMMAND_END(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_END, 0) } -impl<'input> ValueFalseContextAttrs<'input> for ValueFalseContext<'input>{} - -pub struct ValueFalseContextExt<'input>{ - base:ValueContextExt<'input>, - ph:PhantomData<&'input str> } -antlr4rust::tid!{ValueFalseContextExt<'a>} +impl<'input> Call_statementContextAttrs<'input> for Call_statementContext<'input>{} -impl<'input> YarnSpinnerParserContext<'input> for ValueFalseContext<'input>{} +impl<'input, I> YarnSpinnerParser<'input, I> +where + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + pub fn call_statement(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = Call_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 46, RULE_call_statement); + let mut _localctx: Rc = _localctx; + let result: Result<(), ANTLRError> = (|| { -impl<'input,'a> Listenable + 'a> for ValueFalseContext<'input>{ - fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.enter_every_rule(self)?; - listener.enter_valueFalse(self); - Ok(()) - } - fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_valueFalse(self); - listener.exit_every_rule(self)?; - Ok(()) - } -} + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(312); + recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; -impl<'input,'a> Visitable + 'a> for ValueFalseContext<'input>{ - fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_valueFalse(self); - } -} + recog.base.set_state(313); + recog.base.match_token(YarnSpinnerParser_COMMAND_CALL,&mut recog.err_handler)?; -impl<'input> CustomRuleContext<'input> for ValueFalseContextExt<'input>{ - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_value } - //fn type_rule_index() -> usize where Self: Sized { RULE_value } -} + /*InvokeRule function_call*/ + recog.base.set_state(314); + recog.function_call()?; -impl<'input> Borrow> for ValueFalseContext<'input>{ - fn borrow(&self) -> &ValueContextExt<'input> { &self.base } -} -impl<'input> BorrowMut> for ValueFalseContext<'input>{ - fn borrow_mut(&mut self) -> &mut ValueContextExt<'input> { &mut self.base } -} + recog.base.set_state(315); + recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; -impl<'input> ValueContextAttrs<'input> for ValueFalseContext<'input> {} + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; -impl<'input> ValueFalseContextExt<'input>{ - fn new(ctx: &dyn ValueContextAttrs<'input>) -> Rc> { - Rc::new( - ValueContextAll::ValueFalseContext( - BaseParserRuleContext::copy_from(ctx,ValueFalseContextExt{ - base: ctx.borrow().clone(), - ph:PhantomData - }) - ) - ) + Ok(_localctx) } } +//------------------- command_statement ---------------- +pub type Command_statementContextAll<'input> = Command_statementContext<'input>; -pub type ValueFuncContext<'input> = BaseParserRuleContext<'input,ValueFuncContextExt<'input>>; - -pub trait ValueFuncContextAttrs<'input>: YarnSpinnerParserContext<'input>{ - fn function_call(&self) -> Option>> where Self:Sized{ - self.child_of_type(0) - } -} -impl<'input> ValueFuncContextAttrs<'input> for ValueFuncContext<'input>{} +pub type Command_statementContext<'input> = BaseParserRuleContext<'input,Command_statementContextExt<'input>>; -pub struct ValueFuncContextExt<'input>{ - base:ValueContextExt<'input>, - ph:PhantomData<&'input str> +#[derive(Clone)] +pub struct Command_statementContextExt<'input>{ +ph:PhantomData<&'input str> } -antlr4rust::tid!{ValueFuncContextExt<'a>} - -impl<'input> YarnSpinnerParserContext<'input> for ValueFuncContext<'input>{} +impl<'input> YarnSpinnerParserContext<'input> for Command_statementContext<'input>{} -impl<'input,'a> Listenable + 'a> for ValueFuncContext<'input>{ - fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.enter_every_rule(self)?; - listener.enter_valueFunc(self); - Ok(()) - } - fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_valueFunc(self); - listener.exit_every_rule(self)?; - Ok(()) - } +impl<'input,'a> Listenable + 'a> for Command_statementContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_command_statement(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_command_statement(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input,'a> Visitable + 'a> for ValueFuncContext<'input>{ +impl<'input,'a> Visitable + 'a> for Command_statementContext<'input>{ fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_valueFunc(self); + visitor.visit_command_statement(self); } } -impl<'input> CustomRuleContext<'input> for ValueFuncContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for Command_statementContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_value } - //fn type_rule_index() -> usize where Self: Sized { RULE_value } -} - -impl<'input> Borrow> for ValueFuncContext<'input>{ - fn borrow(&self) -> &ValueContextExt<'input> { &self.base } -} -impl<'input> BorrowMut> for ValueFuncContext<'input>{ - fn borrow_mut(&mut self) -> &mut ValueContextExt<'input> { &mut self.base } + fn get_rule_index(&self) -> usize { RULE_command_statement } + //fn type_rule_index() -> usize where Self: Sized { RULE_command_statement } } +antlr4rust::tid!{Command_statementContextExt<'a>} -impl<'input> ValueContextAttrs<'input> for ValueFuncContext<'input> {} - -impl<'input> ValueFuncContextExt<'input>{ - fn new(ctx: &dyn ValueContextAttrs<'input>) -> Rc> { +impl<'input> Command_statementContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { Rc::new( - ValueContextAll::ValueFuncContext( - BaseParserRuleContext::copy_from(ctx,ValueFuncContextExt{ - base: ctx.borrow().clone(), - ph:PhantomData - }) - ) + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Command_statementContextExt{ + + ph:PhantomData + }), ) } } -pub type ValueVarContext<'input> = BaseParserRuleContext<'input,ValueVarContextExt<'input>>; +pub trait Command_statementContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ -pub trait ValueVarContextAttrs<'input>: YarnSpinnerParserContext<'input>{ - fn variable(&self) -> Option>> where Self:Sized{ - self.child_of_type(0) - } +/// Retrieves first TerminalNode corresponding to token COMMAND_START +/// Returns `None` if there is no child corresponding to token COMMAND_START +fn COMMAND_START(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_START, 0) +} +fn command_formatted_text(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +/// Retrieves first TerminalNode corresponding to token COMMAND_END +/// Returns `None` if there is no child corresponding to token COMMAND_END +fn COMMAND_END(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_END, 0) +} +fn hashtag_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +fn hashtag(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) } -impl<'input> ValueVarContextAttrs<'input> for ValueVarContext<'input>{} - -pub struct ValueVarContextExt<'input>{ - base:ValueContextExt<'input>, - ph:PhantomData<&'input str> } -antlr4rust::tid!{ValueVarContextExt<'a>} +impl<'input> Command_statementContextAttrs<'input> for Command_statementContext<'input>{} -impl<'input> YarnSpinnerParserContext<'input> for ValueVarContext<'input>{} +impl<'input, I> YarnSpinnerParser<'input, I> +where + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + pub fn command_statement(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = Command_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 48, RULE_command_statement); + let mut _localctx: Rc = _localctx; + let mut _la: i32 = -1; + let result: Result<(), ANTLRError> = (|| { -impl<'input,'a> Listenable + 'a> for ValueVarContext<'input>{ - fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.enter_every_rule(self)?; - listener.enter_valueVar(self); - Ok(()) - } - fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_valueVar(self); - listener.exit_every_rule(self)?; - Ok(()) - } -} + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(317); + recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; -impl<'input,'a> Visitable + 'a> for ValueVarContext<'input>{ - fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_valueVar(self); - } -} + /*InvokeRule command_formatted_text*/ + recog.base.set_state(318); + recog.command_formatted_text()?; -impl<'input> CustomRuleContext<'input> for ValueVarContextExt<'input>{ - type TF = LocalTokenFactory<'input>; - type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_value } - //fn type_rule_index() -> usize where Self: Sized { RULE_value } -} + recog.base.set_state(319); + recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; -impl<'input> Borrow> for ValueVarContext<'input>{ - fn borrow(&self) -> &ValueContextExt<'input> { &self.base } -} -impl<'input> BorrowMut> for ValueVarContext<'input>{ - fn borrow_mut(&mut self) -> &mut ValueContextExt<'input> { &mut self.base } -} + { + recog.base.set_state(323); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + while _la==YarnSpinnerParser_HASHTAG { + { + { + /*InvokeRule hashtag*/ + recog.base.set_state(320); + recog.hashtag()?; -impl<'input> ValueContextAttrs<'input> for ValueVarContext<'input> {} + } + } + recog.base.set_state(325); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + } + } + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; -impl<'input> ValueVarContextExt<'input>{ - fn new(ctx: &dyn ValueContextAttrs<'input>) -> Rc> { - Rc::new( - ValueContextAll::ValueVarContext( - BaseParserRuleContext::copy_from(ctx,ValueVarContextExt{ - base: ctx.borrow().clone(), - ph:PhantomData - }) - ) - ) + Ok(_localctx) } } +//------------------- command_formatted_text ---------------- +pub type Command_formatted_textContextAll<'input> = Command_formatted_textContext<'input>; -pub type ValueStringContext<'input> = BaseParserRuleContext<'input,ValueStringContextExt<'input>>; - -pub trait ValueStringContextAttrs<'input>: YarnSpinnerParserContext<'input>{ - /// Retrieves first TerminalNode corresponding to token STRING - /// Returns `None` if there is no child corresponding to token STRING - fn STRING(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_STRING, 0) - } -} -impl<'input> ValueStringContextAttrs<'input> for ValueStringContext<'input>{} +pub type Command_formatted_textContext<'input> = BaseParserRuleContext<'input,Command_formatted_textContextExt<'input>>; -pub struct ValueStringContextExt<'input>{ - base:ValueContextExt<'input>, - ph:PhantomData<&'input str> +#[derive(Clone)] +pub struct Command_formatted_textContextExt<'input>{ +ph:PhantomData<&'input str> } -antlr4rust::tid!{ValueStringContextExt<'a>} - -impl<'input> YarnSpinnerParserContext<'input> for ValueStringContext<'input>{} +impl<'input> YarnSpinnerParserContext<'input> for Command_formatted_textContext<'input>{} -impl<'input,'a> Listenable + 'a> for ValueStringContext<'input>{ - fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.enter_every_rule(self)?; - listener.enter_valueString(self); - Ok(()) - } - fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_valueString(self); - listener.exit_every_rule(self)?; - Ok(()) - } +impl<'input,'a> Listenable + 'a> for Command_formatted_textContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_command_formatted_text(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_command_formatted_text(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input,'a> Visitable + 'a> for ValueStringContext<'input>{ +impl<'input,'a> Visitable + 'a> for Command_formatted_textContext<'input>{ fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_valueString(self); + visitor.visit_command_formatted_text(self); } } -impl<'input> CustomRuleContext<'input> for ValueStringContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for Command_formatted_textContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_value } - //fn type_rule_index() -> usize where Self: Sized { RULE_value } + fn get_rule_index(&self) -> usize { RULE_command_formatted_text } + //fn type_rule_index() -> usize where Self: Sized { RULE_command_formatted_text } } +antlr4rust::tid!{Command_formatted_textContextExt<'a>} -impl<'input> Borrow> for ValueStringContext<'input>{ - fn borrow(&self) -> &ValueContextExt<'input> { &self.base } +impl<'input> Command_formatted_textContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { + Rc::new( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Command_formatted_textContextExt{ + + ph:PhantomData + }), + ) + } } -impl<'input> BorrowMut> for ValueStringContext<'input>{ - fn borrow_mut(&mut self) -> &mut ValueContextExt<'input> { &mut self.base } + +pub trait Command_formatted_textContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ + +/// Retrieves all `TerminalNode`s corresponding to token COMMAND_TEXT in current rule +fn COMMAND_TEXT_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +/// Retrieves 'i's TerminalNode corresponding to token COMMAND_TEXT, starting from 0. +/// Returns `None` if number of children corresponding to token COMMAND_TEXT is less or equal than `i`. +fn COMMAND_TEXT(&self, i: usize) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_TEXT, i) +} +/// Retrieves all `TerminalNode`s corresponding to token COMMAND_EXPRESSION_START in current rule +fn COMMAND_EXPRESSION_START_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +/// Retrieves 'i's TerminalNode corresponding to token COMMAND_EXPRESSION_START, starting from 0. +/// Returns `None` if number of children corresponding to token COMMAND_EXPRESSION_START is less or equal than `i`. +fn COMMAND_EXPRESSION_START(&self, i: usize) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_EXPRESSION_START, i) +} +fn expression_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +fn expression(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) +} +/// Retrieves all `TerminalNode`s corresponding to token EXPRESSION_END in current rule +fn EXPRESSION_END_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +/// Retrieves 'i's TerminalNode corresponding to token EXPRESSION_END, starting from 0. +/// Returns `None` if number of children corresponding to token EXPRESSION_END is less or equal than `i`. +fn EXPRESSION_END(&self, i: usize) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_EXPRESSION_END, i) } -impl<'input> ValueContextAttrs<'input> for ValueStringContext<'input> {} - -impl<'input> ValueStringContextExt<'input>{ - fn new(ctx: &dyn ValueContextAttrs<'input>) -> Rc> { - Rc::new( - ValueContextAll::ValueStringContext( - BaseParserRuleContext::copy_from(ctx,ValueStringContextExt{ - base: ctx.borrow().clone(), - ph:PhantomData - }) - ) - ) - } } +impl<'input> Command_formatted_textContextAttrs<'input> for Command_formatted_textContext<'input>{} + impl<'input, I> YarnSpinnerParser<'input, I> where I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, { - pub fn value(&mut self,) - -> Result>,ANTLRError> { + pub fn command_formatted_text(&mut self,) + -> Result>,ANTLRError> { let mut recog = self; let _parentctx = recog.ctx.take(); - let mut _localctx = ValueContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog.base.enter_rule(_localctx.clone(), 22, RULE_value); - let mut _localctx: Rc = _localctx; + let mut _localctx = Command_formatted_textContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 50, RULE_command_formatted_text); + let mut _localctx: Rc = _localctx; + let mut _la: i32 = -1; let result: Result<(), ANTLRError> = (|| { - recog.base.set_state(176); + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(331); recog.err_handler.sync(&mut recog.base)?; - match recog.base.input.la(1) { - YarnSpinnerParser_NUMBER - => { - let tmp = ValueNumberContextExt::new(&**_localctx); - recog.base.enter_outer_alt(Some(tmp.clone()), 1)?; - _localctx = tmp; - { - recog.base.set_state(169); - recog.base.match_token(YarnSpinnerParser_NUMBER,&mut recog.err_handler)?; - - } - } - - YarnSpinnerParser_KEYWORD_TRUE - => { - let tmp = ValueTrueContextExt::new(&**_localctx); - recog.base.enter_outer_alt(Some(tmp.clone()), 2)?; - _localctx = tmp; - { - recog.base.set_state(170); - recog.base.match_token(YarnSpinnerParser_KEYWORD_TRUE,&mut recog.err_handler)?; - - } - } - - YarnSpinnerParser_KEYWORD_FALSE - => { - let tmp = ValueFalseContextExt::new(&**_localctx); - recog.base.enter_outer_alt(Some(tmp.clone()), 3)?; - _localctx = tmp; - { - recog.base.set_state(171); - recog.base.match_token(YarnSpinnerParser_KEYWORD_FALSE,&mut recog.err_handler)?; + _la = recog.base.input.la(1); + loop { + { + recog.base.set_state(331); + recog.err_handler.sync(&mut recog.base)?; + match recog.base.input.la(1) { + YarnSpinnerParser_COMMAND_TEXT + => { + { + recog.base.set_state(326); + recog.base.match_token(YarnSpinnerParser_COMMAND_TEXT,&mut recog.err_handler)?; + } } - } - YarnSpinnerParser_VAR_ID - => { - let tmp = ValueVarContextExt::new(&**_localctx); - recog.base.enter_outer_alt(Some(tmp.clone()), 4)?; - _localctx = tmp; - { - /*InvokeRule variable*/ - recog.base.set_state(172); - recog.variable()?; + YarnSpinnerParser_COMMAND_EXPRESSION_START + => { + { + recog.base.set_state(327); + recog.base.match_token(YarnSpinnerParser_COMMAND_EXPRESSION_START,&mut recog.err_handler)?; - } - } + /*InvokeRule expression*/ + recog.base.set_state(328); + recog.expression_rec(0)?; - YarnSpinnerParser_STRING - => { - let tmp = ValueStringContextExt::new(&**_localctx); - recog.base.enter_outer_alt(Some(tmp.clone()), 5)?; - _localctx = tmp; - { - recog.base.set_state(173); - recog.base.match_token(YarnSpinnerParser_STRING,&mut recog.err_handler)?; + recog.base.set_state(329); + recog.base.match_token(YarnSpinnerParser_EXPRESSION_END,&mut recog.err_handler)?; + } } - } - - YarnSpinnerParser_KEYWORD_NULL - => { - let tmp = ValueNullContextExt::new(&**_localctx); - recog.base.enter_outer_alt(Some(tmp.clone()), 6)?; - _localctx = tmp; - { - recog.base.set_state(174); - recog.base.match_token(YarnSpinnerParser_KEYWORD_NULL,&mut recog.err_handler)?; - } + _ => Err(ANTLRError::NoAltError(NoViableAltError::new(&mut recog.base)))? } - - YarnSpinnerParser_FUNC_ID - => { - let tmp = ValueFuncContextExt::new(&**_localctx); - recog.base.enter_outer_alt(Some(tmp.clone()), 7)?; - _localctx = tmp; - { - /*InvokeRule function_call*/ - recog.base.set_state(175); - recog.function_call()?; - - } } - - _ => Err(ANTLRError::NoAltError(NoViableAltError::new(&mut recog.base)))? + recog.base.set_state(333); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + if !(_la==YarnSpinnerParser_COMMAND_EXPRESSION_START || _la==YarnSpinnerParser_COMMAND_TEXT) {break} + } } Ok(()) })(); @@ -3656,50 +6035,50 @@ where Ok(_localctx) } } -//------------------- variable ---------------- -pub type VariableContextAll<'input> = VariableContext<'input>; +//------------------- shortcut_option_statement ---------------- +pub type Shortcut_option_statementContextAll<'input> = Shortcut_option_statementContext<'input>; -pub type VariableContext<'input> = BaseParserRuleContext<'input,VariableContextExt<'input>>; +pub type Shortcut_option_statementContext<'input> = BaseParserRuleContext<'input,Shortcut_option_statementContextExt<'input>>; #[derive(Clone)] -pub struct VariableContextExt<'input>{ +pub struct Shortcut_option_statementContextExt<'input>{ ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for VariableContext<'input>{} +impl<'input> YarnSpinnerParserContext<'input> for Shortcut_option_statementContext<'input>{} -impl<'input,'a> Listenable + 'a> for VariableContext<'input>{ +impl<'input,'a> Listenable + 'a> for Shortcut_option_statementContext<'input>{ fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { listener.enter_every_rule(self)?; - listener.enter_variable(self); + listener.enter_shortcut_option_statement(self); Ok(()) } fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_variable(self); + listener.exit_shortcut_option_statement(self); listener.exit_every_rule(self)?; Ok(()) } } -impl<'input,'a> Visitable + 'a> for VariableContext<'input>{ +impl<'input,'a> Visitable + 'a> for Shortcut_option_statementContext<'input>{ fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_variable(self); + visitor.visit_shortcut_option_statement(self); } } -impl<'input> CustomRuleContext<'input> for VariableContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for Shortcut_option_statementContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_variable } - //fn type_rule_index() -> usize where Self: Sized { RULE_variable } + fn get_rule_index(&self) -> usize { RULE_shortcut_option_statement } + //fn type_rule_index() -> usize where Self: Sized { RULE_shortcut_option_statement } } -antlr4rust::tid!{VariableContextExt<'a>} +antlr4rust::tid!{Shortcut_option_statementContextExt<'a>} -impl<'input> VariableContextExt<'input>{ - fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { +impl<'input> Shortcut_option_statementContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { Rc::new( - BaseParserRuleContext::new_parser_ctx(parent, invoking_state,VariableContextExt{ + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Shortcut_option_statementContextExt{ ph:PhantomData }), @@ -3707,37 +6086,77 @@ impl<'input> VariableContextExt<'input>{ } } -pub trait VariableContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ +pub trait Shortcut_option_statementContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ -/// Retrieves first TerminalNode corresponding to token VAR_ID -/// Returns `None` if there is no child corresponding to token VAR_ID -fn VAR_ID(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_VAR_ID, 0) +fn shortcut_option_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +fn shortcut_option(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) +} +/// Retrieves first TerminalNode corresponding to token BLANK_LINE_FOLLOWING_OPTION +/// Returns `None` if there is no child corresponding to token BLANK_LINE_FOLLOWING_OPTION +fn BLANK_LINE_FOLLOWING_OPTION(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_BLANK_LINE_FOLLOWING_OPTION, 0) } } -impl<'input> VariableContextAttrs<'input> for VariableContext<'input>{} +impl<'input> Shortcut_option_statementContextAttrs<'input> for Shortcut_option_statementContext<'input>{} impl<'input, I> YarnSpinnerParser<'input, I> where I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, { - pub fn variable(&mut self,) - -> Result>,ANTLRError> { + pub fn shortcut_option_statement(&mut self,) + -> Result>,ANTLRError> { let mut recog = self; let _parentctx = recog.ctx.take(); - let mut _localctx = VariableContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog.base.enter_rule(_localctx.clone(), 24, RULE_variable); - let mut _localctx: Rc = _localctx; + let mut _localctx = Shortcut_option_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 52, RULE_shortcut_option_statement); + let mut _localctx: Rc = _localctx; + let mut _la: i32 = -1; let result: Result<(), ANTLRError> = (|| { + let mut _alt: i32; //recog.base.enter_outer_alt(_localctx.clone(), 1)?; recog.base.enter_outer_alt(None, 1)?; { - recog.base.set_state(178); - recog.base.match_token(YarnSpinnerParser_VAR_ID,&mut recog.err_handler)?; + recog.base.set_state(338); + recog.err_handler.sync(&mut recog.base)?; + _alt = recog.interpreter.adaptive_predict(32,&mut recog.base)?; + while { _alt!=2 && _alt!=INVALID_ALT } { + if _alt==1 { + { + { + /*InvokeRule shortcut_option*/ + recog.base.set_state(335); + recog.shortcut_option()?; + + } + } + } + recog.base.set_state(340); + recog.err_handler.sync(&mut recog.base)?; + _alt = recog.interpreter.adaptive_predict(32,&mut recog.base)?; + } + { + /*InvokeRule shortcut_option*/ + recog.base.set_state(341); + recog.shortcut_option()?; + + recog.base.set_state(343); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + if _la==YarnSpinnerParser_BLANK_LINE_FOLLOWING_OPTION { + { + recog.base.set_state(342); + recog.base.match_token(YarnSpinnerParser_BLANK_LINE_FOLLOWING_OPTION,&mut recog.err_handler)?; + } + } + + } } Ok(()) })(); @@ -3755,50 +6174,50 @@ where Ok(_localctx) } } -//------------------- function_call ---------------- -pub type Function_callContextAll<'input> = Function_callContext<'input>; +//------------------- shortcut_option ---------------- +pub type Shortcut_optionContextAll<'input> = Shortcut_optionContext<'input>; -pub type Function_callContext<'input> = BaseParserRuleContext<'input,Function_callContextExt<'input>>; +pub type Shortcut_optionContext<'input> = BaseParserRuleContext<'input,Shortcut_optionContextExt<'input>>; #[derive(Clone)] -pub struct Function_callContextExt<'input>{ +pub struct Shortcut_optionContextExt<'input>{ ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for Function_callContext<'input>{} +impl<'input> YarnSpinnerParserContext<'input> for Shortcut_optionContext<'input>{} -impl<'input,'a> Listenable + 'a> for Function_callContext<'input>{ +impl<'input,'a> Listenable + 'a> for Shortcut_optionContext<'input>{ fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { listener.enter_every_rule(self)?; - listener.enter_function_call(self); + listener.enter_shortcut_option(self); Ok(()) } fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_function_call(self); + listener.exit_shortcut_option(self); listener.exit_every_rule(self)?; Ok(()) } } -impl<'input,'a> Visitable + 'a> for Function_callContext<'input>{ +impl<'input,'a> Visitable + 'a> for Shortcut_optionContext<'input>{ fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_function_call(self); + visitor.visit_shortcut_option(self); } } -impl<'input> CustomRuleContext<'input> for Function_callContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for Shortcut_optionContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_function_call } - //fn type_rule_index() -> usize where Self: Sized { RULE_function_call } + fn get_rule_index(&self) -> usize { RULE_shortcut_option } + //fn type_rule_index() -> usize where Self: Sized { RULE_shortcut_option } } -antlr4rust::tid!{Function_callContextExt<'a>} +antlr4rust::tid!{Shortcut_optionContextExt<'a>} -impl<'input> Function_callContextExt<'input>{ - fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { +impl<'input> Shortcut_optionContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { Rc::new( - BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Function_callContextExt{ + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Shortcut_optionContextExt{ ph:PhantomData }), @@ -3806,100 +6225,93 @@ impl<'input> Function_callContextExt<'input>{ } } -pub trait Function_callContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ +pub trait Shortcut_optionContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ -/// Retrieves first TerminalNode corresponding to token FUNC_ID -/// Returns `None` if there is no child corresponding to token FUNC_ID -fn FUNC_ID(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_FUNC_ID, 0) -} -/// Retrieves first TerminalNode corresponding to token LPAREN -/// Returns `None` if there is no child corresponding to token LPAREN -fn LPAREN(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_LPAREN, 0) -} -/// Retrieves first TerminalNode corresponding to token RPAREN -/// Returns `None` if there is no child corresponding to token RPAREN -fn RPAREN(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_RPAREN, 0) +/// Retrieves first TerminalNode corresponding to token SHORTCUT_ARROW +/// Returns `None` if there is no child corresponding to token SHORTCUT_ARROW +fn SHORTCUT_ARROW(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_SHORTCUT_ARROW, 0) } -fn expression_all(&self) -> Vec>> where Self:Sized{ - self.children_of_type() +fn line_statement(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) } -fn expression(&self, i: usize) -> Option>> where Self:Sized{ - self.child_of_type(i) +/// Retrieves first TerminalNode corresponding to token INDENT +/// Returns `None` if there is no child corresponding to token INDENT +fn INDENT(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_INDENT, 0) } -/// Retrieves all `TerminalNode`s corresponding to token COMMA in current rule -fn COMMA_all(&self) -> Vec>> where Self:Sized{ +/// Retrieves first TerminalNode corresponding to token DEDENT +/// Returns `None` if there is no child corresponding to token DEDENT +fn DEDENT(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_DEDENT, 0) +} +fn statement_all(&self) -> Vec>> where Self:Sized{ self.children_of_type() } -/// Retrieves 'i's TerminalNode corresponding to token COMMA, starting from 0. -/// Returns `None` if number of children corresponding to token COMMA is less or equal than `i`. -fn COMMA(&self, i: usize) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_COMMA, i) +fn statement(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) } } -impl<'input> Function_callContextAttrs<'input> for Function_callContext<'input>{} +impl<'input> Shortcut_optionContextAttrs<'input> for Shortcut_optionContext<'input>{} impl<'input, I> YarnSpinnerParser<'input, I> where I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, { - pub fn function_call(&mut self,) - -> Result>,ANTLRError> { + pub fn shortcut_option(&mut self,) + -> Result>,ANTLRError> { let mut recog = self; let _parentctx = recog.ctx.take(); - let mut _localctx = Function_callContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog.base.enter_rule(_localctx.clone(), 26, RULE_function_call); - let mut _localctx: Rc = _localctx; + let mut _localctx = Shortcut_optionContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 54, RULE_shortcut_option); + let mut _localctx: Rc = _localctx; let mut _la: i32 = -1; let result: Result<(), ANTLRError> = (|| { //recog.base.enter_outer_alt(_localctx.clone(), 1)?; recog.base.enter_outer_alt(None, 1)?; { - recog.base.set_state(180); - recog.base.match_token(YarnSpinnerParser_FUNC_ID,&mut recog.err_handler)?; + recog.base.set_state(345); + recog.base.match_token(YarnSpinnerParser_SHORTCUT_ARROW,&mut recog.err_handler)?; - recog.base.set_state(181); - recog.base.match_token(YarnSpinnerParser_LPAREN,&mut recog.err_handler)?; + /*InvokeRule line_statement*/ + recog.base.set_state(346); + recog.line_statement()?; - recog.base.set_state(183); + recog.base.set_state(355); recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - if (((_la) & !0x3f) == 0 && ((1usize << _la) & 1879048192) != 0) || ((((_la - 41)) & !0x3f) == 0 && ((1usize << (_la - 41)) & 1411201) != 0) { - { - /*InvokeRule expression*/ - recog.base.set_state(182); - recog.expression_rec(0)?; - - } - } + match recog.interpreter.adaptive_predict(35,&mut recog.base)? { + x if x == 1=>{ + { + recog.base.set_state(347); + recog.base.match_token(YarnSpinnerParser_INDENT,&mut recog.err_handler)?; - recog.base.set_state(189); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - while _la==YarnSpinnerParser_COMMA { - { - { - recog.base.set_state(185); - recog.base.match_token(YarnSpinnerParser_COMMA,&mut recog.err_handler)?; + recog.base.set_state(351); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + while (((_la) & !0x3f) == 0 && ((1usize << _la) & 18743298) != 0) { + { + { + /*InvokeRule statement*/ + recog.base.set_state(348); + recog.statement()?; - /*InvokeRule expression*/ - recog.base.set_state(186); - recog.expression_rec(0)?; + } + } + recog.base.set_state(353); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + } + recog.base.set_state(354); + recog.base.match_token(YarnSpinnerParser_DEDENT,&mut recog.err_handler)?; + } } - } - recog.base.set_state(191); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - } - recog.base.set_state(192); - recog.base.match_token(YarnSpinnerParser_RPAREN,&mut recog.err_handler)?; + _ => {} + } } Ok(()) })(); @@ -3917,50 +6329,50 @@ where Ok(_localctx) } } -//------------------- if_statement ---------------- -pub type If_statementContextAll<'input> = If_statementContext<'input>; +//------------------- line_group_statement ---------------- +pub type Line_group_statementContextAll<'input> = Line_group_statementContext<'input>; -pub type If_statementContext<'input> = BaseParserRuleContext<'input,If_statementContextExt<'input>>; +pub type Line_group_statementContext<'input> = BaseParserRuleContext<'input,Line_group_statementContextExt<'input>>; #[derive(Clone)] -pub struct If_statementContextExt<'input>{ +pub struct Line_group_statementContextExt<'input>{ ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for If_statementContext<'input>{} +impl<'input> YarnSpinnerParserContext<'input> for Line_group_statementContext<'input>{} -impl<'input,'a> Listenable + 'a> for If_statementContext<'input>{ +impl<'input,'a> Listenable + 'a> for Line_group_statementContext<'input>{ fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { listener.enter_every_rule(self)?; - listener.enter_if_statement(self); + listener.enter_line_group_statement(self); Ok(()) } fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_if_statement(self); + listener.exit_line_group_statement(self); listener.exit_every_rule(self)?; Ok(()) } } -impl<'input,'a> Visitable + 'a> for If_statementContext<'input>{ +impl<'input,'a> Visitable + 'a> for Line_group_statementContext<'input>{ fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_if_statement(self); + visitor.visit_line_group_statement(self); } } -impl<'input> CustomRuleContext<'input> for If_statementContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for Line_group_statementContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_if_statement } - //fn type_rule_index() -> usize where Self: Sized { RULE_if_statement } + fn get_rule_index(&self) -> usize { RULE_line_group_statement } + //fn type_rule_index() -> usize where Self: Sized { RULE_line_group_statement } } -antlr4rust::tid!{If_statementContextExt<'a>} +antlr4rust::tid!{Line_group_statementContextExt<'a>} -impl<'input> If_statementContextExt<'input>{ - fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { +impl<'input> Line_group_statementContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { Rc::new( - BaseParserRuleContext::new_parser_ctx(parent, invoking_state,If_statementContextExt{ + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Line_group_statementContextExt{ ph:PhantomData }), @@ -3968,102 +6380,77 @@ impl<'input> If_statementContextExt<'input>{ } } -pub trait If_statementContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ +pub trait Line_group_statementContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ -fn if_clause(&self) -> Option>> where Self:Sized{ - self.child_of_type(0) -} -/// Retrieves first TerminalNode corresponding to token COMMAND_START -/// Returns `None` if there is no child corresponding to token COMMAND_START -fn COMMAND_START(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_COMMAND_START, 0) -} -/// Retrieves first TerminalNode corresponding to token COMMAND_ENDIF -/// Returns `None` if there is no child corresponding to token COMMAND_ENDIF -fn COMMAND_ENDIF(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_COMMAND_ENDIF, 0) -} -/// Retrieves first TerminalNode corresponding to token COMMAND_END -/// Returns `None` if there is no child corresponding to token COMMAND_END -fn COMMAND_END(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_COMMAND_END, 0) -} -fn else_if_clause_all(&self) -> Vec>> where Self:Sized{ +fn line_group_item_all(&self) -> Vec>> where Self:Sized{ self.children_of_type() } -fn else_if_clause(&self, i: usize) -> Option>> where Self:Sized{ +fn line_group_item(&self, i: usize) -> Option>> where Self:Sized{ self.child_of_type(i) } -fn else_clause(&self) -> Option>> where Self:Sized{ - self.child_of_type(0) +/// Retrieves first TerminalNode corresponding to token BLANK_LINE_FOLLOWING_OPTION +/// Returns `None` if there is no child corresponding to token BLANK_LINE_FOLLOWING_OPTION +fn BLANK_LINE_FOLLOWING_OPTION(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_BLANK_LINE_FOLLOWING_OPTION, 0) } } -impl<'input> If_statementContextAttrs<'input> for If_statementContext<'input>{} +impl<'input> Line_group_statementContextAttrs<'input> for Line_group_statementContext<'input>{} impl<'input, I> YarnSpinnerParser<'input, I> where I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, { - pub fn if_statement(&mut self,) - -> Result>,ANTLRError> { + pub fn line_group_statement(&mut self,) + -> Result>,ANTLRError> { let mut recog = self; let _parentctx = recog.ctx.take(); - let mut _localctx = If_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog.base.enter_rule(_localctx.clone(), 28, RULE_if_statement); - let mut _localctx: Rc = _localctx; + let mut _localctx = Line_group_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 56, RULE_line_group_statement); + let mut _localctx: Rc = _localctx; + let mut _la: i32 = -1; let result: Result<(), ANTLRError> = (|| { let mut _alt: i32; //recog.base.enter_outer_alt(_localctx.clone(), 1)?; recog.base.enter_outer_alt(None, 1)?; { - /*InvokeRule if_clause*/ - recog.base.set_state(194); - recog.if_clause()?; - - recog.base.set_state(198); + recog.base.set_state(360); recog.err_handler.sync(&mut recog.base)?; - _alt = recog.interpreter.adaptive_predict(18,&mut recog.base)?; + _alt = recog.interpreter.adaptive_predict(36,&mut recog.base)?; while { _alt!=2 && _alt!=INVALID_ALT } { if _alt==1 { { { - /*InvokeRule else_if_clause*/ - recog.base.set_state(195); - recog.else_if_clause()?; + /*InvokeRule line_group_item*/ + recog.base.set_state(357); + recog.line_group_item()?; } } } - recog.base.set_state(200); + recog.base.set_state(362); recog.err_handler.sync(&mut recog.base)?; - _alt = recog.interpreter.adaptive_predict(18,&mut recog.base)?; + _alt = recog.interpreter.adaptive_predict(36,&mut recog.base)?; } - recog.base.set_state(202); + { + /*InvokeRule line_group_item*/ + recog.base.set_state(363); + recog.line_group_item()?; + + recog.base.set_state(365); recog.err_handler.sync(&mut recog.base)?; - match recog.interpreter.adaptive_predict(19,&mut recog.base)? { - x if x == 1=>{ - { - /*InvokeRule else_clause*/ - recog.base.set_state(201); - recog.else_clause()?; + _la = recog.base.input.la(1); + if _la==YarnSpinnerParser_BLANK_LINE_FOLLOWING_OPTION { + { + recog.base.set_state(364); + recog.base.match_token(YarnSpinnerParser_BLANK_LINE_FOLLOWING_OPTION,&mut recog.err_handler)?; - } } - - _ => {} } - recog.base.set_state(204); - recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; - - recog.base.set_state(205); - recog.base.match_token(YarnSpinnerParser_COMMAND_ENDIF,&mut recog.err_handler)?; - - recog.base.set_state(206); - recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; + } } Ok(()) })(); @@ -4081,50 +6468,50 @@ where Ok(_localctx) } } -//------------------- if_clause ---------------- -pub type If_clauseContextAll<'input> = If_clauseContext<'input>; +//------------------- line_group_item ---------------- +pub type Line_group_itemContextAll<'input> = Line_group_itemContext<'input>; -pub type If_clauseContext<'input> = BaseParserRuleContext<'input,If_clauseContextExt<'input>>; +pub type Line_group_itemContext<'input> = BaseParserRuleContext<'input,Line_group_itemContextExt<'input>>; #[derive(Clone)] -pub struct If_clauseContextExt<'input>{ +pub struct Line_group_itemContextExt<'input>{ ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for If_clauseContext<'input>{} +impl<'input> YarnSpinnerParserContext<'input> for Line_group_itemContext<'input>{} -impl<'input,'a> Listenable + 'a> for If_clauseContext<'input>{ +impl<'input,'a> Listenable + 'a> for Line_group_itemContext<'input>{ fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { listener.enter_every_rule(self)?; - listener.enter_if_clause(self); + listener.enter_line_group_item(self); Ok(()) } fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_if_clause(self); + listener.exit_line_group_item(self); listener.exit_every_rule(self)?; Ok(()) } } -impl<'input,'a> Visitable + 'a> for If_clauseContext<'input>{ +impl<'input,'a> Visitable + 'a> for Line_group_itemContext<'input>{ fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_if_clause(self); + visitor.visit_line_group_item(self); } } -impl<'input> CustomRuleContext<'input> for If_clauseContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for Line_group_itemContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_if_clause } - //fn type_rule_index() -> usize where Self: Sized { RULE_if_clause } + fn get_rule_index(&self) -> usize { RULE_line_group_item } + //fn type_rule_index() -> usize where Self: Sized { RULE_line_group_item } } -antlr4rust::tid!{If_clauseContextExt<'a>} +antlr4rust::tid!{Line_group_itemContextExt<'a>} -impl<'input> If_clauseContextExt<'input>{ - fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { +impl<'input> Line_group_itemContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { Rc::new( - BaseParserRuleContext::new_parser_ctx(parent, invoking_state,If_clauseContextExt{ + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Line_group_itemContextExt{ ph:PhantomData }), @@ -4132,25 +6519,25 @@ impl<'input> If_clauseContextExt<'input>{ } } -pub trait If_clauseContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ +pub trait Line_group_itemContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ -/// Retrieves first TerminalNode corresponding to token COMMAND_START -/// Returns `None` if there is no child corresponding to token COMMAND_START -fn COMMAND_START(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_COMMAND_START, 0) -} -/// Retrieves first TerminalNode corresponding to token COMMAND_IF -/// Returns `None` if there is no child corresponding to token COMMAND_IF -fn COMMAND_IF(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_COMMAND_IF, 0) +/// Retrieves first TerminalNode corresponding to token LINE_GROUP_ARROW +/// Returns `None` if there is no child corresponding to token LINE_GROUP_ARROW +fn LINE_GROUP_ARROW(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_LINE_GROUP_ARROW, 0) } -fn expression(&self) -> Option>> where Self:Sized{ +fn line_statement(&self) -> Option>> where Self:Sized{ self.child_of_type(0) } -/// Retrieves first TerminalNode corresponding to token COMMAND_END -/// Returns `None` if there is no child corresponding to token COMMAND_END -fn COMMAND_END(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_COMMAND_END, 0) +/// Retrieves first TerminalNode corresponding to token INDENT +/// Returns `None` if there is no child corresponding to token INDENT +fn INDENT(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_INDENT, 0) +} +/// Retrieves first TerminalNode corresponding to token DEDENT +/// Returns `None` if there is no child corresponding to token DEDENT +fn DEDENT(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_DEDENT, 0) } fn statement_all(&self) -> Vec>> where Self:Sized{ self.children_of_type() @@ -4161,55 +6548,63 @@ fn statement(&self, i: usize) -> Option>> where S } -impl<'input> If_clauseContextAttrs<'input> for If_clauseContext<'input>{} +impl<'input> Line_group_itemContextAttrs<'input> for Line_group_itemContext<'input>{} impl<'input, I> YarnSpinnerParser<'input, I> where I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, { - pub fn if_clause(&mut self,) - -> Result>,ANTLRError> { + pub fn line_group_item(&mut self,) + -> Result>,ANTLRError> { let mut recog = self; let _parentctx = recog.ctx.take(); - let mut _localctx = If_clauseContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog.base.enter_rule(_localctx.clone(), 30, RULE_if_clause); - let mut _localctx: Rc = _localctx; + let mut _localctx = Line_group_itemContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 58, RULE_line_group_item); + let mut _localctx: Rc = _localctx; + let mut _la: i32 = -1; let result: Result<(), ANTLRError> = (|| { - let mut _alt: i32; //recog.base.enter_outer_alt(_localctx.clone(), 1)?; recog.base.enter_outer_alt(None, 1)?; { - recog.base.set_state(208); - recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; - - recog.base.set_state(209); - recog.base.match_token(YarnSpinnerParser_COMMAND_IF,&mut recog.err_handler)?; + recog.base.set_state(367); + recog.base.match_token(YarnSpinnerParser_LINE_GROUP_ARROW,&mut recog.err_handler)?; - /*InvokeRule expression*/ - recog.base.set_state(210); - recog.expression_rec(0)?; - - recog.base.set_state(211); - recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; + /*InvokeRule line_statement*/ + recog.base.set_state(368); + recog.line_statement()?; - recog.base.set_state(215); + recog.base.set_state(377); recog.err_handler.sync(&mut recog.base)?; - _alt = recog.interpreter.adaptive_predict(20,&mut recog.base)?; - while { _alt!=2 && _alt!=INVALID_ALT } { - if _alt==1 { - { + match recog.interpreter.adaptive_predict(39,&mut recog.base)? { + x if x == 1=>{ { - /*InvokeRule statement*/ - recog.base.set_state(212); - recog.statement()?; + recog.base.set_state(369); + recog.base.match_token(YarnSpinnerParser_INDENT,&mut recog.err_handler)?; + + recog.base.set_state(373); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + while (((_la) & !0x3f) == 0 && ((1usize << _la) & 18743298) != 0) { + { + { + /*InvokeRule statement*/ + recog.base.set_state(370); + recog.statement()?; + + } + } + recog.base.set_state(375); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + } + recog.base.set_state(376); + recog.base.match_token(YarnSpinnerParser_DEDENT,&mut recog.err_handler)?; } - } } - recog.base.set_state(217); - recog.err_handler.sync(&mut recog.base)?; - _alt = recog.interpreter.adaptive_predict(20,&mut recog.base)?; + + _ => {} } } Ok(()) @@ -4228,50 +6623,52 @@ where Ok(_localctx) } } -//------------------- else_if_clause ---------------- -pub type Else_if_clauseContextAll<'input> = Else_if_clauseContext<'input>; +//------------------- declare_statement ---------------- +pub type Declare_statementContextAll<'input> = Declare_statementContext<'input>; -pub type Else_if_clauseContext<'input> = BaseParserRuleContext<'input,Else_if_clauseContextExt<'input>>; +pub type Declare_statementContext<'input> = BaseParserRuleContext<'input,Declare_statementContextExt<'input>>; #[derive(Clone)] -pub struct Else_if_clauseContextExt<'input>{ +pub struct Declare_statementContextExt<'input>{ + pub type_: Option>, ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for Else_if_clauseContext<'input>{} +impl<'input> YarnSpinnerParserContext<'input> for Declare_statementContext<'input>{} -impl<'input,'a> Listenable + 'a> for Else_if_clauseContext<'input>{ +impl<'input,'a> Listenable + 'a> for Declare_statementContext<'input>{ fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { listener.enter_every_rule(self)?; - listener.enter_else_if_clause(self); + listener.enter_declare_statement(self); Ok(()) } fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_else_if_clause(self); + listener.exit_declare_statement(self); listener.exit_every_rule(self)?; Ok(()) } } -impl<'input,'a> Visitable + 'a> for Else_if_clauseContext<'input>{ +impl<'input,'a> Visitable + 'a> for Declare_statementContext<'input>{ fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_else_if_clause(self); + visitor.visit_declare_statement(self); } } -impl<'input> CustomRuleContext<'input> for Else_if_clauseContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for Declare_statementContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_else_if_clause } - //fn type_rule_index() -> usize where Self: Sized { RULE_else_if_clause } + fn get_rule_index(&self) -> usize { RULE_declare_statement } + //fn type_rule_index() -> usize where Self: Sized { RULE_declare_statement } } -antlr4rust::tid!{Else_if_clauseContextExt<'a>} +antlr4rust::tid!{Declare_statementContextExt<'a>} -impl<'input> Else_if_clauseContextExt<'input>{ - fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { +impl<'input> Declare_statementContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { Rc::new( - BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Else_if_clauseContextExt{ + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Declare_statementContextExt{ + type_: None, ph:PhantomData }), @@ -4279,17 +6676,25 @@ impl<'input> Else_if_clauseContextExt<'input>{ } } -pub trait Else_if_clauseContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ +pub trait Declare_statementContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ /// Retrieves first TerminalNode corresponding to token COMMAND_START /// Returns `None` if there is no child corresponding to token COMMAND_START fn COMMAND_START(&self) -> Option>> where Self:Sized{ self.get_token(YarnSpinnerParser_COMMAND_START, 0) } -/// Retrieves first TerminalNode corresponding to token COMMAND_ELSEIF -/// Returns `None` if there is no child corresponding to token COMMAND_ELSEIF -fn COMMAND_ELSEIF(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_COMMAND_ELSEIF, 0) +/// Retrieves first TerminalNode corresponding to token COMMAND_DECLARE +/// Returns `None` if there is no child corresponding to token COMMAND_DECLARE +fn COMMAND_DECLARE(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_DECLARE, 0) +} +fn variable(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +/// Retrieves first TerminalNode corresponding to token OPERATOR_ASSIGNMENT +/// Returns `None` if there is no child corresponding to token OPERATOR_ASSIGNMENT +fn OPERATOR_ASSIGNMENT(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_OPERATOR_ASSIGNMENT, 0) } fn expression(&self) -> Option>> where Self:Sized{ self.child_of_type(0) @@ -4299,65 +6704,74 @@ fn expression(&self) -> Option>> where Self:Size fn COMMAND_END(&self) -> Option>> where Self:Sized{ self.get_token(YarnSpinnerParser_COMMAND_END, 0) } -fn statement_all(&self) -> Vec>> where Self:Sized{ - self.children_of_type() +/// Retrieves first TerminalNode corresponding to token EXPRESSION_AS +/// Returns `None` if there is no child corresponding to token EXPRESSION_AS +fn EXPRESSION_AS(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_EXPRESSION_AS, 0) } -fn statement(&self, i: usize) -> Option>> where Self:Sized{ - self.child_of_type(i) +/// Retrieves first TerminalNode corresponding to token FUNC_ID +/// Returns `None` if there is no child corresponding to token FUNC_ID +fn FUNC_ID(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_FUNC_ID, 0) } } -impl<'input> Else_if_clauseContextAttrs<'input> for Else_if_clauseContext<'input>{} +impl<'input> Declare_statementContextAttrs<'input> for Declare_statementContext<'input>{} impl<'input, I> YarnSpinnerParser<'input, I> where I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, { - pub fn else_if_clause(&mut self,) - -> Result>,ANTLRError> { + pub fn declare_statement(&mut self,) + -> Result>,ANTLRError> { let mut recog = self; let _parentctx = recog.ctx.take(); - let mut _localctx = Else_if_clauseContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog.base.enter_rule(_localctx.clone(), 32, RULE_else_if_clause); - let mut _localctx: Rc = _localctx; + let mut _localctx = Declare_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 60, RULE_declare_statement); + let mut _localctx: Rc = _localctx; + let mut _la: i32 = -1; let result: Result<(), ANTLRError> = (|| { - let mut _alt: i32; //recog.base.enter_outer_alt(_localctx.clone(), 1)?; recog.base.enter_outer_alt(None, 1)?; { - recog.base.set_state(218); + recog.base.set_state(379); recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; - recog.base.set_state(219); - recog.base.match_token(YarnSpinnerParser_COMMAND_ELSEIF,&mut recog.err_handler)?; + recog.base.set_state(380); + recog.base.match_token(YarnSpinnerParser_COMMAND_DECLARE,&mut recog.err_handler)?; + + /*InvokeRule variable*/ + recog.base.set_state(381); + recog.variable()?; + + recog.base.set_state(382); + recog.base.match_token(YarnSpinnerParser_OPERATOR_ASSIGNMENT,&mut recog.err_handler)?; /*InvokeRule expression*/ - recog.base.set_state(220); + recog.base.set_state(383); recog.expression_rec(0)?; - recog.base.set_state(221); - recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; - - recog.base.set_state(225); + recog.base.set_state(386); recog.err_handler.sync(&mut recog.base)?; - _alt = recog.interpreter.adaptive_predict(21,&mut recog.base)?; - while { _alt!=2 && _alt!=INVALID_ALT } { - if _alt==1 { - { - { - /*InvokeRule statement*/ - recog.base.set_state(222); - recog.statement()?; + _la = recog.base.input.la(1); + if _la==YarnSpinnerParser_EXPRESSION_AS { + { + recog.base.set_state(384); + recog.base.match_token(YarnSpinnerParser_EXPRESSION_AS,&mut recog.err_handler)?; + + recog.base.set_state(385); + let tmp = recog.base.match_token(YarnSpinnerParser_FUNC_ID,&mut recog.err_handler)?; + cast_mut::<_,Declare_statementContext >(&mut _localctx).type_ = Some(tmp.clone()); + - } - } } - recog.base.set_state(227); - recog.err_handler.sync(&mut recog.base)?; - _alt = recog.interpreter.adaptive_predict(21,&mut recog.base)?; } + + recog.base.set_state(388); + recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; + } Ok(()) })(); @@ -4375,50 +6789,52 @@ where Ok(_localctx) } } -//------------------- else_clause ---------------- -pub type Else_clauseContextAll<'input> = Else_clauseContext<'input>; +//------------------- enum_statement ---------------- +pub type Enum_statementContextAll<'input> = Enum_statementContext<'input>; -pub type Else_clauseContext<'input> = BaseParserRuleContext<'input,Else_clauseContextExt<'input>>; +pub type Enum_statementContext<'input> = BaseParserRuleContext<'input,Enum_statementContextExt<'input>>; #[derive(Clone)] -pub struct Else_clauseContextExt<'input>{ +pub struct Enum_statementContextExt<'input>{ + pub name: Option>, ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for Else_clauseContext<'input>{} +impl<'input> YarnSpinnerParserContext<'input> for Enum_statementContext<'input>{} -impl<'input,'a> Listenable + 'a> for Else_clauseContext<'input>{ +impl<'input,'a> Listenable + 'a> for Enum_statementContext<'input>{ fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { listener.enter_every_rule(self)?; - listener.enter_else_clause(self); + listener.enter_enum_statement(self); Ok(()) } fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_else_clause(self); + listener.exit_enum_statement(self); listener.exit_every_rule(self)?; Ok(()) } } -impl<'input,'a> Visitable + 'a> for Else_clauseContext<'input>{ +impl<'input,'a> Visitable + 'a> for Enum_statementContext<'input>{ fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_else_clause(self); + visitor.visit_enum_statement(self); } } -impl<'input> CustomRuleContext<'input> for Else_clauseContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for Enum_statementContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_else_clause } - //fn type_rule_index() -> usize where Self: Sized { RULE_else_clause } + fn get_rule_index(&self) -> usize { RULE_enum_statement } + //fn type_rule_index() -> usize where Self: Sized { RULE_enum_statement } } -antlr4rust::tid!{Else_clauseContextExt<'a>} +antlr4rust::tid!{Enum_statementContextExt<'a>} -impl<'input> Else_clauseContextExt<'input>{ - fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { +impl<'input> Enum_statementContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { Rc::new( - BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Else_clauseContextExt{ + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Enum_statementContextExt{ + name: None, ph:PhantomData }), @@ -4426,78 +6842,114 @@ impl<'input> Else_clauseContextExt<'input>{ } } -pub trait Else_clauseContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ +pub trait Enum_statementContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ -/// Retrieves first TerminalNode corresponding to token COMMAND_START -/// Returns `None` if there is no child corresponding to token COMMAND_START -fn COMMAND_START(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_COMMAND_START, 0) +/// Retrieves all `TerminalNode`s corresponding to token COMMAND_START in current rule +fn COMMAND_START_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() } -/// Retrieves first TerminalNode corresponding to token COMMAND_ELSE -/// Returns `None` if there is no child corresponding to token COMMAND_ELSE -fn COMMAND_ELSE(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_COMMAND_ELSE, 0) +/// Retrieves 'i's TerminalNode corresponding to token COMMAND_START, starting from 0. +/// Returns `None` if number of children corresponding to token COMMAND_START is less or equal than `i`. +fn COMMAND_START(&self, i: usize) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_START, i) } -/// Retrieves first TerminalNode corresponding to token COMMAND_END -/// Returns `None` if there is no child corresponding to token COMMAND_END -fn COMMAND_END(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_COMMAND_END, 0) +/// Retrieves first TerminalNode corresponding to token COMMAND_ENUM +/// Returns `None` if there is no child corresponding to token COMMAND_ENUM +fn COMMAND_ENUM(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_ENUM, 0) } -fn statement_all(&self) -> Vec>> where Self:Sized{ +/// Retrieves all `TerminalNode`s corresponding to token COMMAND_END in current rule +fn COMMAND_END_all(&self) -> Vec>> where Self:Sized{ self.children_of_type() } -fn statement(&self, i: usize) -> Option>> where Self:Sized{ +/// Retrieves 'i's TerminalNode corresponding to token COMMAND_END, starting from 0. +/// Returns `None` if number of children corresponding to token COMMAND_END is less or equal than `i`. +fn COMMAND_END(&self, i: usize) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_END, i) +} +/// Retrieves first TerminalNode corresponding to token COMMAND_ENDENUM +/// Returns `None` if there is no child corresponding to token COMMAND_ENDENUM +fn COMMAND_ENDENUM(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_ENDENUM, 0) +} +/// Retrieves first TerminalNode corresponding to token ID +/// Returns `None` if there is no child corresponding to token ID +fn ID(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_ID, 0) +} +fn enum_case_statement_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +fn enum_case_statement(&self, i: usize) -> Option>> where Self:Sized{ self.child_of_type(i) } } -impl<'input> Else_clauseContextAttrs<'input> for Else_clauseContext<'input>{} +impl<'input> Enum_statementContextAttrs<'input> for Enum_statementContext<'input>{} impl<'input, I> YarnSpinnerParser<'input, I> where I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, { - pub fn else_clause(&mut self,) - -> Result>,ANTLRError> { + pub fn enum_statement(&mut self,) + -> Result>,ANTLRError> { let mut recog = self; let _parentctx = recog.ctx.take(); - let mut _localctx = Else_clauseContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog.base.enter_rule(_localctx.clone(), 34, RULE_else_clause); - let mut _localctx: Rc = _localctx; + let mut _localctx = Enum_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 62, RULE_enum_statement); + let mut _localctx: Rc = _localctx; let result: Result<(), ANTLRError> = (|| { let mut _alt: i32; //recog.base.enter_outer_alt(_localctx.clone(), 1)?; recog.base.enter_outer_alt(None, 1)?; { - recog.base.set_state(228); + recog.base.set_state(390); recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; - recog.base.set_state(229); - recog.base.match_token(YarnSpinnerParser_COMMAND_ELSE,&mut recog.err_handler)?; + recog.base.set_state(391); + recog.base.match_token(YarnSpinnerParser_COMMAND_ENUM,&mut recog.err_handler)?; + + recog.base.set_state(392); + let tmp = recog.base.match_token(YarnSpinnerParser_ID,&mut recog.err_handler)?; + cast_mut::<_,Enum_statementContext >(&mut _localctx).name = Some(tmp.clone()); + - recog.base.set_state(230); + recog.base.set_state(393); recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; - recog.base.set_state(234); + recog.base.set_state(395); recog.err_handler.sync(&mut recog.base)?; - _alt = recog.interpreter.adaptive_predict(22,&mut recog.base)?; - while { _alt!=2 && _alt!=INVALID_ALT } { - if _alt==1 { + _alt = 1; + loop { + match _alt { + x if x == 1=> { { - /*InvokeRule statement*/ - recog.base.set_state(231); - recog.statement()?; + /*InvokeRule enum_case_statement*/ + recog.base.set_state(394); + recog.enum_case_statement()?; } - } + } + + _ => Err(ANTLRError::NoAltError(NoViableAltError::new(&mut recog.base)))? } - recog.base.set_state(236); + recog.base.set_state(397); recog.err_handler.sync(&mut recog.base)?; - _alt = recog.interpreter.adaptive_predict(22,&mut recog.base)?; + _alt = recog.interpreter.adaptive_predict(41,&mut recog.base)?; + if _alt==2 || _alt==INVALID_ALT { break } } + recog.base.set_state(399); + recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; + + recog.base.set_state(400); + recog.base.match_token(YarnSpinnerParser_COMMAND_ENDENUM,&mut recog.err_handler)?; + + recog.base.set_state(401); + recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; + } Ok(()) })(); @@ -4515,52 +6967,54 @@ where Ok(_localctx) } } -//------------------- set_statement ---------------- -pub type Set_statementContextAll<'input> = Set_statementContext<'input>; +//------------------- enum_case_statement ---------------- +pub type Enum_case_statementContextAll<'input> = Enum_case_statementContext<'input>; -pub type Set_statementContext<'input> = BaseParserRuleContext<'input,Set_statementContextExt<'input>>; +pub type Enum_case_statementContext<'input> = BaseParserRuleContext<'input,Enum_case_statementContextExt<'input>>; #[derive(Clone)] -pub struct Set_statementContextExt<'input>{ - pub op: Option>, +pub struct Enum_case_statementContextExt<'input>{ + pub name: Option>, + pub rawValue: Option>>, ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for Set_statementContext<'input>{} +impl<'input> YarnSpinnerParserContext<'input> for Enum_case_statementContext<'input>{} -impl<'input,'a> Listenable + 'a> for Set_statementContext<'input>{ +impl<'input,'a> Listenable + 'a> for Enum_case_statementContext<'input>{ fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { listener.enter_every_rule(self)?; - listener.enter_set_statement(self); + listener.enter_enum_case_statement(self); Ok(()) } fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_set_statement(self); + listener.exit_enum_case_statement(self); listener.exit_every_rule(self)?; Ok(()) } } -impl<'input,'a> Visitable + 'a> for Set_statementContext<'input>{ +impl<'input,'a> Visitable + 'a> for Enum_case_statementContext<'input>{ fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_set_statement(self); + visitor.visit_enum_case_statement(self); } } -impl<'input> CustomRuleContext<'input> for Set_statementContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for Enum_case_statementContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_set_statement } - //fn type_rule_index() -> usize where Self: Sized { RULE_set_statement } + fn get_rule_index(&self) -> usize { RULE_enum_case_statement } + //fn type_rule_index() -> usize where Self: Sized { RULE_enum_case_statement } } -antlr4rust::tid!{Set_statementContextExt<'a>} +antlr4rust::tid!{Enum_case_statementContextExt<'a>} -impl<'input> Set_statementContextExt<'input>{ - fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { +impl<'input> Enum_case_statementContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { Rc::new( - BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Set_statementContextExt{ - op: None, + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Enum_case_statementContextExt{ + name: None, + rawValue: None, ph:PhantomData }), @@ -4568,113 +7022,121 @@ impl<'input> Set_statementContextExt<'input>{ } } -pub trait Set_statementContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ +pub trait Enum_case_statementContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ /// Retrieves first TerminalNode corresponding to token COMMAND_START /// Returns `None` if there is no child corresponding to token COMMAND_START fn COMMAND_START(&self) -> Option>> where Self:Sized{ self.get_token(YarnSpinnerParser_COMMAND_START, 0) } -/// Retrieves first TerminalNode corresponding to token COMMAND_SET -/// Returns `None` if there is no child corresponding to token COMMAND_SET -fn COMMAND_SET(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_COMMAND_SET, 0) -} -fn variable(&self) -> Option>> where Self:Sized{ - self.child_of_type(0) -} -fn expression(&self) -> Option>> where Self:Sized{ - self.child_of_type(0) +/// Retrieves first TerminalNode corresponding to token COMMAND_CASE +/// Returns `None` if there is no child corresponding to token COMMAND_CASE +fn COMMAND_CASE(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_CASE, 0) } /// Retrieves first TerminalNode corresponding to token COMMAND_END /// Returns `None` if there is no child corresponding to token COMMAND_END fn COMMAND_END(&self) -> Option>> where Self:Sized{ self.get_token(YarnSpinnerParser_COMMAND_END, 0) } +/// Retrieves first TerminalNode corresponding to token FUNC_ID +/// Returns `None` if there is no child corresponding to token FUNC_ID +fn FUNC_ID(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_FUNC_ID, 0) +} +/// Retrieves first TerminalNode corresponding to token INDENT +/// Returns `None` if there is no child corresponding to token INDENT +fn INDENT(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_INDENT, 0) +} /// Retrieves first TerminalNode corresponding to token OPERATOR_ASSIGNMENT /// Returns `None` if there is no child corresponding to token OPERATOR_ASSIGNMENT fn OPERATOR_ASSIGNMENT(&self) -> Option>> where Self:Sized{ self.get_token(YarnSpinnerParser_OPERATOR_ASSIGNMENT, 0) } -/// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_MULTIPLICATION_EQUALS -/// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_MULTIPLICATION_EQUALS -fn OPERATOR_MATHS_MULTIPLICATION_EQUALS(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_OPERATOR_MATHS_MULTIPLICATION_EQUALS, 0) -} -/// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_DIVISION_EQUALS -/// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_DIVISION_EQUALS -fn OPERATOR_MATHS_DIVISION_EQUALS(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_OPERATOR_MATHS_DIVISION_EQUALS, 0) -} -/// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_MODULUS_EQUALS -/// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_MODULUS_EQUALS -fn OPERATOR_MATHS_MODULUS_EQUALS(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_OPERATOR_MATHS_MODULUS_EQUALS, 0) -} -/// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_ADDITION_EQUALS -/// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_ADDITION_EQUALS -fn OPERATOR_MATHS_ADDITION_EQUALS(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_OPERATOR_MATHS_ADDITION_EQUALS, 0) +/// Retrieves first TerminalNode corresponding to token DEDENT +/// Returns `None` if there is no child corresponding to token DEDENT +fn DEDENT(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_DEDENT, 0) } -/// Retrieves first TerminalNode corresponding to token OPERATOR_MATHS_SUBTRACTION_EQUALS -/// Returns `None` if there is no child corresponding to token OPERATOR_MATHS_SUBTRACTION_EQUALS -fn OPERATOR_MATHS_SUBTRACTION_EQUALS(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_OPERATOR_MATHS_SUBTRACTION_EQUALS, 0) +fn value(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) } } -impl<'input> Set_statementContextAttrs<'input> for Set_statementContext<'input>{} +impl<'input> Enum_case_statementContextAttrs<'input> for Enum_case_statementContext<'input>{} impl<'input, I> YarnSpinnerParser<'input, I> where I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, { - pub fn set_statement(&mut self,) - -> Result>,ANTLRError> { + pub fn enum_case_statement(&mut self,) + -> Result>,ANTLRError> { let mut recog = self; let _parentctx = recog.ctx.take(); - let mut _localctx = Set_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog.base.enter_rule(_localctx.clone(), 36, RULE_set_statement); - let mut _localctx: Rc = _localctx; + let mut _localctx = Enum_case_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 64, RULE_enum_case_statement); + let mut _localctx: Rc = _localctx; let mut _la: i32 = -1; let result: Result<(), ANTLRError> = (|| { //recog.base.enter_outer_alt(_localctx.clone(), 1)?; recog.base.enter_outer_alt(None, 1)?; { - recog.base.set_state(237); + recog.base.set_state(404); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + if _la==YarnSpinnerParser_INDENT { + { + recog.base.set_state(403); + recog.base.match_token(YarnSpinnerParser_INDENT,&mut recog.err_handler)?; + + } + } + + recog.base.set_state(406); recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; - recog.base.set_state(238); - recog.base.match_token(YarnSpinnerParser_COMMAND_SET,&mut recog.err_handler)?; + recog.base.set_state(407); + recog.base.match_token(YarnSpinnerParser_COMMAND_CASE,&mut recog.err_handler)?; - /*InvokeRule variable*/ - recog.base.set_state(239); - recog.variable()?; + recog.base.set_state(408); + let tmp = recog.base.match_token(YarnSpinnerParser_FUNC_ID,&mut recog.err_handler)?; + cast_mut::<_,Enum_case_statementContext >(&mut _localctx).name = Some(tmp.clone()); + - recog.base.set_state(240); - cast_mut::<_,Set_statementContext >(&mut _localctx).op = recog.base.input.lt(1).cloned(); - + recog.base.set_state(411); + recog.err_handler.sync(&mut recog.base)?; _la = recog.base.input.la(1); - if { !(((((_la - 31)) & !0x3f) == 0 && ((1usize << (_la - 31)) & 63489) != 0)) } { - let tmp = recog.err_handler.recover_inline(&mut recog.base)?; - cast_mut::<_,Set_statementContext >(&mut _localctx).op = Some(tmp.clone()); - - - } - else { - if recog.base.input.la(1)==TOKEN_EOF { recog.base.matched_eof = true }; - recog.err_handler.report_match(&mut recog.base); - recog.base.consume(&mut recog.err_handler); + if _la==YarnSpinnerParser_OPERATOR_ASSIGNMENT { + { + recog.base.set_state(409); + recog.base.match_token(YarnSpinnerParser_OPERATOR_ASSIGNMENT,&mut recog.err_handler)?; + + /*InvokeRule value*/ + recog.base.set_state(410); + let tmp = recog.value()?; + cast_mut::<_,Enum_case_statementContext >(&mut _localctx).rawValue = Some(tmp.clone()); + + + } } - /*InvokeRule expression*/ - recog.base.set_state(241); - recog.expression_rec(0)?; - recog.base.set_state(242); + recog.base.set_state(413); recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; + recog.base.set_state(415); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + if _la==YarnSpinnerParser_DEDENT { + { + recog.base.set_state(414); + recog.base.match_token(YarnSpinnerParser_DEDENT,&mut recog.err_handler)?; + + } + } + } Ok(()) })(); @@ -4692,415 +7154,558 @@ where Ok(_localctx) } } -//------------------- call_statement ---------------- -pub type Call_statementContextAll<'input> = Call_statementContext<'input>; +//------------------- jump_statement ---------------- +#[derive(Debug)] +pub enum Jump_statementContextAll<'input>{ + JumpToNodeNameContext(JumpToNodeNameContext<'input>), + JumpToExpressionContext(JumpToExpressionContext<'input>), + DetourToNodeNameContext(DetourToNodeNameContext<'input>), + DetourToExpressionContext(DetourToExpressionContext<'input>), +Error(Jump_statementContext<'input>) +} +antlr4rust::tid!{Jump_statementContextAll<'a>} +impl<'input> antlr4rust::parser_rule_context::DerefSeal for Jump_statementContextAll<'input>{} + +impl<'input> YarnSpinnerParserContext<'input> for Jump_statementContextAll<'input>{} + +impl<'input> Deref for Jump_statementContextAll<'input>{ + type Target = dyn Jump_statementContextAttrs<'input> + 'input; + fn deref(&self) -> &Self::Target{ + use Jump_statementContextAll::*; + match self{ + JumpToNodeNameContext(inner) => inner, + JumpToExpressionContext(inner) => inner, + DetourToNodeNameContext(inner) => inner, + DetourToExpressionContext(inner) => inner, +Error(inner) => inner + } + } +} +impl<'input,'a> Visitable + 'a> for Jump_statementContextAll<'input>{ + fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { self.deref().accept(visitor) } +} +impl<'input,'a> Listenable + 'a> for Jump_statementContextAll<'input>{ + fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { self.deref().enter(listener) } + fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { self.deref().exit(listener) } +} -pub type Call_statementContext<'input> = BaseParserRuleContext<'input,Call_statementContextExt<'input>>; + + +pub type Jump_statementContext<'input> = BaseParserRuleContext<'input,Jump_statementContextExt<'input>>; #[derive(Clone)] -pub struct Call_statementContextExt<'input>{ +pub struct Jump_statementContextExt<'input>{ ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for Call_statementContext<'input>{} +impl<'input> YarnSpinnerParserContext<'input> for Jump_statementContext<'input>{} -impl<'input,'a> Listenable + 'a> for Call_statementContext<'input>{ - fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.enter_every_rule(self)?; - listener.enter_call_statement(self); - Ok(()) - } - fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_call_statement(self); - listener.exit_every_rule(self)?; - Ok(()) - } +impl<'input,'a> Listenable + 'a> for Jump_statementContext<'input>{ } -impl<'input,'a> Visitable + 'a> for Call_statementContext<'input>{ - fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_call_statement(self); - } +impl<'input,'a> Visitable + 'a> for Jump_statementContext<'input>{ } -impl<'input> CustomRuleContext<'input> for Call_statementContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for Jump_statementContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_call_statement } - //fn type_rule_index() -> usize where Self: Sized { RULE_call_statement } + fn get_rule_index(&self) -> usize { RULE_jump_statement } + //fn type_rule_index() -> usize where Self: Sized { RULE_jump_statement } } -antlr4rust::tid!{Call_statementContextExt<'a>} +antlr4rust::tid!{Jump_statementContextExt<'a>} -impl<'input> Call_statementContextExt<'input>{ - fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { +impl<'input> Jump_statementContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { Rc::new( - BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Call_statementContextExt{ + Jump_statementContextAll::Error( + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Jump_statementContextExt{ ph:PhantomData }), ) + ) } } -pub trait Call_statementContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ +pub trait Jump_statementContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ + -/// Retrieves first TerminalNode corresponding to token COMMAND_START -/// Returns `None` if there is no child corresponding to token COMMAND_START -fn COMMAND_START(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_COMMAND_START, 0) -} -/// Retrieves first TerminalNode corresponding to token COMMAND_CALL -/// Returns `None` if there is no child corresponding to token COMMAND_CALL -fn COMMAND_CALL(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_COMMAND_CALL, 0) -} -fn function_call(&self) -> Option>> where Self:Sized{ - self.child_of_type(0) } -/// Retrieves first TerminalNode corresponding to token COMMAND_END -/// Returns `None` if there is no child corresponding to token COMMAND_END -fn COMMAND_END(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_COMMAND_END, 0) + +impl<'input> Jump_statementContextAttrs<'input> for Jump_statementContext<'input>{} + +pub type JumpToNodeNameContext<'input> = BaseParserRuleContext<'input,JumpToNodeNameContextExt<'input>>; + +pub trait JumpToNodeNameContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + /// Retrieves first TerminalNode corresponding to token COMMAND_START + /// Returns `None` if there is no child corresponding to token COMMAND_START + fn COMMAND_START(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_START, 0) + } + /// Retrieves first TerminalNode corresponding to token COMMAND_JUMP + /// Returns `None` if there is no child corresponding to token COMMAND_JUMP + fn COMMAND_JUMP(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_JUMP, 0) + } + /// Retrieves first TerminalNode corresponding to token COMMAND_END + /// Returns `None` if there is no child corresponding to token COMMAND_END + fn COMMAND_END(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_END, 0) + } + /// Retrieves first TerminalNode corresponding to token ID + /// Returns `None` if there is no child corresponding to token ID + fn ID(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_ID, 0) + } } +impl<'input> JumpToNodeNameContextAttrs<'input> for JumpToNodeNameContext<'input>{} + +pub struct JumpToNodeNameContextExt<'input>{ + base:Jump_statementContextExt<'input>, + pub destination: Option>, + ph:PhantomData<&'input str> } -impl<'input> Call_statementContextAttrs<'input> for Call_statementContext<'input>{} +antlr4rust::tid!{JumpToNodeNameContextExt<'a>} -impl<'input, I> YarnSpinnerParser<'input, I> -where - I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, -{ - pub fn call_statement(&mut self,) - -> Result>,ANTLRError> { - let mut recog = self; - let _parentctx = recog.ctx.take(); - let mut _localctx = Call_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog.base.enter_rule(_localctx.clone(), 38, RULE_call_statement); - let mut _localctx: Rc = _localctx; - let result: Result<(), ANTLRError> = (|| { +impl<'input> YarnSpinnerParserContext<'input> for JumpToNodeNameContext<'input>{} - //recog.base.enter_outer_alt(_localctx.clone(), 1)?; - recog.base.enter_outer_alt(None, 1)?; - { - recog.base.set_state(244); - recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; +impl<'input,'a> Listenable + 'a> for JumpToNodeNameContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_jumpToNodeName(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_jumpToNodeName(self); + listener.exit_every_rule(self)?; + Ok(()) + } +} - recog.base.set_state(245); - recog.base.match_token(YarnSpinnerParser_COMMAND_CALL,&mut recog.err_handler)?; +impl<'input,'a> Visitable + 'a> for JumpToNodeNameContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_jumpToNodeName(self); + } +} - /*InvokeRule function_call*/ - recog.base.set_state(246); - recog.function_call()?; +impl<'input> CustomRuleContext<'input> for JumpToNodeNameContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_jump_statement } + //fn type_rule_index() -> usize where Self: Sized { RULE_jump_statement } +} - recog.base.set_state(247); - recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; +impl<'input> Borrow> for JumpToNodeNameContext<'input>{ + fn borrow(&self) -> &Jump_statementContextExt<'input> { &self.base } +} +impl<'input> BorrowMut> for JumpToNodeNameContext<'input>{ + fn borrow_mut(&mut self) -> &mut Jump_statementContextExt<'input> { &mut self.base } +} - } - Ok(()) - })(); - match result { - Ok(_)=>{}, - Err(e @ ANTLRError::FallThrough(_)) => return Err(e), - Err(ref re) => { - //_localctx.exception = re; - recog.err_handler.report_error(&mut recog.base, re); - recog.err_handler.recover(&mut recog.base, re)?; - } - } - recog.base.exit_rule()?; +impl<'input> Jump_statementContextAttrs<'input> for JumpToNodeNameContext<'input> {} - Ok(_localctx) +impl<'input> JumpToNodeNameContextExt<'input>{ + fn new(ctx: &dyn Jump_statementContextAttrs<'input>) -> Rc> { + Rc::new( + Jump_statementContextAll::JumpToNodeNameContext( + BaseParserRuleContext::copy_from(ctx,JumpToNodeNameContextExt{ + destination:None, + base: ctx.borrow().clone(), + ph:PhantomData + }) + ) + ) } } -//------------------- command_statement ---------------- -pub type Command_statementContextAll<'input> = Command_statementContext<'input>; +pub type JumpToExpressionContext<'input> = BaseParserRuleContext<'input,JumpToExpressionContextExt<'input>>; -pub type Command_statementContext<'input> = BaseParserRuleContext<'input,Command_statementContextExt<'input>>; +pub trait JumpToExpressionContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + /// Retrieves first TerminalNode corresponding to token COMMAND_START + /// Returns `None` if there is no child corresponding to token COMMAND_START + fn COMMAND_START(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_START, 0) + } + /// Retrieves first TerminalNode corresponding to token COMMAND_JUMP + /// Returns `None` if there is no child corresponding to token COMMAND_JUMP + fn COMMAND_JUMP(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_JUMP, 0) + } + /// Retrieves first TerminalNode corresponding to token EXPRESSION_START + /// Returns `None` if there is no child corresponding to token EXPRESSION_START + fn EXPRESSION_START(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_EXPRESSION_START, 0) + } + fn expression(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) + } + /// Retrieves first TerminalNode corresponding to token EXPRESSION_END + /// Returns `None` if there is no child corresponding to token EXPRESSION_END + fn EXPRESSION_END(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_EXPRESSION_END, 0) + } + /// Retrieves first TerminalNode corresponding to token COMMAND_END + /// Returns `None` if there is no child corresponding to token COMMAND_END + fn COMMAND_END(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_END, 0) + } +} -#[derive(Clone)] -pub struct Command_statementContextExt<'input>{ -ph:PhantomData<&'input str> +impl<'input> JumpToExpressionContextAttrs<'input> for JumpToExpressionContext<'input>{} + +pub struct JumpToExpressionContextExt<'input>{ + base:Jump_statementContextExt<'input>, + ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for Command_statementContext<'input>{} +antlr4rust::tid!{JumpToExpressionContextExt<'a>} -impl<'input,'a> Listenable + 'a> for Command_statementContext<'input>{ - fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.enter_every_rule(self)?; - listener.enter_command_statement(self); - Ok(()) - } - fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_command_statement(self); - listener.exit_every_rule(self)?; - Ok(()) - } +impl<'input> YarnSpinnerParserContext<'input> for JumpToExpressionContext<'input>{} + +impl<'input,'a> Listenable + 'a> for JumpToExpressionContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_jumpToExpression(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_jumpToExpression(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input,'a> Visitable + 'a> for Command_statementContext<'input>{ +impl<'input,'a> Visitable + 'a> for JumpToExpressionContext<'input>{ fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_command_statement(self); + visitor.visit_jumpToExpression(self); } } -impl<'input> CustomRuleContext<'input> for Command_statementContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for JumpToExpressionContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_command_statement } - //fn type_rule_index() -> usize where Self: Sized { RULE_command_statement } -} -antlr4rust::tid!{Command_statementContextExt<'a>} - -impl<'input> Command_statementContextExt<'input>{ - fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { - Rc::new( - BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Command_statementContextExt{ - - ph:PhantomData - }), - ) - } + fn get_rule_index(&self) -> usize { RULE_jump_statement } + //fn type_rule_index() -> usize where Self: Sized { RULE_jump_statement } } -pub trait Command_statementContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ - -/// Retrieves first TerminalNode corresponding to token COMMAND_START -/// Returns `None` if there is no child corresponding to token COMMAND_START -fn COMMAND_START(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_COMMAND_START, 0) -} -fn command_formatted_text(&self) -> Option>> where Self:Sized{ - self.child_of_type(0) -} -/// Retrieves first TerminalNode corresponding to token COMMAND_TEXT_END -/// Returns `None` if there is no child corresponding to token COMMAND_TEXT_END -fn COMMAND_TEXT_END(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_COMMAND_TEXT_END, 0) -} -fn hashtag_all(&self) -> Vec>> where Self:Sized{ - self.children_of_type() -} -fn hashtag(&self, i: usize) -> Option>> where Self:Sized{ - self.child_of_type(i) +impl<'input> Borrow> for JumpToExpressionContext<'input>{ + fn borrow(&self) -> &Jump_statementContextExt<'input> { &self.base } } - +impl<'input> BorrowMut> for JumpToExpressionContext<'input>{ + fn borrow_mut(&mut self) -> &mut Jump_statementContextExt<'input> { &mut self.base } } -impl<'input> Command_statementContextAttrs<'input> for Command_statementContext<'input>{} - -impl<'input, I> YarnSpinnerParser<'input, I> -where - I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, -{ - pub fn command_statement(&mut self,) - -> Result>,ANTLRError> { - let mut recog = self; - let _parentctx = recog.ctx.take(); - let mut _localctx = Command_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog.base.enter_rule(_localctx.clone(), 40, RULE_command_statement); - let mut _localctx: Rc = _localctx; - let mut _la: i32 = -1; - let result: Result<(), ANTLRError> = (|| { - - //recog.base.enter_outer_alt(_localctx.clone(), 1)?; - recog.base.enter_outer_alt(None, 1)?; - { - recog.base.set_state(249); - recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; - - /*InvokeRule command_formatted_text*/ - recog.base.set_state(250); - recog.command_formatted_text()?; - - recog.base.set_state(251); - recog.base.match_token(YarnSpinnerParser_COMMAND_TEXT_END,&mut recog.err_handler)?; +impl<'input> Jump_statementContextAttrs<'input> for JumpToExpressionContext<'input> {} - { - recog.base.set_state(255); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - while _la==YarnSpinnerParser_HASHTAG { - { - { - /*InvokeRule hashtag*/ - recog.base.set_state(252); - recog.hashtag()?; +impl<'input> JumpToExpressionContextExt<'input>{ + fn new(ctx: &dyn Jump_statementContextAttrs<'input>) -> Rc> { + Rc::new( + Jump_statementContextAll::JumpToExpressionContext( + BaseParserRuleContext::copy_from(ctx,JumpToExpressionContextExt{ + base: ctx.borrow().clone(), + ph:PhantomData + }) + ) + ) + } +} - } - } - recog.base.set_state(257); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - } - } - } - Ok(()) - })(); - match result { - Ok(_)=>{}, - Err(e @ ANTLRError::FallThrough(_)) => return Err(e), - Err(ref re) => { - //_localctx.exception = re; - recog.err_handler.report_error(&mut recog.base, re); - recog.err_handler.recover(&mut recog.base, re)?; - } - } - recog.base.exit_rule()?; +pub type DetourToNodeNameContext<'input> = BaseParserRuleContext<'input,DetourToNodeNameContextExt<'input>>; - Ok(_localctx) +pub trait DetourToNodeNameContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + /// Retrieves first TerminalNode corresponding to token COMMAND_START + /// Returns `None` if there is no child corresponding to token COMMAND_START + fn COMMAND_START(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_START, 0) + } + /// Retrieves first TerminalNode corresponding to token COMMAND_DETOUR + /// Returns `None` if there is no child corresponding to token COMMAND_DETOUR + fn COMMAND_DETOUR(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_DETOUR, 0) + } + /// Retrieves first TerminalNode corresponding to token COMMAND_END + /// Returns `None` if there is no child corresponding to token COMMAND_END + fn COMMAND_END(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_END, 0) + } + /// Retrieves first TerminalNode corresponding to token ID + /// Returns `None` if there is no child corresponding to token ID + fn ID(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_ID, 0) } } -//------------------- command_formatted_text ---------------- -pub type Command_formatted_textContextAll<'input> = Command_formatted_textContext<'input>; +impl<'input> DetourToNodeNameContextAttrs<'input> for DetourToNodeNameContext<'input>{} -pub type Command_formatted_textContext<'input> = BaseParserRuleContext<'input,Command_formatted_textContextExt<'input>>; - -#[derive(Clone)] -pub struct Command_formatted_textContextExt<'input>{ -ph:PhantomData<&'input str> +pub struct DetourToNodeNameContextExt<'input>{ + base:Jump_statementContextExt<'input>, + pub destination: Option>, + ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for Command_formatted_textContext<'input>{} +antlr4rust::tid!{DetourToNodeNameContextExt<'a>} -impl<'input,'a> Listenable + 'a> for Command_formatted_textContext<'input>{ - fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.enter_every_rule(self)?; - listener.enter_command_formatted_text(self); - Ok(()) - } - fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_command_formatted_text(self); - listener.exit_every_rule(self)?; - Ok(()) - } +impl<'input> YarnSpinnerParserContext<'input> for DetourToNodeNameContext<'input>{} + +impl<'input,'a> Listenable + 'a> for DetourToNodeNameContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_detourToNodeName(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_detourToNodeName(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input,'a> Visitable + 'a> for Command_formatted_textContext<'input>{ +impl<'input,'a> Visitable + 'a> for DetourToNodeNameContext<'input>{ fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_command_formatted_text(self); + visitor.visit_detourToNodeName(self); } } -impl<'input> CustomRuleContext<'input> for Command_formatted_textContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for DetourToNodeNameContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_command_formatted_text } - //fn type_rule_index() -> usize where Self: Sized { RULE_command_formatted_text } + fn get_rule_index(&self) -> usize { RULE_jump_statement } + //fn type_rule_index() -> usize where Self: Sized { RULE_jump_statement } } -antlr4rust::tid!{Command_formatted_textContextExt<'a>} -impl<'input> Command_formatted_textContextExt<'input>{ - fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { - Rc::new( - BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Command_formatted_textContextExt{ +impl<'input> Borrow> for DetourToNodeNameContext<'input>{ + fn borrow(&self) -> &Jump_statementContextExt<'input> { &self.base } +} +impl<'input> BorrowMut> for DetourToNodeNameContext<'input>{ + fn borrow_mut(&mut self) -> &mut Jump_statementContextExt<'input> { &mut self.base } +} - ph:PhantomData - }), +impl<'input> Jump_statementContextAttrs<'input> for DetourToNodeNameContext<'input> {} + +impl<'input> DetourToNodeNameContextExt<'input>{ + fn new(ctx: &dyn Jump_statementContextAttrs<'input>) -> Rc> { + Rc::new( + Jump_statementContextAll::DetourToNodeNameContext( + BaseParserRuleContext::copy_from(ctx,DetourToNodeNameContextExt{ + destination:None, + base: ctx.borrow().clone(), + ph:PhantomData + }) + ) ) } } -pub trait Command_formatted_textContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ +pub type DetourToExpressionContext<'input> = BaseParserRuleContext<'input,DetourToExpressionContextExt<'input>>; -/// Retrieves all `TerminalNode`s corresponding to token COMMAND_TEXT in current rule -fn COMMAND_TEXT_all(&self) -> Vec>> where Self:Sized{ - self.children_of_type() -} -/// Retrieves 'i's TerminalNode corresponding to token COMMAND_TEXT, starting from 0. -/// Returns `None` if number of children corresponding to token COMMAND_TEXT is less or equal than `i`. -fn COMMAND_TEXT(&self, i: usize) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_COMMAND_TEXT, i) -} -/// Retrieves all `TerminalNode`s corresponding to token COMMAND_EXPRESSION_START in current rule -fn COMMAND_EXPRESSION_START_all(&self) -> Vec>> where Self:Sized{ - self.children_of_type() -} -/// Retrieves 'i's TerminalNode corresponding to token COMMAND_EXPRESSION_START, starting from 0. -/// Returns `None` if number of children corresponding to token COMMAND_EXPRESSION_START is less or equal than `i`. -fn COMMAND_EXPRESSION_START(&self, i: usize) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_COMMAND_EXPRESSION_START, i) +pub trait DetourToExpressionContextAttrs<'input>: YarnSpinnerParserContext<'input>{ + /// Retrieves first TerminalNode corresponding to token COMMAND_START + /// Returns `None` if there is no child corresponding to token COMMAND_START + fn COMMAND_START(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_START, 0) + } + /// Retrieves first TerminalNode corresponding to token COMMAND_DETOUR + /// Returns `None` if there is no child corresponding to token COMMAND_DETOUR + fn COMMAND_DETOUR(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_DETOUR, 0) + } + /// Retrieves first TerminalNode corresponding to token EXPRESSION_START + /// Returns `None` if there is no child corresponding to token EXPRESSION_START + fn EXPRESSION_START(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_EXPRESSION_START, 0) + } + fn expression(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) + } + /// Retrieves first TerminalNode corresponding to token EXPRESSION_END + /// Returns `None` if there is no child corresponding to token EXPRESSION_END + fn EXPRESSION_END(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_EXPRESSION_END, 0) + } + /// Retrieves first TerminalNode corresponding to token COMMAND_END + /// Returns `None` if there is no child corresponding to token COMMAND_END + fn COMMAND_END(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_END, 0) + } } -fn expression_all(&self) -> Vec>> where Self:Sized{ - self.children_of_type() + +impl<'input> DetourToExpressionContextAttrs<'input> for DetourToExpressionContext<'input>{} + +pub struct DetourToExpressionContextExt<'input>{ + base:Jump_statementContextExt<'input>, + ph:PhantomData<&'input str> } -fn expression(&self, i: usize) -> Option>> where Self:Sized{ - self.child_of_type(i) + +antlr4rust::tid!{DetourToExpressionContextExt<'a>} + +impl<'input> YarnSpinnerParserContext<'input> for DetourToExpressionContext<'input>{} + +impl<'input,'a> Listenable + 'a> for DetourToExpressionContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_detourToExpression(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_detourToExpression(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -/// Retrieves all `TerminalNode`s corresponding to token EXPRESSION_END in current rule -fn EXPRESSION_END_all(&self) -> Vec>> where Self:Sized{ - self.children_of_type() + +impl<'input,'a> Visitable + 'a> for DetourToExpressionContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_detourToExpression(self); + } } -/// Retrieves 'i's TerminalNode corresponding to token EXPRESSION_END, starting from 0. -/// Returns `None` if number of children corresponding to token EXPRESSION_END is less or equal than `i`. -fn EXPRESSION_END(&self, i: usize) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_EXPRESSION_END, i) + +impl<'input> CustomRuleContext<'input> for DetourToExpressionContextExt<'input>{ + type TF = LocalTokenFactory<'input>; + type Ctx = YarnSpinnerParserContextType; + fn get_rule_index(&self) -> usize { RULE_jump_statement } + //fn type_rule_index() -> usize where Self: Sized { RULE_jump_statement } } +impl<'input> Borrow> for DetourToExpressionContext<'input>{ + fn borrow(&self) -> &Jump_statementContextExt<'input> { &self.base } +} +impl<'input> BorrowMut> for DetourToExpressionContext<'input>{ + fn borrow_mut(&mut self) -> &mut Jump_statementContextExt<'input> { &mut self.base } } -impl<'input> Command_formatted_textContextAttrs<'input> for Command_formatted_textContext<'input>{} +impl<'input> Jump_statementContextAttrs<'input> for DetourToExpressionContext<'input> {} + +impl<'input> DetourToExpressionContextExt<'input>{ + fn new(ctx: &dyn Jump_statementContextAttrs<'input>) -> Rc> { + Rc::new( + Jump_statementContextAll::DetourToExpressionContext( + BaseParserRuleContext::copy_from(ctx,DetourToExpressionContextExt{ + base: ctx.borrow().clone(), + ph:PhantomData + }) + ) + ) + } +} impl<'input, I> YarnSpinnerParser<'input, I> where I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, { - pub fn command_formatted_text(&mut self,) - -> Result>,ANTLRError> { + pub fn jump_statement(&mut self,) + -> Result>,ANTLRError> { let mut recog = self; let _parentctx = recog.ctx.take(); - let mut _localctx = Command_formatted_textContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog.base.enter_rule(_localctx.clone(), 42, RULE_command_formatted_text); - let mut _localctx: Rc = _localctx; - let mut _la: i32 = -1; + let mut _localctx = Jump_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 66, RULE_jump_statement); + let mut _localctx: Rc = _localctx; let result: Result<(), ANTLRError> = (|| { - //recog.base.enter_outer_alt(_localctx.clone(), 1)?; - recog.base.enter_outer_alt(None, 1)?; - { - recog.base.set_state(265); + recog.base.set_state(439); recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - while _la==YarnSpinnerParser_COMMAND_EXPRESSION_START || _la==YarnSpinnerParser_COMMAND_TEXT { - { - recog.base.set_state(263); - recog.err_handler.sync(&mut recog.base)?; - match recog.base.input.la(1) { - YarnSpinnerParser_COMMAND_TEXT - => { - { - recog.base.set_state(258); - recog.base.match_token(YarnSpinnerParser_COMMAND_TEXT,&mut recog.err_handler)?; + match recog.interpreter.adaptive_predict(45,&mut recog.base)? { + 1 =>{ + let tmp = JumpToNodeNameContextExt::new(&**_localctx); + recog.base.enter_outer_alt(Some(tmp.clone()), 1)?; + _localctx = tmp; + { + recog.base.set_state(417); + recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; + + recog.base.set_state(418); + recog.base.match_token(YarnSpinnerParser_COMMAND_JUMP,&mut recog.err_handler)?; + + recog.base.set_state(419); + let tmp = recog.base.match_token(YarnSpinnerParser_ID,&mut recog.err_handler)?; + if let Jump_statementContextAll::JumpToNodeNameContext(ctx) = cast_mut::<_,Jump_statementContextAll >(&mut _localctx){ + ctx.destination = Some(tmp.clone()); } else {unreachable!("cant cast");} + + recog.base.set_state(420); + recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; - } } + } + , + 2 =>{ + let tmp = JumpToExpressionContextExt::new(&**_localctx); + recog.base.enter_outer_alt(Some(tmp.clone()), 2)?; + _localctx = tmp; + { + recog.base.set_state(421); + recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; - YarnSpinnerParser_COMMAND_EXPRESSION_START - => { - { - recog.base.set_state(259); - recog.base.match_token(YarnSpinnerParser_COMMAND_EXPRESSION_START,&mut recog.err_handler)?; + recog.base.set_state(422); + recog.base.match_token(YarnSpinnerParser_COMMAND_JUMP,&mut recog.err_handler)?; - /*InvokeRule expression*/ - recog.base.set_state(260); - recog.expression_rec(0)?; + recog.base.set_state(423); + recog.base.match_token(YarnSpinnerParser_EXPRESSION_START,&mut recog.err_handler)?; - recog.base.set_state(261); - recog.base.match_token(YarnSpinnerParser_EXPRESSION_END,&mut recog.err_handler)?; + /*InvokeRule expression*/ + recog.base.set_state(424); + recog.expression_rec(0)?; + + recog.base.set_state(425); + recog.base.match_token(YarnSpinnerParser_EXPRESSION_END,&mut recog.err_handler)?; + + recog.base.set_state(426); + recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; - } } + } + , + 3 =>{ + let tmp = DetourToNodeNameContextExt::new(&**_localctx); + recog.base.enter_outer_alt(Some(tmp.clone()), 3)?; + _localctx = tmp; + { + recog.base.set_state(428); + recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; - _ => Err(ANTLRError::NoAltError(NoViableAltError::new(&mut recog.base)))? + recog.base.set_state(429); + recog.base.match_token(YarnSpinnerParser_COMMAND_DETOUR,&mut recog.err_handler)?; + + recog.base.set_state(430); + let tmp = recog.base.match_token(YarnSpinnerParser_ID,&mut recog.err_handler)?; + if let Jump_statementContextAll::DetourToNodeNameContext(ctx) = cast_mut::<_,Jump_statementContextAll >(&mut _localctx){ + ctx.destination = Some(tmp.clone()); } else {unreachable!("cant cast");} + + recog.base.set_state(431); + recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; + + } } + , + 4 =>{ + let tmp = DetourToExpressionContextExt::new(&**_localctx); + recog.base.enter_outer_alt(Some(tmp.clone()), 4)?; + _localctx = tmp; + { + recog.base.set_state(432); + recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; + + recog.base.set_state(433); + recog.base.match_token(YarnSpinnerParser_COMMAND_DETOUR,&mut recog.err_handler)?; + + recog.base.set_state(434); + recog.base.match_token(YarnSpinnerParser_EXPRESSION_START,&mut recog.err_handler)?; + + /*InvokeRule expression*/ + recog.base.set_state(435); + recog.expression_rec(0)?; + + recog.base.set_state(436); + recog.base.match_token(YarnSpinnerParser_EXPRESSION_END,&mut recog.err_handler)?; + + recog.base.set_state(437); + recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; + + } } - recog.base.set_state(267); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - } + + _ => {} } Ok(()) })(); @@ -5118,50 +7723,50 @@ where Ok(_localctx) } } -//------------------- shortcut_option_statement ---------------- -pub type Shortcut_option_statementContextAll<'input> = Shortcut_option_statementContext<'input>; +//------------------- return_statement ---------------- +pub type Return_statementContextAll<'input> = Return_statementContext<'input>; -pub type Shortcut_option_statementContext<'input> = BaseParserRuleContext<'input,Shortcut_option_statementContextExt<'input>>; +pub type Return_statementContext<'input> = BaseParserRuleContext<'input,Return_statementContextExt<'input>>; #[derive(Clone)] -pub struct Shortcut_option_statementContextExt<'input>{ +pub struct Return_statementContextExt<'input>{ ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for Shortcut_option_statementContext<'input>{} +impl<'input> YarnSpinnerParserContext<'input> for Return_statementContext<'input>{} -impl<'input,'a> Listenable + 'a> for Shortcut_option_statementContext<'input>{ +impl<'input,'a> Listenable + 'a> for Return_statementContext<'input>{ fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { listener.enter_every_rule(self)?; - listener.enter_shortcut_option_statement(self); + listener.enter_return_statement(self); Ok(()) } fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_shortcut_option_statement(self); + listener.exit_return_statement(self); listener.exit_every_rule(self)?; Ok(()) } } -impl<'input,'a> Visitable + 'a> for Shortcut_option_statementContext<'input>{ +impl<'input,'a> Visitable + 'a> for Return_statementContext<'input>{ fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_shortcut_option_statement(self); + visitor.visit_return_statement(self); } } -impl<'input> CustomRuleContext<'input> for Shortcut_option_statementContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for Return_statementContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_shortcut_option_statement } - //fn type_rule_index() -> usize where Self: Sized { RULE_shortcut_option_statement } + fn get_rule_index(&self) -> usize { RULE_return_statement } + //fn type_rule_index() -> usize where Self: Sized { RULE_return_statement } } -antlr4rust::tid!{Shortcut_option_statementContextExt<'a>} +antlr4rust::tid!{Return_statementContextExt<'a>} -impl<'input> Shortcut_option_statementContextExt<'input>{ - fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { +impl<'input> Return_statementContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { Rc::new( - BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Shortcut_option_statementContextExt{ + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Return_statementContextExt{ ph:PhantomData }), @@ -5169,77 +7774,53 @@ impl<'input> Shortcut_option_statementContextExt<'input>{ } } -pub trait Shortcut_option_statementContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ +pub trait Return_statementContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ -fn shortcut_option_all(&self) -> Vec>> where Self:Sized{ - self.children_of_type() +/// Retrieves first TerminalNode corresponding to token COMMAND_START +/// Returns `None` if there is no child corresponding to token COMMAND_START +fn COMMAND_START(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_START, 0) } -fn shortcut_option(&self, i: usize) -> Option>> where Self:Sized{ - self.child_of_type(i) +/// Retrieves first TerminalNode corresponding to token COMMAND_RETURN +/// Returns `None` if there is no child corresponding to token COMMAND_RETURN +fn COMMAND_RETURN(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_RETURN, 0) } -/// Retrieves first TerminalNode corresponding to token BLANK_LINE_FOLLOWING_OPTION -/// Returns `None` if there is no child corresponding to token BLANK_LINE_FOLLOWING_OPTION -fn BLANK_LINE_FOLLOWING_OPTION(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_BLANK_LINE_FOLLOWING_OPTION, 0) +/// Retrieves first TerminalNode corresponding to token COMMAND_END +/// Returns `None` if there is no child corresponding to token COMMAND_END +fn COMMAND_END(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_END, 0) } } -impl<'input> Shortcut_option_statementContextAttrs<'input> for Shortcut_option_statementContext<'input>{} +impl<'input> Return_statementContextAttrs<'input> for Return_statementContext<'input>{} impl<'input, I> YarnSpinnerParser<'input, I> where I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, { - pub fn shortcut_option_statement(&mut self,) - -> Result>,ANTLRError> { + pub fn return_statement(&mut self,) + -> Result>,ANTLRError> { let mut recog = self; let _parentctx = recog.ctx.take(); - let mut _localctx = Shortcut_option_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog.base.enter_rule(_localctx.clone(), 44, RULE_shortcut_option_statement); - let mut _localctx: Rc = _localctx; - let mut _la: i32 = -1; + let mut _localctx = Return_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 68, RULE_return_statement); + let mut _localctx: Rc = _localctx; let result: Result<(), ANTLRError> = (|| { - let mut _alt: i32; //recog.base.enter_outer_alt(_localctx.clone(), 1)?; recog.base.enter_outer_alt(None, 1)?; { - recog.base.set_state(271); - recog.err_handler.sync(&mut recog.base)?; - _alt = recog.interpreter.adaptive_predict(26,&mut recog.base)?; - while { _alt!=2 && _alt!=INVALID_ALT } { - if _alt==1 { - { - { - /*InvokeRule shortcut_option*/ - recog.base.set_state(268); - recog.shortcut_option()?; - - } - } - } - recog.base.set_state(273); - recog.err_handler.sync(&mut recog.base)?; - _alt = recog.interpreter.adaptive_predict(26,&mut recog.base)?; - } - { - /*InvokeRule shortcut_option*/ - recog.base.set_state(274); - recog.shortcut_option()?; + recog.base.set_state(441); + recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; - recog.base.set_state(276); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - if _la==YarnSpinnerParser_BLANK_LINE_FOLLOWING_OPTION { - { - recog.base.set_state(275); - recog.base.match_token(YarnSpinnerParser_BLANK_LINE_FOLLOWING_OPTION,&mut recog.err_handler)?; + recog.base.set_state(442); + recog.base.match_token(YarnSpinnerParser_COMMAND_RETURN,&mut recog.err_handler)?; - } - } + recog.base.set_state(443); + recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; - } } Ok(()) })(); @@ -5257,50 +7838,50 @@ where Ok(_localctx) } } -//------------------- shortcut_option ---------------- -pub type Shortcut_optionContextAll<'input> = Shortcut_optionContext<'input>; +//------------------- once_statement ---------------- +pub type Once_statementContextAll<'input> = Once_statementContext<'input>; -pub type Shortcut_optionContext<'input> = BaseParserRuleContext<'input,Shortcut_optionContextExt<'input>>; +pub type Once_statementContext<'input> = BaseParserRuleContext<'input,Once_statementContextExt<'input>>; #[derive(Clone)] -pub struct Shortcut_optionContextExt<'input>{ +pub struct Once_statementContextExt<'input>{ ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for Shortcut_optionContext<'input>{} +impl<'input> YarnSpinnerParserContext<'input> for Once_statementContext<'input>{} -impl<'input,'a> Listenable + 'a> for Shortcut_optionContext<'input>{ +impl<'input,'a> Listenable + 'a> for Once_statementContext<'input>{ fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { listener.enter_every_rule(self)?; - listener.enter_shortcut_option(self); + listener.enter_once_statement(self); Ok(()) } fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_shortcut_option(self); + listener.exit_once_statement(self); listener.exit_every_rule(self)?; Ok(()) } } -impl<'input,'a> Visitable + 'a> for Shortcut_optionContext<'input>{ +impl<'input,'a> Visitable + 'a> for Once_statementContext<'input>{ fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_shortcut_option(self); + visitor.visit_once_statement(self); } } -impl<'input> CustomRuleContext<'input> for Shortcut_optionContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for Once_statementContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_shortcut_option } - //fn type_rule_index() -> usize where Self: Sized { RULE_shortcut_option } + fn get_rule_index(&self) -> usize { RULE_once_statement } + //fn type_rule_index() -> usize where Self: Sized { RULE_once_statement } } -antlr4rust::tid!{Shortcut_optionContextExt<'a>} +antlr4rust::tid!{Once_statementContextExt<'a>} -impl<'input> Shortcut_optionContextExt<'input>{ - fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { +impl<'input> Once_statementContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { Rc::new( - BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Shortcut_optionContextExt{ + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Once_statementContextExt{ ph:PhantomData }), @@ -5308,93 +7889,77 @@ impl<'input> Shortcut_optionContextExt<'input>{ } } -pub trait Shortcut_optionContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ +pub trait Once_statementContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ -/// Retrieves first TerminalNode corresponding to token SHORTCUT_ARROW -/// Returns `None` if there is no child corresponding to token SHORTCUT_ARROW -fn SHORTCUT_ARROW(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_SHORTCUT_ARROW, 0) -} -fn line_statement(&self) -> Option>> where Self:Sized{ +fn once_primary_clause(&self) -> Option>> where Self:Sized{ self.child_of_type(0) } -/// Retrieves first TerminalNode corresponding to token INDENT -/// Returns `None` if there is no child corresponding to token INDENT -fn INDENT(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_INDENT, 0) +/// Retrieves first TerminalNode corresponding to token COMMAND_START +/// Returns `None` if there is no child corresponding to token COMMAND_START +fn COMMAND_START(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_START, 0) } -/// Retrieves first TerminalNode corresponding to token DEDENT -/// Returns `None` if there is no child corresponding to token DEDENT -fn DEDENT(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_DEDENT, 0) +/// Retrieves first TerminalNode corresponding to token COMMAND_ENDONCE +/// Returns `None` if there is no child corresponding to token COMMAND_ENDONCE +fn COMMAND_ENDONCE(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_ENDONCE, 0) } -fn statement_all(&self) -> Vec>> where Self:Sized{ - self.children_of_type() +/// Retrieves first TerminalNode corresponding to token COMMAND_END +/// Returns `None` if there is no child corresponding to token COMMAND_END +fn COMMAND_END(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_END, 0) } -fn statement(&self, i: usize) -> Option>> where Self:Sized{ - self.child_of_type(i) +fn once_alternate_clause(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) } } -impl<'input> Shortcut_optionContextAttrs<'input> for Shortcut_optionContext<'input>{} +impl<'input> Once_statementContextAttrs<'input> for Once_statementContext<'input>{} impl<'input, I> YarnSpinnerParser<'input, I> where I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, { - pub fn shortcut_option(&mut self,) - -> Result>,ANTLRError> { + pub fn once_statement(&mut self,) + -> Result>,ANTLRError> { let mut recog = self; let _parentctx = recog.ctx.take(); - let mut _localctx = Shortcut_optionContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog.base.enter_rule(_localctx.clone(), 46, RULE_shortcut_option); - let mut _localctx: Rc = _localctx; - let mut _la: i32 = -1; + let mut _localctx = Once_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 70, RULE_once_statement); + let mut _localctx: Rc = _localctx; let result: Result<(), ANTLRError> = (|| { //recog.base.enter_outer_alt(_localctx.clone(), 1)?; recog.base.enter_outer_alt(None, 1)?; { - recog.base.set_state(278); - recog.base.match_token(YarnSpinnerParser_SHORTCUT_ARROW,&mut recog.err_handler)?; + /*InvokeRule once_primary_clause*/ + recog.base.set_state(445); + recog.once_primary_clause()?; - /*InvokeRule line_statement*/ - recog.base.set_state(279); - recog.line_statement()?; - - recog.base.set_state(288); + recog.base.set_state(447); recog.err_handler.sync(&mut recog.base)?; - match recog.interpreter.adaptive_predict(29,&mut recog.base)? { + match recog.interpreter.adaptive_predict(46,&mut recog.base)? { x if x == 1=>{ { - recog.base.set_state(280); - recog.base.match_token(YarnSpinnerParser_INDENT,&mut recog.err_handler)?; - - recog.base.set_state(284); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - while (((_la) & !0x3f) == 0 && ((1usize << _la) & 1163266) != 0) { - { - { - /*InvokeRule statement*/ - recog.base.set_state(281); - recog.statement()?; - - } - } - recog.base.set_state(286); - recog.err_handler.sync(&mut recog.base)?; - _la = recog.base.input.la(1); - } - recog.base.set_state(287); - recog.base.match_token(YarnSpinnerParser_DEDENT,&mut recog.err_handler)?; + /*InvokeRule once_alternate_clause*/ + recog.base.set_state(446); + recog.once_alternate_clause()?; } } _ => {} } + recog.base.set_state(449); + recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; + + recog.base.set_state(450); + recog.base.match_token(YarnSpinnerParser_COMMAND_ENDONCE,&mut recog.err_handler)?; + + recog.base.set_state(451); + recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; + } Ok(()) })(); @@ -5412,52 +7977,50 @@ where Ok(_localctx) } } -//------------------- declare_statement ---------------- -pub type Declare_statementContextAll<'input> = Declare_statementContext<'input>; +//------------------- once_primary_clause ---------------- +pub type Once_primary_clauseContextAll<'input> = Once_primary_clauseContext<'input>; -pub type Declare_statementContext<'input> = BaseParserRuleContext<'input,Declare_statementContextExt<'input>>; +pub type Once_primary_clauseContext<'input> = BaseParserRuleContext<'input,Once_primary_clauseContextExt<'input>>; #[derive(Clone)] -pub struct Declare_statementContextExt<'input>{ - pub type_: Option>, +pub struct Once_primary_clauseContextExt<'input>{ ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for Declare_statementContext<'input>{} +impl<'input> YarnSpinnerParserContext<'input> for Once_primary_clauseContext<'input>{} -impl<'input,'a> Listenable + 'a> for Declare_statementContext<'input>{ +impl<'input,'a> Listenable + 'a> for Once_primary_clauseContext<'input>{ fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { listener.enter_every_rule(self)?; - listener.enter_declare_statement(self); + listener.enter_once_primary_clause(self); Ok(()) } fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_declare_statement(self); + listener.exit_once_primary_clause(self); listener.exit_every_rule(self)?; Ok(()) } } -impl<'input,'a> Visitable + 'a> for Declare_statementContext<'input>{ +impl<'input,'a> Visitable + 'a> for Once_primary_clauseContext<'input>{ fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_declare_statement(self); + visitor.visit_once_primary_clause(self); } } -impl<'input> CustomRuleContext<'input> for Declare_statementContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for Once_primary_clauseContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_declare_statement } - //fn type_rule_index() -> usize where Self: Sized { RULE_declare_statement } + fn get_rule_index(&self) -> usize { RULE_once_primary_clause } + //fn type_rule_index() -> usize where Self: Sized { RULE_once_primary_clause } } -antlr4rust::tid!{Declare_statementContextExt<'a>} +antlr4rust::tid!{Once_primary_clauseContextExt<'a>} -impl<'input> Declare_statementContextExt<'input>{ - fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { +impl<'input> Once_primary_clauseContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { Rc::new( - BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Declare_statementContextExt{ - type_: None, + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Once_primary_clauseContextExt{ ph:PhantomData }), @@ -5465,102 +8028,102 @@ impl<'input> Declare_statementContextExt<'input>{ } } -pub trait Declare_statementContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ +pub trait Once_primary_clauseContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ /// Retrieves first TerminalNode corresponding to token COMMAND_START /// Returns `None` if there is no child corresponding to token COMMAND_START fn COMMAND_START(&self) -> Option>> where Self:Sized{ self.get_token(YarnSpinnerParser_COMMAND_START, 0) } -/// Retrieves first TerminalNode corresponding to token COMMAND_DECLARE -/// Returns `None` if there is no child corresponding to token COMMAND_DECLARE -fn COMMAND_DECLARE(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_COMMAND_DECLARE, 0) -} -fn variable(&self) -> Option>> where Self:Sized{ - self.child_of_type(0) -} -/// Retrieves first TerminalNode corresponding to token OPERATOR_ASSIGNMENT -/// Returns `None` if there is no child corresponding to token OPERATOR_ASSIGNMENT -fn OPERATOR_ASSIGNMENT(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_OPERATOR_ASSIGNMENT, 0) -} -fn value(&self) -> Option>> where Self:Sized{ - self.child_of_type(0) +/// Retrieves first TerminalNode corresponding to token COMMAND_ONCE +/// Returns `None` if there is no child corresponding to token COMMAND_ONCE +fn COMMAND_ONCE(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_ONCE, 0) } /// Retrieves first TerminalNode corresponding to token COMMAND_END /// Returns `None` if there is no child corresponding to token COMMAND_END fn COMMAND_END(&self) -> Option>> where Self:Sized{ self.get_token(YarnSpinnerParser_COMMAND_END, 0) } -/// Retrieves first TerminalNode corresponding to token EXPRESSION_AS -/// Returns `None` if there is no child corresponding to token EXPRESSION_AS -fn EXPRESSION_AS(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_EXPRESSION_AS, 0) +/// Retrieves first TerminalNode corresponding to token COMMAND_IF +/// Returns `None` if there is no child corresponding to token COMMAND_IF +fn COMMAND_IF(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_IF, 0) } -/// Retrieves first TerminalNode corresponding to token FUNC_ID -/// Returns `None` if there is no child corresponding to token FUNC_ID -fn FUNC_ID(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_FUNC_ID, 0) +fn expression(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +fn statement_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +fn statement(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) } } -impl<'input> Declare_statementContextAttrs<'input> for Declare_statementContext<'input>{} +impl<'input> Once_primary_clauseContextAttrs<'input> for Once_primary_clauseContext<'input>{} impl<'input, I> YarnSpinnerParser<'input, I> where I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, { - pub fn declare_statement(&mut self,) - -> Result>,ANTLRError> { + pub fn once_primary_clause(&mut self,) + -> Result>,ANTLRError> { let mut recog = self; let _parentctx = recog.ctx.take(); - let mut _localctx = Declare_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog.base.enter_rule(_localctx.clone(), 48, RULE_declare_statement); - let mut _localctx: Rc = _localctx; + let mut _localctx = Once_primary_clauseContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 72, RULE_once_primary_clause); + let mut _localctx: Rc = _localctx; let mut _la: i32 = -1; let result: Result<(), ANTLRError> = (|| { + let mut _alt: i32; //recog.base.enter_outer_alt(_localctx.clone(), 1)?; recog.base.enter_outer_alt(None, 1)?; { - recog.base.set_state(290); + recog.base.set_state(453); recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; - recog.base.set_state(291); - recog.base.match_token(YarnSpinnerParser_COMMAND_DECLARE,&mut recog.err_handler)?; - - /*InvokeRule variable*/ - recog.base.set_state(292); - recog.variable()?; - - recog.base.set_state(293); - recog.base.match_token(YarnSpinnerParser_OPERATOR_ASSIGNMENT,&mut recog.err_handler)?; + recog.base.set_state(454); + recog.base.match_token(YarnSpinnerParser_COMMAND_ONCE,&mut recog.err_handler)?; - /*InvokeRule value*/ - recog.base.set_state(294); - recog.value()?; - - recog.base.set_state(297); + recog.base.set_state(457); recog.err_handler.sync(&mut recog.base)?; _la = recog.base.input.la(1); - if _la==YarnSpinnerParser_EXPRESSION_AS { + if _la==YarnSpinnerParser_COMMAND_IF { { - recog.base.set_state(295); - recog.base.match_token(YarnSpinnerParser_EXPRESSION_AS,&mut recog.err_handler)?; + recog.base.set_state(455); + recog.base.match_token(YarnSpinnerParser_COMMAND_IF,&mut recog.err_handler)?; - recog.base.set_state(296); - let tmp = recog.base.match_token(YarnSpinnerParser_FUNC_ID,&mut recog.err_handler)?; - cast_mut::<_,Declare_statementContext >(&mut _localctx).type_ = Some(tmp.clone()); - + /*InvokeRule expression*/ + recog.base.set_state(456); + recog.expression_rec(0)?; } } - recog.base.set_state(299); + recog.base.set_state(459); recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; + recog.base.set_state(463); + recog.err_handler.sync(&mut recog.base)?; + _alt = recog.interpreter.adaptive_predict(48,&mut recog.base)?; + while { _alt!=2 && _alt!=INVALID_ALT } { + if _alt==1 { + { + { + /*InvokeRule statement*/ + recog.base.set_state(460); + recog.statement()?; + + } + } + } + recog.base.set_state(465); + recog.err_handler.sync(&mut recog.base)?; + _alt = recog.interpreter.adaptive_predict(48,&mut recog.base)?; + } } Ok(()) })(); @@ -5578,322 +8141,371 @@ where Ok(_localctx) } } -//------------------- jump_statement ---------------- -#[derive(Debug)] -pub enum Jump_statementContextAll<'input>{ - JumpToNodeNameContext(JumpToNodeNameContext<'input>), - JumpToExpressionContext(JumpToExpressionContext<'input>), -Error(Jump_statementContext<'input>) -} -antlr4rust::tid!{Jump_statementContextAll<'a>} - -impl<'input> antlr4rust::parser_rule_context::DerefSeal for Jump_statementContextAll<'input>{} - -impl<'input> YarnSpinnerParserContext<'input> for Jump_statementContextAll<'input>{} - -impl<'input> Deref for Jump_statementContextAll<'input>{ - type Target = dyn Jump_statementContextAttrs<'input> + 'input; - fn deref(&self) -> &Self::Target{ - use Jump_statementContextAll::*; - match self{ - JumpToNodeNameContext(inner) => inner, - JumpToExpressionContext(inner) => inner, -Error(inner) => inner - } - } -} -impl<'input,'a> Visitable + 'a> for Jump_statementContextAll<'input>{ - fn accept(&self, visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { self.deref().accept(visitor) } -} -impl<'input,'a> Listenable + 'a> for Jump_statementContextAll<'input>{ - fn enter(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { self.deref().enter(listener) } - fn exit(&self, listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { self.deref().exit(listener) } -} +//------------------- once_alternate_clause ---------------- +pub type Once_alternate_clauseContextAll<'input> = Once_alternate_clauseContext<'input>; - -pub type Jump_statementContext<'input> = BaseParserRuleContext<'input,Jump_statementContextExt<'input>>; +pub type Once_alternate_clauseContext<'input> = BaseParserRuleContext<'input,Once_alternate_clauseContextExt<'input>>; #[derive(Clone)] -pub struct Jump_statementContextExt<'input>{ +pub struct Once_alternate_clauseContextExt<'input>{ ph:PhantomData<&'input str> } -impl<'input> YarnSpinnerParserContext<'input> for Jump_statementContext<'input>{} +impl<'input> YarnSpinnerParserContext<'input> for Once_alternate_clauseContext<'input>{} -impl<'input,'a> Listenable + 'a> for Jump_statementContext<'input>{ +impl<'input,'a> Listenable + 'a> for Once_alternate_clauseContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_once_alternate_clause(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_once_alternate_clause(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input,'a> Visitable + 'a> for Jump_statementContext<'input>{ +impl<'input,'a> Visitable + 'a> for Once_alternate_clauseContext<'input>{ + fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { + visitor.visit_once_alternate_clause(self); + } } -impl<'input> CustomRuleContext<'input> for Jump_statementContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for Once_alternate_clauseContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_jump_statement } - //fn type_rule_index() -> usize where Self: Sized { RULE_jump_statement } + fn get_rule_index(&self) -> usize { RULE_once_alternate_clause } + //fn type_rule_index() -> usize where Self: Sized { RULE_once_alternate_clause } } -antlr4rust::tid!{Jump_statementContextExt<'a>} +antlr4rust::tid!{Once_alternate_clauseContextExt<'a>} -impl<'input> Jump_statementContextExt<'input>{ - fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { +impl<'input> Once_alternate_clauseContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { Rc::new( - Jump_statementContextAll::Error( - BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Jump_statementContextExt{ + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Once_alternate_clauseContextExt{ ph:PhantomData }), ) - ) } } -pub trait Jump_statementContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ +pub trait Once_alternate_clauseContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ +/// Retrieves first TerminalNode corresponding to token COMMAND_START +/// Returns `None` if there is no child corresponding to token COMMAND_START +fn COMMAND_START(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_START, 0) +} +/// Retrieves first TerminalNode corresponding to token COMMAND_ELSE +/// Returns `None` if there is no child corresponding to token COMMAND_ELSE +fn COMMAND_ELSE(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_ELSE, 0) +} +/// Retrieves first TerminalNode corresponding to token COMMAND_END +/// Returns `None` if there is no child corresponding to token COMMAND_END +fn COMMAND_END(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_COMMAND_END, 0) +} +fn statement_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +fn statement(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) +} } -impl<'input> Jump_statementContextAttrs<'input> for Jump_statementContext<'input>{} +impl<'input> Once_alternate_clauseContextAttrs<'input> for Once_alternate_clauseContext<'input>{} -pub type JumpToNodeNameContext<'input> = BaseParserRuleContext<'input,JumpToNodeNameContextExt<'input>>; +impl<'input, I> YarnSpinnerParser<'input, I> +where + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + pub fn once_alternate_clause(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = Once_alternate_clauseContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 74, RULE_once_alternate_clause); + let mut _localctx: Rc = _localctx; + let result: Result<(), ANTLRError> = (|| { -pub trait JumpToNodeNameContextAttrs<'input>: YarnSpinnerParserContext<'input>{ - /// Retrieves first TerminalNode corresponding to token COMMAND_START - /// Returns `None` if there is no child corresponding to token COMMAND_START - fn COMMAND_START(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_COMMAND_START, 0) - } - /// Retrieves first TerminalNode corresponding to token COMMAND_JUMP - /// Returns `None` if there is no child corresponding to token COMMAND_JUMP - fn COMMAND_JUMP(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_COMMAND_JUMP, 0) - } - /// Retrieves first TerminalNode corresponding to token COMMAND_END - /// Returns `None` if there is no child corresponding to token COMMAND_END - fn COMMAND_END(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_COMMAND_END, 0) - } - /// Retrieves first TerminalNode corresponding to token ID - /// Returns `None` if there is no child corresponding to token ID - fn ID(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_ID, 0) + let mut _alt: i32; + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(466); + recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; + + recog.base.set_state(467); + recog.base.match_token(YarnSpinnerParser_COMMAND_ELSE,&mut recog.err_handler)?; + + recog.base.set_state(468); + recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; + + recog.base.set_state(472); + recog.err_handler.sync(&mut recog.base)?; + _alt = recog.interpreter.adaptive_predict(49,&mut recog.base)?; + while { _alt!=2 && _alt!=INVALID_ALT } { + if _alt==1 { + { + { + /*InvokeRule statement*/ + recog.base.set_state(469); + recog.statement()?; + + } + } + } + recog.base.set_state(474); + recog.err_handler.sync(&mut recog.base)?; + _alt = recog.interpreter.adaptive_predict(49,&mut recog.base)?; + } + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) } } +//------------------- structured_command ---------------- +pub type Structured_commandContextAll<'input> = Structured_commandContext<'input>; -impl<'input> JumpToNodeNameContextAttrs<'input> for JumpToNodeNameContext<'input>{} -pub struct JumpToNodeNameContextExt<'input>{ - base:Jump_statementContextExt<'input>, - pub destination: Option>, - ph:PhantomData<&'input str> -} +pub type Structured_commandContext<'input> = BaseParserRuleContext<'input,Structured_commandContextExt<'input>>; -antlr4rust::tid!{JumpToNodeNameContextExt<'a>} +#[derive(Clone)] +pub struct Structured_commandContextExt<'input>{ + pub command_id: Option>, +ph:PhantomData<&'input str> +} -impl<'input> YarnSpinnerParserContext<'input> for JumpToNodeNameContext<'input>{} +impl<'input> YarnSpinnerParserContext<'input> for Structured_commandContext<'input>{} -impl<'input,'a> Listenable + 'a> for JumpToNodeNameContext<'input>{ - fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.enter_every_rule(self)?; - listener.enter_jumpToNodeName(self); - Ok(()) - } - fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_jumpToNodeName(self); - listener.exit_every_rule(self)?; - Ok(()) - } +impl<'input,'a> Listenable + 'a> for Structured_commandContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_structured_command(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_structured_command(self); + listener.exit_every_rule(self)?; + Ok(()) + } } -impl<'input,'a> Visitable + 'a> for JumpToNodeNameContext<'input>{ +impl<'input,'a> Visitable + 'a> for Structured_commandContext<'input>{ fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_jumpToNodeName(self); + visitor.visit_structured_command(self); } } -impl<'input> CustomRuleContext<'input> for JumpToNodeNameContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for Structured_commandContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_jump_statement } - //fn type_rule_index() -> usize where Self: Sized { RULE_jump_statement } -} - -impl<'input> Borrow> for JumpToNodeNameContext<'input>{ - fn borrow(&self) -> &Jump_statementContextExt<'input> { &self.base } -} -impl<'input> BorrowMut> for JumpToNodeNameContext<'input>{ - fn borrow_mut(&mut self) -> &mut Jump_statementContextExt<'input> { &mut self.base } + fn get_rule_index(&self) -> usize { RULE_structured_command } + //fn type_rule_index() -> usize where Self: Sized { RULE_structured_command } } +antlr4rust::tid!{Structured_commandContextExt<'a>} -impl<'input> Jump_statementContextAttrs<'input> for JumpToNodeNameContext<'input> {} - -impl<'input> JumpToNodeNameContextExt<'input>{ - fn new(ctx: &dyn Jump_statementContextAttrs<'input>) -> Rc> { +impl<'input> Structured_commandContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { Rc::new( - Jump_statementContextAll::JumpToNodeNameContext( - BaseParserRuleContext::copy_from(ctx,JumpToNodeNameContextExt{ - destination:None, - base: ctx.borrow().clone(), - ph:PhantomData - }) - ) + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Structured_commandContextExt{ + command_id: None, + + ph:PhantomData + }), ) } } -pub type JumpToExpressionContext<'input> = BaseParserRuleContext<'input,JumpToExpressionContextExt<'input>>; +pub trait Structured_commandContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ -pub trait JumpToExpressionContextAttrs<'input>: YarnSpinnerParserContext<'input>{ - /// Retrieves first TerminalNode corresponding to token COMMAND_START - /// Returns `None` if there is no child corresponding to token COMMAND_START - fn COMMAND_START(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_COMMAND_START, 0) - } - /// Retrieves first TerminalNode corresponding to token COMMAND_JUMP - /// Returns `None` if there is no child corresponding to token COMMAND_JUMP - fn COMMAND_JUMP(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_COMMAND_JUMP, 0) - } - /// Retrieves first TerminalNode corresponding to token EXPRESSION_START - /// Returns `None` if there is no child corresponding to token EXPRESSION_START - fn EXPRESSION_START(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_EXPRESSION_START, 0) - } - fn expression(&self) -> Option>> where Self:Sized{ - self.child_of_type(0) - } - /// Retrieves first TerminalNode corresponding to token EXPRESSION_END - /// Returns `None` if there is no child corresponding to token EXPRESSION_END - fn EXPRESSION_END(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_EXPRESSION_END, 0) - } - /// Retrieves first TerminalNode corresponding to token COMMAND_END - /// Returns `None` if there is no child corresponding to token COMMAND_END - fn COMMAND_END(&self) -> Option>> where Self:Sized{ - self.get_token(YarnSpinnerParser_COMMAND_END, 0) - } +/// Retrieves first TerminalNode corresponding to token FUNC_ID +/// Returns `None` if there is no child corresponding to token FUNC_ID +fn FUNC_ID(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_FUNC_ID, 0) +} +fn structured_command_value_all(&self) -> Vec>> where Self:Sized{ + self.children_of_type() +} +fn structured_command_value(&self, i: usize) -> Option>> where Self:Sized{ + self.child_of_type(i) } -impl<'input> JumpToExpressionContextAttrs<'input> for JumpToExpressionContext<'input>{} - -pub struct JumpToExpressionContextExt<'input>{ - base:Jump_statementContextExt<'input>, - ph:PhantomData<&'input str> } -antlr4rust::tid!{JumpToExpressionContextExt<'a>} +impl<'input> Structured_commandContextAttrs<'input> for Structured_commandContext<'input>{} -impl<'input> YarnSpinnerParserContext<'input> for JumpToExpressionContext<'input>{} +impl<'input, I> YarnSpinnerParser<'input, I> +where + I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, +{ + pub fn structured_command(&mut self,) + -> Result>,ANTLRError> { + let mut recog = self; + let _parentctx = recog.ctx.take(); + let mut _localctx = Structured_commandContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 76, RULE_structured_command); + let mut _localctx: Rc = _localctx; + let mut _la: i32 = -1; + let result: Result<(), ANTLRError> = (|| { -impl<'input,'a> Listenable + 'a> for JumpToExpressionContext<'input>{ - fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.enter_every_rule(self)?; - listener.enter_jumpToExpression(self); - Ok(()) - } - fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { - listener.exit_jumpToExpression(self); - listener.exit_every_rule(self)?; - Ok(()) + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; + { + recog.base.set_state(475); + let tmp = recog.base.match_token(YarnSpinnerParser_FUNC_ID,&mut recog.err_handler)?; + cast_mut::<_,Structured_commandContext >(&mut _localctx).command_id = Some(tmp.clone()); + + + recog.base.set_state(479); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + while ((((_la - 33)) & !0x3f) == 0 && ((1usize << (_la - 33)) & 2970624003) != 0) || _la==YarnSpinnerParser_DOT || _la==YarnSpinnerParser_NUMBER { + { + { + /*InvokeRule structured_command_value*/ + recog.base.set_state(476); + recog.structured_command_value()?; + + } + } + recog.base.set_state(481); + recog.err_handler.sync(&mut recog.base)?; + _la = recog.base.input.la(1); + } + } + Ok(()) + })(); + match result { + Ok(_)=>{}, + Err(e @ ANTLRError::FallThrough(_)) => return Err(e), + Err(ref re) => { + //_localctx.exception = re; + recog.err_handler.report_error(&mut recog.base, re); + recog.err_handler.recover(&mut recog.base, re)?; + } + } + recog.base.exit_rule()?; + + Ok(_localctx) } } +//------------------- structured_command_value ---------------- +pub type Structured_command_valueContextAll<'input> = Structured_command_valueContext<'input>; -impl<'input,'a> Visitable + 'a> for JumpToExpressionContext<'input>{ + +pub type Structured_command_valueContext<'input> = BaseParserRuleContext<'input,Structured_command_valueContextExt<'input>>; + +#[derive(Clone)] +pub struct Structured_command_valueContextExt<'input>{ +ph:PhantomData<&'input str> +} + +impl<'input> YarnSpinnerParserContext<'input> for Structured_command_valueContext<'input>{} + +impl<'input,'a> Listenable + 'a> for Structured_command_valueContext<'input>{ + fn enter(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.enter_every_rule(self)?; + listener.enter_structured_command_value(self); + Ok(()) + } + fn exit(&self,listener: &mut (dyn YarnSpinnerParserListener<'input> + 'a)) -> Result<(), ANTLRError> { + listener.exit_structured_command_value(self); + listener.exit_every_rule(self)?; + Ok(()) + } +} + +impl<'input,'a> Visitable + 'a> for Structured_command_valueContext<'input>{ fn accept(&self,visitor: &mut (dyn YarnSpinnerParserVisitor<'input> + 'a)) { - visitor.visit_jumpToExpression(self); + visitor.visit_structured_command_value(self); } } -impl<'input> CustomRuleContext<'input> for JumpToExpressionContextExt<'input>{ +impl<'input> CustomRuleContext<'input> for Structured_command_valueContextExt<'input>{ type TF = LocalTokenFactory<'input>; type Ctx = YarnSpinnerParserContextType; - fn get_rule_index(&self) -> usize { RULE_jump_statement } - //fn type_rule_index() -> usize where Self: Sized { RULE_jump_statement } -} - -impl<'input> Borrow> for JumpToExpressionContext<'input>{ - fn borrow(&self) -> &Jump_statementContextExt<'input> { &self.base } -} -impl<'input> BorrowMut> for JumpToExpressionContext<'input>{ - fn borrow_mut(&mut self) -> &mut Jump_statementContextExt<'input> { &mut self.base } + fn get_rule_index(&self) -> usize { RULE_structured_command_value } + //fn type_rule_index() -> usize where Self: Sized { RULE_structured_command_value } } +antlr4rust::tid!{Structured_command_valueContextExt<'a>} -impl<'input> Jump_statementContextAttrs<'input> for JumpToExpressionContext<'input> {} - -impl<'input> JumpToExpressionContextExt<'input>{ - fn new(ctx: &dyn Jump_statementContextAttrs<'input>) -> Rc> { +impl<'input> Structured_command_valueContextExt<'input>{ + fn new(parent: Option + 'input > >, invoking_state: i32) -> Rc> { Rc::new( - Jump_statementContextAll::JumpToExpressionContext( - BaseParserRuleContext::copy_from(ctx,JumpToExpressionContextExt{ - base: ctx.borrow().clone(), - ph:PhantomData - }) - ) + BaseParserRuleContext::new_parser_ctx(parent, invoking_state,Structured_command_valueContextExt{ + + ph:PhantomData + }), ) } } +pub trait Structured_command_valueContextAttrs<'input>: YarnSpinnerParserContext<'input> + BorrowMut>{ + +fn expression(&self) -> Option>> where Self:Sized{ + self.child_of_type(0) +} +/// Retrieves first TerminalNode corresponding to token FUNC_ID +/// Returns `None` if there is no child corresponding to token FUNC_ID +fn FUNC_ID(&self) -> Option>> where Self:Sized{ + self.get_token(YarnSpinnerParser_FUNC_ID, 0) +} + +} + +impl<'input> Structured_command_valueContextAttrs<'input> for Structured_command_valueContext<'input>{} + impl<'input, I> YarnSpinnerParser<'input, I> where I: TokenStream<'input, TF = LocalTokenFactory<'input> > + TidAble<'input>, { - pub fn jump_statement(&mut self,) - -> Result>,ANTLRError> { + pub fn structured_command_value(&mut self,) + -> Result>,ANTLRError> { let mut recog = self; let _parentctx = recog.ctx.take(); - let mut _localctx = Jump_statementContextExt::new(_parentctx.clone(), recog.base.get_state()); - recog.base.enter_rule(_localctx.clone(), 50, RULE_jump_statement); - let mut _localctx: Rc = _localctx; + let mut _localctx = Structured_command_valueContextExt::new(_parentctx.clone(), recog.base.get_state()); + recog.base.enter_rule(_localctx.clone(), 78, RULE_structured_command_value); + let mut _localctx: Rc = _localctx; let result: Result<(), ANTLRError> = (|| { - recog.base.set_state(312); + recog.base.set_state(484); recog.err_handler.sync(&mut recog.base)?; - match recog.interpreter.adaptive_predict(31,&mut recog.base)? { + match recog.interpreter.adaptive_predict(51,&mut recog.base)? { 1 =>{ - let tmp = JumpToNodeNameContextExt::new(&**_localctx); - recog.base.enter_outer_alt(Some(tmp.clone()), 1)?; - _localctx = tmp; + //recog.base.enter_outer_alt(_localctx.clone(), 1)?; + recog.base.enter_outer_alt(None, 1)?; { - recog.base.set_state(301); - recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; - - recog.base.set_state(302); - recog.base.match_token(YarnSpinnerParser_COMMAND_JUMP,&mut recog.err_handler)?; - - recog.base.set_state(303); - let tmp = recog.base.match_token(YarnSpinnerParser_ID,&mut recog.err_handler)?; - if let Jump_statementContextAll::JumpToNodeNameContext(ctx) = cast_mut::<_,Jump_statementContextAll >(&mut _localctx){ - ctx.destination = Some(tmp.clone()); } else {unreachable!("cant cast");} - - recog.base.set_state(304); - recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; + /*InvokeRule expression*/ + recog.base.set_state(482); + recog.expression_rec(0)?; } } , 2 =>{ - let tmp = JumpToExpressionContextExt::new(&**_localctx); - recog.base.enter_outer_alt(Some(tmp.clone()), 2)?; - _localctx = tmp; + //recog.base.enter_outer_alt(_localctx.clone(), 2)?; + recog.base.enter_outer_alt(None, 2)?; { - recog.base.set_state(305); - recog.base.match_token(YarnSpinnerParser_COMMAND_START,&mut recog.err_handler)?; - - recog.base.set_state(306); - recog.base.match_token(YarnSpinnerParser_COMMAND_JUMP,&mut recog.err_handler)?; - - recog.base.set_state(307); - recog.base.match_token(YarnSpinnerParser_EXPRESSION_START,&mut recog.err_handler)?; - - /*InvokeRule expression*/ - recog.base.set_state(308); - recog.expression_rec(0)?; - - recog.base.set_state(309); - recog.base.match_token(YarnSpinnerParser_EXPRESSION_END,&mut recog.err_handler)?; - - recog.base.set_state(310); - recog.base.match_token(YarnSpinnerParser_COMMAND_END,&mut recog.err_handler)?; + recog.base.set_state(483); + recog.base.match_token(YarnSpinnerParser_FUNC_ID,&mut recog.err_handler)?; } } @@ -5932,148 +8544,228 @@ where Arc::new(dfa) }; static ref _serializedATN: Vec = vec![ - 4, 1, 84, 315, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, + 4, 1, 94, 487, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, - 7, 25, 1, 0, 5, 0, 54, 8, 0, 10, 0, 12, 0, 57, 9, 0, 1, 0, 4, 0, 60, 8, - 0, 11, 0, 12, 0, 61, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 68, 8, 2, 11, 2, 12, - 2, 69, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 3, 3, 79, 8, 3, 1, 4, - 5, 4, 82, 8, 4, 10, 4, 12, 4, 85, 9, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, - 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 97, 8, 5, 10, 5, 12, 5, 100, 9, 5, - 1, 5, 3, 5, 103, 8, 5, 1, 6, 1, 6, 3, 6, 107, 8, 6, 1, 6, 5, 6, 110, 8, - 6, 10, 6, 12, 6, 113, 9, 6, 1, 6, 1, 6, 1, 7, 4, 7, 118, 8, 7, 11, 7, - 12, 7, 119, 1, 7, 1, 7, 1, 7, 1, 7, 4, 7, 126, 8, 7, 11, 7, 12, 7, 127, - 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, - 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 148, 8, 10, 1, 10, - 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, - 1, 10, 1, 10, 1, 10, 1, 10, 5, 10, 165, 8, 10, 10, 10, 12, 10, 168, 9, - 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 177, 8, 11, - 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 3, 13, 184, 8, 13, 1, 13, 1, 13, 5, - 13, 188, 8, 13, 10, 13, 12, 13, 191, 9, 13, 1, 13, 1, 13, 1, 14, 1, 14, - 5, 14, 197, 8, 14, 10, 14, 12, 14, 200, 9, 14, 1, 14, 3, 14, 203, 8, 14, - 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, - 214, 8, 15, 10, 15, 12, 15, 217, 9, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, - 16, 5, 16, 224, 8, 16, 10, 16, 12, 16, 227, 9, 16, 1, 17, 1, 17, 1, 17, - 1, 17, 5, 17, 233, 8, 17, 10, 17, 12, 17, 236, 9, 17, 1, 18, 1, 18, 1, - 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, - 20, 1, 20, 1, 20, 1, 20, 5, 20, 254, 8, 20, 10, 20, 12, 20, 257, 9, 20, - 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 5, 21, 264, 8, 21, 10, 21, 12, 21, - 267, 9, 21, 1, 22, 5, 22, 270, 8, 22, 10, 22, 12, 22, 273, 9, 22, 1, 22, - 1, 22, 3, 22, 277, 8, 22, 1, 23, 1, 23, 1, 23, 1, 23, 5, 23, 283, 8, 23, - 10, 23, 12, 23, 286, 9, 23, 1, 23, 3, 23, 289, 8, 23, 1, 24, 1, 24, 1, - 24, 1, 24, 1, 24, 1, 24, 1, 24, 3, 24, 298, 8, 24, 1, 24, 1, 24, 1, 25, - 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, - 3, 25, 313, 8, 25, 1, 25, 0, 1, 20, 26, 0, 2, 4, 6, 8, 10, 12, 14, 16, - 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 0, - 6, 1, 0, 49, 51, 1, 0, 47, 48, 2, 0, 32, 33, 35, 36, 2, 0, 34, 34, 37, - 37, 1, 0, 38, 40, 2, 0, 31, 31, 42, 46, 337, 0, 55, 1, 0, 0, 0, 2, 63, - 1, 0, 0, 0, 4, 67, 1, 0, 0, 0, 6, 75, 1, 0, 0, 0, 8, 83, 1, 0, 0, 0, 10, - 102, 1, 0, 0, 0, 12, 104, 1, 0, 0, 0, 14, 125, 1, 0, 0, 0, 16, 129, 1, - 0, 0, 0, 18, 132, 1, 0, 0, 0, 20, 147, 1, 0, 0, 0, 22, 176, 1, 0, 0, 0, - 24, 178, 1, 0, 0, 0, 26, 180, 1, 0, 0, 0, 28, 194, 1, 0, 0, 0, 30, 208, - 1, 0, 0, 0, 32, 218, 1, 0, 0, 0, 34, 228, 1, 0, 0, 0, 36, 237, 1, 0, 0, - 0, 38, 244, 1, 0, 0, 0, 40, 249, 1, 0, 0, 0, 42, 265, 1, 0, 0, 0, 44, - 271, 1, 0, 0, 0, 46, 278, 1, 0, 0, 0, 48, 290, 1, 0, 0, 0, 50, 312, 1, - 0, 0, 0, 52, 54, 3, 2, 1, 0, 53, 52, 1, 0, 0, 0, 54, 57, 1, 0, 0, 0, 55, - 53, 1, 0, 0, 0, 55, 56, 1, 0, 0, 0, 56, 59, 1, 0, 0, 0, 57, 55, 1, 0, - 0, 0, 58, 60, 3, 4, 2, 0, 59, 58, 1, 0, 0, 0, 60, 61, 1, 0, 0, 0, 61, - 59, 1, 0, 0, 0, 61, 62, 1, 0, 0, 0, 62, 1, 1, 0, 0, 0, 63, 64, 5, 10, - 0, 0, 64, 65, 5, 26, 0, 0, 65, 3, 1, 0, 0, 0, 66, 68, 3, 6, 3, 0, 67, - 66, 1, 0, 0, 0, 68, 69, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 69, 70, 1, 0, - 0, 0, 70, 71, 1, 0, 0, 0, 71, 72, 5, 8, 0, 0, 72, 73, 3, 8, 4, 0, 73, - 74, 5, 13, 0, 0, 74, 5, 1, 0, 0, 0, 75, 76, 5, 7, 0, 0, 76, 78, 5, 9, - 0, 0, 77, 79, 5, 11, 0, 0, 78, 77, 1, 0, 0, 0, 78, 79, 1, 0, 0, 0, 79, - 7, 1, 0, 0, 0, 80, 82, 3, 10, 5, 0, 81, 80, 1, 0, 0, 0, 82, 85, 1, 0, - 0, 0, 83, 81, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 9, 1, 0, 0, 0, 85, 83, - 1, 0, 0, 0, 86, 103, 3, 12, 6, 0, 87, 103, 3, 28, 14, 0, 88, 103, 3, 36, - 18, 0, 89, 103, 3, 44, 22, 0, 90, 103, 3, 38, 19, 0, 91, 103, 3, 40, 20, - 0, 92, 103, 3, 48, 24, 0, 93, 103, 3, 50, 25, 0, 94, 98, 5, 1, 0, 0, 95, - 97, 3, 10, 5, 0, 96, 95, 1, 0, 0, 0, 97, 100, 1, 0, 0, 0, 98, 96, 1, 0, - 0, 0, 98, 99, 1, 0, 0, 0, 99, 101, 1, 0, 0, 0, 100, 98, 1, 0, 0, 0, 101, - 103, 5, 2, 0, 0, 102, 86, 1, 0, 0, 0, 102, 87, 1, 0, 0, 0, 102, 88, 1, - 0, 0, 0, 102, 89, 1, 0, 0, 0, 102, 90, 1, 0, 0, 0, 102, 91, 1, 0, 0, 0, - 102, 92, 1, 0, 0, 0, 102, 93, 1, 0, 0, 0, 102, 94, 1, 0, 0, 0, 103, 11, - 1, 0, 0, 0, 104, 106, 3, 14, 7, 0, 105, 107, 3, 18, 9, 0, 106, 105, 1, - 0, 0, 0, 106, 107, 1, 0, 0, 0, 107, 111, 1, 0, 0, 0, 108, 110, 3, 16, - 8, 0, 109, 108, 1, 0, 0, 0, 110, 113, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, - 111, 112, 1, 0, 0, 0, 112, 114, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, - 115, 5, 6, 0, 0, 115, 13, 1, 0, 0, 0, 116, 118, 5, 20, 0, 0, 117, 116, - 1, 0, 0, 0, 118, 119, 1, 0, 0, 0, 119, 117, 1, 0, 0, 0, 119, 120, 1, 0, - 0, 0, 120, 126, 1, 0, 0, 0, 121, 122, 5, 16, 0, 0, 122, 123, 3, 20, 10, - 0, 123, 124, 5, 58, 0, 0, 124, 126, 1, 0, 0, 0, 125, 117, 1, 0, 0, 0, - 125, 121, 1, 0, 0, 0, 126, 127, 1, 0, 0, 0, 127, 125, 1, 0, 0, 0, 127, - 128, 1, 0, 0, 0, 128, 15, 1, 0, 0, 0, 129, 130, 5, 10, 0, 0, 130, 131, - 5, 26, 0, 0, 131, 17, 1, 0, 0, 0, 132, 133, 5, 15, 0, 0, 133, 134, 5, - 64, 0, 0, 134, 135, 3, 20, 10, 0, 135, 136, 5, 76, 0, 0, 136, 19, 1, 0, - 0, 0, 137, 138, 6, 10, -1, 0, 138, 139, 5, 52, 0, 0, 139, 140, 3, 20, - 10, 0, 140, 141, 5, 53, 0, 0, 141, 148, 1, 0, 0, 0, 142, 143, 5, 48, 0, - 0, 143, 148, 3, 20, 10, 8, 144, 145, 5, 41, 0, 0, 145, 148, 3, 20, 10, - 7, 146, 148, 3, 22, 11, 0, 147, 137, 1, 0, 0, 0, 147, 142, 1, 0, 0, 0, - 147, 144, 1, 0, 0, 0, 147, 146, 1, 0, 0, 0, 148, 166, 1, 0, 0, 0, 149, - 150, 10, 6, 0, 0, 150, 151, 7, 0, 0, 0, 151, 165, 3, 20, 10, 7, 152, 153, - 10, 5, 0, 0, 153, 154, 7, 1, 0, 0, 154, 165, 3, 20, 10, 6, 155, 156, 10, - 4, 0, 0, 156, 157, 7, 2, 0, 0, 157, 165, 3, 20, 10, 5, 158, 159, 10, 3, - 0, 0, 159, 160, 7, 3, 0, 0, 160, 165, 3, 20, 10, 4, 161, 162, 10, 2, 0, - 0, 162, 163, 7, 4, 0, 0, 163, 165, 3, 20, 10, 3, 164, 149, 1, 0, 0, 0, - 164, 152, 1, 0, 0, 0, 164, 155, 1, 0, 0, 0, 164, 158, 1, 0, 0, 0, 164, - 161, 1, 0, 0, 0, 165, 168, 1, 0, 0, 0, 166, 164, 1, 0, 0, 0, 166, 167, - 1, 0, 0, 0, 167, 21, 1, 0, 0, 0, 168, 166, 1, 0, 0, 0, 169, 177, 5, 61, - 0, 0, 170, 177, 5, 28, 0, 0, 171, 177, 5, 29, 0, 0, 172, 177, 3, 24, 12, - 0, 173, 177, 5, 56, 0, 0, 174, 177, 5, 30, 0, 0, 175, 177, 3, 26, 13, - 0, 176, 169, 1, 0, 0, 0, 176, 170, 1, 0, 0, 0, 176, 171, 1, 0, 0, 0, 176, - 172, 1, 0, 0, 0, 176, 173, 1, 0, 0, 0, 176, 174, 1, 0, 0, 0, 176, 175, - 1, 0, 0, 0, 177, 23, 1, 0, 0, 0, 178, 179, 5, 59, 0, 0, 179, 25, 1, 0, - 0, 0, 180, 181, 5, 57, 0, 0, 181, 183, 5, 52, 0, 0, 182, 184, 3, 20, 10, - 0, 183, 182, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 189, 1, 0, 0, 0, 185, - 186, 5, 54, 0, 0, 186, 188, 3, 20, 10, 0, 187, 185, 1, 0, 0, 0, 188, 191, - 1, 0, 0, 0, 189, 187, 1, 0, 0, 0, 189, 190, 1, 0, 0, 0, 190, 192, 1, 0, - 0, 0, 191, 189, 1, 0, 0, 0, 192, 193, 5, 53, 0, 0, 193, 27, 1, 0, 0, 0, - 194, 198, 3, 30, 15, 0, 195, 197, 3, 32, 16, 0, 196, 195, 1, 0, 0, 0, - 197, 200, 1, 0, 0, 0, 198, 196, 1, 0, 0, 0, 198, 199, 1, 0, 0, 0, 199, - 202, 1, 0, 0, 0, 200, 198, 1, 0, 0, 0, 201, 203, 3, 34, 17, 0, 202, 201, - 1, 0, 0, 0, 202, 203, 1, 0, 0, 0, 203, 204, 1, 0, 0, 0, 204, 205, 5, 15, - 0, 0, 205, 206, 5, 68, 0, 0, 206, 207, 5, 76, 0, 0, 207, 29, 1, 0, 0, - 0, 208, 209, 5, 15, 0, 0, 209, 210, 5, 64, 0, 0, 210, 211, 3, 20, 10, - 0, 211, 215, 5, 76, 0, 0, 212, 214, 3, 10, 5, 0, 213, 212, 1, 0, 0, 0, - 214, 217, 1, 0, 0, 0, 215, 213, 1, 0, 0, 0, 215, 216, 1, 0, 0, 0, 216, - 31, 1, 0, 0, 0, 217, 215, 1, 0, 0, 0, 218, 219, 5, 15, 0, 0, 219, 220, - 5, 65, 0, 0, 220, 221, 3, 20, 10, 0, 221, 225, 5, 76, 0, 0, 222, 224, - 3, 10, 5, 0, 223, 222, 1, 0, 0, 0, 224, 227, 1, 0, 0, 0, 225, 223, 1, - 0, 0, 0, 225, 226, 1, 0, 0, 0, 226, 33, 1, 0, 0, 0, 227, 225, 1, 0, 0, - 0, 228, 229, 5, 15, 0, 0, 229, 230, 5, 66, 0, 0, 230, 234, 5, 76, 0, 0, - 231, 233, 3, 10, 5, 0, 232, 231, 1, 0, 0, 0, 233, 236, 1, 0, 0, 0, 234, - 232, 1, 0, 0, 0, 234, 235, 1, 0, 0, 0, 235, 35, 1, 0, 0, 0, 236, 234, - 1, 0, 0, 0, 237, 238, 5, 15, 0, 0, 238, 239, 5, 67, 0, 0, 239, 240, 3, - 24, 12, 0, 240, 241, 7, 5, 0, 0, 241, 242, 3, 20, 10, 0, 242, 243, 5, - 76, 0, 0, 243, 37, 1, 0, 0, 0, 244, 245, 5, 15, 0, 0, 245, 246, 5, 69, - 0, 0, 246, 247, 3, 26, 13, 0, 247, 248, 5, 76, 0, 0, 248, 39, 1, 0, 0, - 0, 249, 250, 5, 15, 0, 0, 250, 251, 3, 42, 21, 0, 251, 255, 5, 78, 0, - 0, 252, 254, 3, 16, 8, 0, 253, 252, 1, 0, 0, 0, 254, 257, 1, 0, 0, 0, - 255, 253, 1, 0, 0, 0, 255, 256, 1, 0, 0, 0, 256, 41, 1, 0, 0, 0, 257, - 255, 1, 0, 0, 0, 258, 264, 5, 80, 0, 0, 259, 260, 5, 79, 0, 0, 260, 261, - 3, 20, 10, 0, 261, 262, 5, 58, 0, 0, 262, 264, 1, 0, 0, 0, 263, 258, 1, - 0, 0, 0, 263, 259, 1, 0, 0, 0, 264, 267, 1, 0, 0, 0, 265, 263, 1, 0, 0, - 0, 265, 266, 1, 0, 0, 0, 266, 43, 1, 0, 0, 0, 267, 265, 1, 0, 0, 0, 268, - 270, 3, 46, 23, 0, 269, 268, 1, 0, 0, 0, 270, 273, 1, 0, 0, 0, 271, 269, - 1, 0, 0, 0, 271, 272, 1, 0, 0, 0, 272, 274, 1, 0, 0, 0, 273, 271, 1, 0, - 0, 0, 274, 276, 3, 46, 23, 0, 275, 277, 5, 3, 0, 0, 276, 275, 1, 0, 0, - 0, 276, 277, 1, 0, 0, 0, 277, 45, 1, 0, 0, 0, 278, 279, 5, 14, 0, 0, 279, - 288, 3, 12, 6, 0, 280, 284, 5, 1, 0, 0, 281, 283, 3, 10, 5, 0, 282, 281, - 1, 0, 0, 0, 283, 286, 1, 0, 0, 0, 284, 282, 1, 0, 0, 0, 284, 285, 1, 0, - 0, 0, 285, 287, 1, 0, 0, 0, 286, 284, 1, 0, 0, 0, 287, 289, 5, 2, 0, 0, - 288, 280, 1, 0, 0, 0, 288, 289, 1, 0, 0, 0, 289, 47, 1, 0, 0, 0, 290, - 291, 5, 15, 0, 0, 291, 292, 5, 70, 0, 0, 292, 293, 3, 24, 12, 0, 293, - 294, 5, 31, 0, 0, 294, 297, 3, 22, 11, 0, 295, 296, 5, 55, 0, 0, 296, - 298, 5, 57, 0, 0, 297, 295, 1, 0, 0, 0, 297, 298, 1, 0, 0, 0, 298, 299, - 1, 0, 0, 0, 299, 300, 5, 76, 0, 0, 300, 49, 1, 0, 0, 0, 301, 302, 5, 15, - 0, 0, 302, 303, 5, 71, 0, 0, 303, 304, 5, 7, 0, 0, 304, 313, 5, 76, 0, - 0, 305, 306, 5, 15, 0, 0, 306, 307, 5, 71, 0, 0, 307, 308, 5, 16, 0, 0, - 308, 309, 3, 20, 10, 0, 309, 310, 5, 58, 0, 0, 310, 311, 5, 76, 0, 0, - 311, 313, 1, 0, 0, 0, 312, 301, 1, 0, 0, 0, 312, 305, 1, 0, 0, 0, 313, - 51, 1, 0, 0, 0, 32, 55, 61, 69, 78, 83, 98, 102, 106, 111, 119, 125, 127, - 147, 164, 166, 176, 183, 189, 198, 202, 215, 225, 234, 255, 263, 265, - 271, 276, 284, 288, 297, 312 + 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, + 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, + 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 1, 0, 5, + 0, 82, 8, 0, 10, 0, 12, 0, 85, 9, 0, 1, 0, 4, 0, 88, 8, 0, 11, 0, 12, + 0, 89, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 4, 2, 98, 8, 2, 11, 2, 12, + 2, 99, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, + 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 3, 5, 119, 8, 5, 1, 6, 1, 6, 1, + 6, 1, 6, 1, 6, 3, 6, 126, 8, 6, 3, 6, 128, 8, 6, 1, 7, 5, 7, 131, 8, 7, + 10, 7, 12, 7, 134, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, + 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 5, 8, 150, 8, 8, 10, 8, 12, 8, + 153, 9, 8, 1, 8, 3, 8, 156, 8, 8, 1, 9, 1, 9, 3, 9, 160, 8, 9, 1, 9, 5, + 9, 163, 8, 9, 10, 9, 12, 9, 166, 9, 9, 1, 9, 1, 9, 1, 10, 4, 10, 171, + 8, 10, 11, 10, 12, 10, 172, 1, 10, 1, 10, 1, 10, 1, 10, 4, 10, 179, 8, + 10, 11, 10, 12, 10, 180, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, + 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 195, 8, 12, 1, 12, 3, 12, + 198, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, + 13, 1, 13, 3, 13, 210, 8, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, + 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 5, 13, + 227, 8, 13, 10, 13, 12, 13, 230, 9, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, + 14, 1, 14, 1, 14, 3, 14, 239, 8, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, + 3, 16, 246, 8, 16, 1, 16, 1, 16, 5, 16, 250, 8, 16, 10, 16, 12, 16, 253, + 9, 16, 1, 16, 1, 16, 1, 17, 3, 17, 258, 8, 17, 1, 17, 1, 17, 1, 17, 1, + 18, 1, 18, 5, 18, 265, 8, 18, 10, 18, 12, 18, 268, 9, 18, 1, 18, 3, 18, + 271, 8, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, + 19, 5, 19, 282, 8, 19, 10, 19, 12, 19, 285, 9, 19, 1, 20, 1, 20, 1, 20, + 1, 20, 1, 20, 5, 20, 292, 8, 20, 10, 20, 12, 20, 295, 9, 20, 1, 21, 1, + 21, 1, 21, 1, 21, 5, 21, 301, 8, 21, 10, 21, 12, 21, 304, 9, 21, 1, 22, + 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, + 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 5, 24, 322, 8, 24, 10, 24, 12, 24, + 325, 9, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 4, 25, 332, 8, 25, 11, + 25, 12, 25, 333, 1, 26, 5, 26, 337, 8, 26, 10, 26, 12, 26, 340, 9, 26, + 1, 26, 1, 26, 3, 26, 344, 8, 26, 1, 27, 1, 27, 1, 27, 1, 27, 5, 27, 350, + 8, 27, 10, 27, 12, 27, 353, 9, 27, 1, 27, 3, 27, 356, 8, 27, 1, 28, 5, + 28, 359, 8, 28, 10, 28, 12, 28, 362, 9, 28, 1, 28, 1, 28, 3, 28, 366, + 8, 28, 1, 29, 1, 29, 1, 29, 1, 29, 5, 29, 372, 8, 29, 10, 29, 12, 29, + 375, 9, 29, 1, 29, 3, 29, 378, 8, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, + 1, 30, 1, 30, 3, 30, 387, 8, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, + 31, 1, 31, 4, 31, 396, 8, 31, 11, 31, 12, 31, 397, 1, 31, 1, 31, 1, 31, + 1, 31, 1, 32, 3, 32, 405, 8, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 3, + 32, 412, 8, 32, 1, 32, 1, 32, 3, 32, 416, 8, 32, 1, 33, 1, 33, 1, 33, + 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, + 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 3, 33, + 440, 8, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 3, 35, 448, 8, 35, + 1, 35, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 3, 36, 458, 8, + 36, 1, 36, 1, 36, 5, 36, 462, 8, 36, 10, 36, 12, 36, 465, 9, 36, 1, 37, + 1, 37, 1, 37, 1, 37, 5, 37, 471, 8, 37, 10, 37, 12, 37, 474, 9, 37, 1, + 38, 1, 38, 5, 38, 478, 8, 38, 10, 38, 12, 38, 481, 9, 38, 1, 39, 1, 39, + 3, 39, 485, 8, 39, 1, 39, 0, 1, 26, 40, 0, 2, 4, 6, 8, 10, 12, 14, 16, + 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, + 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 0, 6, 1, 0, 54, 56, + 1, 0, 52, 53, 2, 0, 37, 38, 40, 41, 2, 0, 39, 39, 42, 42, 1, 0, 43, 45, + 2, 0, 36, 36, 47, 51, 523, 0, 83, 1, 0, 0, 0, 2, 91, 1, 0, 0, 0, 4, 97, + 1, 0, 0, 0, 6, 105, 1, 0, 0, 0, 8, 110, 1, 0, 0, 0, 10, 115, 1, 0, 0, + 0, 12, 127, 1, 0, 0, 0, 14, 132, 1, 0, 0, 0, 16, 155, 1, 0, 0, 0, 18, + 157, 1, 0, 0, 0, 20, 178, 1, 0, 0, 0, 22, 182, 1, 0, 0, 0, 24, 197, 1, + 0, 0, 0, 26, 209, 1, 0, 0, 0, 28, 238, 1, 0, 0, 0, 30, 240, 1, 0, 0, 0, + 32, 242, 1, 0, 0, 0, 34, 257, 1, 0, 0, 0, 36, 262, 1, 0, 0, 0, 38, 276, + 1, 0, 0, 0, 40, 286, 1, 0, 0, 0, 42, 296, 1, 0, 0, 0, 44, 305, 1, 0, 0, + 0, 46, 312, 1, 0, 0, 0, 48, 317, 1, 0, 0, 0, 50, 331, 1, 0, 0, 0, 52, + 338, 1, 0, 0, 0, 54, 345, 1, 0, 0, 0, 56, 360, 1, 0, 0, 0, 58, 367, 1, + 0, 0, 0, 60, 379, 1, 0, 0, 0, 62, 390, 1, 0, 0, 0, 64, 404, 1, 0, 0, 0, + 66, 439, 1, 0, 0, 0, 68, 441, 1, 0, 0, 0, 70, 445, 1, 0, 0, 0, 72, 453, + 1, 0, 0, 0, 74, 466, 1, 0, 0, 0, 76, 475, 1, 0, 0, 0, 78, 484, 1, 0, 0, + 0, 80, 82, 3, 2, 1, 0, 81, 80, 1, 0, 0, 0, 82, 85, 1, 0, 0, 0, 83, 81, + 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 87, 1, 0, 0, 0, 85, 83, 1, 0, 0, 0, + 86, 88, 3, 4, 2, 0, 87, 86, 1, 0, 0, 0, 88, 89, 1, 0, 0, 0, 89, 87, 1, + 0, 0, 0, 89, 90, 1, 0, 0, 0, 90, 1, 1, 0, 0, 0, 91, 92, 5, 12, 0, 0, 92, + 93, 5, 30, 0, 0, 93, 3, 1, 0, 0, 0, 94, 98, 3, 10, 5, 0, 95, 98, 3, 8, + 4, 0, 96, 98, 3, 6, 3, 0, 97, 94, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 97, + 96, 1, 0, 0, 0, 98, 99, 1, 0, 0, 0, 99, 97, 1, 0, 0, 0, 99, 100, 1, 0, + 0, 0, 100, 101, 1, 0, 0, 0, 101, 102, 5, 10, 0, 0, 102, 103, 3, 14, 7, + 0, 103, 104, 5, 16, 0, 0, 104, 5, 1, 0, 0, 0, 105, 106, 5, 8, 0, 0, 106, + 107, 5, 11, 0, 0, 107, 108, 5, 9, 0, 0, 108, 109, 5, 6, 0, 0, 109, 7, + 1, 0, 0, 0, 110, 111, 5, 7, 0, 0, 111, 112, 5, 11, 0, 0, 112, 113, 3, + 12, 6, 0, 113, 114, 5, 6, 0, 0, 114, 9, 1, 0, 0, 0, 115, 116, 5, 9, 0, + 0, 116, 118, 5, 11, 0, 0, 117, 119, 5, 14, 0, 0, 118, 117, 1, 0, 0, 0, + 118, 119, 1, 0, 0, 0, 119, 11, 1, 0, 0, 0, 120, 128, 3, 26, 13, 0, 121, + 128, 5, 32, 0, 0, 122, 125, 5, 82, 0, 0, 123, 124, 5, 69, 0, 0, 124, 126, + 3, 26, 13, 0, 125, 123, 1, 0, 0, 0, 125, 126, 1, 0, 0, 0, 126, 128, 1, + 0, 0, 0, 127, 120, 1, 0, 0, 0, 127, 121, 1, 0, 0, 0, 127, 122, 1, 0, 0, + 0, 128, 13, 1, 0, 0, 0, 129, 131, 3, 16, 8, 0, 130, 129, 1, 0, 0, 0, 131, + 134, 1, 0, 0, 0, 132, 130, 1, 0, 0, 0, 132, 133, 1, 0, 0, 0, 133, 15, + 1, 0, 0, 0, 134, 132, 1, 0, 0, 0, 135, 156, 3, 18, 9, 0, 136, 156, 3, + 36, 18, 0, 137, 156, 3, 44, 22, 0, 138, 156, 3, 52, 26, 0, 139, 156, 3, + 46, 23, 0, 140, 156, 3, 48, 24, 0, 141, 156, 3, 60, 30, 0, 142, 156, 3, + 62, 31, 0, 143, 156, 3, 66, 33, 0, 144, 156, 3, 68, 34, 0, 145, 156, 3, + 56, 28, 0, 146, 156, 3, 70, 35, 0, 147, 151, 5, 1, 0, 0, 148, 150, 3, + 16, 8, 0, 149, 148, 1, 0, 0, 0, 150, 153, 1, 0, 0, 0, 151, 149, 1, 0, + 0, 0, 151, 152, 1, 0, 0, 0, 152, 154, 1, 0, 0, 0, 153, 151, 1, 0, 0, 0, + 154, 156, 5, 2, 0, 0, 155, 135, 1, 0, 0, 0, 155, 136, 1, 0, 0, 0, 155, + 137, 1, 0, 0, 0, 155, 138, 1, 0, 0, 0, 155, 139, 1, 0, 0, 0, 155, 140, + 1, 0, 0, 0, 155, 141, 1, 0, 0, 0, 155, 142, 1, 0, 0, 0, 155, 143, 1, 0, + 0, 0, 155, 144, 1, 0, 0, 0, 155, 145, 1, 0, 0, 0, 155, 146, 1, 0, 0, 0, + 155, 147, 1, 0, 0, 0, 156, 17, 1, 0, 0, 0, 157, 159, 3, 20, 10, 0, 158, + 160, 3, 24, 12, 0, 159, 158, 1, 0, 0, 0, 159, 160, 1, 0, 0, 0, 160, 164, + 1, 0, 0, 0, 161, 163, 3, 22, 11, 0, 162, 161, 1, 0, 0, 0, 163, 166, 1, + 0, 0, 0, 164, 162, 1, 0, 0, 0, 164, 165, 1, 0, 0, 0, 165, 167, 1, 0, 0, + 0, 166, 164, 1, 0, 0, 0, 167, 168, 5, 6, 0, 0, 168, 19, 1, 0, 0, 0, 169, + 171, 5, 24, 0, 0, 170, 169, 1, 0, 0, 0, 171, 172, 1, 0, 0, 0, 172, 170, + 1, 0, 0, 0, 172, 173, 1, 0, 0, 0, 173, 179, 1, 0, 0, 0, 174, 175, 5, 20, + 0, 0, 175, 176, 3, 26, 13, 0, 176, 177, 5, 63, 0, 0, 177, 179, 1, 0, 0, + 0, 178, 170, 1, 0, 0, 0, 178, 174, 1, 0, 0, 0, 179, 180, 1, 0, 0, 0, 180, + 178, 1, 0, 0, 0, 180, 181, 1, 0, 0, 0, 181, 21, 1, 0, 0, 0, 182, 183, + 5, 12, 0, 0, 183, 184, 5, 30, 0, 0, 184, 23, 1, 0, 0, 0, 185, 186, 5, + 19, 0, 0, 186, 187, 5, 69, 0, 0, 187, 188, 3, 26, 13, 0, 188, 189, 5, + 85, 0, 0, 189, 198, 1, 0, 0, 0, 190, 191, 5, 19, 0, 0, 191, 194, 5, 82, + 0, 0, 192, 193, 5, 69, 0, 0, 193, 195, 3, 26, 13, 0, 194, 192, 1, 0, 0, + 0, 194, 195, 1, 0, 0, 0, 195, 196, 1, 0, 0, 0, 196, 198, 5, 85, 0, 0, + 197, 185, 1, 0, 0, 0, 197, 190, 1, 0, 0, 0, 198, 25, 1, 0, 0, 0, 199, + 200, 6, 13, -1, 0, 200, 201, 5, 57, 0, 0, 201, 202, 3, 26, 13, 0, 202, + 203, 5, 58, 0, 0, 203, 210, 1, 0, 0, 0, 204, 205, 5, 53, 0, 0, 205, 210, + 3, 26, 13, 8, 206, 207, 5, 46, 0, 0, 207, 210, 3, 26, 13, 7, 208, 210, + 3, 28, 14, 0, 209, 199, 1, 0, 0, 0, 209, 204, 1, 0, 0, 0, 209, 206, 1, + 0, 0, 0, 209, 208, 1, 0, 0, 0, 210, 228, 1, 0, 0, 0, 211, 212, 10, 6, + 0, 0, 212, 213, 7, 0, 0, 0, 213, 227, 3, 26, 13, 7, 214, 215, 10, 5, 0, + 0, 215, 216, 7, 1, 0, 0, 216, 227, 3, 26, 13, 6, 217, 218, 10, 4, 0, 0, + 218, 219, 7, 2, 0, 0, 219, 227, 3, 26, 13, 5, 220, 221, 10, 3, 0, 0, 221, + 222, 7, 3, 0, 0, 222, 227, 3, 26, 13, 4, 223, 224, 10, 2, 0, 0, 224, 225, + 7, 4, 0, 0, 225, 227, 3, 26, 13, 3, 226, 211, 1, 0, 0, 0, 226, 214, 1, + 0, 0, 0, 226, 217, 1, 0, 0, 0, 226, 220, 1, 0, 0, 0, 226, 223, 1, 0, 0, + 0, 227, 230, 1, 0, 0, 0, 228, 226, 1, 0, 0, 0, 228, 229, 1, 0, 0, 0, 229, + 27, 1, 0, 0, 0, 230, 228, 1, 0, 0, 0, 231, 239, 5, 66, 0, 0, 232, 239, + 5, 33, 0, 0, 233, 239, 5, 34, 0, 0, 234, 239, 3, 30, 15, 0, 235, 239, + 5, 61, 0, 0, 236, 239, 3, 32, 16, 0, 237, 239, 3, 34, 17, 0, 238, 231, + 1, 0, 0, 0, 238, 232, 1, 0, 0, 0, 238, 233, 1, 0, 0, 0, 238, 234, 1, 0, + 0, 0, 238, 235, 1, 0, 0, 0, 238, 236, 1, 0, 0, 0, 238, 237, 1, 0, 0, 0, + 239, 29, 1, 0, 0, 0, 240, 241, 5, 64, 0, 0, 241, 31, 1, 0, 0, 0, 242, + 243, 5, 62, 0, 0, 243, 245, 5, 57, 0, 0, 244, 246, 3, 26, 13, 0, 245, + 244, 1, 0, 0, 0, 245, 246, 1, 0, 0, 0, 246, 251, 1, 0, 0, 0, 247, 248, + 5, 59, 0, 0, 248, 250, 3, 26, 13, 0, 249, 247, 1, 0, 0, 0, 250, 253, 1, + 0, 0, 0, 251, 249, 1, 0, 0, 0, 251, 252, 1, 0, 0, 0, 252, 254, 1, 0, 0, + 0, 253, 251, 1, 0, 0, 0, 254, 255, 5, 58, 0, 0, 255, 33, 1, 0, 0, 0, 256, + 258, 5, 62, 0, 0, 257, 256, 1, 0, 0, 0, 257, 258, 1, 0, 0, 0, 258, 259, + 1, 0, 0, 0, 259, 260, 5, 65, 0, 0, 260, 261, 5, 62, 0, 0, 261, 35, 1, + 0, 0, 0, 262, 266, 3, 38, 19, 0, 263, 265, 3, 40, 20, 0, 264, 263, 1, + 0, 0, 0, 265, 268, 1, 0, 0, 0, 266, 264, 1, 0, 0, 0, 266, 267, 1, 0, 0, + 0, 267, 270, 1, 0, 0, 0, 268, 266, 1, 0, 0, 0, 269, 271, 3, 42, 21, 0, + 270, 269, 1, 0, 0, 0, 270, 271, 1, 0, 0, 0, 271, 272, 1, 0, 0, 0, 272, + 273, 5, 19, 0, 0, 273, 274, 5, 73, 0, 0, 274, 275, 5, 85, 0, 0, 275, 37, + 1, 0, 0, 0, 276, 277, 5, 19, 0, 0, 277, 278, 5, 69, 0, 0, 278, 279, 3, + 26, 13, 0, 279, 283, 5, 85, 0, 0, 280, 282, 3, 16, 8, 0, 281, 280, 1, + 0, 0, 0, 282, 285, 1, 0, 0, 0, 283, 281, 1, 0, 0, 0, 283, 284, 1, 0, 0, + 0, 284, 39, 1, 0, 0, 0, 285, 283, 1, 0, 0, 0, 286, 287, 5, 19, 0, 0, 287, + 288, 5, 70, 0, 0, 288, 289, 3, 26, 13, 0, 289, 293, 5, 85, 0, 0, 290, + 292, 3, 16, 8, 0, 291, 290, 1, 0, 0, 0, 292, 295, 1, 0, 0, 0, 293, 291, + 1, 0, 0, 0, 293, 294, 1, 0, 0, 0, 294, 41, 1, 0, 0, 0, 295, 293, 1, 0, + 0, 0, 296, 297, 5, 19, 0, 0, 297, 298, 5, 71, 0, 0, 298, 302, 5, 85, 0, + 0, 299, 301, 3, 16, 8, 0, 300, 299, 1, 0, 0, 0, 301, 304, 1, 0, 0, 0, + 302, 300, 1, 0, 0, 0, 302, 303, 1, 0, 0, 0, 303, 43, 1, 0, 0, 0, 304, + 302, 1, 0, 0, 0, 305, 306, 5, 19, 0, 0, 306, 307, 5, 72, 0, 0, 307, 308, + 3, 30, 15, 0, 308, 309, 7, 5, 0, 0, 309, 310, 3, 26, 13, 0, 310, 311, + 5, 85, 0, 0, 311, 45, 1, 0, 0, 0, 312, 313, 5, 19, 0, 0, 313, 314, 5, + 74, 0, 0, 314, 315, 3, 32, 16, 0, 315, 316, 5, 85, 0, 0, 316, 47, 1, 0, + 0, 0, 317, 318, 5, 19, 0, 0, 318, 319, 3, 50, 25, 0, 319, 323, 5, 85, + 0, 0, 320, 322, 3, 22, 11, 0, 321, 320, 1, 0, 0, 0, 322, 325, 1, 0, 0, + 0, 323, 321, 1, 0, 0, 0, 323, 324, 1, 0, 0, 0, 324, 49, 1, 0, 0, 0, 325, + 323, 1, 0, 0, 0, 326, 332, 5, 88, 0, 0, 327, 328, 5, 87, 0, 0, 328, 329, + 3, 26, 13, 0, 329, 330, 5, 63, 0, 0, 330, 332, 1, 0, 0, 0, 331, 326, 1, + 0, 0, 0, 331, 327, 1, 0, 0, 0, 332, 333, 1, 0, 0, 0, 333, 331, 1, 0, 0, + 0, 333, 334, 1, 0, 0, 0, 334, 51, 1, 0, 0, 0, 335, 337, 3, 54, 27, 0, + 336, 335, 1, 0, 0, 0, 337, 340, 1, 0, 0, 0, 338, 336, 1, 0, 0, 0, 338, + 339, 1, 0, 0, 0, 339, 341, 1, 0, 0, 0, 340, 338, 1, 0, 0, 0, 341, 343, + 3, 54, 27, 0, 342, 344, 5, 3, 0, 0, 343, 342, 1, 0, 0, 0, 343, 344, 1, + 0, 0, 0, 344, 53, 1, 0, 0, 0, 345, 346, 5, 17, 0, 0, 346, 355, 3, 18, + 9, 0, 347, 351, 5, 1, 0, 0, 348, 350, 3, 16, 8, 0, 349, 348, 1, 0, 0, + 0, 350, 353, 1, 0, 0, 0, 351, 349, 1, 0, 0, 0, 351, 352, 1, 0, 0, 0, 352, + 354, 1, 0, 0, 0, 353, 351, 1, 0, 0, 0, 354, 356, 5, 2, 0, 0, 355, 347, + 1, 0, 0, 0, 355, 356, 1, 0, 0, 0, 356, 55, 1, 0, 0, 0, 357, 359, 3, 58, + 29, 0, 358, 357, 1, 0, 0, 0, 359, 362, 1, 0, 0, 0, 360, 358, 1, 0, 0, + 0, 360, 361, 1, 0, 0, 0, 361, 363, 1, 0, 0, 0, 362, 360, 1, 0, 0, 0, 363, + 365, 3, 58, 29, 0, 364, 366, 5, 3, 0, 0, 365, 364, 1, 0, 0, 0, 365, 366, + 1, 0, 0, 0, 366, 57, 1, 0, 0, 0, 367, 368, 5, 18, 0, 0, 368, 377, 3, 18, + 9, 0, 369, 373, 5, 1, 0, 0, 370, 372, 3, 16, 8, 0, 371, 370, 1, 0, 0, + 0, 372, 375, 1, 0, 0, 0, 373, 371, 1, 0, 0, 0, 373, 374, 1, 0, 0, 0, 374, + 376, 1, 0, 0, 0, 375, 373, 1, 0, 0, 0, 376, 378, 5, 2, 0, 0, 377, 369, + 1, 0, 0, 0, 377, 378, 1, 0, 0, 0, 378, 59, 1, 0, 0, 0, 379, 380, 5, 19, + 0, 0, 380, 381, 5, 75, 0, 0, 381, 382, 3, 30, 15, 0, 382, 383, 5, 36, + 0, 0, 383, 386, 3, 26, 13, 0, 384, 385, 5, 60, 0, 0, 385, 387, 5, 62, + 0, 0, 386, 384, 1, 0, 0, 0, 386, 387, 1, 0, 0, 0, 387, 388, 1, 0, 0, 0, + 388, 389, 5, 85, 0, 0, 389, 61, 1, 0, 0, 0, 390, 391, 5, 19, 0, 0, 391, + 392, 5, 79, 0, 0, 392, 393, 5, 9, 0, 0, 393, 395, 5, 85, 0, 0, 394, 396, + 3, 64, 32, 0, 395, 394, 1, 0, 0, 0, 396, 397, 1, 0, 0, 0, 397, 395, 1, + 0, 0, 0, 397, 398, 1, 0, 0, 0, 398, 399, 1, 0, 0, 0, 399, 400, 5, 19, + 0, 0, 400, 401, 5, 81, 0, 0, 401, 402, 5, 85, 0, 0, 402, 63, 1, 0, 0, + 0, 403, 405, 5, 1, 0, 0, 404, 403, 1, 0, 0, 0, 404, 405, 1, 0, 0, 0, 405, + 406, 1, 0, 0, 0, 406, 407, 5, 19, 0, 0, 407, 408, 5, 80, 0, 0, 408, 411, + 5, 62, 0, 0, 409, 410, 5, 36, 0, 0, 410, 412, 3, 28, 14, 0, 411, 409, + 1, 0, 0, 0, 411, 412, 1, 0, 0, 0, 412, 413, 1, 0, 0, 0, 413, 415, 5, 85, + 0, 0, 414, 416, 5, 2, 0, 0, 415, 414, 1, 0, 0, 0, 415, 416, 1, 0, 0, 0, + 416, 65, 1, 0, 0, 0, 417, 418, 5, 19, 0, 0, 418, 419, 5, 76, 0, 0, 419, + 420, 5, 9, 0, 0, 420, 440, 5, 85, 0, 0, 421, 422, 5, 19, 0, 0, 422, 423, + 5, 76, 0, 0, 423, 424, 5, 20, 0, 0, 424, 425, 3, 26, 13, 0, 425, 426, + 5, 63, 0, 0, 426, 427, 5, 85, 0, 0, 427, 440, 1, 0, 0, 0, 428, 429, 5, + 19, 0, 0, 429, 430, 5, 77, 0, 0, 430, 431, 5, 9, 0, 0, 431, 440, 5, 85, + 0, 0, 432, 433, 5, 19, 0, 0, 433, 434, 5, 77, 0, 0, 434, 435, 5, 20, 0, + 0, 435, 436, 3, 26, 13, 0, 436, 437, 5, 63, 0, 0, 437, 438, 5, 85, 0, + 0, 438, 440, 1, 0, 0, 0, 439, 417, 1, 0, 0, 0, 439, 421, 1, 0, 0, 0, 439, + 428, 1, 0, 0, 0, 439, 432, 1, 0, 0, 0, 440, 67, 1, 0, 0, 0, 441, 442, + 5, 19, 0, 0, 442, 443, 5, 78, 0, 0, 443, 444, 5, 85, 0, 0, 444, 69, 1, + 0, 0, 0, 445, 447, 3, 72, 36, 0, 446, 448, 3, 74, 37, 0, 447, 446, 1, + 0, 0, 0, 447, 448, 1, 0, 0, 0, 448, 449, 1, 0, 0, 0, 449, 450, 5, 19, + 0, 0, 450, 451, 5, 83, 0, 0, 451, 452, 5, 85, 0, 0, 452, 71, 1, 0, 0, + 0, 453, 454, 5, 19, 0, 0, 454, 457, 5, 82, 0, 0, 455, 456, 5, 69, 0, 0, + 456, 458, 3, 26, 13, 0, 457, 455, 1, 0, 0, 0, 457, 458, 1, 0, 0, 0, 458, + 459, 1, 0, 0, 0, 459, 463, 5, 85, 0, 0, 460, 462, 3, 16, 8, 0, 461, 460, + 1, 0, 0, 0, 462, 465, 1, 0, 0, 0, 463, 461, 1, 0, 0, 0, 463, 464, 1, 0, + 0, 0, 464, 73, 1, 0, 0, 0, 465, 463, 1, 0, 0, 0, 466, 467, 5, 19, 0, 0, + 467, 468, 5, 71, 0, 0, 468, 472, 5, 85, 0, 0, 469, 471, 3, 16, 8, 0, 470, + 469, 1, 0, 0, 0, 471, 474, 1, 0, 0, 0, 472, 470, 1, 0, 0, 0, 472, 473, + 1, 0, 0, 0, 473, 75, 1, 0, 0, 0, 474, 472, 1, 0, 0, 0, 475, 479, 5, 62, + 0, 0, 476, 478, 3, 78, 39, 0, 477, 476, 1, 0, 0, 0, 478, 481, 1, 0, 0, + 0, 479, 477, 1, 0, 0, 0, 479, 480, 1, 0, 0, 0, 480, 77, 1, 0, 0, 0, 481, + 479, 1, 0, 0, 0, 482, 485, 3, 26, 13, 0, 483, 485, 5, 62, 0, 0, 484, 482, + 1, 0, 0, 0, 484, 483, 1, 0, 0, 0, 485, 79, 1, 0, 0, 0, 52, 83, 89, 97, + 99, 118, 125, 127, 132, 151, 155, 159, 164, 172, 178, 180, 194, 197, 209, + 226, 228, 238, 245, 251, 257, 266, 270, 283, 293, 302, 323, 331, 333, + 338, 343, 351, 355, 360, 365, 373, 377, 386, 397, 404, 411, 415, 439, + 447, 457, 463, 472, 479, 484 ]; } diff --git a/crates/compiler/src/parser/generated/yarnspinnerparserbaselistener.rs b/crates/compiler/src/parser/generated/yarnspinnerparserbaselistener.rs new file mode 100644 index 000000000..f65216cf5 --- /dev/null +++ b/crates/compiler/src/parser/generated/yarnspinnerparserbaselistener.rs @@ -0,0 +1,707 @@ +// Generated from third-party/YarnSpinner/YarnSpinner.Compiler/Grammars/YarnSpinnerParser.g4 by ANTLR 4.13.2 + +use super::yarnspinnerparser::*; +use antlr4rust::tree::ParseTreeListener; + +// A complete Visitor for a parse tree produced by YarnSpinnerParser. + +pub trait YarnSpinnerParserBaseListener<'input>: + ParseTreeListener<'input, YarnSpinnerParserContextType> { + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_dialogue(&mut self, _ctx: &DialogueContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_dialogue(&mut self, _ctx: &DialogueContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_file_hashtag(&mut self, _ctx: &File_hashtagContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_file_hashtag(&mut self, _ctx: &File_hashtagContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_node(&mut self, _ctx: &NodeContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_node(&mut self, _ctx: &NodeContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_title_header(&mut self, _ctx: &Title_headerContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_title_header(&mut self, _ctx: &Title_headerContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_when_header(&mut self, _ctx: &When_headerContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_when_header(&mut self, _ctx: &When_headerContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_header(&mut self, _ctx: &HeaderContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_header(&mut self, _ctx: &HeaderContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_header_when_expression(&mut self, _ctx: &Header_when_expressionContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_header_when_expression(&mut self, _ctx: &Header_when_expressionContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_body(&mut self, _ctx: &BodyContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_body(&mut self, _ctx: &BodyContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_statement(&mut self, _ctx: &StatementContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_statement(&mut self, _ctx: &StatementContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_line_statement(&mut self, _ctx: &Line_statementContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_line_statement(&mut self, _ctx: &Line_statementContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_line_formatted_text(&mut self, _ctx: &Line_formatted_textContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_line_formatted_text(&mut self, _ctx: &Line_formatted_textContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_hashtag(&mut self, _ctx: &HashtagContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_hashtag(&mut self, _ctx: &HashtagContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_linecondition(&mut self, _ctx: &LineConditionContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_linecondition(&mut self, _ctx: &LineConditionContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_lineoncecondition(&mut self, _ctx: &LineOnceConditionContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_lineoncecondition(&mut self, _ctx: &LineOnceConditionContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_expparens(&mut self, _ctx: &ExpParensContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_expparens(&mut self, _ctx: &ExpParensContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_expmultdivmod(&mut self, _ctx: &ExpMultDivModContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_expmultdivmod(&mut self, _ctx: &ExpMultDivModContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_expcomparison(&mut self, _ctx: &ExpComparisonContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_expcomparison(&mut self, _ctx: &ExpComparisonContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_expnegative(&mut self, _ctx: &ExpNegativeContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_expnegative(&mut self, _ctx: &ExpNegativeContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_expandorxor(&mut self, _ctx: &ExpAndOrXorContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_expandorxor(&mut self, _ctx: &ExpAndOrXorContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_expaddsub(&mut self, _ctx: &ExpAddSubContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_expaddsub(&mut self, _ctx: &ExpAddSubContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_expnot(&mut self, _ctx: &ExpNotContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_expnot(&mut self, _ctx: &ExpNotContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_expvalue(&mut self, _ctx: &ExpValueContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_expvalue(&mut self, _ctx: &ExpValueContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_expequality(&mut self, _ctx: &ExpEqualityContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_expequality(&mut self, _ctx: &ExpEqualityContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_valuenumber(&mut self, _ctx: &ValueNumberContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_valuenumber(&mut self, _ctx: &ValueNumberContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_valuetrue(&mut self, _ctx: &ValueTrueContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_valuetrue(&mut self, _ctx: &ValueTrueContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_valuefalse(&mut self, _ctx: &ValueFalseContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_valuefalse(&mut self, _ctx: &ValueFalseContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_valuevar(&mut self, _ctx: &ValueVarContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_valuevar(&mut self, _ctx: &ValueVarContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_valuestring(&mut self, _ctx: &ValueStringContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_valuestring(&mut self, _ctx: &ValueStringContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_valuefunc(&mut self, _ctx: &ValueFuncContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_valuefunc(&mut self, _ctx: &ValueFuncContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_valuetypememberreference(&mut self, _ctx: &ValueTypeMemberReferenceContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_valuetypememberreference(&mut self, _ctx: &ValueTypeMemberReferenceContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_variable(&mut self, _ctx: &VariableContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_variable(&mut self, _ctx: &VariableContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_function_call(&mut self, _ctx: &Function_callContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_function_call(&mut self, _ctx: &Function_callContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_typememberreference(&mut self, _ctx: &TypeMemberReferenceContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_typememberreference(&mut self, _ctx: &TypeMemberReferenceContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_if_statement(&mut self, _ctx: &If_statementContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_if_statement(&mut self, _ctx: &If_statementContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_if_clause(&mut self, _ctx: &If_clauseContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_if_clause(&mut self, _ctx: &If_clauseContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_else_if_clause(&mut self, _ctx: &Else_if_clauseContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_else_if_clause(&mut self, _ctx: &Else_if_clauseContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_else_clause(&mut self, _ctx: &Else_clauseContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_else_clause(&mut self, _ctx: &Else_clauseContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_set_statement(&mut self, _ctx: &Set_statementContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_set_statement(&mut self, _ctx: &Set_statementContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_call_statement(&mut self, _ctx: &Call_statementContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_call_statement(&mut self, _ctx: &Call_statementContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_command_statement(&mut self, _ctx: &Command_statementContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_command_statement(&mut self, _ctx: &Command_statementContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_command_formatted_text(&mut self, _ctx: &Command_formatted_textContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_command_formatted_text(&mut self, _ctx: &Command_formatted_textContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_shortcut_option_statement(&mut self, _ctx: &Shortcut_option_statementContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_shortcut_option_statement(&mut self, _ctx: &Shortcut_option_statementContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_shortcut_option(&mut self, _ctx: &Shortcut_optionContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_shortcut_option(&mut self, _ctx: &Shortcut_optionContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_line_group_statement(&mut self, _ctx: &Line_group_statementContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_line_group_statement(&mut self, _ctx: &Line_group_statementContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_line_group_item(&mut self, _ctx: &Line_group_itemContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_line_group_item(&mut self, _ctx: &Line_group_itemContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_declare_statement(&mut self, _ctx: &Declare_statementContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_declare_statement(&mut self, _ctx: &Declare_statementContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_enum_statement(&mut self, _ctx: &Enum_statementContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_enum_statement(&mut self, _ctx: &Enum_statementContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_enum_case_statement(&mut self, _ctx: &Enum_case_statementContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_enum_case_statement(&mut self, _ctx: &Enum_case_statementContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_jumptonodename(&mut self, _ctx: &JumpToNodeNameContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_jumptonodename(&mut self, _ctx: &JumpToNodeNameContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_jumptoexpression(&mut self, _ctx: &JumpToExpressionContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_jumptoexpression(&mut self, _ctx: &JumpToExpressionContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_detourtonodename(&mut self, _ctx: &DetourToNodeNameContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_detourtonodename(&mut self, _ctx: &DetourToNodeNameContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_detourtoexpression(&mut self, _ctx: &DetourToExpressionContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_detourtoexpression(&mut self, _ctx: &DetourToExpressionContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_return_statement(&mut self, _ctx: &Return_statementContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_return_statement(&mut self, _ctx: &Return_statementContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_once_statement(&mut self, _ctx: &Once_statementContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_once_statement(&mut self, _ctx: &Once_statementContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_once_primary_clause(&mut self, _ctx: &Once_primary_clauseContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_once_primary_clause(&mut self, _ctx: &Once_primary_clauseContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_once_alternate_clause(&mut self, _ctx: &Once_alternate_clauseContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_once_alternate_clause(&mut self, _ctx: &Once_alternate_clauseContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_structured_command(&mut self, _ctx: &Structured_commandContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_structured_command(&mut self, _ctx: &Structured_commandContext<'input>) {} + + + /** + * Enter a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn enter_structured_command_value(&mut self, _ctx: &Structured_command_valueContext<'input>) {} + /** + * Exit a parse tree produced by \{@link YarnSpinnerParserBaseParser#s}. + * @param ctx the parse tree + */ + fn exit_structured_command_value(&mut self, _ctx: &Structured_command_valueContext<'input>) {} + + +} \ No newline at end of file diff --git a/crates/compiler/src/parser/generated/yarnspinnerparserbasevisitor.rs b/crates/compiler/src/parser/generated/yarnspinnerparserbasevisitor.rs new file mode 100644 index 000000000..93f546e87 --- /dev/null +++ b/crates/compiler/src/parser/generated/yarnspinnerparserbasevisitor.rs @@ -0,0 +1,301 @@ + +// Generated from third-party/YarnSpinner/YarnSpinner.Compiler/Grammars/YarnSpinnerParser.g4 by ANTLR 4.13.2 + +use antlr4rust::tree::ParseTreeVisitor; +use super::yarnspinnerparser::*; + +// A complete Visitor for a parse tree produced by YarnSpinnerParser. + +pub trait YarnSpinnerParserBaseVisitor<'input>: + ParseTreeVisitor<'input, YarnSpinnerParserContextType> { + // Visit a parse tree produced by YarnSpinnerParser#dialogue. + fn visit_dialogue(&mut self, ctx: &DialogueContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#file_hashtag. + fn visit_file_hashtag(&mut self, ctx: &File_hashtagContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#node. + fn visit_node(&mut self, ctx: &NodeContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#title_header. + fn visit_title_header(&mut self, ctx: &Title_headerContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#when_header. + fn visit_when_header(&mut self, ctx: &When_headerContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#header. + fn visit_header(&mut self, ctx: &HeaderContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#header_when_expression. + fn visit_header_when_expression(&mut self, ctx: &Header_when_expressionContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#body. + fn visit_body(&mut self, ctx: &BodyContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#statement. + fn visit_statement(&mut self, ctx: &StatementContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#line_statement. + fn visit_line_statement(&mut self, ctx: &Line_statementContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#line_formatted_text. + fn visit_line_formatted_text(&mut self, ctx: &Line_formatted_textContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#hashtag. + fn visit_hashtag(&mut self, ctx: &HashtagContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#lineCondition. + fn visit_linecondition(&mut self, ctx: &LineConditionContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#lineOnceCondition. + fn visit_lineoncecondition(&mut self, ctx: &LineOnceConditionContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#expParens. + fn visit_expparens(&mut self, ctx: &ExpParensContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#expMultDivMod. + fn visit_expmultdivmod(&mut self, ctx: &ExpMultDivModContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#expComparison. + fn visit_expcomparison(&mut self, ctx: &ExpComparisonContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#expNegative. + fn visit_expnegative(&mut self, ctx: &ExpNegativeContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#expAndOrXor. + fn visit_expandorxor(&mut self, ctx: &ExpAndOrXorContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#expAddSub. + fn visit_expaddsub(&mut self, ctx: &ExpAddSubContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#expNot. + fn visit_expnot(&mut self, ctx: &ExpNotContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#expValue. + fn visit_expvalue(&mut self, ctx: &ExpValueContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#expEquality. + fn visit_expequality(&mut self, ctx: &ExpEqualityContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#valueNumber. + fn visit_valuenumber(&mut self, ctx: &ValueNumberContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#valueTrue. + fn visit_valuetrue(&mut self, ctx: &ValueTrueContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#valueFalse. + fn visit_valuefalse(&mut self, ctx: &ValueFalseContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#valueVar. + fn visit_valuevar(&mut self, ctx: &ValueVarContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#valueString. + fn visit_valuestring(&mut self, ctx: &ValueStringContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#valueFunc. + fn visit_valuefunc(&mut self, ctx: &ValueFuncContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#valueTypeMemberReference. + fn visit_valuetypememberreference(&mut self, ctx: &ValueTypeMemberReferenceContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#variable. + fn visit_variable(&mut self, ctx: &VariableContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#function_call. + fn visit_function_call(&mut self, ctx: &Function_callContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#typeMemberReference. + fn visit_typememberreference(&mut self, ctx: &TypeMemberReferenceContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#if_statement. + fn visit_if_statement(&mut self, ctx: &If_statementContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#if_clause. + fn visit_if_clause(&mut self, ctx: &If_clauseContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#else_if_clause. + fn visit_else_if_clause(&mut self, ctx: &Else_if_clauseContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#else_clause. + fn visit_else_clause(&mut self, ctx: &Else_clauseContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#set_statement. + fn visit_set_statement(&mut self, ctx: &Set_statementContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#call_statement. + fn visit_call_statement(&mut self, ctx: &Call_statementContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#command_statement. + fn visit_command_statement(&mut self, ctx: &Command_statementContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#command_formatted_text. + fn visit_command_formatted_text(&mut self, ctx: &Command_formatted_textContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#shortcut_option_statement. + fn visit_shortcut_option_statement(&mut self, ctx: &Shortcut_option_statementContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#shortcut_option. + fn visit_shortcut_option(&mut self, ctx: &Shortcut_optionContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#line_group_statement. + fn visit_line_group_statement(&mut self, ctx: &Line_group_statementContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#line_group_item. + fn visit_line_group_item(&mut self, ctx: &Line_group_itemContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#declare_statement. + fn visit_declare_statement(&mut self, ctx: &Declare_statementContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#enum_statement. + fn visit_enum_statement(&mut self, ctx: &Enum_statementContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#enum_case_statement. + fn visit_enum_case_statement(&mut self, ctx: &Enum_case_statementContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#jumpToNodeName. + fn visit_jumptonodename(&mut self, ctx: &JumpToNodeNameContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#jumpToExpression. + fn visit_jumptoexpression(&mut self, ctx: &JumpToExpressionContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#detourToNodeName. + fn visit_detourtonodename(&mut self, ctx: &DetourToNodeNameContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#detourToExpression. + fn visit_detourtoexpression(&mut self, ctx: &DetourToExpressionContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#return_statement. + fn visit_return_statement(&mut self, ctx: &Return_statementContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#once_statement. + fn visit_once_statement(&mut self, ctx: &Once_statementContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#once_primary_clause. + fn visit_once_primary_clause(&mut self, ctx: &Once_primary_clauseContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#once_alternate_clause. + fn visit_once_alternate_clause(&mut self, ctx: &Once_alternate_clauseContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#structured_command. + fn visit_structured_command(&mut self, ctx: &Structured_commandContext<'input>) { + self.visit_children(ctx) + } + + // Visit a parse tree produced by YarnSpinnerParser#structured_command_value. + fn visit_structured_command_value(&mut self, ctx: &Structured_command_valueContext<'input>) { + self.visit_children(ctx) + } + +} \ No newline at end of file diff --git a/crates/compiler/src/parser/generated/yarnspinnerparserlistener.rs b/crates/compiler/src/parser/generated/yarnspinnerparserlistener.rs index 52f12acae..07945b1df 100644 --- a/crates/compiler/src/parser/generated/yarnspinnerparserlistener.rs +++ b/crates/compiler/src/parser/generated/yarnspinnerparserlistener.rs @@ -1,5 +1,5 @@ #![allow(nonstandard_style)] -// Generated from third-party/YarnSpinner/YarnSpinner.Compiler/YarnSpinnerParser.g4 by ANTLR 4.13.2 +// Generated from third-party/YarnSpinner/YarnSpinner.Compiler/Grammars/YarnSpinnerParser.g4 by ANTLR 4.13.2 use antlr4rust::tree::ParseTreeListener; use super::yarnspinnerparser::*; @@ -34,6 +34,26 @@ fn enter_node(&mut self, _ctx: &NodeContext<'input>) { } * @param ctx the parse tree */ fn exit_node(&mut self, _ctx: &NodeContext<'input>) { } +/** + * Enter a parse tree produced by {@link YarnSpinnerParser#title_header}. + * @param ctx the parse tree + */ +fn enter_title_header(&mut self, _ctx: &Title_headerContext<'input>) { } +/** + * Exit a parse tree produced by {@link YarnSpinnerParser#title_header}. + * @param ctx the parse tree + */ +fn exit_title_header(&mut self, _ctx: &Title_headerContext<'input>) { } +/** + * Enter a parse tree produced by {@link YarnSpinnerParser#when_header}. + * @param ctx the parse tree + */ +fn enter_when_header(&mut self, _ctx: &When_headerContext<'input>) { } +/** + * Exit a parse tree produced by {@link YarnSpinnerParser#when_header}. + * @param ctx the parse tree + */ +fn exit_when_header(&mut self, _ctx: &When_headerContext<'input>) { } /** * Enter a parse tree produced by {@link YarnSpinnerParser#header}. * @param ctx the parse tree @@ -44,6 +64,16 @@ fn enter_header(&mut self, _ctx: &HeaderContext<'input>) { } * @param ctx the parse tree */ fn exit_header(&mut self, _ctx: &HeaderContext<'input>) { } +/** + * Enter a parse tree produced by {@link YarnSpinnerParser#header_when_expression}. + * @param ctx the parse tree + */ +fn enter_header_when_expression(&mut self, _ctx: &Header_when_expressionContext<'input>) { } +/** + * Exit a parse tree produced by {@link YarnSpinnerParser#header_when_expression}. + * @param ctx the parse tree + */ +fn exit_header_when_expression(&mut self, _ctx: &Header_when_expressionContext<'input>) { } /** * Enter a parse tree produced by {@link YarnSpinnerParser#body}. * @param ctx the parse tree @@ -95,15 +125,29 @@ fn enter_hashtag(&mut self, _ctx: &HashtagContext<'input>) { } */ fn exit_hashtag(&mut self, _ctx: &HashtagContext<'input>) { } /** - * Enter a parse tree produced by {@link YarnSpinnerParser#line_condition}. + * Enter a parse tree produced by the {@code lineCondition} + * labeled alternative in {@link YarnSpinnerParser#line_condition}. + * @param ctx the parse tree + */ +fn enter_lineCondition(&mut self, _ctx: &LineConditionContext<'input>) { } +/** + * Exit a parse tree produced by the {@code lineCondition} + * labeled alternative in {@link YarnSpinnerParser#line_condition}. + * @param ctx the parse tree + */ +fn exit_lineCondition(&mut self, _ctx: &LineConditionContext<'input>) { } +/** + * Enter a parse tree produced by the {@code lineOnceCondition} + * labeled alternative in {@link YarnSpinnerParser#line_condition}. * @param ctx the parse tree */ -fn enter_line_condition(&mut self, _ctx: &Line_conditionContext<'input>) { } +fn enter_lineOnceCondition(&mut self, _ctx: &LineOnceConditionContext<'input>) { } /** - * Exit a parse tree produced by {@link YarnSpinnerParser#line_condition}. + * Exit a parse tree produced by the {@code lineOnceCondition} + * labeled alternative in {@link YarnSpinnerParser#line_condition}. * @param ctx the parse tree */ -fn exit_line_condition(&mut self, _ctx: &Line_conditionContext<'input>) { } +fn exit_lineOnceCondition(&mut self, _ctx: &LineOnceConditionContext<'input>) { } /** * Enter a parse tree produced by the {@code expParens} * labeled alternative in {@link YarnSpinnerParser#expression}. @@ -273,29 +317,29 @@ fn enter_valueString(&mut self, _ctx: &ValueStringContext<'input>) { } */ fn exit_valueString(&mut self, _ctx: &ValueStringContext<'input>) { } /** - * Enter a parse tree produced by the {@code valueNull} + * Enter a parse tree produced by the {@code valueFunc} * labeled alternative in {@link YarnSpinnerParser#value}. * @param ctx the parse tree */ -fn enter_valueNull(&mut self, _ctx: &ValueNullContext<'input>) { } +fn enter_valueFunc(&mut self, _ctx: &ValueFuncContext<'input>) { } /** - * Exit a parse tree produced by the {@code valueNull} + * Exit a parse tree produced by the {@code valueFunc} * labeled alternative in {@link YarnSpinnerParser#value}. * @param ctx the parse tree */ -fn exit_valueNull(&mut self, _ctx: &ValueNullContext<'input>) { } +fn exit_valueFunc(&mut self, _ctx: &ValueFuncContext<'input>) { } /** - * Enter a parse tree produced by the {@code valueFunc} + * Enter a parse tree produced by the {@code valueTypeMemberReference} * labeled alternative in {@link YarnSpinnerParser#value}. * @param ctx the parse tree */ -fn enter_valueFunc(&mut self, _ctx: &ValueFuncContext<'input>) { } +fn enter_valueTypeMemberReference(&mut self, _ctx: &ValueTypeMemberReferenceContext<'input>) { } /** - * Exit a parse tree produced by the {@code valueFunc} + * Exit a parse tree produced by the {@code valueTypeMemberReference} * labeled alternative in {@link YarnSpinnerParser#value}. * @param ctx the parse tree */ -fn exit_valueFunc(&mut self, _ctx: &ValueFuncContext<'input>) { } +fn exit_valueTypeMemberReference(&mut self, _ctx: &ValueTypeMemberReferenceContext<'input>) { } /** * Enter a parse tree produced by {@link YarnSpinnerParser#variable}. * @param ctx the parse tree @@ -316,6 +360,16 @@ fn enter_function_call(&mut self, _ctx: &Function_callContext<'input>) { } * @param ctx the parse tree */ fn exit_function_call(&mut self, _ctx: &Function_callContext<'input>) { } +/** + * Enter a parse tree produced by {@link YarnSpinnerParser#typeMemberReference}. + * @param ctx the parse tree + */ +fn enter_typeMemberReference(&mut self, _ctx: &TypeMemberReferenceContext<'input>) { } +/** + * Exit a parse tree produced by {@link YarnSpinnerParser#typeMemberReference}. + * @param ctx the parse tree + */ +fn exit_typeMemberReference(&mut self, _ctx: &TypeMemberReferenceContext<'input>) { } /** * Enter a parse tree produced by {@link YarnSpinnerParser#if_statement}. * @param ctx the parse tree @@ -416,6 +470,26 @@ fn enter_shortcut_option(&mut self, _ctx: &Shortcut_optionContext<'input>) { } * @param ctx the parse tree */ fn exit_shortcut_option(&mut self, _ctx: &Shortcut_optionContext<'input>) { } +/** + * Enter a parse tree produced by {@link YarnSpinnerParser#line_group_statement}. + * @param ctx the parse tree + */ +fn enter_line_group_statement(&mut self, _ctx: &Line_group_statementContext<'input>) { } +/** + * Exit a parse tree produced by {@link YarnSpinnerParser#line_group_statement}. + * @param ctx the parse tree + */ +fn exit_line_group_statement(&mut self, _ctx: &Line_group_statementContext<'input>) { } +/** + * Enter a parse tree produced by {@link YarnSpinnerParser#line_group_item}. + * @param ctx the parse tree + */ +fn enter_line_group_item(&mut self, _ctx: &Line_group_itemContext<'input>) { } +/** + * Exit a parse tree produced by {@link YarnSpinnerParser#line_group_item}. + * @param ctx the parse tree + */ +fn exit_line_group_item(&mut self, _ctx: &Line_group_itemContext<'input>) { } /** * Enter a parse tree produced by {@link YarnSpinnerParser#declare_statement}. * @param ctx the parse tree @@ -426,6 +500,26 @@ fn enter_declare_statement(&mut self, _ctx: &Declare_statementContext<'input>) { * @param ctx the parse tree */ fn exit_declare_statement(&mut self, _ctx: &Declare_statementContext<'input>) { } +/** + * Enter a parse tree produced by {@link YarnSpinnerParser#enum_statement}. + * @param ctx the parse tree + */ +fn enter_enum_statement(&mut self, _ctx: &Enum_statementContext<'input>) { } +/** + * Exit a parse tree produced by {@link YarnSpinnerParser#enum_statement}. + * @param ctx the parse tree + */ +fn exit_enum_statement(&mut self, _ctx: &Enum_statementContext<'input>) { } +/** + * Enter a parse tree produced by {@link YarnSpinnerParser#enum_case_statement}. + * @param ctx the parse tree + */ +fn enter_enum_case_statement(&mut self, _ctx: &Enum_case_statementContext<'input>) { } +/** + * Exit a parse tree produced by {@link YarnSpinnerParser#enum_case_statement}. + * @param ctx the parse tree + */ +fn exit_enum_case_statement(&mut self, _ctx: &Enum_case_statementContext<'input>) { } /** * Enter a parse tree produced by the {@code jumpToNodeName} * labeled alternative in {@link YarnSpinnerParser#jump_statement}. @@ -450,6 +544,90 @@ fn enter_jumpToExpression(&mut self, _ctx: &JumpToExpressionContext<'input>) { } * @param ctx the parse tree */ fn exit_jumpToExpression(&mut self, _ctx: &JumpToExpressionContext<'input>) { } +/** + * Enter a parse tree produced by the {@code detourToNodeName} + * labeled alternative in {@link YarnSpinnerParser#jump_statement}. + * @param ctx the parse tree + */ +fn enter_detourToNodeName(&mut self, _ctx: &DetourToNodeNameContext<'input>) { } +/** + * Exit a parse tree produced by the {@code detourToNodeName} + * labeled alternative in {@link YarnSpinnerParser#jump_statement}. + * @param ctx the parse tree + */ +fn exit_detourToNodeName(&mut self, _ctx: &DetourToNodeNameContext<'input>) { } +/** + * Enter a parse tree produced by the {@code detourToExpression} + * labeled alternative in {@link YarnSpinnerParser#jump_statement}. + * @param ctx the parse tree + */ +fn enter_detourToExpression(&mut self, _ctx: &DetourToExpressionContext<'input>) { } +/** + * Exit a parse tree produced by the {@code detourToExpression} + * labeled alternative in {@link YarnSpinnerParser#jump_statement}. + * @param ctx the parse tree + */ +fn exit_detourToExpression(&mut self, _ctx: &DetourToExpressionContext<'input>) { } +/** + * Enter a parse tree produced by {@link YarnSpinnerParser#return_statement}. + * @param ctx the parse tree + */ +fn enter_return_statement(&mut self, _ctx: &Return_statementContext<'input>) { } +/** + * Exit a parse tree produced by {@link YarnSpinnerParser#return_statement}. + * @param ctx the parse tree + */ +fn exit_return_statement(&mut self, _ctx: &Return_statementContext<'input>) { } +/** + * Enter a parse tree produced by {@link YarnSpinnerParser#once_statement}. + * @param ctx the parse tree + */ +fn enter_once_statement(&mut self, _ctx: &Once_statementContext<'input>) { } +/** + * Exit a parse tree produced by {@link YarnSpinnerParser#once_statement}. + * @param ctx the parse tree + */ +fn exit_once_statement(&mut self, _ctx: &Once_statementContext<'input>) { } +/** + * Enter a parse tree produced by {@link YarnSpinnerParser#once_primary_clause}. + * @param ctx the parse tree + */ +fn enter_once_primary_clause(&mut self, _ctx: &Once_primary_clauseContext<'input>) { } +/** + * Exit a parse tree produced by {@link YarnSpinnerParser#once_primary_clause}. + * @param ctx the parse tree + */ +fn exit_once_primary_clause(&mut self, _ctx: &Once_primary_clauseContext<'input>) { } +/** + * Enter a parse tree produced by {@link YarnSpinnerParser#once_alternate_clause}. + * @param ctx the parse tree + */ +fn enter_once_alternate_clause(&mut self, _ctx: &Once_alternate_clauseContext<'input>) { } +/** + * Exit a parse tree produced by {@link YarnSpinnerParser#once_alternate_clause}. + * @param ctx the parse tree + */ +fn exit_once_alternate_clause(&mut self, _ctx: &Once_alternate_clauseContext<'input>) { } +/** + * Enter a parse tree produced by {@link YarnSpinnerParser#structured_command}. + * @param ctx the parse tree + */ +fn enter_structured_command(&mut self, _ctx: &Structured_commandContext<'input>) { } +/** + * Exit a parse tree produced by {@link YarnSpinnerParser#structured_command}. + * @param ctx the parse tree + */ +fn exit_structured_command(&mut self, _ctx: &Structured_commandContext<'input>) { } +/** + * Enter a parse tree produced by {@link YarnSpinnerParser#structured_command_value}. + * @param ctx the parse tree + */ +fn enter_structured_command_value(&mut self, _ctx: &Structured_command_valueContext<'input>) { } +/** + * Exit a parse tree produced by {@link YarnSpinnerParser#structured_command_value}. + * @param ctx the parse tree + */ +fn exit_structured_command_value(&mut self, _ctx: &Structured_command_valueContext<'input>) { } } diff --git a/crates/compiler/src/parser/generated/yarnspinnerparservisitor.rs b/crates/compiler/src/parser/generated/yarnspinnerparservisitor.rs index 60acd169f..b6a6e0991 100644 --- a/crates/compiler/src/parser/generated/yarnspinnerparservisitor.rs +++ b/crates/compiler/src/parser/generated/yarnspinnerparservisitor.rs @@ -1,5 +1,5 @@ #![allow(nonstandard_style)] -// Generated from third-party/YarnSpinner/YarnSpinner.Compiler/YarnSpinnerParser.g4 by ANTLR 4.13.2 +// Generated from third-party/YarnSpinner/YarnSpinner.Compiler/Grammars/YarnSpinnerParser.g4 by ANTLR 4.13.2 use antlr4rust::tree::{ParseTreeVisitor,ParseTreeVisitorCompat}; use super::yarnspinnerparser::*; @@ -26,12 +26,30 @@ pub trait YarnSpinnerParserVisitor<'input>: ParseTreeVisitor<'input,YarnSpinnerP */ fn visit_node(&mut self, ctx: &NodeContext<'input>) { self.visit_children(ctx) } + /** + * Visit a parse tree produced by {@link YarnSpinnerParser#title_header}. + * @param ctx the parse tree + */ + fn visit_title_header(&mut self, ctx: &Title_headerContext<'input>) { self.visit_children(ctx) } + + /** + * Visit a parse tree produced by {@link YarnSpinnerParser#when_header}. + * @param ctx the parse tree + */ + fn visit_when_header(&mut self, ctx: &When_headerContext<'input>) { self.visit_children(ctx) } + /** * Visit a parse tree produced by {@link YarnSpinnerParser#header}. * @param ctx the parse tree */ fn visit_header(&mut self, ctx: &HeaderContext<'input>) { self.visit_children(ctx) } + /** + * Visit a parse tree produced by {@link YarnSpinnerParser#header_when_expression}. + * @param ctx the parse tree + */ + fn visit_header_when_expression(&mut self, ctx: &Header_when_expressionContext<'input>) { self.visit_children(ctx) } + /** * Visit a parse tree produced by {@link YarnSpinnerParser#body}. * @param ctx the parse tree @@ -63,10 +81,18 @@ pub trait YarnSpinnerParserVisitor<'input>: ParseTreeVisitor<'input,YarnSpinnerP fn visit_hashtag(&mut self, ctx: &HashtagContext<'input>) { self.visit_children(ctx) } /** - * Visit a parse tree produced by {@link YarnSpinnerParser#line_condition}. + * Visit a parse tree produced by the {@code lineCondition} + * labeled alternative in {@link YarnSpinnerParser#line_condition}. + * @param ctx the parse tree + */ + fn visit_lineCondition(&mut self, ctx: &LineConditionContext<'input>) { self.visit_children(ctx) } + + /** + * Visit a parse tree produced by the {@code lineOnceCondition} + * labeled alternative in {@link YarnSpinnerParser#line_condition}. * @param ctx the parse tree */ - fn visit_line_condition(&mut self, ctx: &Line_conditionContext<'input>) { self.visit_children(ctx) } + fn visit_lineOnceCondition(&mut self, ctx: &LineOnceConditionContext<'input>) { self.visit_children(ctx) } /** * Visit a parse tree produced by the {@code expParens} @@ -167,18 +193,18 @@ pub trait YarnSpinnerParserVisitor<'input>: ParseTreeVisitor<'input,YarnSpinnerP fn visit_valueString(&mut self, ctx: &ValueStringContext<'input>) { self.visit_children(ctx) } /** - * Visit a parse tree produced by the {@code valueNull} + * Visit a parse tree produced by the {@code valueFunc} * labeled alternative in {@link YarnSpinnerParser#value}. * @param ctx the parse tree */ - fn visit_valueNull(&mut self, ctx: &ValueNullContext<'input>) { self.visit_children(ctx) } + fn visit_valueFunc(&mut self, ctx: &ValueFuncContext<'input>) { self.visit_children(ctx) } /** - * Visit a parse tree produced by the {@code valueFunc} + * Visit a parse tree produced by the {@code valueTypeMemberReference} * labeled alternative in {@link YarnSpinnerParser#value}. * @param ctx the parse tree */ - fn visit_valueFunc(&mut self, ctx: &ValueFuncContext<'input>) { self.visit_children(ctx) } + fn visit_valueTypeMemberReference(&mut self, ctx: &ValueTypeMemberReferenceContext<'input>) { self.visit_children(ctx) } /** * Visit a parse tree produced by {@link YarnSpinnerParser#variable}. @@ -192,6 +218,12 @@ pub trait YarnSpinnerParserVisitor<'input>: ParseTreeVisitor<'input,YarnSpinnerP */ fn visit_function_call(&mut self, ctx: &Function_callContext<'input>) { self.visit_children(ctx) } + /** + * Visit a parse tree produced by {@link YarnSpinnerParser#typeMemberReference}. + * @param ctx the parse tree + */ + fn visit_typeMemberReference(&mut self, ctx: &TypeMemberReferenceContext<'input>) { self.visit_children(ctx) } + /** * Visit a parse tree produced by {@link YarnSpinnerParser#if_statement}. * @param ctx the parse tree @@ -252,12 +284,36 @@ pub trait YarnSpinnerParserVisitor<'input>: ParseTreeVisitor<'input,YarnSpinnerP */ fn visit_shortcut_option(&mut self, ctx: &Shortcut_optionContext<'input>) { self.visit_children(ctx) } + /** + * Visit a parse tree produced by {@link YarnSpinnerParser#line_group_statement}. + * @param ctx the parse tree + */ + fn visit_line_group_statement(&mut self, ctx: &Line_group_statementContext<'input>) { self.visit_children(ctx) } + + /** + * Visit a parse tree produced by {@link YarnSpinnerParser#line_group_item}. + * @param ctx the parse tree + */ + fn visit_line_group_item(&mut self, ctx: &Line_group_itemContext<'input>) { self.visit_children(ctx) } + /** * Visit a parse tree produced by {@link YarnSpinnerParser#declare_statement}. * @param ctx the parse tree */ fn visit_declare_statement(&mut self, ctx: &Declare_statementContext<'input>) { self.visit_children(ctx) } + /** + * Visit a parse tree produced by {@link YarnSpinnerParser#enum_statement}. + * @param ctx the parse tree + */ + fn visit_enum_statement(&mut self, ctx: &Enum_statementContext<'input>) { self.visit_children(ctx) } + + /** + * Visit a parse tree produced by {@link YarnSpinnerParser#enum_case_statement}. + * @param ctx the parse tree + */ + fn visit_enum_case_statement(&mut self, ctx: &Enum_case_statementContext<'input>) { self.visit_children(ctx) } + /** * Visit a parse tree produced by the {@code jumpToNodeName} * labeled alternative in {@link YarnSpinnerParser#jump_statement}. @@ -272,6 +328,56 @@ pub trait YarnSpinnerParserVisitor<'input>: ParseTreeVisitor<'input,YarnSpinnerP */ fn visit_jumpToExpression(&mut self, ctx: &JumpToExpressionContext<'input>) { self.visit_children(ctx) } + /** + * Visit a parse tree produced by the {@code detourToNodeName} + * labeled alternative in {@link YarnSpinnerParser#jump_statement}. + * @param ctx the parse tree + */ + fn visit_detourToNodeName(&mut self, ctx: &DetourToNodeNameContext<'input>) { self.visit_children(ctx) } + + /** + * Visit a parse tree produced by the {@code detourToExpression} + * labeled alternative in {@link YarnSpinnerParser#jump_statement}. + * @param ctx the parse tree + */ + fn visit_detourToExpression(&mut self, ctx: &DetourToExpressionContext<'input>) { self.visit_children(ctx) } + + /** + * Visit a parse tree produced by {@link YarnSpinnerParser#return_statement}. + * @param ctx the parse tree + */ + fn visit_return_statement(&mut self, ctx: &Return_statementContext<'input>) { self.visit_children(ctx) } + + /** + * Visit a parse tree produced by {@link YarnSpinnerParser#once_statement}. + * @param ctx the parse tree + */ + fn visit_once_statement(&mut self, ctx: &Once_statementContext<'input>) { self.visit_children(ctx) } + + /** + * Visit a parse tree produced by {@link YarnSpinnerParser#once_primary_clause}. + * @param ctx the parse tree + */ + fn visit_once_primary_clause(&mut self, ctx: &Once_primary_clauseContext<'input>) { self.visit_children(ctx) } + + /** + * Visit a parse tree produced by {@link YarnSpinnerParser#once_alternate_clause}. + * @param ctx the parse tree + */ + fn visit_once_alternate_clause(&mut self, ctx: &Once_alternate_clauseContext<'input>) { self.visit_children(ctx) } + + /** + * Visit a parse tree produced by {@link YarnSpinnerParser#structured_command}. + * @param ctx the parse tree + */ + fn visit_structured_command(&mut self, ctx: &Structured_commandContext<'input>) { self.visit_children(ctx) } + + /** + * Visit a parse tree produced by {@link YarnSpinnerParser#structured_command_value}. + * @param ctx the parse tree + */ + fn visit_structured_command_value(&mut self, ctx: &Structured_command_valueContext<'input>) { self.visit_children(ctx) } + } pub trait YarnSpinnerParserVisitorCompat<'input>:ParseTreeVisitorCompat<'input, Node= YarnSpinnerParserContextType>{ @@ -299,6 +405,22 @@ pub trait YarnSpinnerParserVisitorCompat<'input>:ParseTreeVisitorCompat<'input, self.visit_children(ctx) } + /** + * Visit a parse tree produced by {@link YarnSpinnerParser#title_header}. + * @param ctx the parse tree + */ + fn visit_title_header(&mut self, ctx: &Title_headerContext<'input>) -> Self::Return { + self.visit_children(ctx) + } + + /** + * Visit a parse tree produced by {@link YarnSpinnerParser#when_header}. + * @param ctx the parse tree + */ + fn visit_when_header(&mut self, ctx: &When_headerContext<'input>) -> Self::Return { + self.visit_children(ctx) + } + /** * Visit a parse tree produced by {@link YarnSpinnerParser#header}. * @param ctx the parse tree @@ -307,6 +429,14 @@ pub trait YarnSpinnerParserVisitorCompat<'input>:ParseTreeVisitorCompat<'input, self.visit_children(ctx) } + /** + * Visit a parse tree produced by {@link YarnSpinnerParser#header_when_expression}. + * @param ctx the parse tree + */ + fn visit_header_when_expression(&mut self, ctx: &Header_when_expressionContext<'input>) -> Self::Return { + self.visit_children(ctx) + } + /** * Visit a parse tree produced by {@link YarnSpinnerParser#body}. * @param ctx the parse tree @@ -348,10 +478,20 @@ pub trait YarnSpinnerParserVisitorCompat<'input>:ParseTreeVisitorCompat<'input, } /** - * Visit a parse tree produced by {@link YarnSpinnerParser#line_condition}. + * Visit a parse tree produced by the {@code lineCondition} + * labeled alternative in {@link YarnSpinnerParser#line_condition}. + * @param ctx the parse tree + */ + fn visit_lineCondition(&mut self, ctx: &LineConditionContext<'input>) -> Self::Return { + self.visit_children(ctx) + } + + /** + * Visit a parse tree produced by the {@code lineOnceCondition} + * labeled alternative in {@link YarnSpinnerParser#line_condition}. * @param ctx the parse tree */ - fn visit_line_condition(&mut self, ctx: &Line_conditionContext<'input>) -> Self::Return { + fn visit_lineOnceCondition(&mut self, ctx: &LineOnceConditionContext<'input>) -> Self::Return { self.visit_children(ctx) } @@ -482,20 +622,20 @@ pub trait YarnSpinnerParserVisitorCompat<'input>:ParseTreeVisitorCompat<'input, } /** - * Visit a parse tree produced by the {@code valueNull} + * Visit a parse tree produced by the {@code valueFunc} * labeled alternative in {@link YarnSpinnerParser#value}. * @param ctx the parse tree */ - fn visit_valueNull(&mut self, ctx: &ValueNullContext<'input>) -> Self::Return { + fn visit_valueFunc(&mut self, ctx: &ValueFuncContext<'input>) -> Self::Return { self.visit_children(ctx) } /** - * Visit a parse tree produced by the {@code valueFunc} + * Visit a parse tree produced by the {@code valueTypeMemberReference} * labeled alternative in {@link YarnSpinnerParser#value}. * @param ctx the parse tree */ - fn visit_valueFunc(&mut self, ctx: &ValueFuncContext<'input>) -> Self::Return { + fn visit_valueTypeMemberReference(&mut self, ctx: &ValueTypeMemberReferenceContext<'input>) -> Self::Return { self.visit_children(ctx) } @@ -515,6 +655,14 @@ pub trait YarnSpinnerParserVisitorCompat<'input>:ParseTreeVisitorCompat<'input, self.visit_children(ctx) } + /** + * Visit a parse tree produced by {@link YarnSpinnerParser#typeMemberReference}. + * @param ctx the parse tree + */ + fn visit_typeMemberReference(&mut self, ctx: &TypeMemberReferenceContext<'input>) -> Self::Return { + self.visit_children(ctx) + } + /** * Visit a parse tree produced by {@link YarnSpinnerParser#if_statement}. * @param ctx the parse tree @@ -595,6 +743,22 @@ pub trait YarnSpinnerParserVisitorCompat<'input>:ParseTreeVisitorCompat<'input, self.visit_children(ctx) } + /** + * Visit a parse tree produced by {@link YarnSpinnerParser#line_group_statement}. + * @param ctx the parse tree + */ + fn visit_line_group_statement(&mut self, ctx: &Line_group_statementContext<'input>) -> Self::Return { + self.visit_children(ctx) + } + + /** + * Visit a parse tree produced by {@link YarnSpinnerParser#line_group_item}. + * @param ctx the parse tree + */ + fn visit_line_group_item(&mut self, ctx: &Line_group_itemContext<'input>) -> Self::Return { + self.visit_children(ctx) + } + /** * Visit a parse tree produced by {@link YarnSpinnerParser#declare_statement}. * @param ctx the parse tree @@ -603,6 +767,22 @@ pub trait YarnSpinnerParserVisitorCompat<'input>:ParseTreeVisitorCompat<'input, self.visit_children(ctx) } + /** + * Visit a parse tree produced by {@link YarnSpinnerParser#enum_statement}. + * @param ctx the parse tree + */ + fn visit_enum_statement(&mut self, ctx: &Enum_statementContext<'input>) -> Self::Return { + self.visit_children(ctx) + } + + /** + * Visit a parse tree produced by {@link YarnSpinnerParser#enum_case_statement}. + * @param ctx the parse tree + */ + fn visit_enum_case_statement(&mut self, ctx: &Enum_case_statementContext<'input>) -> Self::Return { + self.visit_children(ctx) + } + /** * Visit a parse tree produced by the {@code jumpToNodeName} * labeled alternative in {@link YarnSpinnerParser#jump_statement}. @@ -621,6 +801,72 @@ pub trait YarnSpinnerParserVisitorCompat<'input>:ParseTreeVisitorCompat<'input, self.visit_children(ctx) } + /** + * Visit a parse tree produced by the {@code detourToNodeName} + * labeled alternative in {@link YarnSpinnerParser#jump_statement}. + * @param ctx the parse tree + */ + fn visit_detourToNodeName(&mut self, ctx: &DetourToNodeNameContext<'input>) -> Self::Return { + self.visit_children(ctx) + } + + /** + * Visit a parse tree produced by the {@code detourToExpression} + * labeled alternative in {@link YarnSpinnerParser#jump_statement}. + * @param ctx the parse tree + */ + fn visit_detourToExpression(&mut self, ctx: &DetourToExpressionContext<'input>) -> Self::Return { + self.visit_children(ctx) + } + + /** + * Visit a parse tree produced by {@link YarnSpinnerParser#return_statement}. + * @param ctx the parse tree + */ + fn visit_return_statement(&mut self, ctx: &Return_statementContext<'input>) -> Self::Return { + self.visit_children(ctx) + } + + /** + * Visit a parse tree produced by {@link YarnSpinnerParser#once_statement}. + * @param ctx the parse tree + */ + fn visit_once_statement(&mut self, ctx: &Once_statementContext<'input>) -> Self::Return { + self.visit_children(ctx) + } + + /** + * Visit a parse tree produced by {@link YarnSpinnerParser#once_primary_clause}. + * @param ctx the parse tree + */ + fn visit_once_primary_clause(&mut self, ctx: &Once_primary_clauseContext<'input>) -> Self::Return { + self.visit_children(ctx) + } + + /** + * Visit a parse tree produced by {@link YarnSpinnerParser#once_alternate_clause}. + * @param ctx the parse tree + */ + fn visit_once_alternate_clause(&mut self, ctx: &Once_alternate_clauseContext<'input>) -> Self::Return { + self.visit_children(ctx) + } + + /** + * Visit a parse tree produced by {@link YarnSpinnerParser#structured_command}. + * @param ctx the parse tree + */ + fn visit_structured_command(&mut self, ctx: &Structured_commandContext<'input>) -> Self::Return { + self.visit_children(ctx) + } + + /** + * Visit a parse tree produced by {@link YarnSpinnerParser#structured_command_value}. + * @param ctx the parse tree + */ + fn visit_structured_command_value(&mut self, ctx: &Structured_command_valueContext<'input>) -> Self::Return { + self.visit_children(ctx) + } + } impl<'input,T> YarnSpinnerParserVisitor<'input> for T @@ -642,11 +888,26 @@ where *::temp_result(self) = result; } + fn visit_title_header(&mut self, ctx: &Title_headerContext<'input>){ + let result = ::visit_title_header(self, ctx); + *::temp_result(self) = result; + } + + fn visit_when_header(&mut self, ctx: &When_headerContext<'input>){ + let result = ::visit_when_header(self, ctx); + *::temp_result(self) = result; + } + fn visit_header(&mut self, ctx: &HeaderContext<'input>){ let result = ::visit_header(self, ctx); *::temp_result(self) = result; } + fn visit_header_when_expression(&mut self, ctx: &Header_when_expressionContext<'input>){ + let result = ::visit_header_when_expression(self, ctx); + *::temp_result(self) = result; + } + fn visit_body(&mut self, ctx: &BodyContext<'input>){ let result = ::visit_body(self, ctx); *::temp_result(self) = result; @@ -672,8 +933,13 @@ where *::temp_result(self) = result; } - fn visit_line_condition(&mut self, ctx: &Line_conditionContext<'input>){ - let result = ::visit_line_condition(self, ctx); + fn visit_lineCondition(&mut self, ctx: &LineConditionContext<'input>){ + let result = ::visit_lineCondition(self, ctx); + *::temp_result(self) = result; + } + + fn visit_lineOnceCondition(&mut self, ctx: &LineOnceConditionContext<'input>){ + let result = ::visit_lineOnceCondition(self, ctx); *::temp_result(self) = result; } @@ -747,13 +1013,13 @@ where *::temp_result(self) = result; } - fn visit_valueNull(&mut self, ctx: &ValueNullContext<'input>){ - let result = ::visit_valueNull(self, ctx); + fn visit_valueFunc(&mut self, ctx: &ValueFuncContext<'input>){ + let result = ::visit_valueFunc(self, ctx); *::temp_result(self) = result; } - fn visit_valueFunc(&mut self, ctx: &ValueFuncContext<'input>){ - let result = ::visit_valueFunc(self, ctx); + fn visit_valueTypeMemberReference(&mut self, ctx: &ValueTypeMemberReferenceContext<'input>){ + let result = ::visit_valueTypeMemberReference(self, ctx); *::temp_result(self) = result; } @@ -767,6 +1033,11 @@ where *::temp_result(self) = result; } + fn visit_typeMemberReference(&mut self, ctx: &TypeMemberReferenceContext<'input>){ + let result = ::visit_typeMemberReference(self, ctx); + *::temp_result(self) = result; + } + fn visit_if_statement(&mut self, ctx: &If_statementContext<'input>){ let result = ::visit_if_statement(self, ctx); *::temp_result(self) = result; @@ -817,11 +1088,31 @@ where *::temp_result(self) = result; } + fn visit_line_group_statement(&mut self, ctx: &Line_group_statementContext<'input>){ + let result = ::visit_line_group_statement(self, ctx); + *::temp_result(self) = result; + } + + fn visit_line_group_item(&mut self, ctx: &Line_group_itemContext<'input>){ + let result = ::visit_line_group_item(self, ctx); + *::temp_result(self) = result; + } + fn visit_declare_statement(&mut self, ctx: &Declare_statementContext<'input>){ let result = ::visit_declare_statement(self, ctx); *::temp_result(self) = result; } + fn visit_enum_statement(&mut self, ctx: &Enum_statementContext<'input>){ + let result = ::visit_enum_statement(self, ctx); + *::temp_result(self) = result; + } + + fn visit_enum_case_statement(&mut self, ctx: &Enum_case_statementContext<'input>){ + let result = ::visit_enum_case_statement(self, ctx); + *::temp_result(self) = result; + } + fn visit_jumpToNodeName(&mut self, ctx: &JumpToNodeNameContext<'input>){ let result = ::visit_jumpToNodeName(self, ctx); *::temp_result(self) = result; @@ -832,4 +1123,44 @@ where *::temp_result(self) = result; } + fn visit_detourToNodeName(&mut self, ctx: &DetourToNodeNameContext<'input>){ + let result = ::visit_detourToNodeName(self, ctx); + *::temp_result(self) = result; + } + + fn visit_detourToExpression(&mut self, ctx: &DetourToExpressionContext<'input>){ + let result = ::visit_detourToExpression(self, ctx); + *::temp_result(self) = result; + } + + fn visit_return_statement(&mut self, ctx: &Return_statementContext<'input>){ + let result = ::visit_return_statement(self, ctx); + *::temp_result(self) = result; + } + + fn visit_once_statement(&mut self, ctx: &Once_statementContext<'input>){ + let result = ::visit_once_statement(self, ctx); + *::temp_result(self) = result; + } + + fn visit_once_primary_clause(&mut self, ctx: &Once_primary_clauseContext<'input>){ + let result = ::visit_once_primary_clause(self, ctx); + *::temp_result(self) = result; + } + + fn visit_once_alternate_clause(&mut self, ctx: &Once_alternate_clauseContext<'input>){ + let result = ::visit_once_alternate_clause(self, ctx); + *::temp_result(self) = result; + } + + fn visit_structured_command(&mut self, ctx: &Structured_commandContext<'input>){ + let result = ::visit_structured_command(self, ctx); + *::temp_result(self) = result; + } + + fn visit_structured_command_value(&mut self, ctx: &Structured_command_valueContext<'input>){ + let result = ::visit_structured_command_value(self, ctx); + *::temp_result(self) = result; + } + } \ No newline at end of file diff --git a/crates/compiler/src/visitors/code_generation_visitor.rs b/crates/compiler/src/visitors/code_generation_visitor.rs index 59bad8057..ad873e238 100644 --- a/crates/compiler/src/visitors/code_generation_visitor.rs +++ b/crates/compiler/src/visitors/code_generation_visitor.rs @@ -10,7 +10,7 @@ use antlr4rust::token::Token; use antlr4rust::tree::{ParseTree, ParseTreeVisitorCompat, Tree}; use std::ops::Deref; use std::rc::Rc; -use yarnspinner_core::prelude::OpCode; +use antlr4rust::parser::ParserNodeType; use yarnspinner_core::prelude::*; use yarnspinner_core::types::Type; @@ -84,6 +84,7 @@ impl<'a, 'input: 'a> ParseTreeVisitorCompat<'input> for CodeGenerationVisitor<'a } } +#[allow(non_snake_case)] impl<'a, 'input: 'a> YarnSpinnerParserVisitorCompat<'input> for CodeGenerationVisitor<'a, 'input> { /// a regular ol' line of text fn visit_line_statement(&mut self, ctx: &Line_statementContext<'input>) -> Self::Return { @@ -560,6 +561,17 @@ impl<'a, 'input: 'a> YarnSpinnerParserVisitorCompat<'input> for CodeGenerationVi .emit(Emit::from_op_code(OpCode::Pop).with_token(token.deref())); } + fn visit_line_group_statement( + &mut self, + ctx: &Line_group_statementContext<'input>, + ) -> Self::Return { + todo!() + } + + fn visit_line_group_item(&mut self, ctx: &Line_group_itemContext<'input>) -> Self::Return { + todo!() + } + fn visit_declare_statement(&mut self, _ctx: &Declare_statementContext<'input>) -> Self::Return { // Declare statements do not participate in code generation } @@ -590,6 +602,25 @@ impl<'a, 'input: 'a> YarnSpinnerParserVisitorCompat<'input> for CodeGenerationVi self.compiler_listener .emit(Emit::from_op_code(OpCode::RunNode).with_token(ctx.start().deref())) } + + /// A <> command, which immediately jumps to another node, given its name. + fn visit_detourToNodeName(&mut self, ctx: &DetourToNodeNameContext<'input>) -> Self::Return { + todo!() + } + + /// A <> command, which immediately jumps to another node, given an + /// expression that resolves to a node's name. + fn visit_detourToExpression( + &mut self, + ctx: &DetourToExpressionContext<'input>, + ) -> Self::Return { + todo!() + } + + /// A <> command, which immediately returns from a detour or exits a dialogue. + fn visit_return_statement(&mut self, ctx: &Return_statementContext<'input>) -> Self::Return { + todo!() + } } impl<'a, 'input: 'a> CodeGenerationVisitor<'a, 'input> { diff --git a/crates/compiler/src/visitors/constant_value_visitor.rs b/crates/compiler/src/visitors/constant_value_visitor.rs index 1d9a9d40b..82c69fbd7 100644 --- a/crates/compiler/src/visitors/constant_value_visitor.rs +++ b/crates/compiler/src/visitors/constant_value_visitor.rs @@ -91,16 +91,6 @@ impl<'input> YarnSpinnerParserVisitorCompat<'input> for ConstantValueVisitor<'in InternalValue::from(text.trim_matches('"')).into() } - fn visit_valueNull(&mut self, ctx: &ValueNullContext<'input>) -> Self::Return { - let message = "Null is not a permitted type in Yarn Spinner 2.0 and later"; - self.diagnostics.push( - Diagnostic::from_message(message) - .with_file_name(&self.file.name) - .with_parser_context(ctx, self.file.tokens()), - ); - ConstantValue::non_panicking_default() - } - fn visit_valueFunc(&mut self, ctx: &ValueFuncContext<'input>) -> Self::Return { let text = ctx.get_text(); let message = @@ -112,6 +102,10 @@ impl<'input> YarnSpinnerParserVisitorCompat<'input> for ConstantValueVisitor<'in ); ConstantValue::non_panicking_default() } + + fn visit_expValue(&mut self, ctx: &ExpValueContext<'input>) -> Self::Return { + self.visit(ctx.value().unwrap().deref()) + } } /// Needed because ANTLR needs visitors' return values to have a default. diff --git a/crates/compiler/src/visitors/declaration_visitor.rs b/crates/compiler/src/visitors/declaration_visitor.rs index 403e4dfa3..b795fc764 100644 --- a/crates/compiler/src/visitors/declaration_visitor.rs +++ b/crates/compiler/src/visitors/declaration_visitor.rs @@ -87,14 +87,12 @@ impl<'input> YarnSpinnerParserVisitorCompat<'input> for DeclarationVisitor<'inpu } fn visit_node(&mut self, ctx: &NodeContext<'input>) -> Self::Return { - for header in ctx.header_all() { - let header_key = header.header_key.as_ref().unwrap(); - if header_key.get_text() != "title" { - continue; - } + for header in ctx.title_header_all() { + let current_node_name = match &header.title { + None => continue, + Some(title) => title.get_text() + }; - let header_value = header.header_value.as_ref().unwrap(); - let current_node_name = header_value.get_text(); self.current_node_name = Some(current_node_name.to_owned()); if self.regex.is_match(current_node_name) { let message = @@ -142,7 +140,7 @@ impl<'input> YarnSpinnerParserVisitorCompat<'input> for DeclarationVisitor<'inpu // Figure out the value and its type let mut constant_value_visitor = ConstantValueVisitor::new(self.diagnostics.clone(), self.file.clone()); - let Some(value_context) = ctx.value() else { + let Some(value_context) = ctx.expression() else { // no value was provided, declare as undefined and continue return; }; diff --git a/crates/compiler/src/visitors/node_tracking_visitor.rs b/crates/compiler/src/visitors/node_tracking_visitor.rs index 841b52829..1d2f30451 100644 --- a/crates/compiler/src/visitors/node_tracking_visitor.rs +++ b/crates/compiler/src/visitors/node_tracking_visitor.rs @@ -1,10 +1,10 @@ use crate::parser::generated::yarnspinnerparser::*; -use crate::prelude::generated::yarnspinnerlexer; use crate::prelude::generated::yarnspinnerparservisitor::YarnSpinnerParserVisitorCompat; use antlr4rust::parser_rule_context::ParserRuleContext; use antlr4rust::token::Token; use antlr4rust::tree::{ParseTree, ParseTreeVisitorCompat}; use std::collections::HashSet; +use crate::parser::generated::yarnspinnerparser; #[derive(Clone, Default)] pub(crate) struct NodeTrackingVisitor { @@ -68,7 +68,7 @@ impl<'input> YarnSpinnerParserVisitorCompat<'input> for NodeTrackingVisitor { } fn visit_valueString(&mut self, ctx: &ValueStringContext<'input>) -> Self::Return { - ctx.get_token(yarnspinnerlexer::STRING, 0) + ctx.get_token(yarnspinnerparser::YarnSpinnerParser_STRING, 0) .unwrap() .get_text() .trim_matches('"') @@ -78,7 +78,7 @@ impl<'input> YarnSpinnerParserVisitorCompat<'input> for NodeTrackingVisitor { fn visit_function_call(&mut self, ctx: &Function_callContext<'input>) -> Self::Return { let function_name = ctx - .get_token(yarnspinnerlexer::FUNC_ID, 0) + .get_token(yarnspinnerparser::YarnSpinnerParser_FUNC_ID, 0) .unwrap() .get_text(); diff --git a/crates/compiler/src/visitors/type_check_visitor.rs b/crates/compiler/src/visitors/type_check_visitor.rs index 4b453ee1f..f89efce29 100644 --- a/crates/compiler/src/visitors/type_check_visitor.rs +++ b/crates/compiler/src/visitors/type_check_visitor.rs @@ -119,11 +119,10 @@ impl<'input> ParseTreeVisitorCompat<'input> for TypeCheckVisitor<'input> { impl<'input> YarnSpinnerParserVisitorCompat<'input> for TypeCheckVisitor<'input> { fn visit_node(&mut self, ctx: &NodeContext<'input>) -> Self::Return { - for header in ctx.header_all() { - let key = header.header_key.as_ref().unwrap_or_bug().get_text(); - if key == "title" { - let value = header.header_value.as_ref().unwrap_or_bug().get_text(); - self.current_node_name = Some(value.to_owned()); + for header in ctx.title_header_all() { + match &header.title { + None => {} + Some(title) => { self.current_node_name = Some(title.get_text().to_owned()) } } } if let Some(body) = ctx.body() { @@ -248,16 +247,6 @@ impl<'input> YarnSpinnerParserVisitorCompat<'input> for TypeCheckVisitor<'input> Some(Type::String) } - fn visit_valueNull(&mut self, ctx: &ValueNullContext<'input>) -> Self::Return { - self.diagnostics.push( - Diagnostic::from_message("Null is not a permitted type in Yarn Spinner 2.0 and later") - .with_file_name(&self.file.name) - .with_parser_context(ctx, self.file.tokens()), - ); - - None - } - fn visit_valueFunc(&mut self, ctx: &ValueFuncContext<'input>) -> Self::Return { let function_name = ctx .function_call() diff --git a/crates/core/src/generated/ext.rs b/crates/core/src/generated/ext.rs index 2ce2c3ce9..5675eed42 100644 --- a/crates/core/src/generated/ext.rs +++ b/crates/core/src/generated/ext.rs @@ -1,8 +1,10 @@ //! Contains extensions to generated types that in the original implementation are sprinkled around the repo via partial classes +use crate::generated::instruction::InstructionType; use crate::prelude::*; use core::error::Error; use core::fmt::{Debug, Display}; +use std::iter::empty; impl From for Operand { fn from(s: String) -> Self { @@ -136,15 +138,125 @@ impl Program { } } -impl Instruction { - pub fn read_operand(&self, index: usize) -> T - where - T: TryFrom, - >::Error: Debug, - { - self.operands[index] - .clone() - .try_into() - .unwrap_or_else(|e| panic!("Failed to convert operand {index}: {e:?}",)) +#[derive(Debug)] +pub enum InstructionCastError { + IncorrectInstructionType, + NotADestinationInstructionType +} + +macro_rules! instruction_from { + ($( $enum_val:ident($instruction:ty) ),+) => { + $( + impl From<$instruction> for Instruction { + fn from(value: $instruction) -> Self { + Self { instruction_type: Some(InstructionType::$enum_val(value)) } + } + } + + impl<'a> TryFrom<&'a Instruction> for &'a $instruction { + type Error = InstructionCastError; + + fn try_from(value: &'a Instruction) -> Result { + match &value.instruction_type { + Some(InstructionType::$enum_val(t)) => Ok(t), + _ => Err(Self::Error::IncorrectInstructionType) + } + } + } + + impl<'a> TryFrom<&'a mut Instruction> for &'a mut $instruction { + type Error = InstructionCastError; + + fn try_from(value: &'a mut Instruction) -> Result { + match &mut value.instruction_type { + Some(InstructionType::$enum_val(t)) => Ok(t), + _ => Err(Self::Error::IncorrectInstructionType) + } + } + } + )* + }; +} + +instruction_from! { + JumpTo(JumpToInstruction), + PeekAndJump(PeekAndJumpInstruction), + RunLine(RunLineInstruction), + RunCommand(RunCommandInstruction), + AddOption(AddOptionInstruction), + ShowOptions(ShowOptionsInstruction), + PushString(PushStringInstruction), + PushFloat(PushFloatInstruction), + PushBool(PushBoolInstruction), + JumpIfFalse(JumpIfFalseInstruction), + Pop(PopInstruction), + CallFunc(CallFunctionInstruction), + PushVariable(PushVariableInstruction), + StoreVariable(StoreVariableInstruction), + Stop(StopInstruction), + RunNode(RunNodeInstruction), + PeekAndRunNode(PeekAndRunNodeInstruction), + DetourToNode(DetourToNodeInstruction), + PeekAndDetourToNode(PeekAndDetourToNode), + Return(ReturnInstruction), + AddSaliencyCandidate(AddSaliencyCandidateInstruction), + AddSaliencyCandidateFromNode(AddSaliencyCandidateFromNodeInstruction), + SelectSaliencyCandidate(SelectSaliencyCandidateInstruction) +} + +impl Node { + + pub fn get_header(&self, key: &str) -> Option { + return self.headers.iter().find_map(|h| if h.key == key { Some(h.value.clone()) } else { None }) + } + + pub fn tags(&self) -> Vec { + let Some(tags) = self.get_header("tags") else { return empty().collect(); }; + + tags.split(' ').map(|t| t.into()).collect() + } +} + +pub trait Destination { + fn destination(&self) -> usize; + fn set_destination(&mut self, destination: usize); +} + +macro_rules! impl_destination { + ($($enum_val:ident($ty:ident)),+) => { + $( + impl Destination for $ty { + fn destination(&self) -> usize { + self.destination as usize + } + + fn set_destination(&mut self, destination: usize) { + self.destination = destination as i32; + } + } + )+ + + impl<'a> TryFrom<&'a mut Instruction> for &'a mut dyn Destination { + type Error = InstructionCastError; + + fn try_from(value: &'a mut Instruction) -> Result { + match &mut value.instruction_type { + $( + Some(InstructionType::$enum_val(val)) => { + Ok(val as &mut dyn Destination) + }, + )+ + _ => Err(InstructionCastError::NotADestinationInstructionType) + } + } + } } } + +impl_destination!( + JumpTo(JumpToInstruction), + AddOption(AddOptionInstruction), + JumpIfFalse(JumpIfFalseInstruction), + AddSaliencyCandidate(AddSaliencyCandidateInstruction), + AddSaliencyCandidateFromNode(AddSaliencyCandidateFromNodeInstruction) +); \ No newline at end of file diff --git a/crates/core/src/generated/yarn.rs b/crates/core/src/generated/yarn.rs index b928687db..6cd8a0fef 100644 --- a/crates/core/src/generated/yarn.rs +++ b/crates/core/src/generated/yarn.rs @@ -5,7 +5,6 @@ use crate::prelude::*; #[cfg_attr(feature = "bevy", derive(Reflect))] #[cfg_attr(feature = "bevy", reflect(Debug, PartialEq))] #[cfg_attr(all(feature = "bevy", feature = "serde"), reflect(Serialize, Deserialize))] -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Program { /// The name of the program. @@ -32,29 +31,15 @@ use crate::prelude::*; #[cfg_attr(feature = "bevy", derive(Reflect))] #[cfg_attr(feature = "bevy", reflect(Debug, PartialEq))] #[cfg_attr(all(feature = "bevy", feature = "serde"), reflect(Serialize, Deserialize))] -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Node { /// The name of this node. #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, /// The list of instructions in this node. - #[prost(message, repeated, tag = "2")] + #[prost(message, repeated, tag = "7")] pub instructions: ::prost::alloc::vec::Vec, - /// A jump table, mapping the names of labels to positions in the - /// instructions list. - #[prost(btree_map = "string, int32", tag = "3")] - pub labels: ::prost::alloc::collections::BTreeMap< - ::prost::alloc::string::String, - i32, - >, - /// The tags associated with this node. - #[prost(string, repeated, tag = "4")] - pub tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// the entry in the program's string table that contains the original - /// text of this node; null if this is not available - #[prost(string, tag = "5")] - pub source_text_string_id: ::prost::alloc::string::String, + /// The headers present on this node. #[prost(message, repeated, tag = "6")] pub headers: ::prost::alloc::vec::Vec
, } @@ -63,32 +48,456 @@ use crate::prelude::*; #[cfg_attr(feature = "bevy", derive(Reflect))] #[cfg_attr(feature = "bevy", reflect(Debug, PartialEq))] #[cfg_attr(all(feature = "bevy", feature = "serde"), reflect(Serialize, Deserialize))] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Header { + /// The name of the header. #[prost(string, tag = "1")] pub key: ::prost::alloc::string::String, + /// The value of the header. #[prost(string, tag = "2")] pub value: ::prost::alloc::string::String, } -/// A single Yarn instruction. use crate::prelude::*; #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "bevy", derive(Reflect))] #[cfg_attr(feature = "bevy", reflect(Debug, PartialEq))] #[cfg_attr(all(feature = "bevy", feature = "serde"), reflect(Serialize, Deserialize))] -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Instruction { + #[prost( + oneof = "instruction::InstructionType", + tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23" + )] + pub instruction_type: ::core::option::Option, +} +/// Nested message and enum types in `Instruction`. +pub mod instruction { + use crate::prelude::*; + #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] + #[cfg_attr(feature = "bevy", derive(Reflect))] + #[cfg_attr(feature = "bevy", reflect(Debug, PartialEq))] + #[cfg_attr( + all(feature = "bevy", feature = "serde"), + reflect(Serialize, Deserialize) + )] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] + pub struct PeekAndJumpInstruction {} + use crate::prelude::*; + #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] + #[cfg_attr(feature = "bevy", derive(Reflect))] + #[cfg_attr(feature = "bevy", reflect(Debug, PartialEq))] + #[cfg_attr( + all(feature = "bevy", feature = "serde"), + reflect(Serialize, Deserialize) + )] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] + pub struct PeekAndRunNodeInstruction {} + use crate::prelude::*; + #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] + #[cfg_attr(feature = "bevy", derive(Reflect))] + #[cfg_attr(feature = "bevy", reflect(Debug, PartialEq))] + #[cfg_attr( + all(feature = "bevy", feature = "serde"), + reflect(Serialize, Deserialize) + )] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] + pub struct ShowOptionsInstruction {} + use crate::prelude::*; + #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] + #[cfg_attr(feature = "bevy", derive(Reflect))] + #[cfg_attr(feature = "bevy", reflect(Debug, PartialEq))] + #[cfg_attr( + all(feature = "bevy", feature = "serde"), + reflect(Serialize, Deserialize) + )] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] + pub struct PushStringInstruction { + /// The value to push. + #[prost(string, tag = "1")] + pub value: ::prost::alloc::string::String, + } + use crate::prelude::*; + #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] + #[cfg_attr(feature = "bevy", derive(Reflect))] + #[cfg_attr(feature = "bevy", reflect(Debug, PartialEq))] + #[cfg_attr( + all(feature = "bevy", feature = "serde"), + reflect(Serialize, Deserialize) + )] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] + pub struct PushFloatInstruction { + /// The value to push. + #[prost(float, tag = "1")] + pub value: f32, + } + use crate::prelude::*; + #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] + #[cfg_attr(feature = "bevy", derive(Reflect))] + #[cfg_attr(feature = "bevy", reflect(Debug, PartialEq))] + #[cfg_attr( + all(feature = "bevy", feature = "serde"), + reflect(Serialize, Deserialize) + )] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] + pub struct PushBoolInstruction { + /// The value to push. + #[prost(bool, tag = "1")] + pub value: bool, + } + use crate::prelude::*; + #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] + #[cfg_attr(feature = "bevy", derive(Reflect))] + #[cfg_attr(feature = "bevy", reflect(Debug, PartialEq))] + #[cfg_attr( + all(feature = "bevy", feature = "serde"), + reflect(Serialize, Deserialize) + )] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] + pub struct JumpToInstruction { + /// The instruction number in the current node to jump to. + #[prost(int32, tag = "1")] + pub destination: i32, + } + use crate::prelude::*; + #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] + #[cfg_attr(feature = "bevy", derive(Reflect))] + #[cfg_attr(feature = "bevy", reflect(Debug, PartialEq))] + #[cfg_attr( + all(feature = "bevy", feature = "serde"), + reflect(Serialize, Deserialize) + )] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] + pub struct RunLineInstruction { + /// The ID of the localised content that should be shown for this line. + #[prost(string, tag = "1")] + pub line_id: ::prost::alloc::string::String, + /// The number of substitutions present in this line that must be popped + /// off the stack. + #[prost(int32, tag = "2")] + pub substitution_count: i32, + } + use crate::prelude::*; + #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] + #[cfg_attr(feature = "bevy", derive(Reflect))] + #[cfg_attr(feature = "bevy", reflect(Debug, PartialEq))] + #[cfg_attr( + all(feature = "bevy", feature = "serde"), + reflect(Serialize, Deserialize) + )] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] + pub struct RunCommandInstruction { + /// The text of the command to send to the client. + #[prost(string, tag = "1")] + pub command_text: ::prost::alloc::string::String, + /// The number of substitutions present in this command that must be popped + /// off the stack. + #[prost(int32, tag = "2")] + pub substitution_count: i32, + } + use crate::prelude::*; + #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] + #[cfg_attr(feature = "bevy", derive(Reflect))] + #[cfg_attr(feature = "bevy", reflect(Debug, PartialEq))] + #[cfg_attr( + all(feature = "bevy", feature = "serde"), + reflect(Serialize, Deserialize) + )] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] + pub struct AddOptionInstruction { + /// The ID of the content that should be shown for this option. + #[prost(string, tag = "1")] + pub line_id: ::prost::alloc::string::String, + /// The instruction number in the current node to jump to if this option + /// is selected. + #[prost(int32, tag = "2")] + pub destination: i32, + /// The number of substitutions present in this option that must be popped + /// off the stack. + #[prost(int32, tag = "3")] + pub substitution_count: i32, + /// A value indicating whether this instruction has a line condition on + /// it, whose evaluated value must be popped off the stack. + #[prost(bool, tag = "4")] + pub has_condition: bool, + } + use crate::prelude::*; + #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] + #[cfg_attr(feature = "bevy", derive(Reflect))] + #[cfg_attr(feature = "bevy", reflect(Debug, PartialEq))] + #[cfg_attr( + all(feature = "bevy", feature = "serde"), + reflect(Serialize, Deserialize) + )] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] + pub struct JumpIfFalseInstruction { + /// The instruction number in the current node to jump to. + #[prost(int32, tag = "1")] + pub destination: i32, + } + use crate::prelude::*; + #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] + #[cfg_attr(feature = "bevy", derive(Reflect))] + #[cfg_attr(feature = "bevy", reflect(Debug, PartialEq))] + #[cfg_attr( + all(feature = "bevy", feature = "serde"), + reflect(Serialize, Deserialize) + )] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] + pub struct PopInstruction {} + use crate::prelude::*; + #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] + #[cfg_attr(feature = "bevy", derive(Reflect))] + #[cfg_attr(feature = "bevy", reflect(Debug, PartialEq))] + #[cfg_attr( + all(feature = "bevy", feature = "serde"), + reflect(Serialize, Deserialize) + )] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] + pub struct CallFunctionInstruction { + /// The name of the function to call. + #[prost(string, tag = "1")] + pub function_name: ::prost::alloc::string::String, + } + use crate::prelude::*; + #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] + #[cfg_attr(feature = "bevy", derive(Reflect))] + #[cfg_attr(feature = "bevy", reflect(Debug, PartialEq))] + #[cfg_attr( + all(feature = "bevy", feature = "serde"), + reflect(Serialize, Deserialize) + )] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] + pub struct PushVariableInstruction { + /// The name of the variable whose value should be pushed onto the stack. + #[prost(string, tag = "1")] + pub variable_name: ::prost::alloc::string::String, + } + use crate::prelude::*; + #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] + #[cfg_attr(feature = "bevy", derive(Reflect))] + #[cfg_attr(feature = "bevy", reflect(Debug, PartialEq))] + #[cfg_attr( + all(feature = "bevy", feature = "serde"), + reflect(Serialize, Deserialize) + )] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] + pub struct StoreVariableInstruction { + /// The name of the variable whose value should be updated with the value + /// currently on top of the stack. + #[prost(string, tag = "1")] + pub variable_name: ::prost::alloc::string::String, + } + use crate::prelude::*; + #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] + #[cfg_attr(feature = "bevy", derive(Reflect))] + #[cfg_attr(feature = "bevy", reflect(Debug, PartialEq))] + #[cfg_attr( + all(feature = "bevy", feature = "serde"), + reflect(Serialize, Deserialize) + )] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] + pub struct StopInstruction {} + use crate::prelude::*; + #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] + #[cfg_attr(feature = "bevy", derive(Reflect))] + #[cfg_attr(feature = "bevy", reflect(Debug, PartialEq))] + #[cfg_attr( + all(feature = "bevy", feature = "serde"), + reflect(Serialize, Deserialize) + )] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] + pub struct RunNodeInstruction { + /// The name of the node to begin running. + #[prost(string, tag = "1")] + pub node_name: ::prost::alloc::string::String, + } + use crate::prelude::*; + #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] + #[cfg_attr(feature = "bevy", derive(Reflect))] + #[cfg_attr(feature = "bevy", reflect(Debug, PartialEq))] + #[cfg_attr( + all(feature = "bevy", feature = "serde"), + reflect(Serialize, Deserialize) + )] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] + pub struct DetourToNodeInstruction { + #[prost(string, tag = "1")] + pub node_name: ::prost::alloc::string::String, + } + use crate::prelude::*; + #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] + #[cfg_attr(feature = "bevy", derive(Reflect))] + #[cfg_attr(feature = "bevy", reflect(Debug, PartialEq))] + #[cfg_attr( + all(feature = "bevy", feature = "serde"), + reflect(Serialize, Deserialize) + )] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] + pub struct PeekAndDetourToNode {} + use crate::prelude::*; + #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] + #[cfg_attr(feature = "bevy", derive(Reflect))] + #[cfg_attr(feature = "bevy", reflect(Debug, PartialEq))] + #[cfg_attr( + all(feature = "bevy", feature = "serde"), + reflect(Serialize, Deserialize) + )] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] + pub struct ReturnInstruction {} + use crate::prelude::*; + #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] + #[cfg_attr(feature = "bevy", derive(Reflect))] + #[cfg_attr(feature = "bevy", reflect(Debug, PartialEq))] + #[cfg_attr( + all(feature = "bevy", feature = "serde"), + reflect(Serialize, Deserialize) + )] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] + pub struct AddSaliencyCandidateInstruction { + /// The unique ID for this piece of content, such as a line ID. + #[prost(string, tag = "1")] + pub content_id: ::prost::alloc::string::String, + /// The complexity score of the candidate. + #[prost(int32, tag = "2")] + pub complexity_score: i32, + /// The instruction number in the current node to jump to if this + /// candidate is selected. + #[prost(int32, tag = "3")] + pub destination: i32, + } + use crate::prelude::*; + #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] + #[cfg_attr(feature = "bevy", derive(Reflect))] + #[cfg_attr(feature = "bevy", reflect(Debug, PartialEq))] + #[cfg_attr( + all(feature = "bevy", feature = "serde"), + reflect(Serialize, Deserialize) + )] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] + pub struct AddSaliencyCandidateFromNodeInstruction { + /// The name of the node to get saliency information from. + #[prost(string, tag = "1")] + pub node_name: ::prost::alloc::string::String, + /// The instruction number in the current node to jump to if this + /// candidate is selected. + #[prost(int32, tag = "2")] + pub destination: i32, + } + use crate::prelude::*; + #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] + #[cfg_attr(feature = "bevy", derive(Reflect))] + #[cfg_attr(feature = "bevy", reflect(Debug, PartialEq))] + #[cfg_attr( + all(feature = "bevy", feature = "serde"), + reflect(Serialize, Deserialize) + )] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] + pub struct SelectSaliencyCandidateInstruction {} + use crate::prelude::*; + #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] + #[cfg_attr(feature = "bevy", derive(Reflect))] + #[cfg_attr(feature = "bevy", reflect(Debug, PartialEq))] + #[cfg_attr( + all(feature = "bevy", feature = "serde"), + reflect(Serialize, Deserialize) + )] + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum InstructionType { + /// Jumps to a specified position in the current node. + #[prost(message, tag = "1")] + JumpTo(JumpToInstruction), + /// Peeks a number on the stack, and jumps to that position in the + /// current node. + #[prost(message, tag = "2")] + PeekAndJump(PeekAndJumpInstruction), + /// Runs a line of dialogue. + #[prost(message, tag = "3")] + RunLine(RunLineInstruction), + /// Runs a command. + #[prost(message, tag = "4")] + RunCommand(RunCommandInstruction), + /// Adds an option to the 'pending options' list. + #[prost(message, tag = "5")] + AddOption(AddOptionInstruction), + /// Shows all options in the 'pending options' list, then clears the list. + #[prost(message, tag = "6")] + ShowOptions(ShowOptionsInstruction), + /// Pushes a string onto the stack. + #[prost(message, tag = "7")] + PushString(PushStringInstruction), + /// Pushes a floating point number onto the stack. + #[prost(message, tag = "8")] + PushFloat(PushFloatInstruction), + /// Pushes a boolean onto the stack. + #[prost(message, tag = "9")] + PushBool(PushBoolInstruction), + /// Peeks a boolean on the stack, and if it's false, jumps to the + /// indicated position in the current node. + #[prost(message, tag = "10")] + JumpIfFalse(JumpIfFalseInstruction), + /// Pops a value of any kind off the stack. + #[prost(message, tag = "11")] + Pop(PopInstruction), + /// Calls a named function. + #[prost(message, tag = "12")] + CallFunc(CallFunctionInstruction), + /// Pushes the value of the named variable onto the stack. + #[prost(message, tag = "13")] + PushVariable(PushVariableInstruction), + /// Peeks a value of any kind on the stack, and stores it in the + /// indicated variable. + #[prost(message, tag = "14")] + StoreVariable(StoreVariableInstruction), + /// Halts execution. + #[prost(message, tag = "15")] + Stop(StopInstruction), + /// Jumps to the start of a named node. + #[prost(message, tag = "16")] + RunNode(RunNodeInstruction), + /// Peeks a string on the stack, and jumps to the start of that node. + #[prost(message, tag = "17")] + PeekAndRunNode(PeekAndRunNodeInstruction), + #[prost(message, tag = "18")] + DetourToNode(DetourToNodeInstruction), + #[prost(message, tag = "19")] + PeekAndDetourToNode(PeekAndDetourToNode), + #[prost(message, tag = "20")] + Return(ReturnInstruction), + /// Pops a boolean from the stack, and adds a saliency candidate to the + /// current list. + #[prost(message, tag = "21")] + AddSaliencyCandidate(AddSaliencyCandidateInstruction), + /// Add a saliency candidate to the current list, given a node name. + #[prost(message, tag = "22")] + AddSaliencyCandidateFromNode(AddSaliencyCandidateFromNodeInstruction), + /// Attempt to select a single saliency candidate from the current list: + /// - if one is selected, pushes the destination of that candidate and + /// the value 'true' + /// - if none is selected, pushes the value 'false' + /// + /// In all circumstances, clears the saliency candidate list before + /// returning. + #[prost(message, tag = "23")] + SelectSaliencyCandidate(SelectSaliencyCandidateInstruction), + } +} +/// A single Yarn instruction. +use crate::prelude::*; +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "bevy", derive(Reflect))] +#[cfg_attr(feature = "bevy", reflect(Debug, PartialEq))] +#[cfg_attr(all(feature = "bevy", feature = "serde"), reflect(Serialize, Deserialize))] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct InstructionV1 { /// The operation that this instruction will perform. - #[prost(enumeration = "instruction::OpCode", tag = "1")] + #[prost(enumeration = "instruction_v1::OpCode", tag = "1")] pub opcode: i32, /// The list of operands, if any, that this instruction uses. #[prost(message, repeated, tag = "2")] pub operands: ::prost::alloc::vec::Vec, } -/// Nested message and enum types in `Instruction`. -pub mod instruction { +/// Nested message and enum types in `InstructionV1`. +pub mod instruction_v1 { /// The type of instruction that this is. use crate::prelude::*; #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] @@ -184,23 +593,23 @@ pub mod instruction { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - OpCode::JumpTo => "JUMP_TO", - OpCode::Jump => "JUMP", - OpCode::RunLine => "RUN_LINE", - OpCode::RunCommand => "RUN_COMMAND", - OpCode::AddOption => "ADD_OPTION", - OpCode::ShowOptions => "SHOW_OPTIONS", - OpCode::PushString => "PUSH_STRING", - OpCode::PushFloat => "PUSH_FLOAT", - OpCode::PushBool => "PUSH_BOOL", - OpCode::PushNull => "PUSH_NULL", - OpCode::JumpIfFalse => "JUMP_IF_FALSE", - OpCode::Pop => "POP", - OpCode::CallFunc => "CALL_FUNC", - OpCode::PushVariable => "PUSH_VARIABLE", - OpCode::StoreVariable => "STORE_VARIABLE", - OpCode::Stop => "STOP", - OpCode::RunNode => "RUN_NODE", + Self::JumpTo => "JUMP_TO", + Self::Jump => "JUMP", + Self::RunLine => "RUN_LINE", + Self::RunCommand => "RUN_COMMAND", + Self::AddOption => "ADD_OPTION", + Self::ShowOptions => "SHOW_OPTIONS", + Self::PushString => "PUSH_STRING", + Self::PushFloat => "PUSH_FLOAT", + Self::PushBool => "PUSH_BOOL", + Self::PushNull => "PUSH_NULL", + Self::JumpIfFalse => "JUMP_IF_FALSE", + Self::Pop => "POP", + Self::CallFunc => "CALL_FUNC", + Self::PushVariable => "PUSH_VARIABLE", + Self::StoreVariable => "STORE_VARIABLE", + Self::Stop => "STOP", + Self::RunNode => "RUN_NODE", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -234,7 +643,6 @@ use crate::prelude::*; #[cfg_attr(feature = "bevy", derive(Reflect))] #[cfg_attr(feature = "bevy", reflect(Debug, PartialEq))] #[cfg_attr(all(feature = "bevy", feature = "serde"), reflect(Serialize, Deserialize))] -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Operand { /// The type of operand this is. @@ -252,7 +660,6 @@ pub mod operand { all(feature = "bevy", feature = "serde"), reflect(Serialize, Deserialize) )] - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Value { /// A string. diff --git a/crates/core/src/lib.rs b/crates/core/src/lib.rs index 90814c467..d739e51ad 100644 --- a/crates/core/src/lib.rs +++ b/crates/core/src/lib.rs @@ -41,7 +41,7 @@ pub mod prelude { pub use crate::{ generated::{ - Header, Instruction, InvalidOpCodeError, Node, Operand, Program, instruction::OpCode, + Header, Instruction, InvalidOpCodeError, Node, Operand, Program, instruction::*, operand::Value as OperandValue, }, internal_value::*, diff --git a/crates/runtime/src/analyser/default_analysers/unused_variable_checker.rs b/crates/runtime/src/analyser/default_analysers/unused_variable_checker.rs index 2a3a5902b..06e63145b 100644 --- a/crates/runtime/src/analyser/default_analysers/unused_variable_checker.rs +++ b/crates/runtime/src/analyser/default_analysers/unused_variable_checker.rs @@ -22,9 +22,10 @@ impl CompiledProgramAnalyser for UnusedVariableChecker { let new_variables = program.nodes.values().flat_map(|node| { node.instructions .iter() - .filter_map(|instruction| match instruction.opcode() { - OpCode::PushVariable | OpCode::StoreVariable => { - Some((instruction.opcode(), instruction.operands[0].clone())) + .filter_map(|instruction| match instruction.instruction_type.as_ref() { + Some(InstructionType::PushVariable(PushVariableInstruction { variable_name })) | + Some(InstructionType::StoreVariable(StoreVariableInstruction { variable_name })) => { + Some((instruction.instruction_type.clone().unwrap(), variable_name.clone())) } _ => None, }) @@ -32,10 +33,10 @@ impl CompiledProgramAnalyser for UnusedVariableChecker { }); for (opcode, variable) in new_variables { match opcode { - OpCode::PushVariable => { + InstructionType::PushVariable(_) => { self.read_variables.insert(variable); } - OpCode::StoreVariable => { + InstructionType::StoreVariable(_) => { self.written_variables.insert(variable); } _ => unreachable!(), diff --git a/crates/runtime/src/analyser/default_analysers/variable_lister.rs b/crates/runtime/src/analyser/default_analysers/variable_lister.rs index f29dd4206..933932f82 100644 --- a/crates/runtime/src/analyser/default_analysers/variable_lister.rs +++ b/crates/runtime/src/analyser/default_analysers/variable_lister.rs @@ -21,9 +21,10 @@ impl CompiledProgramAnalyser for VariableLister { let new_variables = program.nodes.values().flat_map(|node| { node.instructions .iter() - .filter_map(|instruction| match instruction.opcode() { - OpCode::PushVariable | OpCode::StoreVariable => { - Some(instruction.operands[0].clone()) + .filter_map(|instruction| match instruction.instruction_type.as_ref() { + Some(InstructionType::PushVariable(PushVariableInstruction { variable_name })) | + Some(InstructionType::StoreVariable(StoreVariableInstruction { variable_name })) => { + Some(variable_name.clone()) } _ => None, }) diff --git a/crates/runtime/src/dialogue.rs b/crates/runtime/src/dialogue.rs index 057030cd7..169ebed24 100644 --- a/crates/runtime/src/dialogue.rs +++ b/crates/runtime/src/dialogue.rs @@ -398,7 +398,7 @@ impl Dialogue { #[must_use] pub fn get_tags_for_node(&self, node_name: &str) -> Option> { self.get_node_logging_errors(node_name) - .map(|node| node.tags) + .map(|node| node.tags()) } /// Returns the headers for the node `node_name`. diff --git a/crates/runtime/src/virtual_machine.rs b/crates/runtime/src/virtual_machine.rs index 430b26883..b35cafb76 100644 --- a/crates/runtime/src/virtual_machine.rs +++ b/crates/runtime/src/virtual_machine.rs @@ -304,20 +304,19 @@ impl VirtualMachine { instruction: &Instruction, mut function_call_fn: impl FnMut(&dyn UntypedYarnFn, Vec) -> YarnValue, ) -> crate::Result<()> { - let opcode: OpCode = instruction.opcode.try_into().unwrap(); - match opcode { - OpCode::JumpTo => { + match instruction.instruction_type.as_ref().unwrap_or_bug() { + InstructionType::JumpTo(jumpto) => { // Jumps to a named label let label_name: String = instruction.read_operand(0); self.state.program_counter = self.find_instruction_point_for_label(&label_name); } - OpCode::Jump => { + InstructionType::PeekAndJump(_) => { // Jumps to a label whose name is on the stack. let jump_destination: String = self.state.peek(); self.state.program_counter = self.find_instruction_point_for_label(&jump_destination); } - OpCode::RunLine => { + InstructionType::RunLine(run_line) => { // Looks up a string from the string table and passes it to the client as a line let string_id: String = instruction.read_operand(0); @@ -343,7 +342,7 @@ impl VirtualMachine { self.set_execution_state(ExecutionState::WaitingForContinue); self.state.program_counter += 1; } - OpCode::RunCommand => { + InstructionType::RunCommand(cmd) => { // Passes a string to the client as a custom command let command_text: String = instruction.read_operand(0); assert_up_to_date_compiler(instruction.operands.len() >= 2); @@ -366,7 +365,7 @@ impl VirtualMachine { self.set_execution_state(ExecutionState::WaitingForContinue); self.state.program_counter += 1; } - OpCode::AddOption => { + InstructionType::AddOption(opt) => { // Add an option to the current state let string_id: String = instruction.read_operand(0); let string_id: LineId = string_id.into(); @@ -402,7 +401,7 @@ impl VirtualMachine { }); self.state.program_counter += 1; } - OpCode::ShowOptions => { + InstructionType::ShowOptions(_) => { // If we have no options to show, immediately stop. if self.state.current_options.is_empty() { self.batched_events.push(DialogueEvent::DialogueComplete); @@ -425,31 +424,25 @@ impl VirtualMachine { // Not checking the execution state now since we have no line handler to call `continue_` from. self.state.program_counter += 1; } - OpCode::PushString => { + InstructionType::PushString(push) => { // Pushes a string value onto the stack. The operand is an index into the string table, so that's looked up first. let string_table_index: String = instruction.read_operand(0); self.state.push(string_table_index); self.state.program_counter += 1; } - OpCode::PushFloat => { + InstructionType::PushFloat(push) => { // Pushes a floating point onto the stack. let float: f32 = instruction.read_operand(0); self.state.push(float); self.state.program_counter += 1; } - OpCode::PushBool => { + InstructionType::PushBool(push) => { // Pushes a boolean value onto the stack. let boolean: bool = instruction.read_operand(0); self.state.push(boolean); self.state.program_counter += 1; } - - OpCode::PushNull => { - panic!( - "PushNull is no longer valid op code, because null is no longer a valid value from Yarn Spinner 2.0 onwards. To fix this error, re-compile the original source code." - ); - } - OpCode::JumpIfFalse => { + InstructionType::JumpIfFalse(jump) => { // Jumps to a named label if the value on the top of the stack evaluates to the boolean value 'false'. let is_top_value_true: bool = self.state.peek(); if !is_top_value_true { @@ -460,12 +453,12 @@ impl VirtualMachine { self.state.program_counter += 1; } } - OpCode::Pop => { + InstructionType::Pop(_) => { // Pops a value from the stack. self.state.pop_value(); self.state.program_counter += 1; } - OpCode::CallFunc => { + InstructionType::CallFunc(func) => { let actual_parameter_count: usize = self.state.pop(); // Get the parameters, which were pushed in reverse let parameters = { @@ -512,7 +505,7 @@ impl VirtualMachine { self.state.push(typed_return_value); self.state.program_counter += 1; } - OpCode::PushVariable => { + InstructionType::PushVariable(push) => { // Get the contents of a variable, push that onto the stack. let variable_name: String = instruction.read_operand(0); let loaded_value = self @@ -544,14 +537,14 @@ impl VirtualMachine { self.state.push(loaded_value); self.state.program_counter += 1; } - OpCode::StoreVariable => { + InstructionType::StoreVariable(store) => { // Store the top value on the stack in a variable. let top_value = self.state.peek_value().clone(); let variable_name: String = instruction.read_operand(0); self.variable_storage.set(variable_name, top_value.into())?; self.state.program_counter += 1; } - OpCode::Stop => { + InstructionType::Stop(_) => { // Immediately stop execution, and report that fact. let current_node_name = self.current_node_name.clone().unwrap(); self.batched_events @@ -561,7 +554,7 @@ impl VirtualMachine { self.state.program_counter += 1; } - OpCode::RunNode => { + InstructionType::RunNode(run) => { // Run a node // Pop a string from the stack, and jump to a node @@ -573,6 +566,21 @@ impl VirtualMachine { // No need to increment the program counter, since otherwise we'd skip the first instruction } + InstructionType::PeekAndDetourToNode(_) => { + todo!() + } + InstructionType::DetourToNode(detour) => { + todo!() + } + InstructionType::AddSaliencyCandidate(_) => { + todo!() + } + InstructionType::AddSaliencyCandidateFromNode(_) => { + todo!() + } + InstructionType::SelectSaliencyCandidate(_) => { + todo!() + } } Ok(()) } diff --git a/crates/runtime/src/virtual_machine/state.rs b/crates/runtime/src/virtual_machine/state.rs index 40bab67c5..b1ed985ef 100644 --- a/crates/runtime/src/virtual_machine/state.rs +++ b/crates/runtime/src/virtual_machine/state.rs @@ -3,7 +3,7 @@ use crate::prelude::*; use core::fmt::Debug; -#[derive(Debug, Clone, PartialEq, Default)] +#[derive(Debug, Clone, PartialEq)] #[cfg_attr(feature = "bevy", derive(Reflect))] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "bevy", reflect(Debug, PartialEq, Default))] @@ -23,6 +23,16 @@ pub(crate) struct State { pub(crate) stack: Vec, } +impl Default for State { + fn default() -> Self { + State { + program_counter: 0, + current_options: vec![], + stack: vec![] + } + } +} + impl State { pub(crate) fn push(&mut self, value: impl Into) { self.stack.push(value.into()) diff --git a/crates/yarnspinner/tests/language_tests.rs b/crates/yarnspinner/tests/language_tests.rs index 3d17db9e0..f20230b2f 100644 --- a/crates/yarnspinner/tests/language_tests.rs +++ b/crates/yarnspinner/tests/language_tests.rs @@ -112,7 +112,7 @@ fn test_node_headers() { assert_eq!(program.nodes.len(), 6); for tag in &["one", "two", "three"].map(|s| s.to_owned()) { - assert!(program.nodes["Tags"].tags.contains(tag)); + assert!(program.nodes["Tags"].tags().contains(tag)); } let headers: HashMap<_, _> = vec![ diff --git a/third-party/YarnSpinnerLexer.g4 b/third-party/YarnSpinnerLexer.g4 new file mode 100644 index 000000000..9cdc4e5eb --- /dev/null +++ b/third-party/YarnSpinnerLexer.g4 @@ -0,0 +1,390 @@ +lexer grammar YarnSpinnerLexer; + +tokens { INDENT, DEDENT, BLANK_LINE_FOLLOWING_OPTION } + +channels { + WHITESPACE, + COMMENTS +} + +options { + superClass=IndentAwareLexer; +} + +// Root mode: skip whitespaces, set up some commonly-seen +// tokens +WS : ([ \t])+ -> channel(HIDDEN); + +COMMENT: '//' ~('\r'|'\n')* -> channel(COMMENTS); + +// Newlines are lexed and normally not used in the parser, but we'll put them in a +// separate channel here (rather than skipping them) so that the indent +// checker has access to them +NEWLINE: ( '\r'? '\n' | '\r' ) [ \t]* -> channel(WHITESPACE); + +// The 'when' header, in the context of a node's preamble. Move to HeaderWhenMode, +HEADER_WHEN: 'when' -> pushMode(HeaderWhenMode); + +HEADER_TITLE: 'title' -> pushMode(HeaderTitleMode); + +ID : IDENTIFIER_HEAD IDENTIFIER_CHARACTERS?; + +fragment IDENTIFIER_HEAD : + [a-zA-Z_] + | '\u00A8' | '\u00AA' | '\u00AD' | '\u00AF' | [\u00B2-\u00B5] | [\u00B7-\u00BA] + | [\u00BC-\u00BE] | [\u00C0-\u00D6] | [\u00D8-\u00F6] | [\u00F8-\u00FF] + | [\u0100-\u02FF] | [\u0370-\u167F] | [\u1681-\u180D] | [\u180F-\u1DBF] + | [\u1E00-\u1FFF] + | [\u200B-\u200D] | [\u202A-\u202E] | [\u203F-\u2040] | '\u2054' | [\u2060-\u206F] + | [\u2070-\u20CF] | [\u2100-\u218F] | [\u2460-\u24FF] | [\u2776-\u2793] + | [\u2C00-\u2DFF] | [\u2E80-\u2FFF] + | [\u3004-\u3007] | [\u3021-\u302F] | [\u3031-\u303F] | [\u3040-\uD7FF] + | [\uF900-\uFD3D] | [\uFD40-\uFDCF] | [\uFDF0-\uFE1F] | [\uFE30-\uFE44] + | [\uFE47-\uFFFD] + | [\u{10000}-\u{1FFFD}] | [\u{20000}-\u{2FFFD}] | [\u{30000}-\u{3FFFD}] | [\u{40000}-\u{4FFFD}] + | [\u{50000}-\u{5FFFD}] | [\u{60000}-\u{6FFFD}] | [\u{70000}-\u{7FFFD}] | [\u{80000}-\u{8FFFD}] + | [\u{90000}-\u{9FFFD}] | [\u{A0000}-\u{AFFFD}] | [\u{B0000}-\u{BFFFD}] | [\u{C0000}-\u{CFFFD}] + | [\u{D0000}-\u{DFFFD}] | [\u{E0000}-\u{EFFFD}] + ; + +fragment IDENTIFIER_CHARACTER : [0-9] + | [\u0300-\u036F] | [\u1DC0-\u1DFF] | [\u20D0-\u20FF] | [\uFE20-\uFE2F] + | IDENTIFIER_HEAD + ; + +fragment IDENTIFIER_CHARACTERS : IDENTIFIER_CHARACTER+ ; + +// The 'end of node headers, start of node body' marker +BODY_START : '---' -> pushMode(BodyMode) ; + +// The ':' in 'foo: bar (plus any whitespace after it). +// If we match this, we are in a header. +HEADER_DELIMITER : WS? ':' WS? -> pushMode(HeaderMode); + +// A hashtag. These can appear at the start of a file, or after +// certain lines (see BODY_HASHTAG rule) +HASHTAG : '#' -> pushMode(HashtagMode); + +mode HeaderWhenMode; +// When we see the header delimiter inside a 'when' header, flag that we're in a +// when clause (ExpressionMode will use that to decide what to do when reaching +// a newline), and change our mode to ExpressionMode. +HEADER_WHEN_DELIMITER: WS? ':' WS? {SetInWhenClause(true);} -> type(HEADER_DELIMITER), mode(ExpressionMode); +// Any other text is not allowed. +HEADER_WHEN_UNKNOWN: . -> popMode; + +mode HeaderTitleMode; +// When we see the header delimiter inside a 'title' header, flag that we're in a +// title clause, where we expect to see a single ID. +HEADER_TITLE_DELIMITER: WS? ':' WS? -> type(HEADER_DELIMITER); +HEADER_TITLE_ID: WS? ID WS? -> type(ID); +HEADER_TITLE_NEWLINE : NEWLINE -> type(NEWLINE), popMode; + +// Headers before a node. +mode HeaderMode; +// Allow arbitrary text up to the end of the line. +REST_OF_LINE : ~('\r'|'\n')+; +HEADER_NEWLINE : NEWLINE -> type(NEWLINE), channel(WHITESPACE), popMode; + +// The main body of a node. +mode BodyMode; + +// Ignore all whitespace and comments +BODY_WS : WS -> channel(HIDDEN); +BODY_NEWLINE : NEWLINE -> type(NEWLINE), channel(WHITESPACE); +BODY_COMMENT : COMMENT -> type(COMMENT), channel(COMMENTS) ; + +// End of this node; return to global mode (eg node headers) +// or end of file +BODY_END : '===' -> popMode; + +// The start of a shortcut option +SHORTCUT_ARROW : '->' ; + +// The start of a line group entry +LINE_GROUP_ARROW : '=>' ; + +// The start of a command +COMMAND_START: '<<' -> pushMode(CommandMode) ; + +// The start of a hashtag. Can goes at the end of the +// line, but this rule allows us to capture '#' at the start +// of a line. +BODY_HASHTAG: '#' -> type(HASHTAG), pushMode(TextCommandOrHashtagMode), pushMode(HashtagMode); + +// The start of an inline expression. Immediately lex as +// TEXT_EXPRESSION_START and push into TextMode and +// ExpressionMode. +EXPRESSION_START: '{' -> pushMode(TextMode), pushMode(ExpressionMode); + +// this is a weird one and this should be considered a temporary fix +// basically we don't actually want to treat escaped markup as if it was escaped +// hence why there is the TEXT_ESCAPED_MARKUP_BRACKET token +// but if a line starts with \[ then the TextEscapedMode will be pushed +// jumping over the TEXT_ESCAPED_MARKUP_BRACKET rule, so it will never get matched +// which will attempt to match a valid escape character and fail because the \ has been eaten +ESCAPED_BRACKET_START: '\\[' -> type(TEXT), pushMode(TextMode) ; + +// Any other text means this is a Line. Lex this first character as +// TEXT, and enter TextMode. +// +// We special case when the the line starts with an escape character because +// otherwise it will be detected as regular text BEFORE it has a chance to be +// pushed into TextEscapedMode. +ESCAPED_ANY : '\\' -> channel(HIDDEN), pushMode(TextMode), pushMode(TextEscapedMode); +ANY: . -> type(TEXT), pushMode(TextMode); + +// Arbitrary text, punctuated by expressions, and ended by +// hashtags and/or a newline. +mode TextMode; + +// Newlines while in text mode are syntactically relevant, so we emit them +// into the default channel (rather than into WHITESPACE). +TEXT_NEWLINE: NEWLINE -> type(NEWLINE), popMode; + +// An escaped markup bracket. Markup is parsed by a separate phase (see +// LineParser.cs in the C# code), and we want to pass escaped markers +// directly through, so we'll match this and report it as TEXT before +// matching the more general 'escaped character' rule. +TEXT_ESCAPED_MARKUP_BRACKET: ('\\[' | '\\]') -> type(TEXT); + +// An escape marker. Hide this token and enter escaped text mode, which +// allows escaping characters that would otherwise be syntactically +// meaningful. +TEXT_ESCAPE: '\\' -> channel(HIDDEN), pushMode(TextEscapedMode) ; + +// The start of a hashtag. The remainder of this line will consist of +// commands or hashtags, so swap to this mode and then enter hashtag mode. + +TEXT_HASHTAG: HASHTAG -> type(HASHTAG), mode(TextCommandOrHashtagMode), pushMode(HashtagMode) ; + +// push into expression mode here, because we might lex more +// free text after the expression is done +TEXT_EXPRESSION_START: '{' -> type(EXPRESSION_START), pushMode(ExpressionMode); + +// The start of a hashtag. The remainder of this line will consist of +// commands or hashtags, so swap to this mode, and then enter command mode. +TEXT_COMMAND_START: '<<' -> type(COMMAND_START), mode(TextCommandOrHashtagMode), pushMode(CommandMode); + +// Comments after free text. +TEXT_COMMENT: COMMENT -> channel(COMMENTS); + +// Finally, lex text. We'll read either everything up to (but not including) a +// newline, a hashtag, the start of an expression, the start of an escape, the +// start of a command, or the start of a comma. We'll also lex a _single_ +// chevron or slash as a text; we know that they won't be a command or a +// comment, because the earlier rules for TEXT_COMMAND_START and TEXT_COMMENT +// would have caught them. By lexing a single one of these and then stopping, +// we'll force the lexer to restart scanning after the current character, which +// means we'll correctly lex things like "<<<" as "TEXT(<) COMMAND_START(<<)". +TEXT: TEXT_FRAG+ | '<' | '/' ; +fragment TEXT_FRAG: ~[\r\n#{\\{}#/] -> type(TEXT), popMode ; +// catches the situation where someone has escaped a character that is not allowed to be escaped +// previously this was impossible but with the changes to ANY and ESCAPED_ANY that can now happen +// as such we need to just go back to regular mode and mark the token as invalid +UNESCAPABLE_CHARACTER : . -> popMode; + +mode TextCommandOrHashtagMode; +TEXT_COMMANDHASHTAG_WS: WS -> channel(HIDDEN); + +// Comments following hashtags and line conditions. +TEXT_COMMANDHASHTAG_COMMENT: COMMENT -> channel(COMMENTS); + +TEXT_COMMANDHASHTAG_COMMAND_START: '<<' -> type(COMMAND_START), pushMode(CommandMode); + +TEXT_COMMANDHASHTAG_HASHTAG: '#' -> type(HASHTAG), pushMode(HashtagMode); + +// Newlines while in text mode are syntactically relevant, so we emit them +// into the default channel (rather than into WHITESPACE). +TEXT_COMMANDHASHTAG_NEWLINE: NEWLINE -> type(NEWLINE), popMode; + +TEXT_COMMANDHASHTAG_ERROR: . ; + +// Hashtags at the end of a Line or Command. +mode HashtagMode; +HASHTAG_WS: WS -> channel(HIDDEN); +HASHTAG_TAG: HASHTAG -> type(HASHTAG); + +// The text of the hashtag. After we parse it, we're done parsing this +// hashtag, so leave this mode. +HASHTAG_TEXT: ~[ \t\r\n#$<]+ -> popMode; + +// Expressions, involving values and operations on values. +mode ExpressionMode; +EXPR_WS : WS -> channel(HIDDEN); + +// special keywords that are only permitted inside 'when' clauses. +EXPRESSION_WHEN_ALWAYS: 'always' {IsInWhenClause();}? ; +EXPRESSION_WHEN_ONCE: 'once' {IsInWhenClause();}? -> type(COMMAND_ONCE) ; +EXPRESSION_WHEN_IF: 'if' {IsInWhenClause();}? -> type(COMMAND_IF) ; + +// Simple values +KEYWORD_TRUE : 'true' ; +KEYWORD_FALSE : 'false' ; +KEYWORD_NULL : 'null' ; + +OPERATOR_ASSIGNMENT : '=' | 'to' ; + +OPERATOR_LOGICAL_LESS_THAN_EQUALS : '<=' | 'lte' ; +OPERATOR_LOGICAL_GREATER_THAN_EQUALS : '>=' | 'gte' ; +OPERATOR_LOGICAL_EQUALS : '==' | 'is' | 'eq' ; +OPERATOR_LOGICAL_LESS : '<' | 'lt' ; +OPERATOR_LOGICAL_GREATER : '>' | 'gt' ; +OPERATOR_LOGICAL_NOT_EQUALS : '!=' | 'neq' ; +OPERATOR_LOGICAL_AND : 'and' | '&&' ; +OPERATOR_LOGICAL_OR : 'or' | '||' ; +OPERATOR_LOGICAL_XOR : 'xor' | '^' ; +OPERATOR_LOGICAL_NOT : 'not' | '!' ; +OPERATOR_MATHS_ADDITION_EQUALS : '+=' ; +OPERATOR_MATHS_SUBTRACTION_EQUALS : '-=' ; +OPERATOR_MATHS_MULTIPLICATION_EQUALS : '*=' ; +OPERATOR_MATHS_MODULUS_EQUALS : '%=' ; +OPERATOR_MATHS_DIVISION_EQUALS : '/=' ; +OPERATOR_MATHS_ADDITION : '+' ; +OPERATOR_MATHS_SUBTRACTION : '-' ; +OPERATOR_MATHS_MULTIPLICATION : '*' ; +OPERATOR_MATHS_DIVISION : '/' ; +OPERATOR_MATHS_MODULUS : '%' ; + +LPAREN : '(' ; +RPAREN : ')' ; +COMMA : ',' ; + +EXPRESSION_AS: 'as'; + +TYPE_STRING: 'string' -> type(FUNC_ID); +TYPE_NUMBER: 'number' -> type(FUNC_ID); +TYPE_BOOL: 'bool' -> type(FUNC_ID); + +// A run of text. Escaped quotes and backslashes are allowed. +STRING : '"' (~('"' | '\\' | '\r' | '\n') | '\\' ('"' | '\\'))* '"'; + +FUNC_ID: ID ; + +// The end of an expression. Return to whatever we were lexing before. +EXPRESSION_END: '}' -> popMode; + +// The end of a command. We need to leave both expression mode, and command mode. +EXPRESSION_COMMAND_END: '>>' -> type(COMMAND_END), popMode, popMode; + +// Variables, which always begin with a '$' +VAR_ID : '$' ID ; + +// Dots ('.') +DOT : '.' ; + +// Integer or decimal numbers. +NUMBER + : INT + | INT '.' INT + ; + +// Newlines (only syntactically relevant when inside a 'when' clause). +// We use a newline to indicate that the expression is over, but only +// when we're in a 'when' clause - in all other expressions, newlines are +// ignored. +// +// Mark that we are no longer in a 'when' clause, and pop the mode. +EXPRESSION_NEWLINE: [\r\n]+ {IsInWhenClause();}? {SetInWhenClause(false);} -> type(NEWLINE), popMode; + +fragment INT: DIGIT+ ; +fragment DIGIT: [0-9]; + +// Commands; these are either specific ones that the compiler has a special +// behaviour for, like if, else, set; otherwise, they are arbitrary text +// (which may contain expressions), which are passed to the game. +mode CommandMode; + +// Newlines aren't allowed in commands, so match against them inside the +// CommandMode to produce a token that will lead to parse errors +COMMAND_NEWLINE: NEWLINE; +COMMAND_WS: WS -> channel(HIDDEN); + +// Special keywords that can appear in commands. If we see one of these after +// the <<, it's part of the Yarn language and used for flow control. If we +// see anything else, it's a Command whose text will be passed to the game. + +// Certain commands are followed by expressions (separated by some +// whitespace), and we want to ensure that we don't accidentally match +// things like "iffy" or "settle" as keywords followed by arbitrary text. +// So we make some whitespace be part of the definition of the keyword. +COMMAND_IF: 'if' {IsEndOfCommandKeyword()}? -> pushMode(ExpressionMode); +COMMAND_ELSEIF: 'elseif' {IsEndOfCommandKeyword()}? -> pushMode(ExpressionMode); +COMMAND_ELSE: 'else' {IsEndOfCommandKeyword()}?; +COMMAND_SET : 'set' {IsEndOfCommandKeyword()}? -> pushMode(ExpressionMode); +COMMAND_ENDIF: 'endif' {IsEndOfCommandKeyword()}?; + +COMMAND_CALL: 'call' {IsEndOfCommandKeyword()}? -> pushMode(ExpressionMode); + +COMMAND_DECLARE: 'declare' {IsEndOfCommandKeyword()}? -> pushMode(ExpressionMode); + +COMMAND_JUMP: 'jump' {IsEndOfCommandKeyword()}? -> pushMode(CommandIDOrExpressionMode); + +COMMAND_DETOUR: 'detour' {IsEndOfCommandKeyword()}? -> pushMode(CommandIDOrExpressionMode); + +COMMAND_RETURN: 'return' {IsEndOfCommandKeyword()}? ; // next expected token after 'return' is '>>' so no whitespace is strictly needed + +COMMAND_ENUM: 'enum' {IsEndOfCommandKeyword()}? -> pushMode(CommandIDMode); + +COMMAND_CASE: 'case' {IsEndOfCommandKeyword()}? -> pushMode(ExpressionMode); + +COMMAND_ENDENUM: 'endenum' {IsEndOfCommandKeyword()}?; + +COMMAND_ONCE: 'once' {IsEndOfCommandKeyword()}?; +COMMAND_ENDONCE: 'endonce' {IsEndOfCommandKeyword()}?; + +// Keywords reserved for future language versions +COMMAND_LOCAL: 'local' {IsEndOfCommandKeyword()}?; + +// End of a command. +COMMAND_END: '>>' -> popMode; + +// If we see an expression start immediately after the command start, +// this represents an expression at the start of an arbitrary command +// (it's not good, but it's legal!). +// Switch to CommandTextMode, and also jump into ExpressionMode to +// lex the rest of the expression. When we're done, the closing brace } +// will return us to CommandTextMode for the remainder of the command. +COMMAND_EXPRESSION_AT_START: '{' -> type(COMMAND_EXPRESSION_START), mode(CommandTextMode), pushMode(ExpressionMode); + +// If we see anything that we don't expect, assume that this +// is a command with arbitrary text inside it. Replace this +// lexer state with CommandTextMode so that when it finishes +// up, it returns to BodyMode +COMMAND_ARBITRARY: . -> type(COMMAND_TEXT), mode(CommandTextMode); + +// Arbitrary commands, which may contain expressions, and end with a '>>'. +mode CommandTextMode; +COMMAND_TEXT_NEWLINE: NEWLINE; +COMMAND_TEXT_END: '>>' -> type(COMMAND_END), popMode; +COMMAND_EXPRESSION_START: '{' -> pushMode(ExpressionMode); +COMMAND_TEXT: ~[>{\r\n]+; + +// A mode in which we expect to parse a node ID. +mode CommandIDMode; +COMMAND_ID_WS: WS -> channel(HIDDEN); +COMMAND_ID_NEWLINE: NEWLINE; +COMMAND_ID: ID -> type(ID), popMode; +COMMAND_ID_END: '>>' -> type(COMMAND_END), popMode; // almost certainly a parse error, but not a lex error + +// A mode in which we expect to parse a node ID, or an expression. +mode CommandIDOrExpressionMode; + +COMMAND_ID_OR_EXPRESSION_WS: WS -> channel(HIDDEN); + +// We saw an ID; leave this mode immediately +COMMAND_ID_OR_EXPRESSION_ID: ID -> type(ID), popMode; + +// The start of an expression. Switch to expression mode; it will pop back to +// our previous mode. +COMMAND_ID_OR_EXPRESSION_START: EXPRESSION_START -> type(EXPRESSION_START), mode(ExpressionMode) ; + +// The end of the command. Leave this mode. +COMMAND_ID_OR_EXPRESSION_END: '>>' -> type(COMMAND_END), popMode; \ No newline at end of file diff --git a/third-party/YarnSpinnerParser.g4 b/third-party/YarnSpinnerParser.g4 new file mode 100644 index 000000000..cdd551d67 --- /dev/null +++ b/third-party/YarnSpinnerParser.g4 @@ -0,0 +1,212 @@ +parser grammar YarnSpinnerParser; + +options { tokenVocab=YarnSpinnerLexer; } + +dialogue + : (file_hashtag*) node+ + ; + +// File-global hashtags, which precede all nodes +file_hashtag + : HASHTAG text=HASHTAG_TEXT + ; + +node + : (header|when_header|title_header)+ BODY_START body BODY_END + ; + +title_header: + HEADER_TITLE HEADER_DELIMITER title=ID NEWLINE + ; + +when_header: + HEADER_WHEN HEADER_DELIMITER header_expression=header_when_expression NEWLINE + ; + +header + // : header_key=ID HEADER_DELIMITER (header_value=REST_OF_LINE|header_expression=header_when_expression NEWLINE)? + : header_key=ID HEADER_DELIMITER (header_value=REST_OF_LINE)? + ; + +header_when_expression + : expression + | (always=EXPRESSION_WHEN_ALWAYS) + | once=COMMAND_ONCE (COMMAND_IF expression)? + ; + +body + : statement* + ; + +statement + : line_statement + | if_statement + | set_statement + | shortcut_option_statement + | call_statement + | command_statement + | declare_statement + | enum_statement + | jump_statement + | return_statement + | line_group_statement + | once_statement + | INDENT statement* DEDENT + ; + +line_statement + : + line_formatted_text // text, interspersed with expressions + line_condition? // a line condition + hashtag* // any number of hashtags + NEWLINE + ; + +line_formatted_text + : ( TEXT+ // one or more chunks of text to show to the player + | EXPRESSION_START expression EXPRESSION_END // an expression to evaluate + )+ + ; + +hashtag + : HASHTAG text=HASHTAG_TEXT + ; + +line_condition + : COMMAND_START COMMAND_IF expression COMMAND_END #lineCondition + | COMMAND_START COMMAND_ONCE (COMMAND_IF expression)? COMMAND_END #lineOnceCondition + ; + +expression + : '(' expression ')' #expParens + | op='-' expression #expNegative + | op=OPERATOR_LOGICAL_NOT expression #expNot + | expression op=('*' | '/' | '%') expression #expMultDivMod + | expression op=('+' | '-') expression #expAddSub + | expression op=(OPERATOR_LOGICAL_LESS_THAN_EQUALS | OPERATOR_LOGICAL_GREATER_THAN_EQUALS | OPERATOR_LOGICAL_LESS | OPERATOR_LOGICAL_GREATER ) expression #expComparison + | expression op=(OPERATOR_LOGICAL_EQUALS | OPERATOR_LOGICAL_NOT_EQUALS) expression #expEquality + | expression op=(OPERATOR_LOGICAL_AND | OPERATOR_LOGICAL_OR | OPERATOR_LOGICAL_XOR) expression #expAndOrXor + | value #expValue + ; + +value + : NUMBER #valueNumber + | KEYWORD_TRUE #valueTrue + | KEYWORD_FALSE #valueFalse + | variable #valueVar + | STRING #valueString + | function_call #valueFunc + | typeMemberReference #valueTypeMemberReference + + ; +variable + : VAR_ID + ; + +function_call + : FUNC_ID '(' expression? (COMMA expression)* ')' ; + +typeMemberReference + : (typeName=FUNC_ID)? '.' memberName=FUNC_ID + ; + +if_statement + : if_clause // <> statements... + else_if_clause* // <> statements.. (can have zero or more of these) + else_clause? // <> statements (optional) + COMMAND_START COMMAND_ENDIF COMMAND_END // <> + ; + +if_clause + : COMMAND_START COMMAND_IF expression COMMAND_END statement* + ; + +else_if_clause + : COMMAND_START COMMAND_ELSEIF expression COMMAND_END statement* + ; + +else_clause + : COMMAND_START COMMAND_ELSE COMMAND_END statement* + ; + +set_statement + : COMMAND_START COMMAND_SET variable op=(OPERATOR_ASSIGNMENT | '*=' | '/=' | '%=' | '+=' | '-=') expression COMMAND_END + ; + +call_statement + : COMMAND_START COMMAND_CALL function_call COMMAND_END + ; + +command_statement + : COMMAND_START command_formatted_text COMMAND_END (hashtag*) + ; + +command_formatted_text + : (COMMAND_TEXT|COMMAND_EXPRESSION_START expression EXPRESSION_END)+ + ; + +shortcut_option_statement + : shortcut_option* (shortcut_option BLANK_LINE_FOLLOWING_OPTION?) + ; + +shortcut_option + : '->' line_statement (INDENT statement* DEDENT)? + ; + +line_group_statement + : line_group_item* (line_group_item BLANK_LINE_FOLLOWING_OPTION?) + ; + +line_group_item + : '=>' line_statement (INDENT statement* DEDENT)? + ; + +declare_statement + : COMMAND_START COMMAND_DECLARE variable OPERATOR_ASSIGNMENT expression ('as' type=FUNC_ID)? COMMAND_END + ; + +enum_statement + : COMMAND_START COMMAND_ENUM name=ID COMMAND_END enum_case_statement+ COMMAND_START COMMAND_ENDENUM COMMAND_END + ; + +enum_case_statement + : INDENT? COMMAND_START COMMAND_CASE name=FUNC_ID (OPERATOR_ASSIGNMENT rawValue=value)? COMMAND_END DEDENT? + ; + +jump_statement + : COMMAND_START COMMAND_JUMP destination=ID COMMAND_END #jumpToNodeName + | COMMAND_START COMMAND_JUMP EXPRESSION_START expression EXPRESSION_END COMMAND_END #jumpToExpression + | COMMAND_START COMMAND_DETOUR destination=ID COMMAND_END #detourToNodeName + | COMMAND_START COMMAND_DETOUR EXPRESSION_START expression EXPRESSION_END COMMAND_END #detourToExpression + ; + +return_statement + : COMMAND_START COMMAND_RETURN COMMAND_END + ; + +once_statement + : once_primary_clause + once_alternate_clause? + COMMAND_START COMMAND_ENDONCE COMMAND_END + ; + +once_primary_clause + : COMMAND_START COMMAND_ONCE (COMMAND_IF expression)? COMMAND_END statement* + ; + +once_alternate_clause + : COMMAND_START COMMAND_ELSE COMMAND_END statement* + ; + +structured_command + : command_id=FUNC_ID structured_command_value* + ; + +structured_command_value + : expression + // parse commands as a sequence of IDs, expressions, and (for compatibility) + // braced expressions + + // | '{' expression '}' + | FUNC_ID + ; diff --git a/third-party/YarnSpinnerTestPlan.g4 b/third-party/YarnSpinnerTestPlan.g4 new file mode 100644 index 000000000..60cadc943 --- /dev/null +++ b/third-party/YarnSpinnerTestPlan.g4 @@ -0,0 +1,65 @@ +grammar YarnSpinnerTestPlan; + + +testplan + : run ('---' run)* + | EOF + ; + +run + : step+ + ; + +step + : lineExpected + | optionExpected + | commandExpected + | stopExpected + | actionSelect + | actionSet + | actionJumpToNode + | actionSetSaliencyMode + ; + +hashtag: '#' .+? ; + +lineExpected + : 'line:' TEXT hashtag* #lineWithSpecificTextExpected + | 'line:' '*' hashtag* #lineWithAnyTextExpected + ; + +optionExpected + : 'option:' TEXT hashtag* (isDisabled='[disabled]')? + ; + +commandExpected + : 'command:' TEXT + ; + +stopExpected + : 'stop' + ; + +actionSelect + : 'select:' option=NUMBER + ; + +actionSet + : 'set:' variable=VARIABLE '=' value=BOOL #actionSetBool + | 'set:' variable=VARIABLE '=' value=NUMBER #actionSetNumber + ; + +actionSetSaliencyMode + : 'saliency:' saliencyMode=IDENTIFIER + ; + +actionJumpToNode + : 'node:' nodeName=IDENTIFIER; + +COMMENT: '#' ~[\r\n]* -> skip; +WS: [ \t\r\n]+ -> skip; +BOOL: 'true' | 'false'; +IDENTIFIER: [a-zA-Z_][a-zA-Z0-9_]*; +VARIABLE: '$' IDENTIFIER ; +NUMBER: [0-9]+; +TEXT: '`' .*? '`'; diff --git a/third-party/yarn_spinner.proto b/third-party/yarn_spinner.proto new file mode 100644 index 000000000..b44006e14 --- /dev/null +++ b/third-party/yarn_spinner.proto @@ -0,0 +1,338 @@ +syntax = "proto3"; +package Yarn; + +// A complete Yarn program. +message Program { + + // The name of the program. + string name = 1; + + // The collection of nodes in this program. + map nodes = 2; + + // The collection of initial values for variables; if a PUSH_VARIABLE + // instruction is run, and the value is not found in the storage, this + // value will be used + map initial_values = 3; +} + +// A collection of instructions +message Node { + // The name of this node. + string name = 1; + + // The list of instructions in this node. + repeated Instruction instructions = 7; + + // The headers present on this node. + repeated Header headers = 6; + + // Deprecated and removed fields + reserved 2, 3, 4, 5; +} + +message Header { + // The name of the header. + string key = 1; + + // The value of the header. + string value = 2; +} + +message Instruction { + oneof InstructionType { + // Jumps to a specified position in the current node. + JumpToInstruction jumpTo = 1; + + // Peeks a number on the stack, and jumps to that position in the + // current node. + PeekAndJumpInstruction peekAndJump = 2; + + // Runs a line of dialogue. + RunLineInstruction runLine = 3; + + // Runs a command. + RunCommandInstruction runCommand = 4; + + // Adds an option to the 'pending options' list. + AddOptionInstruction addOption = 5; + + // Shows all options in the 'pending options' list, then clears the list. + ShowOptionsInstruction showOptions = 6; + + // Pushes a string onto the stack. + PushStringInstruction pushString = 7; + + // Pushes a floating point number onto the stack. + PushFloatInstruction pushFloat = 8; + + // Pushes a boolean onto the stack. + PushBoolInstruction pushBool = 9; + + // Peeks a boolean on the stack, and if it's false, jumps to the + // indicated position in the current node. + JumpIfFalseInstruction jumpIfFalse = 10; + + // Pops a value of any kind off the stack. + PopInstruction pop = 11; + + // Calls a named function. + CallFunctionInstruction callFunc = 12; + + // Pushes the value of the named variable onto the stack. + PushVariableInstruction pushVariable = 13; + + // Peeks a value of any kind on the stack, and stores it in the + // indicated variable. + StoreVariableInstruction storeVariable = 14; + + // Halts execution. + StopInstruction stop = 15; + + // Jumps to the start of a named node. + RunNodeInstruction runNode = 16; + + // Peeks a string on the stack, and jumps to the start of that node. + PeekAndRunNodeInstruction peekAndRunNode = 17; + + DetourToNodeInstruction detourToNode = 18; + + PeekAndDetourToNode peekAndDetourToNode = 19; + + ReturnInstruction return = 20; + + // Pops a boolean from the stack, and adds a saliency candidate to the + // current list. + AddSaliencyCandidateInstruction addSaliencyCandidate = 21; + + // Add a saliency candidate to the current list, given a node name. + AddSaliencyCandidateFromNodeInstruction addSaliencyCandidateFromNode = 22; + + // Attempt to select a single saliency candidate from the current list: + // - if one is selected, pushes the destination of that candidate and + // the value 'true' + // - if none is selected, pushes the value 'false' + // + // In all circumstances, clears the saliency candidate list before + // returning. + SelectSaliencyCandidateInstruction selectSaliencyCandidate = 23; + } + message PeekAndJumpInstruction { } + message PeekAndRunNodeInstruction { } + message ShowOptionsInstruction { } + message PushStringInstruction { + // The value to push. + string value = 1; + } + message PushFloatInstruction { + // The value to push. + float value = 1; + } + message PushBoolInstruction { + // The value to push. + bool value = 1; + } + message JumpToInstruction { + // The instruction number in the current node to jump to. + int32 destination = 1; + } + message RunLineInstruction { + // The ID of the localised content that should be shown for this line. + string lineID = 1; + + // The number of substitutions present in this line that must be popped + // off the stack. + int32 substitutionCount = 2; + } + message RunCommandInstruction { + // The text of the command to send to the client. + string commandText = 1; + + // The number of substitutions present in this command that must be popped + // off the stack. + int32 substitutionCount = 2; + } + message AddOptionInstruction { + // The ID of the content that should be shown for this option. + string lineID = 1; + + // The instruction number in the current node to jump to if this option + // is selected. + int32 destination = 2; + + // The number of substitutions present in this option that must be popped + // off the stack. + int32 substitutionCount = 3; + + // A value indicating whether this instruction has a line condition on + // it, whose evaluated value must be popped off the stack. + bool hasCondition = 4; + } + message JumpIfFalseInstruction { + // The instruction number in the current node to jump to. + int32 destination = 1; + } + message PopInstruction { } + message CallFunctionInstruction { + // The name of the function to call. + string functionName = 1; + } + message PushVariableInstruction { + // The name of the variable whose value should be pushed onto the stack. + string variableName = 1; + } + message StoreVariableInstruction { + // The name of the variable whose value should be updated with the value + // currently on top of the stack. + string variableName = 1; + } + message StopInstruction {} + message RunNodeInstruction { + // The name of the node to begin running. + string nodeName = 1; + } + + message DetourToNodeInstruction { + string nodeName = 1; + } + message PeekAndDetourToNode { } + + message ReturnInstruction { } + + message AddSaliencyCandidateInstruction { + // The unique ID for this piece of content, such as a line ID. + string contentID = 1; + + // The complexity score of the candidate. + int32 complexityScore = 2; + + // The instruction number in the current node to jump to if this + // candidate is selected. + int32 destination = 3; + } + + message AddSaliencyCandidateFromNodeInstruction { + // The name of the node to get saliency information from. + string nodeName = 1; + + // The instruction number in the current node to jump to if this + // candidate is selected. + int32 destination = 2; + } + + message SelectSaliencyCandidateInstruction { } + +} + +// A single Yarn instruction. +message InstructionV1 { + + // The operation that this instruction will perform. + OpCode opcode = 1; + + // The list of operands, if any, that this instruction uses. + repeated Operand operands = 2; + + // The type of instruction that this is. + enum OpCode { + + // Jumps to a named position in the node. + // opA = string: label name + JUMP_TO = 0; + + // Peeks a string from stack, and jumps to that named position in + // the node. + // No operands. + JUMP = 1; + + // Delivers a string ID to the client. + // opA = string: string ID + RUN_LINE = 2; + + // Delivers a command to the client. + // opA = string: command text + RUN_COMMAND = 3; + + // Adds an entry to the option list (see ShowOptions). + // - opA = string: string ID for option to add + // - opB = string: destination to go to if this option is selected + // - opC = number: number of expressions on the stack to insert + // into the line + // - opD = bool: whether the option has a condition on it (in which + // case a value should be popped off the stack and used to signal + // the game that the option should be not available) + ADD_OPTION = 4; + + // Presents the current list of options to the client, then clears + // the list. The most recently selected option will be on the top + // of the stack when execution resumes. + // No operands. + SHOW_OPTIONS = 5; + + // Pushes a string onto the stack. + // opA = string: the string to push to the stack. + PUSH_STRING = 6; + + // Pushes a floating point number onto the stack. + // opA = float: number to push to stack + PUSH_FLOAT = 7; + + // Pushes a boolean onto the stack. + // opA = bool: the bool to push to stack + PUSH_BOOL = 8; + + // Pushes a null value onto the stack. + // No operands. + PUSH_NULL = 9; + + // Jumps to the named position in the the node, if the top of the + // stack is not null, zero or false. + // opA = string: label name + JUMP_IF_FALSE = 10; + + // Discards top of stack. + // No operands. + POP = 11; + + // Calls a function in the client. Pops as many arguments as the + // client indicates the function receives, and the result (if any) + // is pushed to the stack. + // opA = string: name of the function + CALL_FUNC = 12; + + // Pushes the contents of a variable onto the stack. + // opA = name of variable + PUSH_VARIABLE = 13; + + // Stores the contents of the top of the stack in the named + // variable. + // opA = name of variable + STORE_VARIABLE = 14; + + // Stops execution of the program. + // No operands. + STOP = 15; + + // Pops a string off the top of the stack, and runs the node with + // that name. + // No operands. + RUN_NODE = 16; + } +} + +// A value used by an Instruction. +message Operand { + + // The type of operand this is. + oneof value { + + // A string. + string string_value = 1; + + // A boolean (true or false). + bool bool_value = 2; + + // A floating point number. + float float_value = 3; + } +} From 320987389922f88cc64aceb19ead660d8fd05bf5 Mon Sep 17 00:00:00 2001 From: Finix Date: Sun, 19 Jul 2026 19:48:48 +0200 Subject: [PATCH 07/15] add NodeBuilder for emitting instructions The NodeBuilder further abstracts the emitter process. It specifically allows setting the destination fields of jump and jump-like instructions, which is required for the Yarnspinner 3 system. --- .../src/listeners/compiler_listener.rs | 18 +- crates/compiler/src/output.rs | 4 +- .../src/output/instruction_address.rs | 109 +++++++++++ crates/compiler/src/output/node_builder.rs | 178 ++++++++++++++++++ 4 files changed, 305 insertions(+), 4 deletions(-) create mode 100644 crates/compiler/src/output/instruction_address.rs create mode 100644 crates/compiler/src/output/node_builder.rs diff --git a/crates/compiler/src/listeners/compiler_listener.rs b/crates/compiler/src/listeners/compiler_listener.rs index f2b8a5aab..888489555 100644 --- a/crates/compiler/src/listeners/compiler_listener.rs +++ b/crates/compiler/src/listeners/compiler_listener.rs @@ -27,13 +27,14 @@ pub(crate) struct CompilerListener<'input> { pub(crate) types: KnownTypes, /// The current node to which instructions are being added. pub(crate) current_node: Option, + /// The node builder which emits a node. + pub(crate) node_builder: Option, /// The current debug information that describes [`current_node`]. current_debug_info: DebugInfo, /// Whether we are currently parsing the /// current node as a 'raw text' node, or as a fully syntactic node. is_current_node_raw_text: bool, file: FileParseResult<'input>, - label_count: usize, } impl<'input> CompilerListener<'input> { @@ -49,11 +50,11 @@ impl<'input> CompilerListener<'input> { tracking_nodes: Rc::new(RefCell::new(tracking_nodes)), skip_nodes: Rc::new(RefCell::new(skip_nodes)), current_node: Default::default(), + node_builder: Default::default(), current_debug_info: Default::default(), is_current_node_raw_text: Default::default(), diagnostics: Default::default(), program: Default::default(), - label_count: Default::default(), debug_infos: Default::default(), } } @@ -76,11 +77,14 @@ impl<'input> YarnSpinnerParserListener<'input> for CompilerListener<'input> { fn enter_node(&mut self, _ctx: &NodeContext<'input>) { // we have found a new node set up the currentNode var ready to hold it and otherwise continue self.current_node = Some(Node::default()); + self.node_builder = Some(NodeBuilder::new("")); self.current_debug_info = Default::default(); self.is_current_node_raw_text = false; } fn exit_node(&mut self, ctx: &NodeContext<'input>) { + let builder = mem::replace(&mut self.node_builder, None).unwrap(); + self.current_node = builder.build().into(); let name = &self.current_node.as_ref().unwrap().name.clone(); if name.is_empty() { // We don't have a name for this node. We can't emit code for it. @@ -113,7 +117,15 @@ impl<'input> YarnSpinnerParserListener<'input> for CompilerListener<'input> { } fn exit_title_header(&mut self, ctx: &Title_headerContext<'input>) { - todo!() + let header_value = ctx + .title + .as_ref() + .unwrap() + .get_text() + .to_owned(); + + let builder = self.node_builder.as_mut().unwrap(); + builder.name.clone_from(&header_value); } fn enter_header(&mut self, _ctx: &HeaderContext<'input>) { diff --git a/crates/compiler/src/output.rs b/crates/compiler/src/output.rs index d4f948fea..86a09f7be 100644 --- a/crates/compiler/src/output.rs +++ b/crates/compiler/src/output.rs @@ -1,7 +1,7 @@ //! Adapted from use crate::listeners::*; -pub use crate::output::{debug_info::*, declaration::*, string_info::*}; +pub use crate::output::{debug_info::*, declaration::*, string_info::*, node_builder::*, instruction_address::*}; use crate::prelude::*; use std::collections::HashMap; use std::error::Error; @@ -11,6 +11,8 @@ use yarnspinner_core::prelude::*; mod debug_info; mod declaration; mod string_info; +mod node_builder; +mod instruction_address; /// The result of a compilation. /// diff --git a/crates/compiler/src/output/instruction_address.rs b/crates/compiler/src/output/instruction_address.rs new file mode 100644 index 000000000..05ae50915 --- /dev/null +++ b/crates/compiler/src/output/instruction_address.rs @@ -0,0 +1,109 @@ +use std::ops::{Add, Sub}; +use yarnspinner_core::prelude::Destination; + +#[derive(Copy, Clone, Eq, Ord, PartialEq, PartialOrd)] +pub(crate) struct InstructionAddress(usize); + +impl InstructionAddress { + pub(crate) const ZERO: InstructionAddress = InstructionAddress(0); + + pub fn default() -> Self { + Self::ZERO + } + + pub fn new(address: usize) -> Self { + Self(address) + } + + pub fn value(&self) -> usize { self.0 } +} + +impl From for usize { + fn from(value: InstructionAddress) -> Self { + value.0 + } +} + +impl TryFrom for i32 { + type Error = >::Error; + + fn try_from(value: InstructionAddress) -> Result { + value.0.try_into() + } +} + +impl Add for InstructionAddress { + type Output = InstructionAddress; + + fn add(self, rhs: isize) -> Self::Output { + if rhs > 0 { + InstructionAddress(self.0 + rhs as usize) + } else { + InstructionAddress(self.0 - rhs as usize) + } + } +} + +impl Sub for InstructionAddress { + type Output = InstructionAddress; + + fn sub(self, rhs: isize) -> Self::Output { + if rhs > 0 { + InstructionAddress(self.0 - rhs as usize) + } else { + InstructionAddress(self.0 + rhs as usize) + } + } +} + +impl Add for InstructionAddress { + type Output = InstructionAddress; + + fn add(self, rhs: usize) -> Self::Output { + InstructionAddress(self.0 + rhs) + } +} + +impl Sub for InstructionAddress { + type Output = InstructionAddress; + + fn sub(self, rhs: usize) -> Self::Output { + InstructionAddress(self.0 - rhs) + } +} + +impl Sub for InstructionAddress { + type Output = isize; + + fn sub(self, rhs: InstructionAddress) -> Self::Output { + let lhs = self.0; + let rhs = rhs.0; + + if lhs > rhs { + (lhs - rhs) as isize + } else { + - ( (rhs - lhs) as isize ) + } + } +} + +pub(crate) fn range(from: InstructionAddress, to: InstructionAddress) -> impl Iterator { + let from = from.0; + let to = to.0; + + (from..to).map(|a| InstructionAddress::new(a)) +} + +trait DestinationAddress: Destination { + fn destination_addr(&self) -> InstructionAddress + { + InstructionAddress::new(self.destination()) + } + + fn set_destination_addr(&mut self, destination: InstructionAddress) + { + self.set_destination(destination.value()); + } +} + +impl DestinationAddress for T {} diff --git a/crates/compiler/src/output/node_builder.rs b/crates/compiler/src/output/node_builder.rs new file mode 100644 index 000000000..e73db340e --- /dev/null +++ b/crates/compiler/src/output/node_builder.rs @@ -0,0 +1,178 @@ +use std::mem; +use yarnspinner_core::prelude::{Destination, Header, Instruction, Node}; +use crate::output::instruction_address::InstructionAddress; +use crate::output::range; + +pub struct NodeBuilder { + pub name: String, + pub headers: Vec
, + instructions: Vec, +} + +#[derive(Clone)] +pub struct InstructionCell { + instruction: Instruction, + address: InstructionAddress +} + +impl InstructionCell { + pub fn address(&self) -> InstructionAddress { + self.address + } + + pub fn get(&self) -> &Instruction { &self.instruction } + + pub fn get_mut(&mut self) -> &mut Instruction { &mut self.instruction } + + pub fn set(&mut self, instruction: impl Into) + { + self.instruction = instruction.into(); + } +} + +impl NodeBuilder { + pub fn new(name: &str) -> Self { + Self { name: name.to_owned(), headers: Vec::new(), instructions: Vec::new() } + } + + fn ensure_reserve(&mut self, increase: usize) { + self.instructions.reserve(increase); + } + + pub fn last_address(&self) -> Option { + Some(self.instructions.last()?.address) + } + + /// Returns the current instruction pointer. + /// This points just past the last emitted instruction. + /// + /// When no instructions have been emitted the instruction pointer points to 0. + pub fn next_address(&self) -> InstructionAddress { + if let Some(InstructionCell { address, .. }) = self.instructions.last().as_mut() { + address.clone() + 1usize + } else { + InstructionAddress::ZERO + } + } + + pub fn append_instruction(&mut self, instruction: impl Into) -> InstructionAddress { + self.append_instruction_mut(instruction).address + } + + pub fn append_instruction_mut(&mut self, instruction: impl Into) -> &mut InstructionCell { + self.ensure_reserve(1); + + self.instructions.push_mut(InstructionCell { + instruction: instruction.into(), + address: self.next_address() + }) + } + + pub fn set_instruction(&mut self, address: InstructionAddress, instruction: impl Into) -> InstructionAddress { + let diff = address + 1usize - self.next_address(); + if diff > 0 { + self.reserve_instructions(diff as usize); + } + + self.get_instruction_mut(address).unwrap().set(instruction); + address + } + + pub fn reserve_instructions(&mut self, count: usize) -> Vec { + if count == 0 { return Vec::new() } + + self.ensure_reserve(count); + + let mut result = Vec::new(); + + let start = self.next_address(); + for address in range(start, start+count) { + self.instructions.push(InstructionCell { + instruction: Instruction::default(), + address + }); + + result.push(address); + } + + result + } + + pub fn reserve_instructions_mut(&mut self, count: usize) -> &mut [InstructionCell] { + if count == 0 { return &mut [] } + self.ensure_reserve(count); + + let addr = self.next_address(); + self.reserve_instructions(count); + &mut self.instructions[addr.value()..] + } + + pub fn get_instruction(&self, address: InstructionAddress) -> Option<&InstructionCell> { + self.instructions.get(address.value()) + } + pub fn get_instruction_mut(&mut self, address: InstructionAddress) -> Option<&mut InstructionCell> { + self.instructions.get_mut(address.value()) + } + + pub fn set(&mut self, mut cell: InstructionCell) -> &mut InstructionCell { + let instruction = mem::replace(&mut cell.instruction, Instruction::default()); + let addr = self.set_instruction(cell.address, instruction); + mem::forget(cell); + self.get_instruction_mut(addr).unwrap() + } + + pub fn take(node: Node) -> Self { + let mut builder = Self { + name: node.name, + headers: node.headers, + instructions: Vec::new() + }; + + for inst in node.instructions { + builder.append_instruction(inst); + } + + builder + } + + pub fn set_destination_at(&mut self, at: InstructionAddress, to: InstructionAddress) -> Result<(), ()> { + let Some(inst) = self.get_instruction_mut(at) else { return Err(()); }; + let Some(inst): Option<&mut dyn Destination> = inst.get_mut().try_into().ok() else { return Err(()); }; + + inst.set_destination(to.value()); + + Ok(()) + } + + pub fn build(self) -> Node { + let mut node = Node::default(); + self.build_in(&mut node); + node + } + + pub fn build_in(mut self, node: &mut Node) { + node.name = mem::replace(&mut self.name, "".to_owned()); + node.headers = mem::replace(&mut self.headers, Vec::new()); + let instructions = mem::replace(&mut self.instructions, Vec::new()); + + for cell in instructions { + node.instructions.push(cell.instruction.clone()); + mem::forget(cell); + } + } +} + +impl Drop for InstructionCell { + fn drop(&mut self) { + panic!("must not drop InstructionCell"); + } +} + +impl Drop for NodeBuilder { + fn drop(&mut self) { + let instructions = mem::replace(&mut self.instructions, Vec::new()); + for cell in instructions { + mem::forget(cell); + } + } +} \ No newline at end of file From 0a3cc6d1b9f23e664dda51e784c8fd25d11973f8 Mon Sep 17 00:00:00 2001 From: Finix Date: Sun, 19 Jul 2026 19:52:57 +0200 Subject: [PATCH 08/15] add emit! macro to improve code generator code --- Cargo.lock | 10 + Cargo.toml | 1 + crates/compiler/Cargo.toml | 1 + .../src/listeners/compiler_listener.rs | 8 +- crates/compiler/src/output/node_builder.rs | 33 +++ crates/compiler_macros/Cargo.toml | 16 ++ crates/compiler_macros/src/lib.rs | 266 ++++++++++++++++++ 7 files changed, 329 insertions(+), 6 deletions(-) create mode 100644 crates/compiler_macros/Cargo.toml create mode 100644 crates/compiler_macros/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index 532d05e8a..078fbae4a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7479,10 +7479,20 @@ dependencies = [ "serde", "serde_json", "walkdir", + "yarnspinner_compiler_macros", "yarnspinner_core", "yarnspinner_internal_shared", ] +[[package]] +name = "yarnspinner_compiler_macros" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + [[package]] name = "yarnspinner_core" version = "0.8.0" diff --git a/Cargo.toml b/Cargo.toml index 932be44fa..9fb22fdf4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,6 +13,7 @@ members = [ "demo", "examples/bevy_yarnspinner", "examples/yarnspinner_without_bevy", + "crates/compiler_macros", ] # Source: https://github.com/bevyengine/bevy/blob/main/examples/README.md#1-tweak-your-cargotoml diff --git a/crates/compiler/Cargo.toml b/crates/compiler/Cargo.toml index 5736e2c53..ca50bbca2 100644 --- a/crates/compiler/Cargo.toml +++ b/crates/compiler/Cargo.toml @@ -20,6 +20,7 @@ better_any = "=0.2.0" regex = "1" yarnspinner_internal_shared = { path = "../internal_shared", version = "0.1.0" } yarnspinner_core = { path = "../core", version = "0.8.0" } +yarnspinner_compiler_macros = { path = "../compiler_macros", version = "0.1.0" } annotate-snippets = "0.12" serde = { version = "1", features = [ "derive" ], optional = true } serde_json = { version = "1", optional = true } diff --git a/crates/compiler/src/listeners/compiler_listener.rs b/crates/compiler/src/listeners/compiler_listener.rs index 888489555..81a6fba08 100644 --- a/crates/compiler/src/listeners/compiler_listener.rs +++ b/crates/compiler/src/listeners/compiler_listener.rs @@ -27,14 +27,13 @@ pub(crate) struct CompilerListener<'input> { pub(crate) types: KnownTypes, /// The current node to which instructions are being added. pub(crate) current_node: Option, - /// The node builder which emits a node. - pub(crate) node_builder: Option, /// The current debug information that describes [`current_node`]. current_debug_info: DebugInfo, /// Whether we are currently parsing the /// current node as a 'raw text' node, or as a fully syntactic node. is_current_node_raw_text: bool, file: FileParseResult<'input>, + label_count: usize, } impl<'input> CompilerListener<'input> { @@ -50,11 +49,11 @@ impl<'input> CompilerListener<'input> { tracking_nodes: Rc::new(RefCell::new(tracking_nodes)), skip_nodes: Rc::new(RefCell::new(skip_nodes)), current_node: Default::default(), - node_builder: Default::default(), current_debug_info: Default::default(), is_current_node_raw_text: Default::default(), diagnostics: Default::default(), program: Default::default(), + label_count: Default::default(), debug_infos: Default::default(), } } @@ -77,14 +76,11 @@ impl<'input> YarnSpinnerParserListener<'input> for CompilerListener<'input> { fn enter_node(&mut self, _ctx: &NodeContext<'input>) { // we have found a new node set up the currentNode var ready to hold it and otherwise continue self.current_node = Some(Node::default()); - self.node_builder = Some(NodeBuilder::new("")); self.current_debug_info = Default::default(); self.is_current_node_raw_text = false; } fn exit_node(&mut self, ctx: &NodeContext<'input>) { - let builder = mem::replace(&mut self.node_builder, None).unwrap(); - self.current_node = builder.build().into(); let name = &self.current_node.as_ref().unwrap().name.clone(); if name.is_empty() { // We don't have a name for this node. We can't emit code for it. diff --git a/crates/compiler/src/output/node_builder.rs b/crates/compiler/src/output/node_builder.rs index e73db340e..18044fad0 100644 --- a/crates/compiler/src/output/node_builder.rs +++ b/crates/compiler/src/output/node_builder.rs @@ -68,6 +68,29 @@ impl NodeBuilder { }) } + pub fn append_instruction_static(&mut self, instructions: [impl Into; Count]) -> [InstructionAddress; Count] { + self.ensure_reserve(Count); + + let mut result = [InstructionAddress::default(); Count]; + + for (i, instruction) in instructions.into_iter().enumerate() { + let addr = self.append_instruction(instruction.into()); + result[i] = addr; + } + + result + } + + pub fn append_instruction_static_mut(&mut self, instructions: [impl Into; Count]) -> &mut [InstructionCell; Count] { + self.ensure_reserve(Count); + + for instruction in instructions.into_iter() { + self.append_instruction(instruction.into()); + } + + self.instructions.last_chunk_mut().unwrap() + } + pub fn set_instruction(&mut self, address: InstructionAddress, instruction: impl Into) -> InstructionAddress { let diff = address + 1usize - self.next_address(); if diff > 0 { @@ -98,6 +121,16 @@ impl NodeBuilder { result } + pub fn reserve_instructions_static(&mut self) -> [InstructionAddress; Count] { + let result =self.reserve_instructions_static_mut(); + result.each_ref().map(|cell| cell.address) + } + + pub fn reserve_instructions_static_mut(&mut self) -> &mut [InstructionCell; Count] { + self.reserve_instructions(Count); + self.instructions.last_chunk_mut().unwrap() + } + pub fn reserve_instructions_mut(&mut self, count: usize) -> &mut [InstructionCell] { if count == 0 { return &mut [] } self.ensure_reserve(count); diff --git a/crates/compiler_macros/Cargo.toml b/crates/compiler_macros/Cargo.toml new file mode 100644 index 000000000..3372d7d7d --- /dev/null +++ b/crates/compiler_macros/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "yarnspinner_compiler_macros" +version = "0.1.0" +edition = "2024" + +[lib] +proc-macro = true + +[profile.dev.build-override] +debug = "line-tables-only" + +[dependencies] +syn = "2.0.119" +quote = "1.0.45" +proc-macro2 = { version = "1.0.106", features = ["span-locations"] } + diff --git a/crates/compiler_macros/src/lib.rs b/crates/compiler_macros/src/lib.rs new file mode 100644 index 000000000..66ca1d2bf --- /dev/null +++ b/crates/compiler_macros/src/lib.rs @@ -0,0 +1,266 @@ + +use proc_macro::TokenStream as OrigTokenStream; +use proc_macro2::{Literal, TokenStream}; +use quote::{quote, ToTokens}; +use syn::{parse::{Parse, ParseStream}, punctuated::Punctuated, Ident, Token, Expr, parse, Error, braced, Path, FieldValue, parse2, parse_macro_input, ExprParen, TypePath, Type}; +use syn::parse::discouraged::Speculative; +use syn::spanned::Spanned; +use syn::token::{Brace}; + +trait ErrorWithBacktrace { + fn with_backtrace(self) -> syn::Result; +} + +impl ErrorWithBacktrace for syn::Result { + fn with_backtrace(self) -> syn::Result { + match self { + Ok(val) => Ok(val), + Err(e) => Err(e) // Err(Error::new(e.span(), format!("Target Type: {}\nbacktrace:\n{}", std::any::type_name::(), Backtrace::capture()))) + } + } +} + +fn forked_parse(input: &ParseStream) -> Option { + let ahead = input.fork(); + let result = ahead.parse::().ok(); + + if result.is_some() { + input.advance_to(&ahead); + } + + result +} + +mod kw { + use syn::custom_keyword; + + custom_keyword!(push); + custom_keyword!(into); +} + +struct Assignment { + has_into: Option, + has_clone: Option, + has_mut: Option, + ident: Ident, + _assign: Token![=], + has_addr: Option, + has_unwrap: Option +} + +impl Parse for Assignment { + fn parse(input: ParseStream) -> syn::Result { + let assignment = Self { + has_into: input.parse().with_backtrace()?, + has_clone: input.parse().with_backtrace()?, + has_mut: input.parse().with_backtrace()?, + ident: input.parse().with_backtrace()?, + _assign: input.parse().with_backtrace()?, + has_addr: input.parse().with_backtrace()?, + has_unwrap: input.parse().with_backtrace()?, + }; + + if assignment.has_addr.is_some() && assignment.has_unwrap.is_some() { + Err(Error::new(input.span(), "invalid syntax: may not combine addr and unwrap syntax.")) + } else { + Ok(assignment) + } + } +} + +impl ToTokens for Assignment { + fn to_tokens(&self, tokens: &mut TokenStream) { + let Self { has_mut, ident, .. } = self; + let expanded = quote! { + #has_mut + #ident + }; + + tokens.extend(expanded); + } +} + +enum AssignmentType { + None, + Assign(Assignment), + Let(Token![let], Assignment), + Push(kw::push, Assignment), +} + +impl Parse for AssignmentType { + fn parse(input: ParseStream) -> syn::Result { + if let Some(t) = input.parse().ok() { + Ok(AssignmentType::Let(t, input.parse()?)) + } else if let Some(t) = input.parse().ok() { + Ok(AssignmentType::Push(t, input.parse()?)) + } else { + let ahead = input.fork(); + if let Some(assign) = ahead.parse().ok() { + input.advance_to(&ahead); + Ok(AssignmentType::Assign(assign)) + } else { + Ok(AssignmentType::None) + } + } + } +} + +impl ToTokens for AssignmentType { + fn to_tokens(&self, tokens: &mut TokenStream) { + let emitted = match self { + AssignmentType::None => quote! {}, + AssignmentType::Assign(a) => quote! {#a}, + AssignmentType::Let(_, a) => quote! {let #a}, + AssignmentType::Push(_, a) => quote! {#a}, + }; + tokens.extend(emitted); + } +} + +struct StructConstructBody { + _brace_token: Brace, + fields: Punctuated, + dot2_token: Option, + rest: Option, +} + +impl Parse for StructConstructBody { + fn parse(input: ParseStream) -> syn::Result { + let content; + Ok(Self { + _brace_token: braced!(content in input), + fields: content.parse_terminated(FieldValue::parse, Token![,]).with_backtrace()?, + dot2_token: content.parse().with_backtrace()?, + rest: if content.is_empty() { + None + } else { + Some(content.parse().with_backtrace()?) + } + }) + } +} + +impl ToTokens for StructConstructBody { + fn to_tokens(&self, tokens: &mut TokenStream) { + let Self { fields, dot2_token, rest, .. } = self; + let expanded = quote! { #fields #dot2_token #rest }; + + expanded.to_tokens(tokens); + } +} + +struct Instruction { + assignment: AssignmentType, + instruction: Ident, + body: Option +} + +impl Parse for Instruction { + fn parse(input: ParseStream) -> syn::Result { + Ok(Self { + assignment: input.parse().with_backtrace()?, + instruction: input.parse().with_backtrace()?, + body: forked_parse(&input) + }) + } +} + +struct EmittingInfo { + emitter: Expr, + _semi: Token![;], + instructions: Punctuated +} + +impl Parse for EmittingInfo { + fn parse(input: ParseStream) -> syn::Result { + Ok(Self { + emitter: input.parse().with_backtrace()?, + _semi: input.parse().with_backtrace()?, + instructions: input.parse_terminated(Instruction::parse, Token![,]).with_backtrace()? + }) + } +} + +impl ToTokens for EmittingInfo { + fn to_tokens(&self, tokens: &mut TokenStream) { + let emitter = &self.emitter; + let assignments: Vec<&AssignmentType> = self.instructions.iter().by_ref() + .map(|i| &i.assignment) + .collect(); + + let line = tokens.span().start(); + let temporaries: Vec = (0..assignments.len()) + .map(|i| Ident::new(format!("_L{}_temp_{}", line.line, i).as_str(), tokens.span())) + .collect(); + + let assignment_stmts: Vec = (0..assignments.len()).map(|i| { + let temp = &temporaries[i]; + let inst = &self.instructions[i].instruction; + match assignments[i] { + AssignmentType::None => quote! { drop(#temp); }, + AssignmentType::Assign(a) | + AssignmentType::Let(_, a) | + AssignmentType::Push(_, a) => { + let (value, drop) = + if a.has_clone.is_some() { + if a.has_into.is_some() { + (quote! { #temp.clone() }, quote! { drop(#temp); }) + } else { + (quote! { #temp.clone() }, quote! { drop(#temp); }) + } + } else if a.has_addr.is_some() { + (quote! { #temp.address() }, quote! { drop(#temp); }) + } else if a.has_unwrap.is_some() { + let unwrap_ex = quote! { <&mut Instruction as TryInto<&mut #inst>>::try_into(#temp.get_mut()).unwrap() }; + (unwrap_ex, quote! { }) + } else { + (quote! { #temp }, quote! { }) + }; + + let value = if a.has_into.is_some() { + quote! { #value.into() } + } else { + value + }; + + match assignments[i] { + AssignmentType::Let(..) => quote! { let #a = #value; #drop }, + AssignmentType::Push(..) => quote! { #a.push(#value); #drop }, + _ => quote! { #a = #value; #drop }, + } + } + } + }).collect(); + + let instructions: Vec = self.instructions.iter().map(|inst| { + let instruction = &inst.instruction; + if let Some(body) = &inst.body { + quote! { Instruction::from(#instruction { #body }) } + } else { + quote! { Instruction::from(#instruction::default()) } + } + }).collect(); + + let count = instructions.len(); + + let expanded = quote! { + let [ + #(#temporaries),* + ] = #emitter.append_instruction_static_mut([ + #(#instructions),* + ]); + + #(#assignment_stmts)*; + #count as usize + }; + + expanded.to_tokens(tokens); + } +} + +#[proc_macro] +pub fn emit(input: OrigTokenStream) -> OrigTokenStream { + // let input = input.into(); + let info = parse_macro_input!(input as EmittingInfo); + info.to_token_stream().into() +} From 9e80b878e139ede30f47a3ea9de9b49b408d9ce2 Mon Sep 17 00:00:00 2001 From: Finix Date: Sun, 19 Jul 2026 20:17:06 +0200 Subject: [PATCH 09/15] make CodeGenerationVisitor use NodeBuilder and emit! # Conflicts: # crates/compiler/src/listeners/compiler_listener.rs --- .../src/listeners/compiler_listener.rs | 37 +- .../src/visitors/code_generation_visitor.rs | 546 +++++++++++------- crates/core/src/lib.rs | 1 + 3 files changed, 361 insertions(+), 223 deletions(-) diff --git a/crates/compiler/src/listeners/compiler_listener.rs b/crates/compiler/src/listeners/compiler_listener.rs index 81a6fba08..48954b6d2 100644 --- a/crates/compiler/src/listeners/compiler_listener.rs +++ b/crates/compiler/src/listeners/compiler_listener.rs @@ -3,17 +3,19 @@ use crate::prelude::*; use antlr4rust::parser_rule_context::ParserRuleContext; use antlr4rust::token::Token; -use antlr4rust::tree::{ParseTreeListener, ParseTreeVisitorCompat}; +use antlr4rust::tree::{ParseTreeListener, ParseTreeVisitorCompat, Tree}; use std::cell::RefCell; use std::collections::HashSet; +use std::mem; +use std::ops::Deref; use std::rc::Rc; -use antlr4rust::CoerceTo; use yarnspinner_core::prelude::*; use crate::parser::generated::yarnspinnerparser::{BodyContext, HeaderContext, LineOnceConditionContext, Line_statementContext, NodeContext, Title_headerContext, YarnSpinnerParserContext, YarnSpinnerParserContextType}; use crate::prelude::generated::yarnspinnerparser::BodyContextAttrs; use crate::prelude::generated::yarnspinnerparserlistener::YarnSpinnerParserListener; use crate::visitors::{CodeGenerationVisitor, KnownTypes}; +use yarnspinner_compiler_macros::emit; pub(crate) struct CompilerListener<'input> { pub(crate) debug_infos: Rc>>, @@ -27,13 +29,14 @@ pub(crate) struct CompilerListener<'input> { pub(crate) types: KnownTypes, /// The current node to which instructions are being added. pub(crate) current_node: Option, + /// The node builder which emits a node. + pub(crate) node_builder: Option, /// The current debug information that describes [`current_node`]. current_debug_info: DebugInfo, /// Whether we are currently parsing the /// current node as a 'raw text' node, or as a fully syntactic node. is_current_node_raw_text: bool, file: FileParseResult<'input>, - label_count: usize, } impl<'input> CompilerListener<'input> { @@ -49,25 +52,14 @@ impl<'input> CompilerListener<'input> { tracking_nodes: Rc::new(RefCell::new(tracking_nodes)), skip_nodes: Rc::new(RefCell::new(skip_nodes)), current_node: Default::default(), + node_builder: Default::default(), current_debug_info: Default::default(), is_current_node_raw_text: Default::default(), diagnostics: Default::default(), program: Default::default(), - label_count: Default::default(), debug_infos: Default::default(), } } - - /// Generates a unique label name to use in the program. - /// - /// ## Params - /// - `commentary` Any additional text to append to the end of the label. - pub(crate) fn register_label<'b>(&mut self, commentary: impl Into>) -> String { - let commentary = commentary.into().unwrap_or_default(); - let label = format!("L{}{}", self.label_count, commentary); - self.label_count += 1; - label - } } impl<'input> ParseTreeListener<'input, YarnSpinnerParserContextType> for CompilerListener<'input> {} @@ -76,11 +68,14 @@ impl<'input> YarnSpinnerParserListener<'input> for CompilerListener<'input> { fn enter_node(&mut self, _ctx: &NodeContext<'input>) { // we have found a new node set up the currentNode var ready to hold it and otherwise continue self.current_node = Some(Node::default()); + self.node_builder = Some(NodeBuilder::new("")); self.current_debug_info = Default::default(); self.is_current_node_raw_text = false; } fn exit_node(&mut self, ctx: &NodeContext<'input>) { + let builder = mem::replace(&mut self.node_builder, None).unwrap(); + self.current_node = builder.build().into(); let name = &self.current_node.as_ref().unwrap().name.clone(); if name.is_empty() { // We don't have a name for this node. We can't emit code for it. @@ -189,13 +184,13 @@ impl<'input> YarnSpinnerParserListener<'input> for CompilerListener<'input> { .then(|| Library::generate_unique_visited_variable_for_node(name)) }; if let Some(track) = track { - CodeGenerationVisitor::generate_tracking_code(self, track); + CodeGenerationVisitor::generate_tracking_code(self.node_builder.as_mut().unwrap(), track); } - // We have exited the body; emit a 'stop' opcode here. - self.emit(Emit::from_op_code(OpCode::Stop).with_source(Position { - line: (ctx.stop().line as usize).saturating_sub(1), - character: 0, - })); + + // We have exited the body; emit a 'return' opcode here. + emit! { + self.node_builder.as_mut().unwrap(); ReturnInstruction + }; } fn exit_lineOnceCondition(&mut self, ctx: &LineOnceConditionContext<'input>) { diff --git a/crates/compiler/src/visitors/code_generation_visitor.rs b/crates/compiler/src/visitors/code_generation_visitor.rs index ad873e238..99d5e0071 100644 --- a/crates/compiler/src/visitors/code_generation_visitor.rs +++ b/crates/compiler/src/visitors/code_generation_visitor.rs @@ -1,6 +1,5 @@ //! Adapted from -use crate::listeners::{CompilerListener, Emit}; use crate::prelude::generated::yarnspinnerlexer; use crate::prelude::generated::yarnspinnerparser::*; use crate::prelude::generated::yarnspinnerparservisitor::YarnSpinnerParserVisitorCompat; @@ -11,8 +10,10 @@ use antlr4rust::tree::{ParseTree, ParseTreeVisitorCompat, Tree}; use std::ops::Deref; use std::rc::Rc; use antlr4rust::parser::ParserNodeType; +use yarnspinner_compiler_macros::emit; use yarnspinner_core::prelude::*; use yarnspinner_core::types::Type; +use crate::listeners::CompilerListener; pub(crate) struct CodeGenerationVisitor<'a, 'input: 'a> { compiler_listener: &'a mut CompilerListener<'input>, @@ -58,20 +59,74 @@ impl<'a, 'input: 'a> CodeGenerationVisitor<'a, 'input> { } // [sic] really ought to make this emit like a list of opcodes actually - pub(crate) fn generate_tracking_code(compiler: &mut CompilerListener, variable_name: String) { + pub(crate) fn generate_tracking_code(compiler: &mut NodeBuilder, variable_name: String) { // pushing the var and the increment onto the stack - compiler.emit(Emit::from_op_code(OpCode::PushVariable).with_operand(variable_name.clone())); - compiler.emit(Emit::from_op_code(OpCode::PushFloat).with_operand(1.)); - // Indicate that we are pushing this many items for comparison - compiler.emit(Emit::from_op_code(OpCode::PushFloat).with_operand(2.)); + emit! { + compiler; + PushVariableInstruction { variable_name: variable_name.clone() }, + PushFloatInstruction { value: 1. }, + // Indicate that we are pushing this many items for comparison + PushFloatInstruction { value: 2. }, + // calling the function + CallFunctionInstruction { function_name: "Number.Add".to_owned() }, + // now store the variable and clean up the stack + StoreVariableInstruction { variable_name }, + PopInstruction + }; + } - // calling the function - compiler.emit(Emit::from_op_code(OpCode::CallFunc).with_operand("Number.Add".to_owned())); + fn emit_function_call(&mut self, fn_name: String, args: usize) -> usize { + emit! { + self.compiler_listener.node_builder.as_mut().unwrap(); + PushFloatInstruction { value: args as f32 }, + CallFunctionInstruction { function_name: fn_name } + } + } - // now store the variable and clean up the stack - compiler.emit(Emit::from_op_code(OpCode::StoreVariable).with_operand(variable_name)); - compiler.emit(Emit::from_op_code(OpCode::Pop)); + fn emit_jump_to_named_node( + &mut self, + name: String, + detour: bool, + ) -> usize { + let compiler = self.compiler_listener.node_builder.as_mut().unwrap(); + if detour { + emit! { + compiler; + DetourToNodeInstruction { + node_name: name + } + }; + } else { + emit! { + compiler; + RunNodeInstruction { + node_name: name + } + }; + } + 1 + } + + fn emit_jump_to_expression( + &mut self, + expr: &ExpressionContextAll<'input>, + detour: bool, + ) { + self.visit(expr); + + let compiler = self.compiler_listener.node_builder.as_mut().unwrap(); + if detour { + emit! { + compiler; + PeekAndDetourToNode + }; + } else { + emit! { + compiler; + PeekAndRunNodeInstruction + }; + } } } @@ -98,18 +153,23 @@ impl<'a, 'input: 'a> YarnSpinnerParserVisitorCompat<'input> for CodeGenerationVi // Evaluate the inline expressions and push the results onto the // stack. - let formatted_text = ctx.line_formatted_text().unwrap(); - let expression_count = - self.generate_code_for_expressions_in_formatted_text(formatted_text.get_children()); let line_id_tag = get_line_id_tag(&ctx.hashtag_all()) .expect_or_bug("Internal error: line should have an implicit or explicit line ID tag, but none was found."); let line_id = line_id_tag.text.as_ref().unwrap().get_text().to_owned(); - self.compiler_listener.emit( - Emit::from_op_code(OpCode::RunLine) - .with_token(ctx.start().deref()) - .with_operand(line_id) - .with_operand(expression_count), - ); + + let formatted_text = ctx.line_formatted_text().unwrap(); + let expression_count = + self.generate_code_for_expressions_in_formatted_text(formatted_text.get_children()); + + let compiler = self.compiler_listener.node_builder.as_mut().unwrap(); + + emit! { + compiler; + RunLineInstruction { + line_id, + substitution_count: expression_count as i32 + } + }; } /// (expression) @@ -210,27 +270,25 @@ impl<'a, 'input: 'a> YarnSpinnerParserVisitorCompat<'input> for CodeGenerationVi fn visit_valueNumber(&mut self, ctx: &ValueNumberContext<'input>) -> Self::Return { let number: f32 = ctx.NUMBER().unwrap().get_text().parse().unwrap(); - self.compiler_listener.emit( - Emit::from_op_code(OpCode::PushFloat) - .with_token(ctx.start().deref()) - .with_operand(number), - ) + + emit! { + self.compiler_listener.node_builder.as_mut().unwrap(); + PushFloatInstruction { value: number } + }; } - fn visit_valueTrue(&mut self, ctx: &ValueTrueContext<'input>) -> Self::Return { - self.compiler_listener.emit( - Emit::from_op_code(OpCode::PushBool) - .with_token(ctx.start().deref()) - .with_operand(true), - ) + fn visit_valueTrue(&mut self, _ctx: &ValueTrueContext<'input>) -> Self::Return { + emit! { + self.compiler_listener.node_builder.as_mut().unwrap(); + PushBoolInstruction { value: true } + }; } - fn visit_valueFalse(&mut self, ctx: &ValueFalseContext<'input>) -> Self::Return { - self.compiler_listener.emit( - Emit::from_op_code(OpCode::PushBool) - .with_token(ctx.start().deref()) - .with_operand(false), - ) + fn visit_valueFalse(&mut self, _ctx: &ValueFalseContext<'input>) -> Self::Return { + emit! { + self.compiler_listener.node_builder.as_mut().unwrap(); + PushBoolInstruction { value: false } + }; } fn visit_valueVar(&mut self, ctx: &ValueVarContext<'input>) -> Self::Return { @@ -245,17 +303,11 @@ impl<'a, 'input: 'a> YarnSpinnerParserVisitorCompat<'input> for CodeGenerationVi .get_text() .trim_matches('"') .to_owned(); - self.compiler_listener.emit( - Emit::from_op_code(OpCode::PushString) - .with_token(ctx.start().deref()) - .with_operand(string_value), - ) - } - /// null value - fn visit_valueNull(&mut self, ctx: &ValueNullContext<'input>) -> Self::Return { - self.compiler_listener - .emit(Emit::from_op_code(OpCode::PushNull).with_token(ctx.start().deref())) + emit! { + self.compiler_listener.node_builder.as_mut().unwrap(); + PushStringInstruction { value: string_value } + }; } /// all we need do is visit the function itself, it will handle everything @@ -265,11 +317,11 @@ impl<'a, 'input: 'a> YarnSpinnerParserVisitorCompat<'input> for CodeGenerationVi fn visit_variable(&mut self, ctx: &VariableContext<'input>) -> Self::Return { let variable_name = ctx.VAR_ID().unwrap().get_text(); - self.compiler_listener.emit( - Emit::from_op_code(OpCode::PushVariable) - .with_token(ctx.start().deref()) - .with_operand(variable_name), - ) + + emit! { + self.compiler_listener.node_builder.as_mut().unwrap(); + PushVariableInstruction { variable_name } + }; } /// handles emitting the correct instructions for the function @@ -280,21 +332,15 @@ impl<'a, 'input: 'a> YarnSpinnerParserVisitorCompat<'input> for CodeGenerationVi self.visit(parameter.as_ref()); } - let token = ctx.start(); - // push the number of parameters onto the stack - self.compiler_listener.emit( - Emit::from_op_code(OpCode::PushFloat) - .with_token(token.deref()) - .with_operand(expressions.len()), - ); - - // then call the function itself let function_name = ctx.FUNC_ID().unwrap().get_text(); - self.compiler_listener.emit( - Emit::from_op_code(OpCode::CallFunc) - .with_token(token.deref()) - .with_operand(function_name), - ); + + emit! { + self.compiler_listener.node_builder.as_mut().unwrap(); + // push the number of parameters onto the stack + PushFloatInstruction { value: expressions.len() as f32 }, + // then call the function itself + CallFunctionInstruction { function_name } + }; } /// if statement ifclause (elseifclause)* (elseclause)? <> @@ -303,12 +349,12 @@ impl<'a, 'input: 'a> YarnSpinnerParserVisitorCompat<'input> for CodeGenerationVi // context.AddErrorNode(null); // label to give us a jump point for when the if finishes - let end_of_if_statement_label = self.compiler_listener.register_label("endif"); + let mut end_of_if_statements = Vec::new(); // handle the if let if_clause = ctx.if_clause().unwrap(); self.generate_code_for_clause( - end_of_if_statement_label.clone(), + &mut end_of_if_statements, if_clause.as_ref(), &if_clause.statement_all(), if_clause.expression().unwrap(), @@ -317,7 +363,7 @@ impl<'a, 'input: 'a> YarnSpinnerParserVisitorCompat<'input> for CodeGenerationVi // all elseifs for else_if_clause in &ctx.else_if_clause_all() { self.generate_code_for_clause( - end_of_if_statement_label.clone(), + &mut end_of_if_statements, else_if_clause.as_ref(), &else_if_clause.statement_all(), else_if_clause.expression().unwrap(), @@ -327,18 +373,18 @@ impl<'a, 'input: 'a> YarnSpinnerParserVisitorCompat<'input> for CodeGenerationVi // the else, if there is one if let Some(else_clause) = ctx.else_clause() { self.generate_code_for_clause( - end_of_if_statement_label.clone(), + &mut end_of_if_statements, else_clause.as_ref(), &else_clause.statement_all(), None, ); } - let current_node = self.compiler_listener.current_node.as_mut().unwrap(); - current_node.labels.insert( - end_of_if_statement_label, - current_node.instructions.len() as i32, - ); + let compiler = self.compiler_listener.node_builder.as_mut().unwrap(); + for mut jump in end_of_if_statements { + jump.set(JumpToInstruction { destination: compiler.next_address().try_into().unwrap() }); + compiler.set(jump); + } } /// A set command: explicitly setting a value to an expression <> @@ -356,11 +402,14 @@ impl<'a, 'input: 'a> YarnSpinnerParserVisitorCompat<'input> for CodeGenerationVi .get(expression.as_ref()) .unwrap() .clone(); + + self.visit(expression.clone().as_ref()); + self.generate_code_for_operation( op, operator_token.as_ref(), &r#type, - &[variable.clone(), expression.clone()], + &vec![variable.clone(), expression.clone()], ) }; match operator_token.get_token_type() { @@ -391,13 +440,12 @@ impl<'a, 'input: 'a> YarnSpinnerParserVisitorCompat<'input> for CodeGenerationVi // now store the variable and clean up the stack let variable_name = variable.get_text(); let token = variable.start(); - self.compiler_listener.emit( - Emit::from_op_code(OpCode::StoreVariable) - .with_token(token.deref()) - .with_operand(variable_name), - ); - self.compiler_listener - .emit(Emit::from_op_code(OpCode::Pop).with_token(token.deref())); + + emit! { + self.compiler_listener.node_builder.as_mut().unwrap(); + StoreVariableInstruction { variable_name }, + PopInstruction + }; } fn visit_call_statement(&mut self, ctx: &Call_statementContext<'input>) -> Self::Return { @@ -431,22 +479,26 @@ impl<'a, 'input: 'a> YarnSpinnerParserVisitorCompat<'input> for CodeGenerationVi }, ); + let compiler = self.compiler_listener.node_builder.as_mut().unwrap(); + // [sic] TODO: look into replacing this as it seems a bit odd match composed_string.as_str() { "stop" => { // "stop" is a special command that immediately stops // execution - self.compiler_listener.emit( - Emit::from_op_code(OpCode::Stop).with_token(formatted_text.start().deref()), - ); + emit! { + compiler; + StopInstruction + }; } _ => { - self.compiler_listener.emit( - Emit::from_op_code(OpCode::RunCommand) - .with_token(formatted_text.start().deref()) - .with_operand(composed_string) - .with_operand(expression_count), - ); + emit! { + compiler; + RunCommandInstruction { + command_text: composed_string, + substitution_count: expression_count as i32 + } + }; } } } @@ -456,8 +508,7 @@ impl<'a, 'input: 'a> YarnSpinnerParserVisitorCompat<'input> for CodeGenerationVi &mut self, ctx: &Shortcut_option_statementContext<'input>, ) -> Self::Return { - let end_of_group_label = self.compiler_listener.register_label("group_end"); - let mut labels = Vec::new(); + let mut options = Vec::new(); // For each option, create an internal destination label that, if // the user selects the option, control flow jumps to. Then, @@ -476,31 +527,15 @@ impl<'a, 'input: 'a> YarnSpinnerParserVisitorCompat<'input> for CodeGenerationVi .as_ref() .map(|node| node.name.clone()) .unwrap_or_else(|| "node".to_string()); - let option_destination_label = self - .compiler_listener - .register_label(format!("shortcutoption_{name}_{}", option_count + 1).as_str()); - labels.push(option_destination_label.clone()); - - // This line statement may have a condition on it. If it does, - // emit code that evaluates the condition, and add a flag on the - // 'Add Option' instruction that indicates that a condition exists. - let has_line_condition = if let Some(expression) = shortcut - .line_statement() - .and_then(|ctx| ctx.line_condition()) - .and_then(|ctx| ctx.expression()) - { - // Evaluate the condition, and leave it on the stack - self.visit(expression.as_ref()); - true - } else { - false - }; + + let line_statement = shortcut.line_statement().unwrap(); + + let has_line_condition = self.evaluate_line_condition(line_statement.deref()); // We can now prepare and add the option. // Start by figuring out the text that we want to add. This will // involve evaluating any inline expressions. - let line_statement = shortcut.line_statement().unwrap(); let expression_count = self.generate_code_for_expressions_in_formatted_text( line_statement.line_formatted_text().unwrap().get_children(), ); @@ -510,55 +545,63 @@ impl<'a, 'input: 'a> YarnSpinnerParserVisitorCompat<'input> for CodeGenerationVi .expect_or_bug("Internal error: no line ID provided."); let line_id = line_id_tag.text.as_ref().unwrap().get_text().to_owned(); - // And add this option to the list. - self.compiler_listener.emit( - Emit::from_op_code(OpCode::AddOption) - .with_token(line_statement.start().deref()) - .with_operand(line_id) - .with_operand(option_destination_label) - .with_operand(expression_count) - .with_operand(has_line_condition), - ); + emit! { + self.compiler_listener.node_builder.as_mut().unwrap(); + // And add this option to the list. + push options = @AddOptionInstruction { + line_id, + destination: -1, + substitution_count: expression_count as i32, + has_condition: has_line_condition + } + }; } - // All of the options that we intend to show are now ready to go. + let token = ctx.stop(); - self.compiler_listener - .emit(Emit::from_op_code(OpCode::ShowOptions).with_token(token.deref())); - // The top of the stack now contains the name of the label we want - // to jump to. Jump to it now. - self.compiler_listener - .emit(Emit::from_op_code(OpCode::Jump).with_token(token.deref())); + emit! { + self.compiler_listener.node_builder.as_mut().unwrap(); + // All the options that we intend to show are now ready to go. + ShowOptionsInstruction, + // The top of the stack now contains the name of the label we want + // to jump to. Jump to it now. + PeekAndJumpInstruction + }; + + let mut groupEndJumps = Vec::new(); // We'll now emit the labels and code associated with each option. for (option_count, shortcut) in ctx.shortcut_option_all().into_iter().enumerate() { - // Emit the label for this option's code - let current_node = self.compiler_listener.current_node.as_mut().unwrap(); - current_node.labels.insert( - labels[option_count].clone(), - current_node.instructions.len() as i32, - ); + // Emit the label for this option's codex + + let option = options[option_count]; + let compiler = self.compiler_listener.node_builder.as_mut().unwrap(); + let addr = compiler.next_address(); + compiler.set_destination_at(option, addr).unwrap(); // Run through all the children statements of the shortcut option for child in shortcut.statement_all() { self.visit(child.as_ref()); } - // Jump to the end of this shortcut option group. - self.compiler_listener.emit( - Emit::from_op_code(OpCode::JumpTo) - .with_token(shortcut.stop().deref()) - .with_operand(end_of_group_label.clone()), - ); + emit! { + self.compiler_listener.node_builder.as_mut().unwrap(); + push groupEndJumps = @JumpToInstruction { destination: -1 } + }; } + let compiler = self.compiler_listener.node_builder.as_mut().unwrap(); + // We made it to the end! Mark the end of the group, so we can jump to it - let current_node = self.compiler_listener.current_node.as_mut().unwrap(); - current_node - .labels - .insert(end_of_group_label, current_node.instructions.len() as i32); - self.compiler_listener - .emit(Emit::from_op_code(OpCode::Pop).with_token(token.deref())); + for pos in groupEndJumps { + let nr = compiler.next_address(); + compiler.set_destination_at(pos, nr).unwrap(); + } + + emit! { + compiler; + PopInstruction + }; } fn visit_line_group_statement( @@ -579,28 +622,26 @@ impl<'a, 'input: 'a> YarnSpinnerParserVisitorCompat<'input> for CodeGenerationVi /// A <> command, which immediately jumps to another node, given its name. fn visit_jumpToNodeName(&mut self, ctx: &JumpToNodeNameContext<'input>) -> Self::Return { if let Some(tracking_enabled) = self.tracking_enabled.clone() { - Self::generate_tracking_code(self.compiler_listener, tracking_enabled); + Self::generate_tracking_code(self.compiler_listener.node_builder.as_mut().unwrap(), tracking_enabled); } - let destination = ctx.destination.as_ref().unwrap(); - self.compiler_listener.emit( - Emit::from_op_code(OpCode::PushString) - .with_token(destination.deref()) - .with_operand(destination.get_text().to_owned()), + + let destination = ctx.destination.as_ref().unwrap_or_bug(); + self.emit_jump_to_named_node( + destination.get_text().into(), + false, ); - self.compiler_listener - .emit(Emit::from_op_code(OpCode::RunNode).with_token(ctx.start().deref())) } /// A <> command, which immediately jumps to another node, given an /// expression that resolves to a node's name. fn visit_jumpToExpression(&mut self, ctx: &JumpToExpressionContext<'input>) -> Self::Return { if let Some(tracking_enabled) = self.tracking_enabled.clone() { - Self::generate_tracking_code(self.compiler_listener, tracking_enabled); + Self::generate_tracking_code(self.compiler_listener.node_builder.as_mut().unwrap(), tracking_enabled); } - // Evaluate the expression, and jump to the result on the stack. - self.visit(ctx.expression().unwrap().as_ref()); - self.compiler_listener - .emit(Emit::from_op_code(OpCode::RunNode).with_token(ctx.start().deref())) + + let expr = ctx.expression().unwrap_or_bug(); + let expr = expr.as_ref(); + self.emit_jump_to_expression(expr, false) } /// A <> command, which immediately jumps to another node, given its name. @@ -624,6 +665,94 @@ impl<'a, 'input: 'a> YarnSpinnerParserVisitorCompat<'input> for CodeGenerationVi } impl<'a, 'input: 'a> CodeGenerationVisitor<'a, 'input> { + fn evaluate_line_condition(&mut self, ctx: &Line_statementContext<'input>) -> bool { + match ctx.line_condition().as_ref().map(|c| c.deref()) { + Some(Line_conditionContextAll::LineOnceConditionContext(once)) => { + todo!() + } + Some(Line_conditionContextAll::LineConditionContext(normal)) => { + self.visit(normal); + true + }, + _ => false + } + } +} + +impl<'a, 'input: 'a> CodeGenerationVisitor<'a, 'input> { + fn generate_jump(&mut self, to: i32) -> usize { + emit! { + self.compiler_listener.node_builder.as_mut().unwrap(); + JumpToInstruction { destination: to } + } + } + + fn generate_function_call( + &mut self, + fn_name: String, + args: &[Rc>], + ) -> usize { + for arg in args { + self.visit(arg.deref()); + } + + let emitted = self.emit_function_call(fn_name, args.len()); + emitted + 2 + } + + fn generate_static_function_call(&mut self, fn_name: String, args: Vec) -> usize { + let builder = self.compiler_listener.node_builder.as_mut().unwrap(); + let mut emitted = 0; + for arg in &args { + emitted += match arg { + OperandValue::StringValue(v) => { + emit! { + builder; + PushStringInstruction { value: v.to_owned() } + } + } + OperandValue::BoolValue(v) => { + emit! { + builder; + PushBoolInstruction { value: v.to_owned() } + } + } + OperandValue::FloatValue(v) => { + emit! { + builder; + PushFloatInstruction { value: v.to_owned() } + } + } + }; + } + + emitted += self.emit_function_call(fn_name, args.len()); + emitted + } + + fn generate_code_for_random_choice(&mut self, choices: u32) -> usize { + let emitted = self.generate_static_function_call( + "random".to_owned(), + vec![ + OperandValue::FloatValue(1.0), + OperandValue::FloatValue(choices as f32), + ], + ); + + let builder = self.compiler_listener.node_builder.as_mut().unwrap(); + let pos = builder.last_address().unwrap(); + + emitted + { emit! { + builder; + // Add instruction number to choices + PushFloatInstruction { value: pos.value() as f32 + 4.0 }, + PushFloatInstruction { value: 2.0 }, + CallFunctionInstruction { function_name: "Add".to_owned() }, + // Peek and Jump to instruction + PeekAndJumpInstruction + } } + } + fn generate_code_for_expressions_in_formatted_text( &mut self, nodes: impl Iterator>>, @@ -646,29 +775,24 @@ impl<'a, 'input: 'a> CodeGenerationVisitor<'a, 'input> { } /// Emits code that calls a method appropriate for the operator - fn generate_code_for_operation( + fn emit_operation( &mut self, op: Operator, - operator_token: &impl Token, r#type: &Type, - operands: &[Rc>], - ) { - // Generate code for each of the operands, so that their value is - // now on the stack. - for operand in operands { - self.visit(operand.as_ref()); + operands: usize, + ) -> Result<(), Diagnostic> { + let method_name = op.to_string(); + let has_method = r#type.has_method(&method_name); + + if !has_method { + let msg = format!("Codegen failed to get implementation type for {} given input type {}.", + op, + r#type.name()); + return Err(Diagnostic::from_message(msg)); } - // Indicate that we are pushing this many items for comparison - self.compiler_listener.emit( - Emit::from_op_code(OpCode::PushFloat) - .with_token(operator_token) - .with_operand(operands.len()), - ); // Figure out the canonical name for the method that the VM should // invoke in order to perform this work - let method_name = op.to_string(); - let has_method = r#type.has_method(&method_name); assert!( has_method, "Codegen failed to get implementation type for {} given input type {}.", @@ -676,33 +800,46 @@ impl<'a, 'input: 'a> CodeGenerationVisitor<'a, 'input> { r#type.name(), ); let function_name = r#type.get_canonical_name_for_method(&method_name); - // Call that function. - self.compiler_listener.emit( - Emit::from_op_code(OpCode::CallFunc) - .with_token(operator_token) - .with_operand(function_name), - ); + self.emit_function_call(function_name, operands); + Ok(()) + } + + /// Emits code that calls a method appropriate for the operator + fn generate_code_for_operation( + &mut self, + op: Operator, + operator_token: &impl Token, + r#type: &Type, + operands: &Vec>::Node as ParserNodeType<'input>>::Type>>, + ) { + // Generate code for each of the operands, so that their value is + // now on the stack. + for operand in operands { + self.visit(operand.as_ref()); + } + + self.emit_operation(op, r#type, operands.len()).unwrap(); } fn generate_code_for_clause( &mut self, - jump_label: String, + jump_to_end: &mut Vec, ctx: &impl ParserRuleContext<'input>, - children: &[Rc>], + children: &Vec>>, expression: impl Into>>>, ) { let expression = expression.into(); - let end_of_clause_label = self.compiler_listener.register_label("skipclause"); + let mut jump_to_end_of_clause = None; + // handling the expression (if it has one) will only be called on ifs and elseifs if let Some(expression) = expression.clone() { // Code-generate the expression self.visit(expression.as_ref()); - self.compiler_listener.emit( - Emit::from_op_code(OpCode::JumpIfFalse) - .with_token(expression.start().deref()) - .with_operand(end_of_clause_label.clone()), - ); + emit! { + self.compiler_listener.node_builder.as_mut().unwrap(); + into jump_to_end_of_clause = @JumpIfFalseInstruction + }; } // running through all of the children statements @@ -710,19 +847,24 @@ impl<'a, 'input: 'a> CodeGenerationVisitor<'a, 'input> { self.visit(child.as_ref()); } - self.compiler_listener.emit( - Emit::from_op_code(OpCode::JumpTo) - .with_token(ctx.stop().deref()) - .with_operand(jump_label), - ); + let builder = self.compiler_listener.node_builder.as_mut().unwrap(); + + emit! { + builder; + push &jump_to_end = JumpToInstruction { destination: -1 } + }; + + if let Some(clause) = jump_to_end_of_clause { + builder.set_destination_at(clause, builder.next_address()).unwrap(); + } if let Some(expression) = expression { - let current_node = self.compiler_listener.current_node.as_mut().unwrap(); - current_node - .labels - .insert(end_of_clause_label, current_node.instructions.len() as i32); - self.compiler_listener - .emit(Emit::from_op_code(OpCode::Pop).with_token(expression.stop().deref())); + emit! { + builder; + PopInstruction + }; + } else { + assert!(jump_to_end_of_clause.is_none()); } } } diff --git a/crates/core/src/lib.rs b/crates/core/src/lib.rs index d739e51ad..a39bfcd49 100644 --- a/crates/core/src/lib.rs +++ b/crates/core/src/lib.rs @@ -43,6 +43,7 @@ pub mod prelude { generated::{ Header, Instruction, InvalidOpCodeError, Node, Operand, Program, instruction::*, operand::Value as OperandValue, + Destination }, internal_value::*, library::*, From 569f0ff179507fe999973bce2033754ad23c9cb3 Mon Sep 17 00:00:00 2001 From: Finix Date: Sun, 19 Jul 2026 20:20:50 +0200 Subject: [PATCH 10/15] change `get_hashable_interval` in hashable_interval.rs to work around bug --- crates/compiler/src/visitors/hashable_interval.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/compiler/src/visitors/hashable_interval.rs b/crates/compiler/src/visitors/hashable_interval.rs index 4237c06fb..9f06ddef3 100644 --- a/crates/compiler/src/visitors/hashable_interval.rs +++ b/crates/compiler/src/visitors/hashable_interval.rs @@ -98,6 +98,8 @@ impl DerefMut for KnownTypes { pub(crate) trait GetHashableInterval<'input>: ParserRuleContext<'input> { fn get_hashable_interval(&self) -> HashableInterval { + // FIXME: The get_source_interval function only seems to return INVALID values. + // I'm not sure if this is a bug in antlr4rust of an issue with the types in this function. let interval = Interval { a: self.start().get_token_index() as i32, b: self.stop().get_token_index() as i32, From a89d5a08bb10e1c11f686627b7f22eef97066738 Mon Sep 17 00:00:00 2001 From: Finix Date: Sun, 19 Jul 2026 20:31:17 +0200 Subject: [PATCH 11/15] update VM with Yarnspinner 3 logic --- .../src/dialogue_runner/dialogue_option.rs | 4 +- crates/runtime/src/dialogue.rs | 11 +- crates/runtime/src/dialogue_option.rs | 2 +- crates/runtime/src/virtual_machine.rs | 388 +++++++++++------- crates/runtime/src/virtual_machine/state.rs | 3 + third-party/YarnSpinner | 2 +- third-party/yarn_spinner.proto | 3 + 7 files changed, 250 insertions(+), 163 deletions(-) diff --git a/crates/bevy_plugin/src/dialogue_runner/dialogue_option.rs b/crates/bevy_plugin/src/dialogue_runner/dialogue_option.rs index adf9cddd5..131a54ebc 100644 --- a/crates/bevy_plugin/src/dialogue_runner/dialogue_option.rs +++ b/crates/bevy_plugin/src/dialogue_runner/dialogue_option.rs @@ -19,7 +19,7 @@ pub struct DialogueOption { /// The name of the node that will be run if this option is selected. /// /// The value of this property not be valid if this is a shortcut option. - pub destination_node: String, + pub destination: usize, /// Gets a value indicating whether the player should be permitted to select this option. /// @@ -41,7 +41,7 @@ impl DialogueOption { Self { line: LocalizedLine::from_yarn_line(yarn_dialogue_option.line, assets, metadata), id: yarn_dialogue_option.id, - destination_node: yarn_dialogue_option.destination_node, + destination: yarn_dialogue_option.destination.unwrap(), is_available: yarn_dialogue_option.is_available, } } diff --git a/crates/runtime/src/dialogue.rs b/crates/runtime/src/dialogue.rs index 169ebed24..639afa22f 100644 --- a/crates/runtime/src/dialogue.rs +++ b/crates/runtime/src/dialogue.rs @@ -42,6 +42,7 @@ pub enum DialogueError { ContinueOnOptionSelectionError, NoNodeSelectedOnContinue, NoProgramLoaded, + ReturnStackEmpty, InvalidNode { node_name: String, }, @@ -50,6 +51,10 @@ pub enum DialogueError { function_name: String, library: Library, }, + LabelNotFound { + label_name: String, + library: Library, + }, } impl Error for DialogueError { @@ -81,6 +86,8 @@ impl Display for DialogueError { InvalidNode { node_name } => write!(f, "No node named \"{node_name}\" has been loaded."), VariableStorageError(e) => Display::fmt(e, f), FunctionNotFound { function_name, library } => write!(f, "Function \"{function_name}\" not found in library: {library}"), + LabelNotFound { label_name, library } => write!(f, "Label \"{label_name}\" not found in library: {library}"), + ReturnStackEmpty => write!(f, "Tried to return from node, but return stack is empty") } } } @@ -337,7 +344,7 @@ impl Dialogue { /// /// Returns an error if no node with the value of `node_name` has been loaded. pub fn set_node(&mut self, node_name: impl Into) -> Result<&mut Self> { - self.vm.set_node(node_name)?; + self.vm.jump_to_node(node_name)?; Ok(self) } @@ -434,7 +441,7 @@ impl Dialogue { /// If [`Dialogue::continue_`] has never been called, this value will be [`None`]. #[must_use] pub fn current_node(&self) -> Option { - self.vm.current_node() + self.vm.current_node_name() } /// Analyses the currently loaded Yarn program with the given [`Context`]. Call [`Context::finish_analysis`] afterwards to get the results. diff --git a/crates/runtime/src/dialogue_option.rs b/crates/runtime/src/dialogue_option.rs index 1d749c08b..24b966849 100644 --- a/crates/runtime/src/dialogue_option.rs +++ b/crates/runtime/src/dialogue_option.rs @@ -24,7 +24,7 @@ pub struct DialogueOption { /// The name of the node that will be run if this option is selected. /// /// The value of this property not be valid if this is a shortcut option. - pub destination_node: String, + pub destination: Option, /// Gets a value indicating whether the player should be permitted to select this option. /// diff --git a/crates/runtime/src/virtual_machine.rs b/crates/runtime/src/virtual_machine.rs index b35cafb76..a9f09ac4c 100644 --- a/crates/runtime/src/virtual_machine.rs +++ b/crates/runtime/src/virtual_machine.rs @@ -8,6 +8,8 @@ use crate::Result; use crate::markup::{LineParser, ParsedMarkup}; use crate::prelude::*; use core::fmt::Debug; +use std::collections::VecDeque; +use std::error::Error; use log::*; mod execution_state; @@ -19,10 +21,8 @@ pub(crate) struct VirtualMachine { pub(crate) program: Option, pub(crate) variable_storage: Box, pub(crate) line_hints_enabled: bool, - current_node_name: Option, - state: State, + states: VecDeque, execution_state: ExecutionState, - current_node: Option, batched_events: Vec, line_parser: LineParser, text_provider: Box, @@ -30,6 +30,50 @@ pub(crate) struct VirtualMachine { } impl VirtualMachine { + + fn current_state(&self) -> Option<&State> { self.states.back() } + + fn current_state_mut(&mut self) -> Option<&mut State> { self.states.back_mut() } + + fn current_node(&self) -> Option<&Node> { + let node_name = self.current_state()?.node_name.clone(); + self.get_node_from_name(&node_name).ok() + } + + fn pop(&mut self) -> T + where + T: TryFrom, + >::Error: Debug { + self.current_state_mut().unwrap_or_bug().pop() + } + + fn pop_value(&mut self) -> InternalValue { + self.current_state_mut().unwrap_or_bug().pop_value() + } + + fn push(&mut self, value: impl Into) { + self.current_state_mut().unwrap_or_bug().push(value); + } + + fn longjmp>(&mut self, destination: T) where T::Error: Error { + let state= self.current_state_mut().unwrap_or_bug(); + let destination = destination.try_into().unwrap(); + assert_ne!(state.program_counter, destination); + log::debug!("longjmp {:#08x}", destination); + state.program_counter = destination; + } + + fn step(&mut self) { + self.current_state_mut().unwrap_or_bug().program_counter += 1; + } + + pub(crate) fn current_node_name(&self) -> Option { + match self.current_node() { + Some(n) => Some(n.name.clone()), + None => None + } + } + pub(crate) fn new( library: Library, variable_storage: Box, @@ -43,10 +87,8 @@ impl VirtualMachine { text_provider, language_code: Default::default(), program: Default::default(), - current_node_name: Default::default(), - state: Default::default(), + states: Default::default(), execution_state: Default::default(), - current_node: Default::default(), batched_events: Default::default(), line_hints_enabled: Default::default(), } @@ -76,8 +118,21 @@ impl VirtualMachine { } pub(crate) fn reset_state(&mut self) { - self.state = State::default(); - self.current_node_name = None; + self.states.clear(); + } + + fn push_state(&mut self, node_name: &str) -> &mut State { + let mut state = State::default(); + state.node_name = node_name.to_owned(); + self.states.push_back_mut(state) + } + + fn pop_state(&mut self) -> Result { + if let Some(state) = self.states.pop_back() { + Ok(state) + } else { + Err(DialogueError::ReturnStackEmpty) + } } pub(crate) fn set_execution_state(&mut self, execution_state: ExecutionState) -> &mut Self { @@ -96,15 +151,23 @@ impl VirtualMachine { core::mem::take(&mut self.batched_events) } - pub(crate) fn set_node(&mut self, node_name: impl Into) -> Result<()> { + pub(crate) fn jump_to_node(&mut self, node_name: impl Into) -> Result<()> { let node_name = node_name.into(); - debug!("Loading node \"{node_name}\""); - let current_node = self.get_node_from_name(&node_name)?; - self.current_node = Some(current_node.clone()); + if !self.states.is_empty() { + self.leave_node()?; + } self.reset_state(); + self.enter_node(node_name) + } - self.current_node_name = Some(node_name.clone()); + pub(crate) fn enter_node(&mut self, node_name: impl Into) -> Result<()> { + let node_name = node_name.into(); + + debug!("Loading node \"{node_name}\""); + self.get_node_from_name(&node_name)?; // must exist + + self.push_state(&node_name); self.batched_events .push(DialogueEvent::NodeStart(node_name)); @@ -112,6 +175,18 @@ impl VirtualMachine { if self.line_hints_enabled { self.send_line_hints(); } + + Ok(()) + } + + pub(crate) fn leave_node(&mut self) -> Result<()> { + let state = self.pop_state()?; + + let node = self.get_node_from_name(&state.node_name)?; + + self.batched_events + .push(DialogueEvent::NodeComplete(node.name.clone())); + Ok(()) } @@ -122,7 +197,7 @@ impl VirtualMachine { // [sic] TODO: maybe this list could be reused to save on allocations? let string_ids: Vec<_> = self - .current_node + .current_node() .as_ref() .unwrap() .instructions @@ -131,16 +206,13 @@ impl VirtualMachine { // line or add an option; these are the two instructions // that will signal a line can appear to the player .filter_map(|instruction| { - let opcode: OpCode = instruction.opcode.try_into().unwrap(); - [OpCode::RunLine, OpCode::AddOption] - .contains(&opcode) - .then(|| { - // Both RunLine and AddOption have the string ID - // they want to show as their first operand, so - // store that - let id: String = instruction.operands[0].clone().try_into().unwrap(); - LineId(id) - }) + let opcode = instruction.instruction_type.as_ref().unwrap_or_bug(); + + match opcode { + InstructionType::RunLine(line) => Some(line.line_id.clone().into()), + InstructionType::AddOption(opt) => Some(opt.line_id.clone().into()), + _ => None + } }) .collect(); self.text_provider.accept_line_hints(&string_ids); @@ -177,6 +249,12 @@ impl VirtualMachine { }) } + fn current_instruction(&self) -> Option { + let state = self.current_state()?; + let current_node = self.current_node()?; + Some(current_node.instructions[state.program_counter].clone()) + } + /// Resumes execution. pub(crate) fn continue_( &mut self, @@ -186,22 +264,24 @@ impl VirtualMachine { self.set_execution_state(ExecutionState::Running); while self.execution_state == ExecutionState::Running { - let current_node = self.current_node.clone().unwrap(); - let current_instruction = ¤t_node.instructions[self.state.program_counter]; - instruction_fn(self, current_instruction)?; + let current_instruction = self.current_instruction().unwrap_or_bug(); + instruction_fn(self, ¤t_instruction)?; // ## Implementation note // The original increments the program counter here, but that leads to intentional underflow on [`OpCode::RunNode`], // so we do the incrementation in [`VirtualMachine::run_instruction`] instead. - if self.state.program_counter < current_node.instructions.len() { - continue; - } + let Some(state) = self.current_state() else { + break + }; - self.batched_events - .push(DialogueEvent::NodeComplete(current_node.name.clone())); - self.set_execution_state(ExecutionState::Stopped); - self.batched_events.push(DialogueEvent::DialogueComplete); - debug!("Run complete."); + let node = self.get_node_from_name(&state.node_name)?; + + if state.program_counter >= node.instructions.len() { + self.leave_node()?; + self.set_execution_state(ExecutionState::Stopped); + self.batched_events.push(DialogueEvent::DialogueComplete); + debug!("Run complete."); + } } Ok(core::mem::take(&mut self.batched_events)) } @@ -212,7 +292,7 @@ impl VirtualMachine { /// Runs a series of tests to see if the [`VirtualMachine`] is in a state where [`VirtualMachine::r#continue`] can be called. Panics if it can't. pub(crate) fn assert_can_continue(&self) -> crate::Result<()> { - if self.current_node.is_none() || self.current_node_name.is_none() { + if self.current_node().is_none() || self.current_node_name().is_none() { Err(DialogueError::NoNodeSelectedOnContinue) } else if self.execution_state == ExecutionState::WaitingOnOptionSelection { Err(DialogueError::ContinueOnOptionSelectionError) @@ -231,23 +311,24 @@ impl VirtualMachine { if self.execution_state != ExecutionState::WaitingOnOptionSelection { return Err(DialogueError::UnexpectedOptionSelectionError); } - if selected_option_id.0 >= self.state.current_options.len() { + + let state = self.current_state_mut().unwrap_or_bug(); + + if selected_option_id.0 >= state.current_options.len() { return Err(DialogueError::InvalidOptionIdError { selected_option_id, - max_id: self.state.current_options.len().saturating_sub(1), + max_id: state.current_options.len().saturating_sub(1), }); } // We now know what number option was selected; push the // corresponding node name to the stack. - let destination_node = self.state.current_options[selected_option_id.0] - .destination_node - .clone(); - self.state.push(destination_node); + let destination = state.current_options[selected_option_id.0].destination.unwrap_or_bug(); + state.push(destination); // We no longer need the accumulated list of options; clear it // so that it's ready for the next one - self.state.current_options.clear(); + state.current_options.clear(); // We're no longer in the WaitingForOptions state; we are now waiting for our game to let us continue self.set_execution_state(ExecutionState::WaitingForContinue); @@ -261,8 +342,10 @@ impl VirtualMachine { if self.execution_state != ExecutionState::WaitingOnOptionSelection { return Err(DialogueError::UnexpectedOptionSelectionError); } - if let Some(selected_option) = self - .state + + let state = self.current_state_mut().unwrap_or_bug(); + + if let Some(selected_option) = state .current_options .iter() .find(|o| o.line.id == selected_line_id) @@ -271,8 +354,7 @@ impl VirtualMachine { self.set_selected_option(selected_option_id) .map(|_| selected_option_id) } else { - let line_ids = self - .state + let line_ids = state .current_options .iter() .map(|o| o.line.id.clone()) @@ -292,10 +374,6 @@ impl VirtualMachine { self.execution_state == ExecutionState::WaitingOnOptionSelection } - pub(crate) fn current_node(&self) -> Option { - self.current_node_name.clone() - } - /// ## Implementation note /// /// Increments the program counter here instead of in `continue_` for cleaner code @@ -304,32 +382,33 @@ impl VirtualMachine { instruction: &Instruction, mut function_call_fn: impl FnMut(&dyn UntypedYarnFn, Vec) -> YarnValue, ) -> crate::Result<()> { + log::debug!("running(0x{:#08x}): {:?}", self.current_state().unwrap().program_counter, instruction); match instruction.instruction_type.as_ref().unwrap_or_bug() { InstructionType::JumpTo(jumpto) => { - // Jumps to a named label - let label_name: String = instruction.read_operand(0); - self.state.program_counter = self.find_instruction_point_for_label(&label_name); + // Jumps to destination + self.longjmp(jumpto.destination); } InstructionType::PeekAndJump(_) => { + let state = self.current_state().unwrap_or_bug(); // Jumps to a label whose name is on the stack. - let jump_destination: String = self.state.peek(); - self.state.program_counter = - self.find_instruction_point_for_label(&jump_destination); + let jump_destination: InternalValue = state.peek(); + + match jump_destination.r#type { + Type::Number => { + self.longjmp(jump_destination); + } + Type::String => { + panic!("invalid operand on stack: labels no longer supported") + }, + _ => { panic!("invalid operand on stack") } + } } InstructionType::RunLine(run_line) => { // Looks up a string from the string table and passes it to the client as a line - let string_id: String = instruction.read_operand(0); - let string_id: LineId = string_id.into(); + let string_id: LineId = run_line.line_id.clone().into(); - // The second operand, if provided (compilers prior - // to v1.1 don't include it), indicates the number - // of expressions in the line. We need to pop these - // values off the stack and deliver them to the - // line handler. - assert_up_to_date_compiler(instruction.operands.len() >= 2); - - let substitutions = self.pop_substitutions_with_count_at_operand(instruction, 1); + let substitutions = self.pop_substitutions(run_line.substitution_count as usize); let line = self.prepare_line(string_id, &substitutions)?; self.batched_events.push(DialogueEvent::Line(line)); @@ -340,17 +419,16 @@ impl VirtualMachine { // how this violates borrow checking. So, we'll always wait at this point instead until the user // called `continue_` themselves outside of the line handler. self.set_execution_state(ExecutionState::WaitingForContinue); - self.state.program_counter += 1; + + self.step(); } InstructionType::RunCommand(cmd) => { // Passes a string to the client as a custom command - let command_text: String = instruction.read_operand(0); - assert_up_to_date_compiler(instruction.operands.len() >= 2); let command_text = self - .pop_substitutions_with_count_at_operand(instruction, 1) + .pop_substitutions(cmd.substitution_count as usize) .into_iter() .enumerate() - .fold(command_text, |command_text, (i, substitution)| { + .fold(cmd.command_text.clone(), |command_text, (i, substitution)| { command_text.replace(&format!("{{{i}}}"), &substitution) }); let command = Command::parse(command_text); @@ -363,50 +441,53 @@ impl VirtualMachine { // how this violates borrow checking. So, we'll always wait at this point instead until the user // called `continue_` themselves outside of the line handler. self.set_execution_state(ExecutionState::WaitingForContinue); - self.state.program_counter += 1; + + self.step(); } InstructionType::AddOption(opt) => { // Add an option to the current state - let string_id: String = instruction.read_operand(0); - let string_id: LineId = string_id.into(); - assert_up_to_date_compiler(instruction.operands.len() >= 4); - let substitutions = self.pop_substitutions_with_count_at_operand(instruction, 2); + let string_id: LineId = opt.line_id.clone().into(); + let substitutions = self.pop_substitutions(opt.substitution_count as usize); let line = self.prepare_line(string_id, &substitutions)?; + let state = self.current_state_mut().unwrap_or_bug(); + // Indicates whether the VM believes that the // option should be shown to the user, based on any // conditions that were attached to the option. - let line_condition_passed = if instruction.read_operand(3) { + let line_condition_passed = if opt.has_condition { // The fourth operand is a bool that indicates // whether this option had a condition or not. // If it does, then a bool value will exist on // the stack indicating whether the condition // passed or not. We pass that information to // the game. - self.state.pop() + state.pop() } else { true }; - let index = self.state.current_options.len(); - let node_name = instruction.read_operand(1); + let index = state.current_options.len(); + // ## Implementation note: // The original calculates the ID in the `ShowOptions` opcode, // but this way is cleaner because it allows us to store a `DialogueOption` instead of a bunch of values in a big tuple. - self.state.current_options.push(DialogueOption { + state.current_options.push(DialogueOption { line, id: OptionId(index), - destination_node: node_name, + destination: Some(opt.destination as usize), is_available: line_condition_passed, }); - self.state.program_counter += 1; + self.step(); } InstructionType::ShowOptions(_) => { + let state = self.current_state().unwrap_or_bug(); + // If we have no options to show, immediately stop. - if self.state.current_options.is_empty() { + if state.current_options.is_empty() { self.batched_events.push(DialogueEvent::DialogueComplete); self.set_execution_state(ExecutionState::Stopped); - self.state.program_counter += 1; + self.step(); return Ok(()); } @@ -416,62 +497,61 @@ impl VirtualMachine { // Pass the options set to the client, as well as a // delegate for them to call when the user has made // a selection - let current_options = self.state.current_options.clone(); + let state = self.current_state().unwrap_or_bug(); + let current_options = state.current_options.clone(); self.batched_events .push(DialogueEvent::Options(current_options)); // Implementation note: // Not checking the execution state now since we have no line handler to call `continue_` from. - self.state.program_counter += 1; + self.step(); } InstructionType::PushString(push) => { - // Pushes a string value onto the stack. The operand is an index into the string table, so that's looked up first. - let string_table_index: String = instruction.read_operand(0); - self.state.push(string_table_index); - self.state.program_counter += 1; + self.push(push.value.clone()); + self.step(); } InstructionType::PushFloat(push) => { - // Pushes a floating point onto the stack. - let float: f32 = instruction.read_operand(0); - self.state.push(float); - self.state.program_counter += 1; + self.push(push.value); + self.step(); } InstructionType::PushBool(push) => { - // Pushes a boolean value onto the stack. - let boolean: bool = instruction.read_operand(0); - self.state.push(boolean); - self.state.program_counter += 1; + self.push(push.value); + self.step(); } InstructionType::JumpIfFalse(jump) => { + let state = self.current_state().unwrap_or_bug(); + // Jumps to a named label if the value on the top of the stack evaluates to the boolean value 'false'. - let is_top_value_true: bool = self.state.peek(); + let is_top_value_true: bool = state.peek(); if !is_top_value_true { - let label_name: String = instruction.read_operand(0); - let instruction_point = self.find_instruction_point_for_label(&label_name); - self.state.program_counter = instruction_point; + let goto = jump.destination; + + self.longjmp(goto); } else { - self.state.program_counter += 1; + self.step(); } } InstructionType::Pop(_) => { // Pops a value from the stack. - self.state.pop_value(); - self.state.program_counter += 1; + self.pop_value(); + self.step(); } InstructionType::CallFunc(func) => { - let actual_parameter_count: usize = self.state.pop(); + let state = self.current_state_mut().unwrap_or_bug(); + + let actual_parameter_count: usize = state.pop(); // Get the parameters, which were pushed in reverse let parameters = { let mut parameters: Vec<_> = (0..actual_parameter_count) .rev() - .map(|_| self.state.pop_value().raw_value) + .map(|_| state.pop_value().raw_value) .collect(); parameters.reverse(); parameters }; // Call a function, whose parameters are expected to be on the stack. Pushes the function's return value, if it returns one. - let function_name: String = instruction.read_operand(0); + let function_name: String = func.function_name.clone(); let function = self.library .get(&function_name) @@ -502,12 +582,12 @@ impl VirtualMachine { // ## Implementation note: // The original code first checks whether the return type is `void`. This is vestigial from the v1 compiler. // In current Yarn, every function MUST return a valid typed value, so we skip that check. - self.state.push(typed_return_value); - self.state.program_counter += 1; + self.push(typed_return_value); + self.step(); } InstructionType::PushVariable(push) => { // Get the contents of a variable, push that onto the stack. - let variable_name: String = instruction.read_operand(0); + let variable_name: String = push.variable_name.clone(); let loaded_value = self .variable_storage .get(&variable_name) @@ -534,35 +614,55 @@ impl VirtualMachine { Err(e) } })?; - self.state.push(loaded_value); - self.state.program_counter += 1; + + self.push(loaded_value); + self.step(); } InstructionType::StoreVariable(store) => { + let state = self.current_state().unwrap_or_bug(); + // Store the top value on the stack in a variable. - let top_value = self.state.peek_value().clone(); - let variable_name: String = instruction.read_operand(0); + let top_value = state.peek_value().clone(); + let variable_name: String = store.variable_name.clone(); self.variable_storage.set(variable_name, top_value.into())?; - self.state.program_counter += 1; + + self.step(); } InstructionType::Stop(_) => { // Immediately stop execution, and report that fact. - let current_node_name = self.current_node_name.clone().unwrap(); - self.batched_events - .push(DialogueEvent::NodeComplete(current_node_name)); + while !self.states.is_empty() { + self.leave_node()?; + } + self.batched_events.push(DialogueEvent::DialogueComplete); self.set_execution_state(ExecutionState::Stopped); + debug!("Stopped"); + } + InstructionType::Return(_) => { + // Perform no action - self.state.program_counter += 1; + self.leave_node()?; + self.step(); + } + InstructionType::PeekAndRunNode(_) => { + // Run a node + + let node_name: String = self.pop(); + + // jump to a node with that name. + self.batched_events + .push(DialogueEvent::NodeComplete(node_name.clone())); + self.jump_to_node(&node_name)?; } InstructionType::RunNode(run) => { // Run a node - // Pop a string from the stack, and jump to a node - // with that name. - let node_name: String = self.state.pop(); + let node_name: String = run.node_name.clone(); + + // jump to a node with that name. self.batched_events .push(DialogueEvent::NodeComplete(node_name.clone())); - self.set_node(&node_name)?; + self.jump_to_node(&node_name)?; // No need to increment the program counter, since otherwise we'd skip the first instruction } @@ -604,40 +704,14 @@ impl VirtualMachine { Ok(line) } - /// Looks up the instruction number for a named label in the current node. - /// - /// # Panics - /// - /// Panics in the following cases: - /// - The label is not found in the current node - /// - The current node is unset - /// - The found instruction point is negative - fn find_instruction_point_for_label(&self, label_name: &str) -> usize { - self.current_node - .as_ref() - .unwrap() - .labels - .get(label_name) - .copied() - .unwrap_or_else(|| { - panic!( - "Unknown label {label_name} in node {}", - self.current_node_name.as_ref().unwrap() - ) - }) - .try_into() - .unwrap() - } - - fn pop_substitutions_with_count_at_operand( + fn pop_substitutions( &mut self, - instruction: &Instruction, - index: usize, + count: usize, ) -> Vec { - let expression_count: usize = instruction.operands[index].clone().try_into().unwrap(); - let mut values: Vec<_> = (0..expression_count) + let state = self.current_state_mut().unwrap_or_bug(); + let mut values: Vec<_> = (0..count) .rev() - .map(|_| self.state.pop()) + .map(|_| state.pop()) .collect(); values.reverse(); values diff --git a/crates/runtime/src/virtual_machine/state.rs b/crates/runtime/src/virtual_machine/state.rs index b1ed985ef..f4f7a7637 100644 --- a/crates/runtime/src/virtual_machine/state.rs +++ b/crates/runtime/src/virtual_machine/state.rs @@ -15,6 +15,8 @@ pub(crate) struct State { /// The instruction number in the current node. pub(crate) program_counter: usize, + pub(crate) node_name: String, + /// The current list of options that will be delivered /// when the next RunOption instruction is encountered. pub(crate) current_options: Vec, @@ -27,6 +29,7 @@ impl Default for State { fn default() -> Self { State { program_counter: 0, + node_name: String::default(), current_options: vec![], stack: vec![] } diff --git a/third-party/YarnSpinner b/third-party/YarnSpinner index 946db0be7..3a5b7343f 160000 --- a/third-party/YarnSpinner +++ b/third-party/YarnSpinner @@ -1 +1 @@ -Subproject commit 946db0be77b5064b88a280cb71ce457e4f0e159c +Subproject commit 3a5b7343f715e4e9a3705fa4224e7fa510b92f1c diff --git a/third-party/yarn_spinner.proto b/third-party/yarn_spinner.proto index b44006e14..88161e342 100644 --- a/third-party/yarn_spinner.proto +++ b/third-party/yarn_spinner.proto @@ -14,6 +14,9 @@ message Program { // instruction is run, and the value is not found in the storage, this // value will be used map initial_values = 3; + + // The version of the Yarn Spinner language that this program was compiled under. + int32 language_version = 4; } // A collection of instructions From 5b398c7509aad5c43e3b9a57acd8defd07fdefce Mon Sep 17 00:00:00 2001 From: Finix Date: Sun, 19 Jul 2026 20:33:20 +0200 Subject: [PATCH 12/15] implement line conditions in CodeGenerationVisitor --- .../src/visitors/code_generation_visitor.rs | 30 ++++++++++++++----- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/crates/compiler/src/visitors/code_generation_visitor.rs b/crates/compiler/src/visitors/code_generation_visitor.rs index 99d5e0071..3a5b5c347 100644 --- a/crates/compiler/src/visitors/code_generation_visitor.rs +++ b/crates/compiler/src/visitors/code_generation_visitor.rs @@ -143,20 +143,23 @@ impl<'a, 'input: 'a> ParseTreeVisitorCompat<'input> for CodeGenerationVisitor<'a impl<'a, 'input: 'a> YarnSpinnerParserVisitorCompat<'input> for CodeGenerationVisitor<'a, 'input> { /// a regular ol' line of text fn visit_line_statement(&mut self, ctx: &Line_statementContext<'input>) -> Self::Return { - // [sic] TODO: add support for line conditions: - // - // Mae: here's a line <> - // - // is identical to - // - // <> Mae: here's a line <> - // Evaluate the inline expressions and push the results onto the // stack. let line_id_tag = get_line_id_tag(&ctx.hashtag_all()) .expect_or_bug("Internal error: line should have an implicit or explicit line ID tag, but none was found."); let line_id = line_id_tag.text.as_ref().unwrap().get_text().to_owned(); + let mut jump_over = Vec::new(); + + let cond = self.evaluate_line_condition(ctx); + + if cond { + emit! { + self.compiler_listener.node_builder.as_mut().unwrap(); + push jump_over = @JumpIfFalseInstruction + }; + } + let formatted_text = ctx.line_formatted_text().unwrap(); let expression_count = self.generate_code_for_expressions_in_formatted_text(formatted_text.get_children()); @@ -170,6 +173,17 @@ impl<'a, 'input: 'a> YarnSpinnerParserVisitorCompat<'input> for CodeGenerationVi substitution_count: expression_count as i32 } }; + + if ctx.line_condition().is_some() { + emit! { + compiler; + PopInstruction + }; + } + + for jump in jump_over { + compiler.set_destination_at(jump, compiler.next_address()).unwrap(); + } } /// (expression) From 5935149a8007efb7ceca26dc269cb81e21ac7618 Mon Sep 17 00:00:00 2001 From: Finix Date: Sun, 19 Jul 2026 20:34:25 +0200 Subject: [PATCH 13/15] add support for detour command --- .../src/visitors/code_generation_visitor.rs | 27 ++++++++++++++++--- crates/runtime/src/virtual_machine.rs | 18 +++++++++++-- 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/crates/compiler/src/visitors/code_generation_visitor.rs b/crates/compiler/src/visitors/code_generation_visitor.rs index 3a5b5c347..03d12c0c8 100644 --- a/crates/compiler/src/visitors/code_generation_visitor.rs +++ b/crates/compiler/src/visitors/code_generation_visitor.rs @@ -505,6 +505,13 @@ impl<'a, 'input: 'a> YarnSpinnerParserVisitorCompat<'input> for CodeGenerationVi StopInstruction }; } + "return" => { + // "return" is a special command that immediately returns from node + emit! { + compiler; + ReturnInstruction + }; + } _ => { emit! { compiler; @@ -660,7 +667,12 @@ impl<'a, 'input: 'a> YarnSpinnerParserVisitorCompat<'input> for CodeGenerationVi /// A <> command, which immediately jumps to another node, given its name. fn visit_detourToNodeName(&mut self, ctx: &DetourToNodeNameContext<'input>) -> Self::Return { - todo!() + if let Some(tracking_enabled) = self.tracking_enabled.clone() { + Self::generate_tracking_code(self.compiler_listener.node_builder.as_mut().unwrap(), tracking_enabled); + } + + let destination = ctx.destination.as_ref().unwrap(); + self.emit_jump_to_named_node(destination.get_text().to_owned(), true); } /// A <> command, which immediately jumps to another node, given an @@ -669,12 +681,21 @@ impl<'a, 'input: 'a> YarnSpinnerParserVisitorCompat<'input> for CodeGenerationVi &mut self, ctx: &DetourToExpressionContext<'input>, ) -> Self::Return { - todo!() + if let Some(tracking_enabled) = self.tracking_enabled.clone() { + Self::generate_tracking_code(self.compiler_listener.node_builder.as_mut().unwrap(), tracking_enabled); + } + + let expr = ctx.expression().unwrap_or_bug(); + let expr = expr.as_ref(); + self.emit_jump_to_expression(expr, false) } /// A <> command, which immediately returns from a detour or exits a dialogue. fn visit_return_statement(&mut self, ctx: &Return_statementContext<'input>) -> Self::Return { - todo!() + emit! { + self.compiler_listener.node_builder.as_mut().unwrap(); + ReturnInstruction + }; } } diff --git a/crates/runtime/src/virtual_machine.rs b/crates/runtime/src/virtual_machine.rs index a9f09ac4c..1369321a5 100644 --- a/crates/runtime/src/virtual_machine.rs +++ b/crates/runtime/src/virtual_machine.rs @@ -667,10 +667,24 @@ impl VirtualMachine { // No need to increment the program counter, since otherwise we'd skip the first instruction } InstructionType::PeekAndDetourToNode(_) => { - todo!() + // Detour to a node + + let node_name: String = self.pop(); + + // jump to a node with that name. + self.enter_node(node_name)?; + + // No need to increment the program counter, since otherwise we'd skip the first instruction } InstructionType::DetourToNode(detour) => { - todo!() + // Detour to a node + + let node_name: String = detour.node_name.clone(); + + // jump to a node with that name. + self.enter_node(&node_name)?; + + // No need to increment the program counter, since otherwise we'd skip the first instruction } InstructionType::AddSaliencyCandidate(_) => { todo!() From fc16b2d6af2c5214811566e14385e71a5c47d260 Mon Sep 17 00:00:00 2001 From: Finix Date: Sun, 19 Jul 2026 20:36:55 +0200 Subject: [PATCH 14/15] add support for once condition --- crates/compiler/src/compiler/utils.rs | 9 ++- .../src/listeners/compiler_listener.rs | 29 +++++++++- .../src/visitors/code_generation_visitor.rs | 56 +++++++++++++------ 3 files changed, 76 insertions(+), 18 deletions(-) diff --git a/crates/compiler/src/compiler/utils.rs b/crates/compiler/src/compiler/utils.rs index 999c0171e..3743a36af 100644 --- a/crates/compiler/src/compiler/utils.rs +++ b/crates/compiler/src/compiler/utils.rs @@ -32,6 +32,13 @@ pub(crate) fn get_line_id_tag<'a>( .cloned() } +pub(crate) fn get_line_id<'a>(line: &Line_statementContext) -> LineId { + let line_id_tag = get_line_id_tag(&line.hashtag_all()) + .expect_or_bug("Internal error: line should have an implicit or explicit line ID tag, but none was found."); + let line_id = line_id_tag.text.as_ref().unwrap().get_text().to_owned(); + LineId(line_id) +} + pub(crate) fn parse_syntax_tree<'a, 'b: 'a>( file: &'b File, file_chars: &'a [u32], @@ -180,8 +187,8 @@ where { fn ref_to_rc(self) -> Rc> { self.get_children() + .filter_map(|child| child.get_parent()) .next() - .map(|child| child.get_parent().unwrap()) .or_else(|| { let interval = self.get_source_interval(); self.get_parent() diff --git a/crates/compiler/src/listeners/compiler_listener.rs b/crates/compiler/src/listeners/compiler_listener.rs index 48954b6d2..b93930a11 100644 --- a/crates/compiler/src/listeners/compiler_listener.rs +++ b/crates/compiler/src/listeners/compiler_listener.rs @@ -9,6 +9,7 @@ use std::collections::HashSet; use std::mem; use std::ops::Deref; use std::rc::Rc; +use better_any::TidExt; use yarnspinner_core::prelude::*; use crate::parser::generated::yarnspinnerparser::{BodyContext, HeaderContext, LineOnceConditionContext, Line_statementContext, NodeContext, Title_headerContext, YarnSpinnerParserContext, YarnSpinnerParserContextType}; @@ -60,6 +61,10 @@ impl<'input> CompilerListener<'input> { debug_infos: Default::default(), } } + + pub fn get_content_viewed_variable_name(&self, line_id: LineId) -> String { + format!("$Yarn.Internal.Once.{}", line_id) + } } impl<'input> ParseTreeListener<'input, YarnSpinnerParserContextType> for CompilerListener<'input> {} @@ -194,6 +199,28 @@ impl<'input> YarnSpinnerParserListener<'input> for CompilerListener<'input> { } fn exit_lineOnceCondition(&mut self, ctx: &LineOnceConditionContext<'input>) { - todo!() + + let ctx = ctx.ref_to_rc(); + if let Some(line) = find_parent::(ctx) { + let id = get_line_id(line.deref()); + let variable = self.get_content_viewed_variable_name(id); + let mut prog = self.program.borrow_mut(); + prog.initial_values.insert(variable, Operand::from(false)); + } + } +} + +fn find_parent<'input, T: ParserRuleContext<'input> + 'input>(ctx: Rc>) -> Option> { + let mut current = Some(ctx); + + while let Some(c) = current { + + if c.self_id() == T::id() { + return c.downcast_rc().ok(); + } + + current = c.get_parent(); } + + None } diff --git a/crates/compiler/src/visitors/code_generation_visitor.rs b/crates/compiler/src/visitors/code_generation_visitor.rs index 03d12c0c8..385d5eae6 100644 --- a/crates/compiler/src/visitors/code_generation_visitor.rs +++ b/crates/compiler/src/visitors/code_generation_visitor.rs @@ -145,13 +145,11 @@ impl<'a, 'input: 'a> YarnSpinnerParserVisitorCompat<'input> for CodeGenerationVi fn visit_line_statement(&mut self, ctx: &Line_statementContext<'input>) -> Self::Return { // Evaluate the inline expressions and push the results onto the // stack. - let line_id_tag = get_line_id_tag(&ctx.hashtag_all()) - .expect_or_bug("Internal error: line should have an implicit or explicit line ID tag, but none was found."); - let line_id = line_id_tag.text.as_ref().unwrap().get_text().to_owned(); + let line_id = get_line_id(ctx); let mut jump_over = Vec::new(); - let cond = self.evaluate_line_condition(ctx); + let (cond, _) = self.evaluate_line_condition(ctx, line_id.clone()); if cond { emit! { @@ -169,7 +167,7 @@ impl<'a, 'input: 'a> YarnSpinnerParserVisitorCompat<'input> for CodeGenerationVi emit! { compiler; RunLineInstruction { - line_id, + line_id: line_id.to_string(), substitution_count: expression_count as i32 } }; @@ -530,6 +528,7 @@ impl<'a, 'input: 'a> YarnSpinnerParserVisitorCompat<'input> for CodeGenerationVi ctx: &Shortcut_option_statementContext<'input>, ) -> Self::Return { let mut options = Vec::new(); + let mut once_vars = Vec::new(); // For each option, create an internal destination label that, if // the user selects the option, control flow jumps to. Then, @@ -551,7 +550,11 @@ impl<'a, 'input: 'a> YarnSpinnerParserVisitorCompat<'input> for CodeGenerationVi let line_statement = shortcut.line_statement().unwrap(); - let has_line_condition = self.evaluate_line_condition(line_statement.deref()); + // Get the line ID from the hashtags if it has one + let line_id = get_line_id(&line_statement); + + let (has_line_condition, once_name) = self.evaluate_line_condition(line_statement.deref(), line_id.clone().into()); + once_vars.push(once_name); // We can now prepare and add the option. @@ -561,16 +564,11 @@ impl<'a, 'input: 'a> YarnSpinnerParserVisitorCompat<'input> for CodeGenerationVi line_statement.line_formatted_text().unwrap().get_children(), ); - // Get the line ID from the hashtags if it has one - let line_id_tag = get_line_id_tag(&line_statement.hashtag_all()) - .expect_or_bug("Internal error: no line ID provided."); - let line_id = line_id_tag.text.as_ref().unwrap().get_text().to_owned(); - emit! { self.compiler_listener.node_builder.as_mut().unwrap(); // And add this option to the list. push options = @AddOptionInstruction { - line_id, + line_id: line_id.to_string(), destination: -1, substitution_count: expression_count as i32, has_condition: has_line_condition @@ -600,6 +598,15 @@ impl<'a, 'input: 'a> YarnSpinnerParserVisitorCompat<'input> for CodeGenerationVi let addr = compiler.next_address(); compiler.set_destination_at(option, addr).unwrap(); + // If a "once" variable was set, the emit a store instruction setting the variable to true. + if let Some(once_var) = once_vars[option_count].as_ref() { + emit! { + self.compiler_listener.node_builder.as_mut().unwrap(); + PushBoolInstruction { value: true }, + StoreVariableInstruction { variable_name: once_var.clone() } + }; + } + // Run through all the children statements of the shortcut option for child in shortcut.statement_all() { self.visit(child.as_ref()); @@ -700,16 +707,33 @@ impl<'a, 'input: 'a> YarnSpinnerParserVisitorCompat<'input> for CodeGenerationVi } impl<'a, 'input: 'a> CodeGenerationVisitor<'a, 'input> { - fn evaluate_line_condition(&mut self, ctx: &Line_statementContext<'input>) -> bool { + fn evaluate_line_condition(&mut self, ctx: &Line_statementContext<'input>, line_id: LineId) -> (bool, Option) { + let line_visited = self.compiler_listener.get_content_viewed_variable_name(line_id); + match ctx.line_condition().as_ref().map(|c| c.deref()) { Some(Line_conditionContextAll::LineOnceConditionContext(once)) => { - todo!() + // Test to see if the 'once' variable for this content is + // false + + emit! { + self.compiler_listener.node_builder.as_mut().unwrap(); + PushVariableInstruction { variable_name: line_visited.clone() }, + }; + self.emit_operation(Operator::Not, &Type::Boolean, 1).unwrap(); + + // If the condition has an expression, evaluate that too + // and 'and' it with the 'once' test we just evaluated + if let Some(expr) = once.expression() { + self.visit(once); + self.emit_operation(Operator::And, &Type::Boolean, 2).unwrap(); + } + (true, Some(line_visited)) } Some(Line_conditionContextAll::LineConditionContext(normal)) => { self.visit(normal); - true + (true, None) }, - _ => false + _ => (false, None) } } } From aa0e8ed87f2a8f072055042f065e86d3afcd3600 Mon Sep 17 00:00:00 2001 From: Finix Date: Sun, 19 Jul 2026 20:45:22 +0200 Subject: [PATCH 15/15] add yarnspinner 3 features to story.yarn --- demo/assets/dialogue/story.yarn | 51 +++++++++++++++++++++++++++++---- demo/src/main.rs | 10 +++++++ 2 files changed, 55 insertions(+), 6 deletions(-) diff --git a/demo/assets/dialogue/story.yarn b/demo/assets/dialogue/story.yarn index 47103e79e..e0e8a8ada 100644 --- a/demo/assets/dialogue/story.yarn +++ b/demo/assets/dialogue/story.yarn @@ -1,24 +1,39 @@ title: Start position: -157,-193 --- -Bartender: Yeah, they're sitting right over there. #line:11330430 + +<> + +<< if $wallet >> + Bartender: I see you've gotten your wallet. + Bartender: Your friend is sitting right over there. +<< else >> + Bartender: Yeah, they're sitting right over there. #line:11330430 +<< endif >> + +-> Go on... +-> Detour! + <> +-> Hold on, I forgot my wallet... <> + <> <> <> <> <> Ferris: Oh, hi there! #line:1768282 --> Good to see you! #line:11949485 +Ferris: That's a nice wallet << if $wallet >> +-> Good to see you! #line:11949485 <> Ferris: Nice to see you too! #line:241831 -<> -<> +<> +<> Ferris: Thanks for coming, I know you've been busy lately. #line:9767167 -> No problem! #line:3857565 Ferris: So, how is life treating you? #line:1194739 -> Actually, it's been rather tough... #line:117616 <> Ferris: Hmm, I'm sorry to hear. #line:8556292 -<> +<> Ferris: Since we last spoke, you started doing game development, right?. #line:13408442 -> As a hobby, yeah. #line:14604755 Ferris: Natural development from your gaming and programming hobbies, I venture. #line:8835991 @@ -177,7 +192,7 @@ Ferris: What do you mean? #line:9979028 Ferris: Me, your friends, your parents, your teachers, your boss, everyone. #line:13611362 Ferris: And that's okay. It's alright to stumble. So game development isn't quite your calling, that's fine. #line:3249308 Ferris: You're doing the best you can, and no one can ask more of you than that. #line:3306653 - <> + <> Ferris: I'm proud of what you achieved so far and I know you *will* find something that makes you as happy. #line:1237066 -> I... wow. #line:4375824 -> Thanks, Ferris. I really needed to hear that. #line:6927534 @@ -250,3 +265,27 @@ Ferris: Same for me. It was nice to see both of you! #line:11913139 <> <> === + +title: Detouring +--- +Narrator: This is a detour! +Narrator: A tour de detour! +-> Ha! + Narrator: Ha! +-> That sucks... + Narrator: Oh come on... +-> I think I should leave... + Narrator: Wait! + -> Good bye + <> + -> Ok, fine... + <> +Narrator: Anyway... +=== + +title: GetWallet +--- +You step out to get your wallet. +<> +<> +=== diff --git a/demo/src/main.rs b/demo/src/main.rs index b9208e99f..ad691b459 100644 --- a/demo/src/main.rs +++ b/demo/src/main.rs @@ -4,10 +4,12 @@ use self::{setup::*, visual_effects::*, yarnspinner_integration::*}; use bevy::asset::AssetMetaCheck; use bevy::color::palettes::css; +use bevy::log::{Level, LogPlugin}; use bevy::prelude::*; use bevy::scene::SceneInstance; use bevy::window::PresentMode; use bevy_sprite3d::Sprite3dPlugin; +use bevy_yarnspinner::events::DialogueCompleted; use bevy_yarnspinner::prelude::*; use bevy_yarnspinner_example_dialogue_view::prelude::*; @@ -34,6 +36,11 @@ fn main() { .set(AssetPlugin { meta_check: AssetMetaCheck::Never, ..default() + }) + .set(LogPlugin { + level: Level::INFO, + filter: "yarnspinner_runtime=debug,yarnspinner_compiler=debug,yarnspinner_core=debug".to_owned(), + ..default() }), YarnSpinnerPlugin::with_yarn_source(YarnFileSource::file("dialogue/story.yarn")), ExampleYarnSpinnerDialogueViewPlugin::new(), @@ -62,6 +69,9 @@ fn main() { .chain() .after(ExampleYarnSpinnerDialogueViewSystemSet), ) + .add_observer(|_: On, mut app_exit_events: MessageWriter| { + app_exit_events.write(AppExit::Success); + }) .run(); }