**Grammars.**
A grammar is a dictionary {str: [[symbol]]} mapping names of nonterminals to
lists of right-hand sides. Each right-hand side is a list of symbols. There
are several kinds of symbols; see grammar.py to learn more.
Instead of a list of right-hand sides, the value of a grammar entry may be a
function; see grammar.Nt for details.
**Token streams.**
The user passes to each method an object representing the input sequence.
This object must support two methods:
* `src.peek()` returns the kind of the next token, or `None` at the end of
input.
* `src.take(kind)` throws an exception if `src.peek() != kind`;
otherwise, it removes the next token from the input stream and returns it.
The special case `src.take(None)` checks that the input stream is empty: if so, it returns None; ifnot, it throws.
For very basic needs, see `lexer.LexicalGrammar`.
"""
from __future__ import annotations
import io import typing
from .grammar import Grammar from . import emit from .rewrites import CanonicalGrammar from .parse_table import ParseTable
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.