JSGFGrammar module

This file lays out the class structure for a JSGF Grammar.

class JSGFGrammar.Disjunction(disjuncts)

Disjunction class stores disjuncts in a list

class JSGFGrammar.Grammar

Grammar class which contains a list for public rules and a list for all rules.

addPublicRule(rule)

adds a rule to the list of public rules

addRule(rule)

adds a rule to the list of rules

getRHS(nt)

returns rule definition

Parameters:nt – Non-Terminal (variable) whose definition to get
class JSGFGrammar.JSGFExpression
class JSGFGrammar.NonTerminal(ntName)

NonTerminal class simply stores the label of the nonterminal

class JSGFGrammar.Optional(option)

Optional class stores either a JSGFExpression, list, or string as its optional element

class JSGFGrammar.Rule(lhs, rhs)

Rule class, represents a JSGF rule, with a nonterminal name representing the left hand side, and a list of possible expansions representing the right hand side.

Previous topic

Welcome to JSGF Grammar Tools’s documentation!

Next topic

JSGFParser module

This Page