opengrammar.parser.meta_syntax¶
The meta-syntax parser.
Module Contents¶
Classes¶
A conjunction. |
|
A disjunction. |
|
The left-hand side of a rule. |
|
The abstract syntax tree of the meta-syntax. |
|
A non-terminal symbol. |
|
The kind of postfix operators available. |
|
The right-hand side of a rule. |
|
A rule. |
|
A terminal symbol. |
- class opengrammar.parser.meta_syntax.Conjunction(antecedent, consequent, postfix=None)[source]¶
A conjunction.
The conjunction of two operands.
- Parameters:
antecedent (Operands) – An antecedent.
consequent (Operands) – A consequent.
postfix (Optional[PostfixType]) – A postfix operator.
- class opengrammar.parser.meta_syntax.Disjunction(antecedent, consequent, postfix=None)[source]¶
A disjunction.
The disjunction of two operands.
- Parameters:
antecedent (Operands) – An antecedent.
consequent (Operands) – A consequent.
postfix (Optional[PostfixType]) – The postfix operator.
- class opengrammar.parser.meta_syntax.LHS(rule)[source]¶
The left-hand side of a rule.
Initializes the LHS.
- Parameters:
rule (Union[NonTerminal, Conjunction, Disjunction]) – A rule.
- class opengrammar.parser.meta_syntax.MetaSyntaxAST(rules)[source]¶
The abstract syntax tree of the meta-syntax.
Initializes the MetaSyntaxAST.
- Parameters:
rules (List[Rule]) – A list of rules.
- class opengrammar.parser.meta_syntax.NonTerminal(symbol, postfix=None)[source]¶
A non-terminal symbol.
Initializes the NonTerminal.
- Parameters:
symbol (str) – The symbol of the non-terminal.
postfix (Optional[PostfixType]) – The postfix operator.
- class opengrammar.parser.meta_syntax.PostfixType(*args, **kwds)[source]¶
Bases:
enum.EnumThe kind of postfix operators available.
- class opengrammar.parser.meta_syntax.RHS(rule)[source]¶
The right-hand side of a rule.
Initializes the RHS.
- Parameters:
rule (Operands) – A rule.