Module enso_flexer::generate[][src]

Expand description

This file contains utilities for generating rust code from lexer definitions, allowing the flexer to be specialised for a specific language.

Enums

GenError

Errors that arise during code generation.

Functions

automaton_for_group

Generate the functions that implement the lexer automaton for a given lexer state.

branch_body

Generate the branch body for a transition in the DFA.

dfa_has_rule_name_for

Check if the DFA has a rule name for the provided target state.

dispatch_in_state

Generate the dispatch function for a given lexer state.

has_reader_arg

Checks if the given expr is a call with a single argument “reader” being passed.

match_for_transition

Generate the pattern match for a given transition function.

name_for_step

Generate a name for a given step function.

rule_for_state

Generate an executable rule function for a given lexer state.

run_current_state_function

Generate the function responsible for executing the lexer in its current state.

run_function

Generate the run function for the specialized lexer.

show_code

Convert the syntax tree into a string.

specialize

Generate specialized code for the provided lexer definition.

step

Generate the step function for the lexer.

step_match_arm

Generate a match arm for the step function.

str_to_ident

Convert a string to an identifier.

str_to_path

Convert a string to a path.

transition_for_dfa

Generate a specific transition function for

transitions_for_dfa

Generate a set of transition functions for the provided dfa, with identifier id.

wrap_in_impl_for

Wrap the provided implementation items into an impl block for the provided state_name type.