|
sdr 0.21 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.cscott.sdr.calls.grm.Grm
public abstract class Grm
This class contains inner classes creating an AST for the 'natural language'
grammar of square dance calls and concepts. This AST is transformed into
a Java Speech grammar for the Sphinx speech recognition engine, which then
generates text strings. The AST is also transformed into an ANTLR v3
grammar parsing those text strings, which creates Apply
trees.
The raw rules from the call file need to be processed to remove
left recursion and to disambiguate using precedence levels.
Nested Class Summary | |
---|---|
static class |
Grm.Alt
Alternation: a|b. |
static class |
Grm.Concat
Concatanation: a b. |
static class |
Grm.Mult
Multiplicity marker: a*, a+, or a?. |
static class |
Grm.Nonterminal
A nonterminal reference to an external rule. |
static class |
Grm.Terminal
A grammar terminal: a string literal to match. |
Constructor Summary | |
---|---|
Grm()
|
Method Summary | ||
---|---|---|
abstract
|
accept(GrmVisitor<T> v)
|
|
static Grm |
mkGrm(String... terminals)
Make a Grm which will recognize the given
sequence of terminal symbols. |
|
static Grm |
parse(String rule)
Parse a string representing a Grm . |
|
abstract int |
precedence()
|
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Grm()
Method Detail |
---|
public abstract int precedence()
public abstract <T> T accept(GrmVisitor<T> v)
public final String toString()
toString
in class Object
public static Grm mkGrm(String... terminals)
Grm
which will recognize the given
sequence of terminal symbols.
public static Grm parse(String rule)
Grm
. Parameter
references must be numerical.
IllegalArgumentException
- if the rule is malformed.
|
sdr 0.21 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |