Class ParallelConfigurableParser
java.lang.Object
com.singularsys.jep.configurableparser.ConfigurableParser
com.singularsys.jep.misc.parallelparsing.ParallelConfigurableParser
- All Implemented Interfaces:
JepComponent,Parser,Serializable
A version of the ConfigurableParser that can parse expressions
in multiple threads.
Only the @link{#parse(Reader)} method is supported other
methods are not suitable for multi-threaded use and will throw UnsupportedOperationException.
The
parse(Reader) method creates a new Tokenizer,
GrammarParser, and new instances of each TokenFilter,
uses them to parse the input.
The individual TokenMatcher and GrammarMatcher objects
are assumed to be thread safe.
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor with no matchers.Copy constructor reuses the TokenMatchers, TokenFilters, GrammarMatchers, TokenizerFactory, GrammarParserFactory, OperatorTokenMatcher and SymbolTokenMatcher from the base. -
Method Summary
Modifier and TypeMethodDescriptionNot implemented.newMultipleEquationParser(Reader input) Creates a new instance of the MultipleEquationParser to parse multiple expressions from the input.Parses the input stream.voidNot implemented.scan()Not implemented.Not implemented.Methods inherited from class com.singularsys.jep.configurableparser.ConfigurableParser
addArrayAccessMatcher, addBracketMatcher, addDoubleQuoteStrings, addExponentNumbers, addFunctionMatcher, addGrammarMatcher, addHashComments, addIdentifiers, addListMatcher, addListOrBracketMatcher, addOperatorTokenMatcher, addSemiColonTerminator, addSimpleNumbers, addSingleQuoteStrings, addSlashComments, addSymbols, addTokenFilter, addTokenMatcher, addWhiteSpace, addWhiteSpaceCommentFilter, filter, getGrammarMatchers, getGrammarParserFactory, getJep, getLightWeightInstance, getOperatorTokenMatcher, getSymbolToken, getSymbolTokenMatcher, getToken, getTokenFilters, getTokenizerFactory, getTokenMatchers, init, parse, replaceGrammarMatcher, replaceTokenMatcher, setGrammarParserFactory, setImplicitMultiplicationSymbols, setTokenizerFactory
-
Constructor Details
-
ParallelConfigurableParser
public ParallelConfigurableParser()Default constructor with no matchers. -
ParallelConfigurableParser
Copy constructor reuses the TokenMatchers, TokenFilters, GrammarMatchers, TokenizerFactory, GrammarParserFactory, OperatorTokenMatcher and SymbolTokenMatcher from the base.- Parameters:
base- the base ConfigurableParser
-
-
Method Details
-
parse
Parses the input stream. Creates a newTokenizer,GrammarParser, and new instances of eachTokenFilter, uses them to parse the input.- Specified by:
parsein interfaceParser- Overrides:
parsein classConfigurableParser- Parameters:
stream- the input stream to read from- Returns:
- top node of the expression
- Throws:
ParseException- if there is a syntax error in the input or an empty expression
-
newMultipleEquationParser
Creates a new instance of the MultipleEquationParser to parse multiple expressions from the input.- Parameters:
input- Reader with the input expressions- Returns:
- new instance of the MultipleEquation
-
restart
Not implemented.- Specified by:
restartin interfaceParser- Overrides:
restartin classConfigurableParser- Parameters:
stream- input stream- Throws:
UnsupportedOperationException- always- See Also:
-
continueParse
Not implemented.- Specified by:
continueParsein interfaceParser- Overrides:
continueParsein classConfigurableParser- Returns:
- top node of the expression or null at end of file
- Throws:
UnsupportedOperationException- alwaysParseException- if there is a syntax error in the input- See Also:
-
scan
Not implemented.- Overrides:
scanin classConfigurableParser- Parameters:
stream- input- Returns:
- a list of tokens, including white space and comments, null at end of input. An empty list is returned for empty equations.
- Throws:
UnsupportedOperationException- alwaysParseException- if there is a syntax error in the input
-
scan
Not implemented.- Overrides:
scanin classConfigurableParser- Returns:
- List of tokens, including white space and comments, null at end of input. An empty list is returned for empty equations.
- Throws:
UnsupportedOperationException- alwaysParseException- if there is a syntax error in the input
-