com.phasmidsoftware.number.core.parse

Members list

Type members

Classlikes

object ComplexParser

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
class ExpressionParserNumeric[Double]
class ExpressionParser[Double]
trait String => Try[Double]
trait JavaTokenParsers
trait RegexParsers
trait Parsers
class Object
trait Matchable
class Any
Show all
Self type
abstract class ExpressionParser[T] extends JavaTokenParsers, String => Try[T]

Attributes

Supertypes
trait String => Try[T]
trait JavaTokenParsers
trait RegexParsers
trait Parsers
class Object
trait Matchable
class Any
Show all
Known subtypes
Self type
abstract class ExpressionParserNumeric[T] extends ExpressionParser[T]

Attributes

Supertypes
class ExpressionParser[T]
trait String => Try[T]
trait JavaTokenParsers
trait RegexParsers
trait Parsers
class Object
trait Matchable
class Any
Show all
Known subtypes
Self type

Attributes

Supertypes
class ExpressionParser[Int]
trait String => Try[Int]
trait JavaTokenParsers
trait RegexParsers
trait Parsers
class Object
trait Matchable
class Any
Show all
Self type
case object LogDebug extends LogLevel

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait LogLevel
class Object
trait Matchable
class Any
Show all
Self type
LogDebug.type
case object LogInfo extends LogLevel

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait LogLevel
class Object
trait Matchable
class Any
Show all
Self type
LogInfo.type
trait LogLevel

Trait which is used to define a logging level for the logit method of SignificantSpaceParsers.

Trait which is used to define a logging level for the logit method of SignificantSpaceParsers.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object LogDebug
object LogInfo
object LogOff
object LogLevel

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
LogLevel.type
case object LogOff extends LogLevel

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait LogLevel
class Object
trait Matchable
class Any
Show all
Self type
LogOff.type
object MillParser extends BaseMillParser

Attributes

Supertypes
trait JavaTokenParsers
trait RegexParsers
trait Parsers
class Object
trait Matchable
class Any
Show all
Self type
MillParser.type
case class ParseException(s: String) extends Exception

Attributes

Supertypes
trait Product
trait Equals
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all

Attributes

Supertypes
trait String => Try[Rational]
trait JavaTokenParsers
trait RegexParsers
trait Parsers
class Object
trait Matchable
class Any
Show all
Self type

The RationalParser object provides functionality to parse strings into Rational objects. It extends the BaseRationalParser and implements parsing logic for rational numbers, including components such as sign, integer part, fractional part, and exponent.

The RationalParser object provides functionality to parse strings into Rational objects. It extends the BaseRationalParser and implements parsing logic for rational numbers, including components such as sign, integer part, fractional part, and exponent.

NOTE unless you are working inside the core module, you should prefer com.phasmidsoftware.number.expression.parse.RationalParser instead.

Attributes

Supertypes
trait JavaTokenParsers
trait RegexParsers
trait Parsers
class Object
trait Matchable
class Any
Show all
Self type
case class RationalParserException(m: String) extends Exception

Represents an exception used specifically for handling errors related to parsing rational expressions.

Represents an exception used specifically for handling errors related to parsing rational expressions.

It extends the Exception class, allowing it to contain an error message describing the parsing issue.

Value parameters

m

The error message that provides details about the parsing error.

Attributes

Supertypes
trait Product
trait Equals
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
case class RepeatingDecimal(sign: Boolean, integerPart: String, nonRepeatingPart: Option[String], repeatingPart: String) extends ValuableNumber

Represents a repeating decimal number, including its sign, integer part, non-repeating fractional part (if any), and repeating fractional part.

Represents a repeating decimal number, including its sign, integer part, non-repeating fractional part (if any), and repeating fractional part.

This class models numbers that can be expressed as decimals with repeating cycles, providing functionality to compute their exact rational representation.

Value parameters

integerPart

The integer portion of the decimal number.

nonRepeatingPart

The non-repeating fractional part of the decimal (optional).

repeatingPart

The repeating fractional part of the decimal.

sign

Specifies the sign of the number (true for positive, false for negative).

Attributes

Constructor

Creates a new instance of the RepeatingDecimal.

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Parser for a Mill. The input to this parser is a string of tokens, each separated by any amount of white space. The input is then converted to an IndexedSeq of Strings which is then reversed and rendered as a single String. The purpose of this strange little dance is to reverse the order of the tokens without reversing the tokens themselves.

Parser for a Mill. The input to this parser is a string of tokens, each separated by any amount of white space. The input is then converted to an IndexedSeq of Strings which is then reversed and rendered as a single String. The purpose of this strange little dance is to reverse the order of the tokens without reversing the tokens themselves.

For detail of the method, please see https://en.wikipedia.org/wiki/Shunting-yard_algorithm

CONSIDER using a TokenParser instead of a RegexParser.

Attributes

Supertypes
trait JavaTokenParsers
trait RegexParsers
trait Parsers
class Object
trait Matchable
class Any
Show all
Self type
case class SignificantSpaceParserException(m: String) extends Exception

Attributes

Supertypes
trait Product
trait Equals
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all

Represents a numerical value that can be evaluated as a Rational number wrapped in a Try, indicating possible failure during parsing.

Represents a numerical value that can be evaluated as a Rational number wrapped in a Try, indicating possible failure during parsing.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
case class VulgarFractionNumber(fraction: String) extends ValuableNumber

Represents a vulgar (Unicode) fraction such as ⅓, ½, ¼, etc. These are single Unicode characters that represent common fractions.

Represents a vulgar (Unicode) fraction such as ⅓, ½, ¼, etc. These are single Unicode characters that represent common fractions.

Value parameters

fraction

the Unicode fraction character as a string

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Deprecated classlikes

abstract class BaseMillParser extends BaseNumberParser

Parser for a Mill. The input to this parser is a string of tokens, each separated by any amount of white space. The input is then converted to an IndexedSeq of Strings which is then reversed and rendered as a single String. The purpose of this strange little dance is to reverse the order of the tokens without reversing the tokens themselves.

Parser for a Mill. The input to this parser is a string of tokens, each separated by any amount of white space. The input is then converted to an IndexedSeq of Strings which is then reversed and rendered as a single String. The purpose of this strange little dance is to reverse the order of the tokens without reversing the tokens themselves.

CONSIDER using a TokenParser instead of a RegexParser.

Attributes

Deprecated
[Since version 1.6.5] use com.phasmidsoftware.number.expression.parse.BaseMillParser instead
Supertypes
trait JavaTokenParsers
trait RegexParsers
trait Parsers
class Object
trait Matchable
class Any
Show all
Known subtypes
abstract class BaseNumberParser extends BaseRationalParser

Parser for Number.

Parser for Number.

NOTE when we specify an exact number by following an integer by an exponent, we must precede the "E" with a decimal point. CONSIDER Try to eliminate that requirement.

Attributes

Deprecated
[Since version 1.6.5] use com.phasmidsoftware.number.expression.parse.BaseNumberParser instead
Supertypes
trait JavaTokenParsers
trait RegexParsers
trait Parsers
class Object
trait Matchable
class Any
Show all
Known subtypes

A parser of Rational objects.

A parser of Rational objects.

Attributes

Deprecated
[Since version 1.6.5] use com.phasmidsoftware.number.expression.parse.baseRationalParser instead
Supertypes
trait JavaTokenParsers
trait RegexParsers
trait Parsers
class Object
trait Matchable
class Any
Show all
Known subtypes

A parser of Rational objects.

A parser of Rational objects.

Attributes

Companion
object
Deprecated
[Since version 1.6.5] use com.phasmidsoftware.number.expression.parse.ComplexParser instead
Supertypes
trait JavaTokenParsers
trait RegexParsers
trait Parsers
class Object
trait Matchable
class Any
Show all

Object for parsing numerical values, extending the functionality of the BaseNumberParser class. Provides methods for parsing, interpreting, and representing numbers, potentially with fuzziness, exponents, and other modifications.

Object for parsing numerical values, extending the functionality of the BaseNumberParser class. Provides methods for parsing, interpreting, and representing numbers, potentially with fuzziness, exponents, and other modifications.

This object specializes in defining the parsing rules for various numeric representations, including:

  • Simple numbers or rational numbers.
  • Numbers with fuzziness or uncertainty.
  • Factors representing constants, symbols, or mathematical concepts.

The parsing logic accounts for optional components such as fractional parts and exponents, and encapsulates results within domain-specific types, such as Number, NumberWithFuzziness, and ValuableNumber.

Attributes

Deprecated
[Since version 1.6.5] use com.phasmidsoftware.number.expression.parse.NumberParser instead
Supertypes
trait JavaTokenParsers
trait RegexParsers
trait Parsers
class Object
trait Matchable
class Any
Show all
Self type
abstract class SignificantSpaceParsers extends JavaTokenParsers

This abstract class extends JavaTokenParsers but where white space is not ignored.

This abstract class extends JavaTokenParsers but where white space is not ignored.

Attributes

Deprecated
[Since version 1.6.5] use com.phasmidsoftware.number.expression.parse.SignificantSpaceParsers instead
Supertypes
trait JavaTokenParsers
trait RegexParsers
trait Parsers
class Object
trait Matchable
class Any
Show all
Known subtypes
Self type