com.phasmidsoftware.number.expression.parse
Members list
Type members
Classlikes
Attributes
- Supertypes
-
trait String => Try[T]trait JavaTokenParserstrait RegexParserstrait Parsersclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
class ArithmeticParserNumeric[T]object DoubleArithmeticParserobject IntArithmeticParserobject RationalArithmeticParser
- Self type
Attributes
- Supertypes
-
class ArithmeticParser[T]trait String => Try[T]trait JavaTokenParserstrait RegexParserstrait Parsersclass Objecttrait Matchableclass AnyShow all
- Known subtypes
- Self type
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
- Supertypes
-
class BaseNumberParserclass BaseRationalParserclass SignificantSpaceParserstrait JavaTokenParserstrait RegexParserstrait Parsersclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
object MillParserobject ShuntingYardParser
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
- Supertypes
-
class BaseRationalParserclass SignificantSpaceParserstrait JavaTokenParserstrait RegexParserstrait Parsersclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
class BaseMillParserobject MillParserobject ShuntingYardParserclass ComplexParserobject NumberParser
A parser of Rational objects.
A parser of Rational objects.
Attributes
- Supertypes
-
class SignificantSpaceParserstrait JavaTokenParserstrait RegexParserstrait Parsersclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
class BaseNumberParserclass BaseMillParserobject MillParserobject ShuntingYardParserclass ComplexParserobject NumberParserobject RationalParserShow all
A parser of Rational objects.
A parser of Rational objects.
Attributes
- Companion
- object
- Supertypes
-
class BaseNumberParserclass BaseRationalParserclass SignificantSpaceParserstrait JavaTokenParserstrait RegexParserstrait Parsersclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ComplexParser.type
Attributes
- Supertypes
-
class ArithmeticParserNumeric[Double]class ArithmeticParser[Double]trait String => Try[Double]trait JavaTokenParserstrait RegexParserstrait Parsersclass Objecttrait Matchableclass AnyShow all
- Self type
Attributes
- Supertypes
-
trait Singletontrait Producttrait Mirrortrait Serializabletrait Producttrait Equalstrait Expressionclass Objecttrait Matchableclass AnyShow all
- Self type
-
EmptyExpression.type
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Expression.type
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
object EmptyExpressionclass ExpressionTokens
ExpressionParser is a parsing utility designed for processing and interpreting arithmetic expressions. It extends JavaTokenParsers to leverage combinator-based parsing functionality.
ExpressionParser is a parsing utility designed for processing and interpreting arithmetic expressions. It extends JavaTokenParsers to leverage combinator-based parsing functionality.
CONSIDER I'm not sure that the Expression structure is that helpful in creating expressions such as BiFunction, etc. Probably we should put the operator first (or maybe last).
The parser supports parsing arithmetic expressions involving addition, subtraction, multiplication, and division, as well as handling nested expressions using parentheses. It is capable of transforming input strings into structured representations of expressions using a robust parsing approach. The class provides detailed breakdowns of expressions into components like terms, factors, numeric values, and additional constructs.
This class also supports error handling, ensuring any invalid input is captured and reported as a Failure within a Try.
Additionally, this class offers utility methods for combining and transforming parse results, and encapsulates complex parsing rules for modular expression parsing.
Superclasses:
scala.util.parsing.combinator.JavaTokenParsersscala.Function1java.lang.Object
Attributes
- Supertypes
-
trait JavaTokenParserstrait RegexParserstrait Parsersclass Objecttrait Matchableclass AnyShow all
- Self type
Attributes
- Supertypes
-
trait Producttrait Equalsclass Exceptionclass Throwabletrait Serializableclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
ExpressionToken.type
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Expressionclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
ExpressionTokens.type
Attributes
- Supertypes
-
class ArithmeticParserNumeric[Int]class ArithmeticParser[Int]trait String => Try[Int]trait JavaTokenParserstrait RegexParserstrait Parsersclass Objecttrait Matchableclass AnyShow all
- Self type
-
IntArithmeticParser.type
Trait which is used to define a logging level for the logit method of SignificantSpaceParsers.
Attributes
- Supertypes
-
class BaseMillParserclass BaseNumberParserclass BaseRationalParserclass SignificantSpaceParserstrait JavaTokenParserstrait RegexParserstrait Parsersclass Objecttrait Matchableclass AnyShow all
- Self type
-
MillParser.type
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
- Supertypes
-
class BaseNumberParserclass BaseRationalParserclass SignificantSpaceParserstrait JavaTokenParserstrait RegexParserstrait Parsersclass Objecttrait Matchableclass AnyShow all
- Self type
-
NumberParser.type
Attributes
- Supertypes
-
trait Producttrait Equalsclass Exceptionclass Throwabletrait Serializableclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
class ArithmeticParserNumeric[Rational]class ArithmeticParser[Rational]trait JavaTokenParserstrait RegexParserstrait Parsersclass Objecttrait Matchableclass AnyShow 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.
Attributes
- Supertypes
-
class BaseRationalParserclass SignificantSpaceParserstrait JavaTokenParserstrait RegexParserstrait Parsersclass Objecttrait Matchableclass AnyShow all
- Self type
-
RationalParser.type
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 Producttrait Equalsclass Exceptionclass Throwabletrait Serializableclass Objecttrait Matchableclass AnyShow all
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 Serializabletrait Producttrait Equalstrait ValuableNumberclass Objecttrait Matchableclass AnyShow 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
-
class BaseMillParserclass BaseNumberParserclass BaseRationalParserclass SignificantSpaceParserstrait JavaTokenParserstrait RegexParserstrait Parsersclass Objecttrait Matchableclass AnyShow all
- Self type
-
ShuntingYardParser.type
Attributes
- Supertypes
-
trait Producttrait Equalsclass Exceptionclass Throwabletrait Serializableclass Objecttrait Matchableclass AnyShow all
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
- Supertypes
-
trait JavaTokenParserstrait RegexParserstrait Parsersclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
class BaseRationalParserclass BaseNumberParserclass BaseMillParserobject MillParserobject ShuntingYardParserclass ComplexParserobject NumberParserobject RationalParserShow all
- Self type
Attributes
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow 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 Objecttrait Matchableclass Any
- Known subtypes
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 Serializabletrait Producttrait Equalstrait ValuableNumberclass Objecttrait Matchableclass AnyShow all