Winter Cardinal UI - v0.457.0 / DScalarExpression
Parser and evaluator of the scalar expressions like 100% - 50s.
Literals
Operators
+-*/( and )Functions
Examples
90%: 0.9 * parent value50s: 0.5 * self value90% - 50s: 0.9 * parent value - 0.5 * self value90% - (50s + 100) * 2: 0.9 * parent value - ( 0.5 * self value + 100 ) * 2• new DScalarExpression(expression): DScalarExpression
| Name | Type |
|---|---|
expression |
string |
src/main/typescript/wcardinal/ui/d-scalar-expression.ts:168
• Protected _node: DScalarExpressionNode
src/main/typescript/wcardinal/ui/d-scalar-expression.ts:166
▪ Static Protected TOKEN_REGEX: RegExp
src/main/typescript/wcardinal/ui/d-scalar-expression.ts:165
▸ calculate(parent, self, padding, current): number
Calculates a scalar value.
| Name | Type | Description |
|---|---|---|
parent |
number |
a parent value |
self |
number |
a self value |
padding |
number |
a padding value |
current |
number |
a current value |
number
a calculated scalar value
src/main/typescript/wcardinal/ui/d-scalar-expression.ts:530
▸ evaluate(node, parent, self, padding, current): number
| Name | Type |
|---|---|
node |
DScalarExpressionNode |
parent |
number |
self |
number |
padding |
number |
current |
number |
number
src/main/typescript/wcardinal/ui/d-scalar-expression.ts:445
▸ toArithmetic(nodes, operatorA, operatorB): void
| Name | Type |
|---|---|
nodes |
DScalarExpressionNodeOrToken[] |
operatorA |
DScalarExpressionNodeArithmeticOperator |
operatorB |
DScalarExpressionNodeArithmeticOperator |
void
src/main/typescript/wcardinal/ui/d-scalar-expression.ts:344
▸ toArithmeticNode(node, operatorA, operatorB): void
| Name | Type |
|---|---|
node |
DScalarExpressionNodeOrToken |
operatorA |
DScalarExpressionNodeArithmeticOperator |
operatorB |
DScalarExpressionNodeArithmeticOperator |
void
src/main/typescript/wcardinal/ui/d-scalar-expression.ts:315
▸ toComma(nodes, ifrom, ito): DScalarExpressionNodeOrToken[]
| Name | Type |
|---|---|
nodes |
DScalarExpressionNodeOrToken[] |
ifrom |
number |
ito |
number |
DScalarExpressionNodeOrToken[]
src/main/typescript/wcardinal/ui/d-scalar-expression.ts:240
▸ toCommaOf(nodes, ifrom, ito): DScalarExpressionNodeOrToken
| Name | Type |
|---|---|
nodes |
DScalarExpressionNodeOrToken[] |
ifrom |
number |
ito |
number |
src/main/typescript/wcardinal/ui/d-scalar-expression.ts:221
▸ toParensesis(nodes, ifrom): number
| Name | Type |
|---|---|
nodes |
DScalarExpressionNodeOrToken[] |
ifrom |
number |
number
src/main/typescript/wcardinal/ui/d-scalar-expression.ts:187
▸ toToken(expression): DScalarExpressionToken[]
| Name | Type |
|---|---|
expression |
string |
src/main/typescript/wcardinal/ui/d-scalar-expression.ts:373
▸ toTokenLiteral(token): null | DScalarExpressionNodeTypeLiteral
| Name | Type |
|---|---|
token |
string |
null | DScalarExpressionNodeTypeLiteral
src/main/typescript/wcardinal/ui/d-scalar-expression.ts:428
▸ toTokenOperator(token): null | DScalarExpressionNodeTypeOperator
| Name | Type |
|---|---|
token |
string |
null | DScalarExpressionNodeTypeOperator
src/main/typescript/wcardinal/ui/d-scalar-expression.ts:404
▸ toUnary(nodes): void
| Name | Type |
|---|---|
nodes |
DScalarExpressionNodeOrToken[] |
void
src/main/typescript/wcardinal/ui/d-scalar-expression.ts:281
▸ toUnaryNode(node): void
| Name | Type |
|---|---|
node |
DScalarExpressionNodeOrToken |
void