Skip to main content

Module common

Module common 

Source
Expand description

Common code generation utilities shared across all code generators.

Structs§

ErrorFields
Common error structure fields
LexerFields
Common lexer structure fields
ParserFields
Common parser structure fields
RuleSignature
Helper to generate rule method signature parts
TokenFields
Common token structure fields (for documentation)
TokenTypeInfo
Common patterns and utilities for code generation. Token type information for code generation

Functions§

extract_all_lexer_rules
Extract all lexer rules (including fragments) for reference
extract_parser_rules
Extract parser rules
extract_token_types
Extract token types from grammar (excluding fragments)
format_identifier
Format identifier according to language conventions
format_type_name
Format type name according to language conventions
generate_header_comment
Generate standard header comment
generate_header_comment_python
Generate standard header comment (Python style)
get_lexer_named_action
Get lexer-specific named action
get_named_action
Get named action code if present
get_parser_named_action
Get parser-specific named action