You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: ascent.rs
    path of file: ./repos/lalrpop/lalrpop/src/lr1/codegen
    
    the code of the file until where you have to start completion: //! A compiler from an LR(1) table to a [recursive ascent] parser.
//!
//! [recursive ascent]: https://en.wikipedia.org/wiki/Recursive_ascent_parser

use crate::collections::Multimap;
use crate::grammar::repr::{
    Grammar, NonterminalString, Production, Symbol, TerminalString, TypeParamete
    
    fn write(&mut self) -> io::Result<()> {
        self.write_parse_mod(|this| {
            this.write_start_fn()?;
            rust!(this.out, "");
            this.write_return_type_defn()?;
            for i in 0..this.states.len() {
                this.write_state_fn(StateIndex(i))?;
            }
            Ok(())
        })
    }