|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ch.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 PredictiveParser
token
- The new token to be added.public void addTokens(java.util.List<java.lang.String> tokens)
PredictiveParser
addTokens
in interface PredictiveParser
tokens
- The tokens to be added.public void removeToken()
PredictiveParser
removeToken
in interface PredictiveParser
public void removeAllTokens()
PredictiveParser
removeAllTokens
in interface PredictiveParser
public void setTokens(java.util.List<java.lang.String> tokens)
PredictiveParser
setTokens
in interface PredictiveParser
tokens
- The tokens.public java.util.List<java.lang.String> getTokens()
PredictiveParser
getTokens
in interface PredictiveParser
public int getTokenCount()
PredictiveParser
getTokenCount
in interface PredictiveParser
public NextTokenOptions getNextTokenOptions()
PredictiveParser
getNextTokenOptions
in interface PredictiveParser
public boolean isPossibleNextToken(java.lang.String token)
PredictiveParser
isPossibleNextToken
in interface PredictiveParser
token
- The token.
public boolean isComplete()
PredictiveParser
isComplete
in interface PredictiveParser
public int getReference()
PredictiveParser
getReference
in interface PredictiveParser
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |