knitout_interpreter.knitout_language.Knitout_Parser module
Parser code for accessing Parglare language support
- class Knitout_Parser(debug_grammar=False, debug_parser=False, debug_parser_layout=False)[source]
Bases:
objectParser for reading knitout using the parglare library.
- __init__(debug_grammar=False, debug_parser=False, debug_parser_layout=False)[source]
Initialize the Knitout parser with optional debugging features.
- Parameters:
- Raises:
FileNotFoundError – If the <knitout.pg> grammar file cannot be located in the package.
- parse_knitout_to_instructions(pattern, pattern_is_file=False)[source]
Parse knitout pattern into a knitout program.
- Parameters:
- Returns:
The program ordered by the parsed lines of knitout code.
- Return type:
- Raises:
Knitout_ParseError – If there’s an error parsing the knitout code.
Incomplete_Knitout_Line_Error – If a knitout line processes into an incomplete code.