<!DOCTYPE html><htmllang="en"><head><metacharset="utf-8"><metaname="viewport"content="width=device-width, initial-scale=1.0"><metaname="generator"content="rustdoc"><metaname="description"content="API documentation for the Rust `ParserDefinition` trait in crate `lalrpop_util`."><title>ParserDefinition in lalrpop_util::state_machine - Rust</title><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><linkrel="stylesheet"href="../../static.files/normalize-76eba96aa4d2e634.css"><linkrel="stylesheet"href="../../static.files/rustdoc-ac92e1bbe349e143.css"><metaname="rustdoc-vars"data-root-path="../../"data-static-root-path="../../static.files/"data-current-crate="lalrpop_util"data-themes=""data-resource-suffix=""data-rustdoc-version="1.76.0 (07dca489a 2024-02-04)"data-channel="1.76.0"data-search-js="search-2b6ce74ff89ae146.js"data-settings-js="settings-4313503d2e1961c2.js"><scriptsrc="../../static.files/storage-f2adc0d6ca4d09fb.js"></script><scriptdefersrc="sidebar-items.js"></script><scriptdefersrc="../../static.files/main-305769736d49e732.js"></script><noscript><linkrel="stylesheet"href="../../static.files/noscript-feafe1bb7466e4bd.css"></noscript><linkrel="alternate icon"type="image/png"href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><linkrel="alternate icon"type="image/png"href="../../static.files/favicon-32x32-422f7d1d52889060.png"><linkrel="icon"type="image/svg+xml"href="../../static.files/favicon-2c020d218678b618.svg"></head><bodyclass="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><navclass="mobile-topbar"><buttonclass="sidebar-menu-toggle">☰</button></nav><navclass="sidebar"><divclass="sidebar-crate"><h2><ahref="../../lalrpop_util/index.html">lalrpop_util</a><spanclass="version">0.20.2</span></h2></div><h2class="location"><ahref="#">ParserDefinition</a></h2><divclass="sidebar-elems"><section><h3><ahref="#required-associated-types">Required Associated Types</a></h3><ulclass="block"><li><ahref="#associatedtype.Action">Action</a></li><li><ahref="#associatedtype.Error">Error</a></li><li><ahref="#associatedtype.Location">Location</a></li><li><ahref="#associatedtype.NonterminalIndex">NonterminalIndex</a></li><li><ahref="#associatedtype.ReduceIndex">ReduceIndex</a></li><li><ahref="#associatedtype.StateIndex">StateIndex</a></li><li><ahref="#associatedtype.Success">Success</a></li><li><ahref="#associatedtype.Symbol">Symbol</a></li><li><ahref="#associatedtype.Token">Token</a></li><li><ahref="#associatedtype.TokenIndex">TokenIndex</a></li></ul><h3><ahref="#required-methods">Required Methods</a></h3><ulclass="block"><li><ahref="#tymethod.action">action</a></li><li><ahref="#tymethod.eof_action">eof_action</a></li><li><ahref="#tymethod.error_action">error_action</a></li><li><ahref="#tymethod.error_recovery_symbol">error_recovery_symbol</a></li><li><ahref="#tymethod.expected_tokens">expected_tokens</a></li><li><ahref="#tymethod.goto">goto</a></li><li><ahref="#tymethod.reduce">reduce</a></li><li><ahref="#tymethod.simulate_reduce">simulate_reduce</a></li><li><ahref="#tymethod.start_location">start_location</a></li><li><ahref="#tymethod.start_state">start_state</a></li><li><ahref="#tymethod.token_to_index">token_to_index</a></li><li><ahref="#tymethod.token_to_symbol">token_to_symbol</a></li><li><ahref="#tymethod.uses_error_recovery">uses_error_recovery<
<main><divclass="width-limiter"><navclass="sub"><formclass="search-form"><span></span><divid="sidebar-button"tabindex="-1"><ahref="../../lalrpop_util/all.html"title="show sidebar"></a></div><inputclass="search-input"name="search"aria-label="Run search in the documentation"autocomplete="off"spellcheck="false"placeholder="Click or press ‘S’ to search, ‘?’ for more options…"type="search"><divid="help-button"tabindex="-1"><ahref="../../help.html"title="help">?</a></div><divid="settings-menu"tabindex="-1"><ahref="../../settings.html"title="settings"><imgwidth="22"height="22"alt="Change settings"src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><sectionid="main-content"class="content"><divclass="main-heading"><h1>Trait <ahref="../index.html">lalrpop_util</a>::<wbr><ahref="index.html">state_machine</a>::<wbr><aclass="trait"href="#">ParserDefinition</a><buttonid="copy-path"title="Copy item path to clipboard"><imgsrc="../../static.files/clipboard-7571035ce49a181d.svg"width="19"height="18"alt="Copy item path"></button></h1><spanclass="out-of-band"><aclass="src"href="../../src/lalrpop_util/state_machine.rs.html#16-153">source</a> · <buttonid="toggle-all-docs"title="collapse all docs">[<span>−</span>]</button></span></div><preclass="rust item-decl"><code>pub trait ParserDefinition: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a> {
type <ahref="#associatedtype.Location"class="associatedtype">Location</a>: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a> + <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/fmt/trait.Debug.html"title="trait core::fmt::Debug">Debug</a>;
type <ahref="#associatedtype.Error"class="associatedtype">Error</a>;
type <ahref="#associatedtype.Token"class="associatedtype">Token</a>: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a> + <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/fmt/trait.Debug.html"title="trait core::fmt::Debug">Debug</a>;
type <ahref="#associatedtype.TokenIndex"class="associatedtype">TokenIndex</a>: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Copy.html"title="trait core::marker::Copy">Copy</a> + <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a> + <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/fmt/trait.Debug.html"title="trait core::fmt::Debug">Debug</a>;
type <ahref="#associatedtype.Symbol"class="associatedtype">Symbol</a>;
type <ahref="#associatedtype.Success"class="associatedtype">Success</a>;
type <ahref="#associatedtype.StateIndex"class="associatedtype">StateIndex</a>: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Copy.html"title="trait core::marker::Copy">Copy</a> + <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a> + <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/fmt/trait.Debug.html"title="trait core::fmt::Debug">Debug</a>;
type <ahref="#associatedtype.Action"class="associatedtype">Action</a>: <aclass="trait"href="trait.ParserAction.html"title="trait lalrpop_util::state_machine::ParserAction">ParserAction</a><Self>;
type <ahref="#associatedtype.ReduceIndex"class="associatedtype">ReduceIndex</a>: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Copy.html"title="trait core::marker::Copy">Copy</a> + <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a> + <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/fmt/trait.Debug.html"title="trait core::fmt::Debug">Debug</a>;
type <ahref="#associatedtype.NonterminalIndex"class="associatedtype">NonterminalIndex</a>: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Copy.html"title="trait core::marker::Copy">Copy</a> + <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a> + <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/fmt/trait.Debug.html"title="trait core::fmt::Debug">Debug</a>;
</details>}</code></pre><h2id="required-associated-types"class="section-header">Required Associated Types<ahref="#required-associated-types"class="anchor">§</a></h2><divclass="methods"><detailsclass="toggle"open><summary><sectionid="associatedtype.Location"class="method"><aclass="src rightside"href="../../src/lalrpop_util/state_machine.rs.html#19">source</a><h4class="code-header">type <ahref="#associatedtype.Location"class="associatedtype">Location</a>: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a> + <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/fmt/trait.Debug.html"title="trait core::fmt::Debug">Debug</a></h4></section></summary><divclass="docblock"><p>Represents a location in the input text. If you are using the
default tokenizer, this will be a <code>usize</code>.</p>
</div></details><detailsclass="toggle"open><summary><sectionid="associatedtype.Error"class="method"><aclass="src rightside"href="../../src/lalrpop_util/state_machine.rs.html#23">source</a><h4class="code-header">type <ahref="#associatedtype.Error"class="associatedtype">Error</a></h4></section></summary><divclass="docblock"><p>Represents a “user error” – this can get produced by
<code>reduce()</code> if the grammar includes <code>=>?</code> actions.</p>
</div></details><detailsclass="toggle"open><summary><sectionid="associatedtype.Token"class="method"><aclass="src rightside"href="../../src/lalrpop_util/state_machine.rs.html#27">source</a><h4class="code-header">type <ahref="#associatedtype.Token"class="associatedtype">Token</a>: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a> + <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/fmt/trait.Debug.html"title="trait core::fmt::Debug">Debug</a></h4></section></summary><divclass="docblock"><p>The type emitted by the user’s tokenizer (excluding the
location information).</p>
</div></details><detailsclass="toggle"open><summary><sectionid="associatedtype.TokenIndex"class="method"><aclass="src rightside"href="../../src/lalrpop_util/state_machine.rs.html#36">source</a><h4class="code-header">type <ahref="#associatedtype.TokenIndex"class="associatedtype">TokenIndex</a>: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Copy.html"title="trait core::marker::Copy">Copy</a> + <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a> + <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/fmt/trait.Debug.html"title="trait core::fmt::Debug">Debug</a></h4></section></summary><divclass="docblock"><p>We assign a unique index to each token in the grammar, which
we call its <em>index</em>. When we pull in a new <code>Token</code> from the
input, we then match against it to determine its index. Note
that the actual <code>Token</code> is retained too, as it may carry
additional information (e.g., an <code>ID</code> terminal often has a
string value associated with it; this is not important to the
parser, but the semantic analyzer will want it).</p>
</div></details><detailsclass="toggle"open><summary><sectionid="associatedtype.Symbol"class="method"><aclass="src rightside"href="../../src/lalrpop_util/state_machine.rs.html#40">source</a><h4class="code-header">type <ahref="#associatedtype.Symbol"class="associatedtype">Symbol</a></h4></section></summary><divclass="docblock"><p>The type representing things on the LALRPOP stack. Represents
the union of terminals and nonterminals.</p>
</div></details><detailsclass="toggle"open><summary><sectionid="associatedtype.Success"class="method"><aclass="src rightside"href="../../src/lalrpop_util/state_machine.rs.html#43">source</a><h4class="code-header">type <ahref="#associatedtype.Success"class="associatedtype">Success</a></h4></section></summary><divclass="docblock"><p>Type produced by reducing the start symbol.</p>
</div></details><detailsclass="toggle"open><summary><sectionid="associatedtype.StateIndex"class="method"><aclass="src rightside"href="../../src/lalrpop_util/state_machine.rs.html#47">source</a><h4class="code-header">type <ahref="#associatedtype.StateIndex"class="associatedtype">StateIndex</a>: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Copy.html"title="trait core::marker::Copy">Copy</a> + <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a> + <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/fmt/trait.Debug.html"title="trait core::fmt::Debug">Debug</a></h4></section></summary><divclass="docblock"><p>Identifies a state. Typically an i8, i16, or i32 (depending on
how many states you have).</p>
</div></details><detailsclass="toggle"open><summary><sectionid="associatedtype.Action"class="method"><aclass="src rightside"href="../../src/lalrpop_util/state_machine.rs.html#50">source</a><h4class="code-header">type <ahref="#associatedtype.Action"class="associatedtype">Action</a>: <aclass="trait"href="trait.ParserAction.html"title="trait lalrpop_util::state_machine::ParserAction">ParserAction</a><Self></h4></section></summary><divclass="docblock"><p>Identifies an action.</p>
</div></details></div><h2id="required-methods"class="section-header">Required Methods<ahref="#required-methods"class="anchor">§</a></h2><divclass="methods"><detailsclass="toggle method-toggle"open><summary><sectionid="tymethod.start_location"class="method"><aclass="src rightside"href="../../src/lalrpop_util/state_machine.rs.html#59">source</a><h4class="code-header">fn <ahref="#tymethod.start_location"class="fn">start_location</a>(&self) -> Self::<aclass="associatedtype"href="trait.ParserDefinition.html#associatedtype.Location"title="type lalrpop_util::state_machine::ParserDefinition::Location">Location</a></h4></section></summary><divclass="docblock"><p>Returns a location representing the “start of the input”.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="tymethod.start_state"class="method"><aclass="src rightside"href="../../src/lalrpop_util/state_machine.rs.html#62">source</a><h4class="code-header">fn <ahref="#tymethod.start_state"class="fn">start_state</a>(&self) -> Self::<aclass="associatedtype"href="trait.ParserDefinition.html#associatedtype.StateIndex"title="type lalrpop_util::state_machine::ParserDefinition::StateIndex">StateIndex</a></h4></section></summary><divclass="docblock"><p>Returns the initial state.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="tymethod.token_to_index"class="method"><aclass="src rightside"href="../../src/lalrpop_util/state_machine.rs.html#74">source</a><h4class="code-header">fn <ahref="#tymethod.token_to_index"class="fn">token_to_index</a>(&self, token: &Self::<aclass="associatedtype"href="trait.ParserDefinition.html#associatedtype.Token"title="type lalrpop_util::state_machine::ParserDefinition::Token">Token</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html"title="enum core::option::Option">Option</a><Self::<aclass="associatedtype"href="trait.ParserDefinition.html#associatedtype.TokenIndex"title="type lalrpop_util::state_machine::ParserDefinition::TokenIndex">TokenIndex</a>></h4></section></summary><divclass="docblock"><p>Converts the user’s tokens into an internal index; this index
is then used to index into actions and the like. When using an
internal tokenizer, these indices are directly produced. When
using an <strong>external</strong> tokenier, however, this function matches
against the patterns given by the user: it is fallible
therefore as these patterns may not be exhaustive. If a token
value is found that doesn’t match any of the patterns the user
supplied, then this function returns <code>None</code>, which is
translated into a parse error by LALRPOP (“unrecognized
) -> Self::<aclass="associatedtype"href="trait.ParserDefinition.html#associatedtype.Action"title="type lalrpop_util::state_machine::ParserDefinition::Action">Action</a></h4></section></summary><divclass="docblock"><p>Given the top-most state and the pending terminal, returns an
action. This can be either SHIFT(state), REDUCE(action), or
ERROR.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="tymethod.error_action"class="method"><aclass="src rightside"href="../../src/lalrpop_util/state_machine.rs.html#85">source</a><h4class="code-header">fn <ahref="#tymethod.error_action"class="fn">error_action</a>(&self, state: Self::<aclass="associatedtype"href="trait.ParserDefinition.html#associatedtype.StateIndex"title="type lalrpop_util::state_machine::ParserDefinition::StateIndex">StateIndex</a>) -> Self::<aclass="associatedtype"href="trait.ParserDefinition.html#associatedtype.Action"title="type lalrpop_util::state_machine::ParserDefinition::Action">Action</a></h4></section></summary><divclass="docblock"><p>Returns the action to take if an error occurs in the given
state. This function is the same as the ordinary <code>action</code>,
except that it applies not to the user’s terminals but to the
“special terminal” <code>!</code>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="tymethod.eof_action"class="method"><aclass="src rightside"href="../../src/lalrpop_util/state_machine.rs.html#90">source</a><h4class="code-header">fn <ahref="#tymethod.eof_action"class="fn">eof_action</a>(&self, state: Self::<aclass="associatedtype"href="trait.ParserDefinition.html#associatedtype.StateIndex"title="type lalrpop_util::state_machine::ParserDefinition::StateIndex">StateIndex</a>) -> Self::<aclass="associatedtype"href="trait.ParserDefinition.html#associatedtype.Action"title="type lalrpop_util::state_machine::ParserDefinition::Action">Action</a></h4></section></summary><divclass="docblock"><p>Action to take if EOF occurs in the given state. This function
is the same as the ordinary <code>action</code>, except that it applies
not to the user’s terminals but to the “special terminal” <code>$</code>.</p>
) -> Self::<aclass="associatedtype"href="trait.ParserDefinition.html#associatedtype.StateIndex"title="type lalrpop_util::state_machine::ParserDefinition::StateIndex">StateIndex</a></h4></section></summary><divclass="docblock"><p>If we reduce to a nonterminal in the given state, what state
do we go to? This is infallible due to the nature of LR(1)
) -> Self::<aclass="associatedtype"href="trait.ParserDefinition.html#associatedtype.Symbol"title="type lalrpop_util::state_machine::ParserDefinition::Symbol">Symbol</a></h4></section></summary><divclass="docblock"><p>“Upcast” a terminal into a symbol so we can push it onto the
parser stack.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="tymethod.expected_tokens"class="method"><aclass="src rightside"href="../../src/lalrpop_util/state_machine.rs.html#103">source</a><h4class="code-header">fn <ahref="#tymethod.expected_tokens"class="fn">expected_tokens</a>(&self, state: Self::<aclass="associatedtype"href="trait.ParserDefinition.html#associatedtype.StateIndex"title="type lalrpop_util::state_machine::ParserDefinition::StateIndex">StateIndex</a>) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/alloc/vec/struct.Vec.html"title="struct alloc::vec::Vec">Vec</a><<aclass="struct"href="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String">String</a>></h4></section></summary><divclass="docblock"><p>Returns the expected tokens in a given state. This is used for
error reporting.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="tymethod.uses_error_recovery"class="method"><aclass="src rightside"href="../../src/lalrpop_util/state_machine.rs.html#114">source</a><h4class="code-header">fn <ahref="#tymethod.uses_error_recovery"class="fn">uses_error_recovery</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass="docblock"><p>True if this grammar supports error recovery.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="tymethod.error_recovery_symbol"class="method"><aclass="src rightside"href="../../src/lalrpop_util/state_machine.rs.html#118">source</a><h4class="code-header">fn <ahref="#tymethod.error_recovery_symbol"class="fn">error_recovery_symbol</a>(&self, recovery: <aclass="type"href="type.ErrorRecovery.html"title="type lalrpop_util::state_machine::ErrorRecovery">ErrorRecovery</a><Self>) -> Self::<aclass="associatedtype"href="trait.ParserDefinition.html#associatedtype.Symbol"title="type lalrpop_util::state_machine::ParserDefinition::Symbol">Symbol</a></h4></section></summary><divclass="docblock"><p>Given error information, creates an error recovery symbol that
we push onto the stack (and supply to user actions).</p>
) -><aclass="enum"href="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="type"href="type.ParseResult.html"title="type lalrpop_util::state_machine::ParseResult">ParseResult</a><Self>></h4></section></summary><divclass="docblock"><p>Execute a reduction in the given state: that is, execute user
code. The start location indicates the “starting point” of the
current lookahead that is triggering the reduction (it is
<code>None</code> for EOF).</p>
<p>The <code>states</code> and <code>symbols</code> vectors represent the internal
state machine vectors; they are given to <code>reduce</code> so that it
can pop off states that no longer apply (and consume their
symbols). At the end, it should also push the new state and
symbol produced.</p>
<p>Returns a <code>Some</code> if we reduced the start state and hence
parsing is complete, or if we encountered an irrecoverable
error.</p>
<p>FIXME. It would be nice to not have so much logic live in
reduce. It should just be given an iterator of popped symbols
and return the newly produced symbol (or error). We can use
<code>simulate_reduce</code> and our own information to drive the rest,
right? This would also allow us – I think – to extend error
recovery to cover user-produced errors.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="tymethod.simulate_reduce"class="method"><aclass="src rightside"href="../../src/lalrpop_util/state_machine.rs.html#152">source</a><h4class="code-header">fn <ahref="#tymethod.simulate_reduce"class="fn">simulate_reduce</a>(&self, action: Self::<aclass="associatedtype"href="trait.ParserDefinition.html#associatedtype.ReduceIndex"title="type lalrpop_util::state_machine::ParserDefinition::ReduceIndex">ReduceIndex</a>) -><aclass="enum"href="enum.SimulatedReduce.html"title="enum lalrpop_util::state_machine::SimulatedReduce">SimulatedReduce</a><Self></h4></section></summary><divclass="docblock"><p>Returns information about how many states will be popped
during a reduction, and what nonterminal would be produced as
) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/alloc/vec/struct.Vec.html"title="struct alloc::vec::Vec">Vec</a><<aclass="struct"href="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String">String</a>></h4></section></summary><divclass="docblock"><p>Returns the expected tokens in a given state. This is used in the
same way as <code>expected_tokens</code> but allows more precise reporting
of accepted tokens in some cases.</p>
</div></details></div><h2id="object-safety"class="section-header">Object Safety<ahref="#object-safety"class="anchor">§</a></h2><divclass="object-safety-info">This trait is <b>not</b><ahref="https://doc.rust-lang.org/1.76.0/reference/items/traits.html#object-safety">object safe</a>.</div><h2id="implementors"class="section-header">Implementors<ahref="#implementors"class="anchor">§</a></h2><divid="implementors-list"></div><scriptsrc="../../trait.impl/lalrpop_util/state_machine/trait.ParserDefinition.js"async></script></section></div></main></body></html>