com.phasmidsoftware.number.parse

Members list

Type members

Classlikes

case class DimensionError(message: String) extends ParseError

Represents an error related to dimensional analysis.

Represents an error related to dimensional analysis.

Value parameters

message

A string describing the dimension error.

Attributes

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

The ExpressionParser object provides utilities for parsing and processing LaTeX-like mathematical expressions, leveraging string interpolation. These utilities enable creation, simplification, and evaluation of mathematical expressions represented as Expression objects.

The ExpressionParser object provides utilities for parsing and processing LaTeX-like mathematical expressions, leveraging string interpolation. These utilities enable creation, simplification, and evaluation of mathematical expressions represented as Expression objects.

TODO instead of throwing exceptions we should return a ParseError object.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object LaTeXParser extends RegexParsers

Object responsible for parsing LaTeX-style mathematical expressions into an internal representation (MathExpr).

Object responsible for parsing LaTeX-style mathematical expressions into an internal representation (MathExpr).

Attributes

Supertypes
trait RegexParsers
trait Parsers
class Object
trait Matchable
class Any
Self type
case class LaTeXParserException(message: String) extends RuntimeException

This exception is thrown when an error occurs while parsing LaTeX input.

This exception is thrown when an error occurs while parsing LaTeX input.

Value parameters

message

Descriptive message providing details about the exception.

Attributes

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

Represents an error that occurs during parsing. This sealed trait serves as a base for all specific parse error types.

Represents an error that occurs during parsing. This sealed trait serves as a base for all specific parse error types.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
case class ParseException(message: String) extends Exception

Exception thrown when parsing fails.

Exception thrown when parsing fails.

Value parameters

message

Description of the parse error.

Attributes

Supertypes
trait Product
trait Equals
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
case class SyntaxError(message: String, position: Int) extends ParseError

Represents a syntax error encountered during parsing.

Represents a syntax error encountered during parsing.

Value parameters

message

A string describing the syntax error.

position

The position in the input where the syntax error occurred.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait ParseError
class Object
trait Matchable
class Any
Show all
case class UnitError(message: String) extends ParseError

Represents an error related to unit handling.

Represents an error related to unit handling.

Value parameters

message

A string describing the unit error.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait ParseError
class Object
trait Matchable
class Any
Show all
trait UnitsParser extends RegexParsers

Object responsible for parsing unit expressions into their corresponding Unit representations. This supports basic SI units, common derivations, unit powers, products, and divisions.

Object responsible for parsing unit expressions into their corresponding Unit representations. This supports basic SI units, common derivations, unit powers, products, and divisions.

Attributes

Companion
object
Supertypes
trait RegexParsers
trait Parsers
class Object
trait Matchable
class Any
Known subtypes
object UnitsParser
object UnitsParser extends UnitsParser

Attributes

Companion
trait
Supertypes
trait UnitsParser
trait RegexParsers
trait Parsers
class Object
trait Matchable
class Any
Show all
Self type
case class UnitsParserException(msg: String) extends Exception

Exception thrown to indicate an error encountered while parsing units.

Exception thrown to indicate an error encountered while parsing units.

Value parameters

msg

The error message describing the reason for the exception.

Attributes

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

Extensions

Extensions

extension [E <: ParseError, A](either: Either[E, A])
def getOrThrow: A