Package com.singularsys.jep.misc.parallelparsing

# Class ParallelConfigurableParser

java.lang.Object
com.singularsys.jep.configurableparser.ConfigurableParser
com.singularsys.jep.misc.parallelparsing.ParallelConfigurableParser

All Implemented Interfaces:
  `JepComponent`, `Parser`, `Serializable`

public class ParallelConfigurableParser extends ConfigurableParser
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:
  - Serialized Form

- ## Field Summary

  ### Fields inherited from class com.singularsys.jep.configurableparser.ConfigurableParser

  `filters, g, gpf, jep, m, otm, stm, tf, tk`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ParallelConfigurableParser()`
  Default constructor with no matchers.
  `ParallelConfigurableParser(ConfigurableParser base)`
  Copy constructor reuses the TokenMatchers, TokenFilters, GrammarMatchers, TokenizerFactory, GrammarParserFactory, OperatorTokenMatcher and SymbolTokenMatcher from the base.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Node`
  `continueParse()`
  Not implemented.
  `MultipleEquationParser`
  `newMultipleEquationParser(Reader input)`
  Creates a new instance of the MultipleEquationParser to parse multiple expressions from the input.
  `Node`
  `parse(Reader stream)`
  Parses the input stream.
  `void`
  `restart(Reader stream)`
  Not implemented.
  `List<Token>`
  `scan()`
  Not implemented.
  `List<Token>`
  `scan(Reader stream)`
  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`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ParallelConfigurableParser

    public ParallelConfigurableParser()
    Default constructor with no matchers.

  - ### ParallelConfigurableParser

    public ParallelConfigurableParser(ConfigurableParser base)
    Copy constructor reuses the TokenMatchers, TokenFilters, GrammarMatchers, TokenizerFactory, GrammarParserFactory, OperatorTokenMatcher and SymbolTokenMatcher from the base.
    Parameters:
      `base` - the base ConfigurableParser

- ## Method Details

  - ### parse

    public Node parse(Reader stream) throws ParseException
    Parses the input stream. Creates a new `Tokenizer`, `GrammarParser`, and new instances of each `TokenFilter`, uses them to parse the input.
    Specified by:
      `parse` in interface `Parser`
    Overrides:
      `parse` in class `ConfigurableParser`
    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

    public MultipleEquationParser newMultipleEquationParser(Reader input)
    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

    public void restart(Reader stream)
    Not implemented.
    Specified by:
      `restart` in interface `Parser`
    Overrides:
      `restart` in class `ConfigurableParser`
    Parameters:
      `stream` - input stream
    Throws:
      `UnsupportedOperationException` - always
    See Also:
      - `ConfigurableParser.continueParse()`

  - ### continueParse

    public Node continueParse() throws ParseException
    Not implemented.
    Specified by:
      `continueParse` in interface `Parser`
    Overrides:
      `continueParse` in class `ConfigurableParser`
    Returns:
      top node of the expression or null at end of file
    Throws:
      `UnsupportedOperationException` - always
      `ParseException` - if there is a syntax error in the input
    See Also:
      - `ConfigurableParser.restart(java.io.Reader)`

  - ### scan

    public List<Token> scan(Reader stream) throws ParseException
    Not implemented.
    Overrides:
      `scan` in class `ConfigurableParser`
    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` - always
      `ParseException` - if there is a syntax error in the input

  - ### scan

    public List<Token> scan() throws ParseException
    Not implemented.
    Overrides:
      `scan` in class `ConfigurableParser`
    Returns:
      List of tokens, including white space and comments, null at end of input. An empty list is returned for empty equations.
    Throws:
      `UnsupportedOperationException` - always
      `ParseException` - if there is a syntax error in the input