EBNF Compiler¶
A tool for parsing and compiling Extended Backus-Naur Form (EBNF) grammars.
📚 Module Documentation
Explore the API documentation and module reference.
🔍 API Reference
Complete index of all classes, functions, and variables.
Modules¶
EBNF Compiler
- class ebnf_compiler.Compiler(scanner: ebnf_compiler.scanner.Scanner, parser: ebnf_compiler.parser.Parser)[source]¶
Bases:
object
- ebnf_compiler.main(source: ~typing.Annotated[~pathlib.Path, <typer.models.ArgumentInfo object at 0x7f60ca3042f0>], debug: bool = False, show_tree: bool = True, analyze: bool = True)[source]¶
EBNF Scanner
- class ebnf_compiler.scanner.Scanner(eof: bool = False, sym: ebnf_compiler.tokens.Token | None = None, value: str = '', _ch: str = '', _file_name: pathlib._local.Path | None = None, _text: TextIO | None = None, _text_line: str = '', _line_no: int = 0, _col_no: int = 0)[source]¶
Bases:
object- eof: bool = False¶
- token_map: ClassVar[dict[str, Token]] = {'(': Token.LPAREN, ')': Token.RPAREN, '.': Token.PERIOD, '=': Token.EQL, '[': Token.LBRAK, ']': Token.RBRAK, '{': Token.LBRACE, '|': Token.BAR, '}': Token.RBRACE}¶
- value: str = ''¶
EBNF Parser
- class ebnf_compiler.parser.Parser(scanner: ebnf_compiler.scanner.Scanner, has_error: bool = False)[source]¶
Bases:
object- has_error: bool = False¶
EBNF Tokens