Winter Cardinal UI - v0.442.0 / DScalarExpression

Class: DScalarExpression

Parser and evaluator of the scalar expressions like 100% - 50s.

Literals

Operators

Functions

Examples

Implements

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new DScalarExpression(expression): DScalarExpression

Parameters

Name Type
expression string

Returns

DScalarExpression

Defined in

src/main/typescript/wcardinal/ui/d-scalar-expression.ts:168

Properties

_node

Protected _node: DScalarExpressionNode

Defined in

src/main/typescript/wcardinal/ui/d-scalar-expression.ts:166


TOKEN_REGEX

Static Protected TOKEN_REGEX: RegExp

Defined in

src/main/typescript/wcardinal/ui/d-scalar-expression.ts:165

Methods

calculate

calculate(parent, self, padding, current): number

Calculates a scalar value.

Parameters

Name Type Description
parent number a parent value
self number a self value
padding number a padding value
current number a current value

Returns

number

a calculated scalar value

Implementation of

DScalar.calculate

Defined in

src/main/typescript/wcardinal/ui/d-scalar-expression.ts:530


evaluate

evaluate(node, parent, self, padding, current): number

Parameters

Name Type
node DScalarExpressionNode
parent number
self number
padding number
current number

Returns

number

Defined in

src/main/typescript/wcardinal/ui/d-scalar-expression.ts:445


toArithmetic

toArithmetic(nodes, operatorA, operatorB): void

Parameters

Name Type
nodes DScalarExpressionNodeOrToken[]
operatorA DScalarExpressionNodeArithmeticOperator
operatorB DScalarExpressionNodeArithmeticOperator

Returns

void

Defined in

src/main/typescript/wcardinal/ui/d-scalar-expression.ts:344


toArithmeticNode

toArithmeticNode(node, operatorA, operatorB): void

Parameters

Name Type
node DScalarExpressionNodeOrToken
operatorA DScalarExpressionNodeArithmeticOperator
operatorB DScalarExpressionNodeArithmeticOperator

Returns

void

Defined in

src/main/typescript/wcardinal/ui/d-scalar-expression.ts:315


toComma

toComma(nodes, ifrom, ito): DScalarExpressionNodeOrToken[]

Parameters

Name Type
nodes DScalarExpressionNodeOrToken[]
ifrom number
ito number

Returns

DScalarExpressionNodeOrToken[]

Defined in

src/main/typescript/wcardinal/ui/d-scalar-expression.ts:240


toCommaOf

toCommaOf(nodes, ifrom, ito): DScalarExpressionNodeOrToken

Parameters

Name Type
nodes DScalarExpressionNodeOrToken[]
ifrom number
ito number

Returns

DScalarExpressionNodeOrToken

Defined in

src/main/typescript/wcardinal/ui/d-scalar-expression.ts:221


toParensesis

toParensesis(nodes, ifrom): number

Parameters

Name Type
nodes DScalarExpressionNodeOrToken[]
ifrom number

Returns

number

Defined in

src/main/typescript/wcardinal/ui/d-scalar-expression.ts:187


toToken

toToken(expression): DScalarExpressionToken[]

Parameters

Name Type
expression string

Returns

DScalarExpressionToken[]

Defined in

src/main/typescript/wcardinal/ui/d-scalar-expression.ts:373


toTokenLiteral

toTokenLiteral(token): null | DScalarExpressionNodeTypeLiteral

Parameters

Name Type
token string

Returns

null | DScalarExpressionNodeTypeLiteral

Defined in

src/main/typescript/wcardinal/ui/d-scalar-expression.ts:428


toTokenOperator

toTokenOperator(token): null | DScalarExpressionNodeTypeOperator

Parameters

Name Type
token string

Returns

null | DScalarExpressionNodeTypeOperator

Defined in

src/main/typescript/wcardinal/ui/d-scalar-expression.ts:404


toUnary

toUnary(nodes): void

Parameters

Name Type
nodes DScalarExpressionNodeOrToken[]

Returns

void

Defined in

src/main/typescript/wcardinal/ui/d-scalar-expression.ts:281


toUnaryNode

toUnaryNode(node): void

Parameters

Name Type
node DScalarExpressionNodeOrToken

Returns

void

Defined in

src/main/typescript/wcardinal/ui/d-scalar-expression.ts:269