import { OclExecutionContext } from '../OclExecutionContext' ; import { Expression } from './Expression' ; import { VariableDeclarationExpression } from './VariableDeclarationExpression' ; oclSpecification oclExample export class LetExpression extends Expression { constructor ( private variableDeclarationExpressions , private inContextDef ) { super ( ) ; } evaluate ( visitor , localVariables ? ) { const variableExpression = this . variableDeclarationExpressions [ 0 ] ; const variables = { [ variableExpression . getVariableName ( ) ] : variableExpression . evaluate ( visitor ) } ; return this . inContextDef . evaluate ( visitor , { ... localVariables , ... variables } ) ; } }