|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.singularsys.jep.configurableparser.ConfigurableParser
public class ConfigurableParser
A configurable parser.
| Field Summary | |
|---|---|
protected java.util.List<TokenFilter> |
filters
List of token filters |
protected java.util.List<GrammarMatcher> |
gm
List of grammar matchers |
protected Jep |
jep
The Jep instance associated with this parser |
protected java.util.List<TokenMatcher> |
m
List of token matchers |
protected Tokenizer |
tk
Tokenizer |
| Constructor Summary | |
|---|---|
|
ConfigurableParser()
Create the standard configurable parser. |
protected |
ConfigurableParser(boolean empty)
Create a configurable parser with an empty lists of matchers. |
|
ConfigurableParser(java.util.List<TokenMatcher> tokenMatchers,
java.util.List<TokenFilter> filters,
java.util.List<GrammarMatcher> grammarMatchers)
Create a parser with the specified set of matchers. |
| Method Summary | |
|---|---|
Node |
continueParse()
Parse the next equation from existing stream. |
java.util.Iterator<Token> |
filter(java.util.List<Token> input)
Filters the tokens to remove whitespace etc. |
java.util.List<GrammarMatcher> |
getGrammarMatchers()
|
JepComponent |
getLightWeightInstance()
Gets a light-weight instance suitable for using in multiple threads. |
java.util.List<TokenFilter> |
getTokenFilters()
|
java.util.List<TokenMatcher> |
getTokenMatchers()
|
void |
init(Jep jep)
Initialize the component. |
Node |
parse(java.util.Iterator<Token> it)
Perform the syntax analysis stage. |
Node |
parse(java.io.Reader stream)
Parse a single equation. |
void |
restart(java.io.Reader stream)
Load a new stream to read from. |
java.util.List<Token> |
scan()
Scan next equations from an existing stream. |
java.util.List<Token> |
scan(java.io.Reader stream)
Scan the input. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.List<TokenMatcher> m
protected java.util.List<TokenFilter> filters
protected java.util.List<GrammarMatcher> gm
protected transient Tokenizer tk
protected transient Jep jep
| Constructor Detail |
|---|
public ConfigurableParser()
protected ConfigurableParser(boolean empty)
getTokenMatchers(),
getTokenFilters() and getGrammarMatchers() methods to
get the appropriate lists.
empty -
public ConfigurableParser(java.util.List<TokenMatcher> tokenMatchers,
java.util.List<TokenFilter> filters,
java.util.List<GrammarMatcher> grammarMatchers)
tokenMatchers - a list of TokenMatchers which to match the input sequence.filters - a list of filters to remove whitespace etc.grammarMatchers - matchers for syntactical elements| Method Detail |
|---|
public void init(Jep jep)
JepComponent
init in interface JepComponentinit in interface Parserjep - the current Jep instance
public Node parse(java.io.Reader stream)
throws ParseException
parse in interface Parserstream - the input stream to read from
ParseExceptionpublic void restart(java.io.Reader stream)
restart in interface ParsercontinueParse()
public Node continueParse()
throws ParseException
continueParse in interface ParserParseExceptionrestart(java.io.Reader)
public java.util.List<Token> scan(java.io.Reader stream)
throws ParseException
stream -
ParseException
public java.util.List<Token> scan()
throws ParseException
ParseException
public java.util.Iterator<Token> filter(java.util.List<Token> input)
throws ParseException
input -
ParseException
public Node parse(java.util.Iterator<Token> it)
throws ParseException
it - an iterator with a list of tokens
ParseExceptionpublic java.util.List<GrammarMatcher> getGrammarMatchers()
public java.util.List<TokenMatcher> getTokenMatchers()
public java.util.List<TokenFilter> getTokenFilters()
public JepComponent getLightWeightInstance()
JepComponent
getLightWeightInstance in interface JepComponent
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||