|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectch.uzh.ifi.attempto.acewiki.gf.GFPredictiveParser
public class GFPredictiveParser
This is a predictive parser connecting to the JPGF implementation of GF.
| Constructor Summary | |
|---|---|
GFPredictiveParser(GFGrammar gfGrammar,
java.lang.String language)
Creates a new parser object for the given language. |
|
| Method Summary | |
|---|---|
void |
addToken(java.lang.String token)
Adds the token to the end of the token sequence. |
void |
addTokens(java.util.List<java.lang.String> tokens)
Adds the tokens to the token list. |
NextTokenOptions |
getNextTokenOptions()
This method returns the options for the next token to be added at the end. |
int |
getReference()
This method should return the token number to which the last token refers, if it is a reference like "it". |
int |
getTokenCount()
Returns the number of tokens of the current (partial) text. |
java.util.List<java.lang.String> |
getTokens()
Returns the current token sequence. |
boolean |
isComplete()
Returns true if the current token sequence is a complete statement. |
boolean |
isPossibleNextToken(java.lang.String token)
Returns whether the given token is a possible next token. |
void |
removeAllTokens()
Removes all tokens in the current token sequence. |
void |
removeToken()
Removes the last token. |
void |
setTokens(java.util.List<java.lang.String> tokens)
Sets the given tokens. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GFPredictiveParser(GFGrammar gfGrammar,
java.lang.String language)
gfGrammar - The grammar object.language - The language.| Method Detail |
|---|
public void addToken(java.lang.String token)
PredictiveParser
addToken in interface PredictiveParsertoken - The new token to be added.public void addTokens(java.util.List<java.lang.String> tokens)
PredictiveParser
addTokens in interface PredictiveParsertokens - The tokens to be added.public void removeToken()
PredictiveParser
removeToken in interface PredictiveParserpublic void removeAllTokens()
PredictiveParser
removeAllTokens in interface PredictiveParserpublic void setTokens(java.util.List<java.lang.String> tokens)
PredictiveParser
setTokens in interface PredictiveParsertokens - The tokens.public java.util.List<java.lang.String> getTokens()
PredictiveParser
getTokens in interface PredictiveParserpublic int getTokenCount()
PredictiveParser
getTokenCount in interface PredictiveParserpublic NextTokenOptions getNextTokenOptions()
PredictiveParser
getNextTokenOptions in interface PredictiveParserpublic boolean isPossibleNextToken(java.lang.String token)
PredictiveParser
isPossibleNextToken in interface PredictiveParsertoken - The token.
public boolean isComplete()
PredictiveParser
isComplete in interface PredictiveParserpublic int getReference()
PredictiveParser
getReference in interface PredictiveParser
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||