Constructor
new TranslatorVisitor()
Create a new TranslatorVisitor with number parsing utilities.
- Source:
Methods
_coerceToString(target) → {String}
Check if we got a complex back and take it to a string.
Some operations return a complex object but some operations throw away that information to
return to original string. This coerces to string.
Parameters:
| Name | Type | Description |
|---|---|---|
target |
Object | The value to coerce down to string. |
- Source:
Returns:
Forced to string.
- Type
- String
buildAirthmeticExpression(ctx, op) → {string}
Build an arithmetic expression.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
op |
string | The operator to use. |
- Source:
Returns:
The formatted arithmetic expression.
- Type
- string
buildDuring(minYear, maxYear) → {YearMatcher}
Build a YearMatcher for a duration.
Parameters:
| Name | Type | Description |
|---|---|---|
minYear |
ParsedYear | null | Start year or null for unbounded |
maxYear |
ParsedYear | null | End year or null for unbounded |
- Source:
Returns:
The year matcher object
- Type
- YearMatcher
visitAboutStanza(ctx) → {AboutStanza}
Visit an about stanza node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New about stanza instance.
- Type
- AboutStanza
visitAdditionExpression(ctx) → {string}
Visit an addition expression node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
The formatted addition expression.
- Type
- string
visitApplicationDef(ctx, isModification) → {Application}
Visit an application definition node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
isModification |
boolean | Whether this is a modification. |
- Source:
Returns:
New application instance.
- Type
- Application
visitApplicationMod(ctx, isModification) → {Application}
Visit an application modification node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
isModification |
boolean | Whether this is a modification. |
- Source:
Returns:
New application instance.
- Type
- Application
visitAssumeContinuedAllYears(ctx) → {AssumeCommand}
Visit an assume continued command for all years.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | Parse tree context. |
- Source:
Returns:
Assume command with mode, stream, and duration.
- Type
- AssumeCommand
visitAssumeContinuedDuration(ctx) → {AssumeCommand}
Visit an assume continued command with duration.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | Parse tree context. |
- Source:
Returns:
Assume command with mode, stream, and duration.
- Type
- AssumeCommand
visitAssumeNoAllYears(ctx) → {AssumeCommand}
Visit an assume no command for all years.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | Parse tree context. |
- Source:
Returns:
Assume command with mode, stream, and duration.
- Type
- AssumeCommand
visitAssumeNoDuration(ctx) → {AssumeCommand}
Visit an assume no command with duration.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | Parse tree context. |
- Source:
Returns:
Assume command with mode, stream, and duration.
- Type
- AssumeCommand
visitAssumeOnlyRechargeAllYears(ctx) → {AssumeCommand}
Visit an assume only recharge command for all years.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | Parse tree context. |
- Source:
Returns:
Assume command with mode, stream, and duration.
- Type
- AssumeCommand
visitAssumeOnlyRechargeDuration(ctx) → {AssumeCommand}
Visit an assume only recharge command with duration.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | Parse tree context. |
- Source:
Returns:
Assume command with mode, stream, and duration.
- Type
- AssumeCommand
visitBaseSimulation(ctx) → {SimulationScenario}
Visit a base simulation node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New simulation scenario instance.
- Type
- SimulationScenario
visitBaseSimulationTrials(ctx) → {IncompatibleCommand}
Visit a base simulation with trials node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
Incompatibility marker for simulate with trials.
- Type
- IncompatibleCommand
visitChangeAllYears(ctx) → {Command}
Visit a change command with all years duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New change command instance.
- Type
- Command
visitChangeDuration(ctx) → {Command}
Visit a change command with duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New change command instance.
- Type
- Command
visitConditionExpression(ctx) → {string}
Visit a condition expression node and format it.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
The formatted condition expression.
- Type
- string
visitConditionalExpression(ctx) → {string}
Visit a conditional expression node and format it.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
The formatted conditional expression.
- Type
- string
visitDefaultStanza(ctx) → {DefinitionalStanza}
Visit a default stanza node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New default stanza instance.
- Type
- DefinitionalStanza
visitDefineVarStatement(ctx) → {IncompatibleCommand}
Visit a define var statement (user-defined variable) node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
Incompatibility marker for define var.
- Type
- IncompatibleCommand
visitDrawNormalExpression(ctx) → {string}
Visit a normal distribution expression node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
The normal distribution expression text.
- Type
- string
visitDrawUniformExpression(ctx) → {string}
Visit a uniform distribution expression node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
The uniform distribution expression text.
- Type
- string
visitDuringAll(ctx) → {function}
Visit an "all years" duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
Function that returns null for unbounded.
- Type
- function
visitDuringRange(ctx) → {YearMatcher}
Visit a year range duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
Year matcher for range.
- Type
- YearMatcher
visitDuringSingleYear(ctx) → {YearMatcher}
Visit a single year duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
Year matcher for single year.
- Type
- YearMatcher
visitDuringStart(ctx) → {YearMatcher}
Visit a start year duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
Year matcher starting from engine start.
- Type
- YearMatcher
visitDuringWithMax(ctx) → {YearMatcher}
Visit a maximum year duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
Year matcher with max bound only.
- Type
- YearMatcher
visitDuringWithMin(ctx) → {YearMatcher}
Visit a minimum year duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
Year matcher with min bound only.
- Type
- YearMatcher
visitEnableAllYears(ctx) → {Command}
Visit an enable command with all years duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
Enable command.
- Type
- Command
visitEnableDuration(ctx) → {Command}
Visit an enable command with duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
Enable command.
- Type
- Command
visitEqualsAllYears(ctx) → {Command}
Visit an equals command with all years duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New equals command instance.
- Type
- Command
visitEqualsDuration(ctx) → {Command}
Visit an equals command with duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New equals command instance.
- Type
- Command
visitGetStream(ctx) → {string}
Visit a stream access expression node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
The stream access text.
- Type
- string
visitGetStreamConversion(ctx) → {string}
Visit a stream conversion expression node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
The stream conversion text.
- Type
- string
visitGetStreamIndirect(ctx) → {string}
Visit an indirect stream access expression node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
The indirect stream access text.
- Type
- string
visitGetStreamIndirectSubstanceAppUnits(ctx) → {string}
Visit a substance/application units stream access node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
The stream access text.
- Type
- string
visitGlobalStatement(ctx) → {*}
Visit a global statement node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
The result of visiting the child node.
- Type
- *
visitInitialChargeAllYears(ctx) → {Command}
Visit an initial charge command with all years duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New initial charge command instance.
- Type
- Command
visitInitialChargeDuration(ctx) → {Command}
Visit an initial charge command with duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New initial charge command instance.
- Type
- Command
visitLimitBoundExpression(ctx) → {string}
Visit a bounded limit expression node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
The bounded limit expression text.
- Type
- string
visitLimitCommandAllYears(ctx) → {LimitCommand}
Visit a limit command with all years duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New limit command instance.
- Type
- LimitCommand
visitLimitCommandDisplacingAllYears(ctx) → {LimitCommand}
Visit a limit command with displacement and all years duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New limit command instance.
- Type
- LimitCommand
visitLimitCommandDisplacingByUnitsAllYears(ctx) → {LimitCommand}
Visit a limit command with displacement by units and all years duration.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New limit command instance.
- Type
- LimitCommand
visitLimitCommandDisplacingByUnitsDuration(ctx) → {LimitCommand}
Visit a limit command with displacement by units and duration.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New limit command instance.
- Type
- LimitCommand
visitLimitCommandDisplacingByVolumeAllYears(ctx) → {LimitCommand}
Visit a limit command with displacement by volume and all years duration.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New limit command instance.
- Type
- LimitCommand
visitLimitCommandDisplacingByVolumeDuration(ctx) → {LimitCommand}
Visit a limit command with displacement by volume and duration.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New limit command instance.
- Type
- LimitCommand
visitLimitCommandDisplacingDuration(ctx) → {LimitCommand}
Visit a limit command with displacement and duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New limit command instance.
- Type
- LimitCommand
visitLimitCommandDuration(ctx) → {LimitCommand}
Visit a limit command with duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New limit command instance.
- Type
- LimitCommand
visitLimitMaxExpression(ctx) → {string}
Visit a maximum limit expression node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
The maximum limit expression text.
- Type
- string
visitLimitMinExpression(ctx) → {string}
Visit a minimum limit expression node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
The minimum limit expression text.
- Type
- string
visitLogicalExpression(ctx) → {string}
Visit a logical expression node and format it.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
The formatted logical expression.
- Type
- string
visitMultiplyExpression(ctx) → {string}
Visit a multiplication expression node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
The formatted multiplication expression.
- Type
- string
visitNumber(ctx) → {number}
Visit a number node and converts it to a numeric value.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
The parsed number value, accounting for sign.
- Type
- number
visitParenExpression(ctx) → {string}
Visit a parenthesized expression node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
The parenthesized expression text.
- Type
- string
visitPolicySim(ctx) → {SimulationScenario}
Visit a policy simulation node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New simulation scenario instance.
- Type
- SimulationScenario
visitPolicySimTrials(ctx) → {IncompatibleCommand}
Visit a policy simulation with trials node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
Incompatibility marker for simulate with trials.
- Type
- IncompatibleCommand
visitPolicyStanza(ctx) → {DefinitionalStanza}
Visit a policy stanza node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New policy stanza instance.
- Type
- DefinitionalStanza
visitPowExpression(ctx) → {string}
Visit a power expression node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
The formatted power expression.
- Type
- string
visitProgram(ctx) → {Program}
Visit a program node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New program instance.
- Type
- Program
visitRechargeAllYears(ctx) → {RechargeCommand}
Visit a recharge command with all years duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New recharge command instance.
- Type
- RechargeCommand
visitRechargeDuration(ctx) → {RechargeCommand}
Visit a recharge command with duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New recharge command instance.
- Type
- RechargeCommand
visitRecoverAllYears(ctx) → {Command}
Visit a recover command with all years duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New recover command instance.
- Type
- Command
visitRecoverDefaultInductionAllYears(ctx) → {RecycleCommand}
Visit a recover command with default induction and all years duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New recycle command with default induction.
- Type
- RecycleCommand
visitRecoverDefaultInductionDuration(ctx) → {RecycleCommand}
Visit a recover command with default induction and duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New recycle command with default induction and duration.
- Type
- RecycleCommand
visitRecoverDefaultInductionStageAllYears(ctx) → {RecycleCommand}
Visit a recover command with default induction, stage and all years duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New recycle command with default induction and stage.
- Type
- RecycleCommand
visitRecoverDefaultInductionStageDuration(ctx) → {RecycleCommand}
Visit a recover command with default induction, stage and duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New recycle command with default induction, stage and duration.
- Type
- RecycleCommand
visitRecoverDuration(ctx) → {Command}
Visit a recover command with duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New recover command instance.
- Type
- Command
visitRecoverInductionAllYears(ctx) → {RecycleCommand}
Visit a recover command with explicit induction and all years duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New recycle command with induction.
- Type
- RecycleCommand
visitRecoverInductionDuration(ctx) → {RecycleCommand}
Visit a recover command with explicit induction and duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New recycle command with induction and duration.
- Type
- RecycleCommand
visitRecoverInductionStageAllYears(ctx) → {RecycleCommand}
Visit a recover command with explicit induction, stage and all years duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New recycle command with induction and stage.
- Type
- RecycleCommand
visitRecoverInductionStageDuration(ctx) → {RecycleCommand}
Visit a recover command with explicit induction, stage and duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New recycle command with induction, stage and duration.
- Type
- RecycleCommand
visitRecoverStageAllYears(ctx) → {RecycleCommand}
Visit a recover command with stage and all years duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New recycle command with stage.
- Type
- RecycleCommand
visitRecoverStageDuration(ctx) → {RecycleCommand}
Visit a recover command with stage and duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New recycle command with stage and duration.
- Type
- RecycleCommand
visitRelativeUnit(ctx) → {string}
Visit a relative unit node and formats it with proper spacing.
Handles percent variants: %, % prior year, % current year, % current.
ANTLR's getText() concatenates tokens without spaces, so we reconstruct
the proper format here.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
The properly formatted relative unit string.
- Type
- string
visitReplaceAllYears(ctx) → {ReplaceCommand}
Visit a replace command with all years duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New replace command instance.
- Type
- ReplaceCommand
visitReplaceDuration(ctx) → {ReplaceCommand}
Visit a replace command with duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New replace command instance.
- Type
- ReplaceCommand
visitRetireAllYears(ctx) → {RetireCommand}
Visit a retire command with all years duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New retire command instance.
- Type
- RetireCommand
visitRetireDuration(ctx) → {RetireCommand}
Visit a retire command with duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New retire command instance.
- Type
- RetireCommand
visitSetAllYears(ctx) → {Command}
Visit a set command with all years duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New set command instance.
- Type
- Command
visitSetDuration(ctx) → {Command}
Visit a set command with duration node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New set command instance.
- Type
- Command
visitSimpleExpression(ctx) → {*}
Visit a simple expression node and processes its single child.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
The result of visiting the child expression.
- Type
- *
visitSimpleIdentifier(ctx) → {string}
Visit a simple identifier node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
The identifier text.
- Type
- string
visitSimulationsStanza(ctx) → {SimulationStanza}
Visit a simulations stanza node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
New simulations stanza instance.
- Type
- SimulationStanza
visitString(ctx) → {string}
Visit a string node and removes surrounding quotes.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
The string value without quotes.
- Type
- string
visitSubstanceDef(ctx, isModification) → {Substance}
Visit a substance definition node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
isModification |
boolean | Whether this is a modification. |
- Source:
Returns:
New substance instance.
- Type
- Substance
visitSubstanceMod(ctx, isModification) → {Substance}
Visit a substance modification node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
isModification |
boolean | Whether this is a modification. |
- Source:
Returns:
New substance instance.
- Type
- Substance
visitSubstanceStatement(ctx) → {*}
Visit a substance statement node.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
The result of visiting the child node.
- Type
- *
visitTemporalUnit(ctx) → {string}
Visit a temporal unit node and returns its text.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
The temporal unit string (year, years, etc.).
- Type
- string
visitUnit(ctx) → {string}
Visit a unit node and formats it by delegating to the appropriate child visitor.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
The formatted unit string.
- Type
- string
visitUnitOrRatio(ctx) → {string}
Visit a unit or ratio node and formats it appropriately.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
The formatted unit or ratio string.
- Type
- string
visitUnitValue(ctx) → {EngineNumber}
Visit a unit value node and creates an EngineNumber.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
The value with its associated units.
- Type
- EngineNumber
visitVolumeUnit(ctx) → {string}
Visit a volume unit node and returns its text.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Object | The parse tree node context. |
- Source:
Returns:
The volume unit string (kg, mt, etc.).
- Type
- string