Package com.singularsys.jep.configurableparser

# Class ConfigurableParserWithRange

java.lang.Object
com.singularsys.jep.configurableparser.ConfigurableParser
com.singularsys.jep.configurableparser.ConfigurableParserWithRange

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

public class ConfigurableParserWithRange extends ConfigurableParser
A modified version of the `StandardConfigurableParser` which includes a grammar matcher for matching lists `[1,2,3]` and ranges `[1..10]`. It also uses a custom pattern for matching numbers which with prevents confusions with the defaults range operator symbol `..`.

The symbol used for the range operator is specified in the constructor, other standard symbols `( ) [ ] ,` are read from the resource bundle.

The full confurations is like

    String lbracket = "(";
    String rbracket = "(";
    String lsqbracket = "[";
    String rsqbracket = "]";
    String seperator = ",";
    this.addHashComments();
    this.addSlashComments();
    this.addSingleQuoteStrings();
    this.addDoubleQuoteStrings();
    this.addWhiteSpace();
    this.addTokenMatcher(
        new NumberTokenMatcher("((\\d+\\.\\d+)|(\\d+\\.(?!\\.))|(\\.\\d+)|(\\d+))(?:[eE][+-]?\\d+)?"));
    this.addSymbols(lbracket, rbracket, lsqbracket, rsqbracket, seperator, rangeSymbols);
    this.setImplicitMultiplicationSymbols(lbracket, lsqbracket);
    this.addOperatorTokenMatcher();
    this.addIdentifiers();
    this.addSemiColonTerminator();
    this.addWhiteSpaceCommentFilter();
    this.addBracketMatcher(lbracket, rbracket);
    this.addFunctionMatcher(lbracket, rbracket, seperator);
    this.addGrammarMatcher(
        new ListOrRangeGrammarMatcher(
            this.getSymbolToken(lsqbracket),
            this.getSymbolToken(rsqbracket),
            this.getSymbolToken(seperator),
             this.getSymbolToken(rangeSymbols)
        ));
    this.addArrayAccessMatcher(lsqbracket, rsqbracket);

    @since Jep 4.1
    @see com.singularsys.jep.configurableparser.matchers.ListOrRangeGrammarMatcher
    @see com.singularsys.jep.configurableparser.RangeOperator
    @see com.singularsys.jep.misc.functions.Range

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
  `ConfigurableParserWithRange(String rangeSymbols)`
  Create a ConfigurableParserWithRange with the specified symbol for the range operator.

- ## Method Summary

  ### 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, continueParse, filter, getGrammarMatchers, getGrammarParserFactory, getJep, getLightWeightInstance, getOperatorTokenMatcher, getSymbolToken, getSymbolTokenMatcher, getToken, getTokenFilters, getTokenizerFactory, getTokenMatchers, init, parse, parse, replaceGrammarMatcher, replaceTokenMatcher, restart, scan, scan, setGrammarParserFactory, setImplicitMultiplicationSymbols, setTokenizerFactory`

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

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

- ## Constructor Details

  - ### ConfigurableParserWithRange

    public ConfigurableParserWithRange(String rangeSymbols)
    Create a ConfigurableParserWithRange with the specified symbol for the range operator.
    Parameters:
      `rangeSymbols` - symbol used for the range operator