import { SourceBasedExpression } from '../Expression' ; import { OclExecutionContext } from '../../OclExecutionContext' ; oclExpression oclExample export class SizeExpression extends SourceBasedExpression { evaluate ( visitor , localVariables ? ) { const source = this . getSource ( ) . evaluate ( visitor , localVariables ) ; if ( source && ( source instanceof Array || typeof source === 'string' ) ) { return source . length ; } else { return 0 ; } } }