com.phasmidsoftware.lascala.parser

Members list

Type members

Classlikes

case class BooleanPredicateExpr(operator: String, operand: Expression) extends PredicateExpr

a predicate expression consisting of an operator and an operand.

a predicate expression consisting of an operator and an operand.

Value parameters

operand

the operand, i.e. the RHS of the operator.

operator

the operator. for example "=", etc.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class CSV[X <: Product](parser: CsvParser, input: Stream[String], givenHeader: Header) extends TupleStreamBase[X]

Case class which implements ProductStream where the header and tuples are specified indirectly, by providing a parser and Stream[String] such that the element types of the resulting tuples will be inferred from their representative Strings.

Case class which implements ProductStream where the header and tuples are specified indirectly, by providing a parser and Stream[String] such that the element types of the resulting tuples will be inferred from their representative Strings.

Type parameters

X

a Tuple which should correspond with the number of (and types inferred from) the values.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class TupleStreamBase[X]
trait ProductStream[X]
class Object
trait Matchable
class Any
Show all
object CSV

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
CSV.type
case class ConcreteProductStream[X <: Product](header: Header, tuples: Stream[X]) extends ProductStreamBase[X]

Case class which implements ProductStream where the header and tuples are specified directly

Case class which implements ProductStream where the header and tuples are specified directly

Type parameters

X

the tuple type

Value parameters

header

the header (names of columns)

tuples

the tuples, as a Stream

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait ProductStream[X]
class Object
trait Matchable
class Any
Show all
case class Condition(subject: String, predicate: PredicateExpr) extends RuleLike

Condition: defines a leaf RuleLike instance.

Condition: defines a leaf RuleLike instance.

Value parameters

predicate

the predicate of this condition

subject

the subject of this condition

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait RuleLike
class Object
trait Matchable
class Any
Show all
case class Conjunction(fs: List[RuleLike]) extends RuleLike

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait RuleLike
class Object
trait Matchable
class Any
Show all
object CsvParser

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
CsvParser.type
case class CsvParser(delimiter: String = ..., quoteChar: String = ..., parseElem: String => Try[Scalar] = ...) extends CsvParserBase

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait JavaTokenParsers
trait RegexParsers
trait Parsers
class Object
trait Matchable
class Any
Show all
abstract class CsvParserBase(f: String => Try[Scalar]) extends JavaTokenParsers

Attributes

Supertypes
trait JavaTokenParsers
trait RegexParsers
trait Parsers
class Object
trait Matchable
class Any
Show all
Known subtypes
class CsvParser
case class Disjunction(ts: List[RuleLike]) extends RuleLike

Attributes

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

Separated from RuleParser by scalaprof on 7/8/16 at which time evaluate and asQuotedString added.

Separated from RuleParser by scalaprof on 7/8/16 at which time evaluate and asQuotedString added.

TODO Trait Expression which needs a better description

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class RuleParser.this.Expr
class RuleParser.this.ExprFactor
class RuleParser.this.Literal
class RuleParser.this.Number
class RuleParser.this.Variable
class RuleParser.this.ExprTerm
Show all
case class Header(columns: List[String], allowPartial: Boolean = ...)

Attributes

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

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
Ingest.type
class Ingest[T] extends Iterable[String] => Iterator[Try[T]]

Attributes

Companion
object
Supertypes
trait Iterable[String] => Iterator[Try[T]]
class Object
trait Matchable
class Any
trait Ingestible[X]

Attributes

Supertypes
class Object
trait Matchable
class Any
case class Parentheses(rule: RuleLike) extends RuleLike

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait RuleLike
class Object
trait Matchable
class Any
Show all
sealed trait PredicateExpr

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait ProductStream[X <: Product]

ProductStream is a monadic trait which provides a Stream of Tuples (tuples) and a Header (header). Thus it is well-suited for use as an ingest mechanism of CSV files.

ProductStream is a monadic trait which provides a Stream of Tuples (tuples) and a Header (header). Thus it is well-suited for use as an ingest mechanism of CSV files.

The polymorphic type X is a Tuple of some count. Please note that type inference is not able to infer this type from reading the file (which doesn't happen until runtime). Therefore, the caller must supply the type of X. Please see ProductStreamSpec for exemplars.

Please see inline method documentation for details of other methods.

Type parameters

X

the underlying type of this product stream: must be a sub-type of Product, that's to say, a Tuple or something similar

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class TupleStreamBase[X]
class CSV[X]
class TupleStream[X]
object ProductStream

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
abstract class ProductStreamBase[X <: Product] extends ProductStream[X]

Base class for implementers of ProductStream

Base class for implementers of ProductStream

Attributes

Supertypes
trait ProductStream[X]
class Object
trait Matchable
class Any
Known subtypes
class TupleStreamBase[X]
class CSV[X]
class TupleStream[X]
case class RangePredicateExpr(operand1: Expression, operand2: Expression) extends PredicateExpr

a predicate expression consisting of an two bounds

a predicate expression consisting of an two bounds

Value parameters

operand1

the lower bound

operand2

the upper bound

Attributes

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

Sealed trait RuleLike which describes the result of parsing a rule. In this context, a rule is defined by several different case classes, each defining a different method of combining rules together into a tree of rules. In general, a leaf rule is a Condition and is made up of two features: a subject and a predicate.

Sealed trait RuleLike which describes the result of parsing a rule. In this context, a rule is defined by several different case classes, each defining a different method of combining rules together into a tree of rules. In general, a leaf rule is a Condition and is made up of two features: a subject and a predicate.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Condition
class Conjunction
class Disjunction
class Parentheses
class TruthValue
class RuleParser extends JavaTokenParsers

RuleParser is a parser-combinator which parses rules. [Wow, that's a surprise!] Of course, it can also parse any of the constituents of a rule (expression, number, predicate, etc.).

RuleParser is a parser-combinator which parses rules. [Wow, that's a surprise!] Of course, it can also parse any of the constituents of a rule (expression, number, predicate, etc.).

A RuleLike is defined as a sealed trait which is extended by several different case classes, each defining a different method of combining rules together into a tree of rules. In general, a leaf rule is a Condition and is made up of two features: a subject and a predicate.

It's important to note that all aspects of these rules are String-based. There is absolutely no conversion to numeric types anywhere in this class.

The trait RuleLike has only one method: asRule which returns a Rule[String]

Created by scalaprof on 5/30/16.

Attributes

Companion
object
Supertypes
trait JavaTokenParsers
trait RegexParsers
trait Parsers
class Object
trait Matchable
class Any
Show all
object RuleParser

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
RuleParser.type
case class TruthValue(b: Boolean) extends RuleLike

Truth value: always or never true

Truth value: always or never true

Value parameters

b

the truth value

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait RuleLike
class Object
trait Matchable
class Any
Show all
object TupleStream

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class TupleStream[X <: Product](parser: CsvParser, input: Stream[String], givenHeader: Header, allowPartial: Boolean = ...) extends TupleStreamBase[X]

Case class which implements ProductStream where the header and tuples are specified indirectly, by providing a parser and Stream[String] such that the element types of the resulting tuples will be Strings.

Case class which implements ProductStream where the header and tuples are specified indirectly, by providing a parser and Stream[String] such that the element types of the resulting tuples will be Strings.

Type parameters

X

a Tuple which should correspond with the number of values (all types of the tuple should be String).

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class TupleStreamBase[X]
trait ProductStream[X]
class Object
trait Matchable
class Any
Show all
abstract class TupleStreamBase[X <: Product](parser: CsvParser, input: Stream[String]) extends ProductStreamBase[X]

Abstract class for ProductStream which additionally derives their header and tuples from parsing a Stream of Strings (one per row).

Abstract class for ProductStream which additionally derives their header and tuples from parsing a Stream of Strings (one per row).

Attributes

Supertypes
trait ProductStream[X]
class Object
trait Matchable
class Any
Known subtypes
class CSV[X]
class TupleStream[X]
object Valuable

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Valuable.type
trait Valuable[X] extends Orderable[X]

Type class Valuable. Perhaps the name "Arithmetical" would be better as this trait encompasses many arithmetic operators.

Type class Valuable. Perhaps the name "Arithmetical" would be better as this trait encompasses many arithmetic operators.

This combination of trait Valuable and implicit objects comprises the "type class" Valuable. It is loosely based on Numeric but has more method definitions and is therefore much more useful for parsing and evaluating expressions. In particular, it provides a fromString method which, to me, seems sorely lacking in Numeric. The reason that it does not extend Numeric is that most of the method result in a Try[X] rather than an X.

Created by scalaprof on 6/5/16.

CONSIDER move this into values package

Attributes

Companion
object
Supertypes
trait Orderable[X]
trait Ordering[X]
trait PartialOrdering[X]
trait Equiv[X]
trait Serializable
trait Comparator[X]
class Object
trait Matchable
class Any
Show all
Known subtypes
trait ValuableInt
object ValuableInt
trait ValuableLong
object ValuableLong
Show all