import { OclExecutionContext } from '../OclExecutionContext' ; import { Expression } from './Expression' ; oclSpecification oclExample export class InvariantExpression extends Expression { private readonly name : string ; private readonly definition : Expression ; constructor ( oclExpression , name ) { super ( ) ; this . name = name || 'anonymous' ; this . definition = oclExpression ; } getName ( ) { return this . name ; } getDefinition ( ) { return this . definition ; } evaluate ( visitor , localVariables ? ) { const evaluationResult = this . getDefinition ( ) . evaluate ( visitor , localVariables ) ; return evaluationResult === true ; } }