|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.uzh.ifi.attempto.chartparser.ChartParser
public class ChartParser
This is a chart parser (concretely an Earley parser) fully implemented in Java. However, there is a Prolog-based format called "Codeco" that can be transformed into Java (at compile time).
Grammar
Constructor Summary | |
---|---|
ChartParser(Grammar grammar)
Creates a new chart parser for the given grammar. |
Method Summary | |
---|---|
void |
addToken(Terminal... token)
Adds the token to the token sequence and makes one more parsing step to process it. |
void |
addTokens(java.util.List<Terminal> tokens)
Adds the tokens to the token sequence and processes them. |
void |
debug(boolean debug)
This method can be used to switch on/off debug mode (default is off). |
java.util.List<Restriction> |
getNextTokenRestrictions()
This method looks ahead and returns the restrictions at least one of which the next token has to fulfill. |
java.util.List<Terminal[]> |
getTokens()
Returns the current token sequence. |
void |
removeAllTokens()
Removes all tokens in the current token sequence and resets the chart. |
void |
removeToken()
Removes the last token and reverts the last parsing step. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ChartParser(Grammar grammar)
grammar
- The grammar to be used by the chart parser.Method Detail |
---|
public void debug(boolean debug)
debug
- true to switch on debug mode or false to switch it off.public void addToken(Terminal... token)
token
- The token to be added to the token sequence.public void addTokens(java.util.List<Terminal> tokens)
tokens
- The tokens to be added to the token sequence.public void removeToken()
public void removeAllTokens()
public java.util.List<Terminal[]> getTokens()
public java.util.List<Restriction> getNextTokenRestrictions()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |