Package-level declarations

Contains all the classes and logic used for parsing and evaluating an expression

Types

Link copied to clipboard
interface AstMember

Interface used to declare the members of the AstTree

Link copied to clipboard
class AstTree(tks: ComplexList, numbers: List<ComplexNumber>)

This class is made to modify, store, return and Parse values provided by the ComplexLexer.complexLexer method, it has an only main and public method that will return a parsed token list to a Tree of AstMember instances

Link copied to clipboard
data class BinaryExpression(val type: AstTypes = AstTypes.BINARY_OPERATOR, val value: Operation) : AstMember

Binary Expression type of the kind AstMember

Link copied to clipboard
class Evaluator(input: AstMember)

This class represents the very last step in the parsing process, it receives in its constructor an AstMember Tree, and it evaluates it its only public main method.

Link copied to clipboard
data class Function(val function: (ComplexNumber) -> ComplexNumber, val inside: AstMember)

Function class that holds the information of a FunctionExpression

Link copied to clipboard
data class FunctionExpression(val type: AstTypes = AstTypes.FUNCTION, val value: Function) : AstMember

Function Expression type of the kind AstMember

Link copied to clipboard
data class NumericLiteral(val type: AstTypes = AstTypes.NUMERIC_LITERAL, val value: ComplexNumber) : AstMember

Numeric Literal type of the kind AstMember

Link copied to clipboard
data class Operation(val leftHandSide: AstMember, val operator: Operator, val rightHandSide: AstMember)

Operation class that holds the information of a BinaryExpression