|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.varankin.bnf.tree.SyntaxImpl<Atom>
Atom
- elementary object of stream described by the syntax.public class SyntaxImpl<Atom>
Accumulator of incoming elementary objects separated by syntax into
parsed bush. Valid instance contains one or more parsed trees.
Every node (ParsedUnit
) of the tree is
either ParsedRule
or ParsedTerminal
.
Constructor Summary | |
---|---|
SyntaxImpl(Syntax aSyntax,
Converter<Atom> aConverter)
Creates empty accumulator ready to accept stream of elementary objects. |
Method Summary | |
---|---|
boolean |
add(Atom aCharacter)
A procedure to accept object. |
java.util.Iterator<ParsedRule<Atom>> |
iterator()
Seamless iterator over all syntax rules recognized by the syntax. |
java.util.List<Atom> |
tail()
|
boolean |
tail(Atom aAtom)
Deprecated. |
java.lang.String |
toString()
|
boolean |
valid()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SyntaxImpl(Syntax aSyntax, Converter<Atom> aConverter)
aSyntax
- syntax definition.aConverter
- text-to-Atom converter.Method Detail |
---|
public boolean add(Atom aCharacter)
Receiver
add
in interface Receiver<Atom>
aCharacter
- a candidate object to accept or null to indicate break in delivery.
public java.util.Iterator<ParsedRule<Atom>> iterator()
iterator
in interface java.lang.Iterable<ParsedRule<Atom>>
@Deprecated public boolean tail(Atom aAtom)
Accumulator
tail
in interface Accumulator<Atom>
aAtom
- elementary object to add.
public java.util.List<Atom> tail()
tail
in interface Accumulator<Atom>
public boolean valid()
valid
in interface Accumulator<Atom>
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |