import { BodyBasedExpression } from '../Expression' ; import { OclExecutionContext } from '../../OclExecutionContext' ; oclExpression oclExample export class IndexOfExpression extends BodyBasedExpression { evaluate ( visitor , localVariables ? ) { const source = this . getSource ( ) . evaluate ( visitor , localVariables ) ; const indexOfString = this . getBody ( ) . evaluate ( visitor , localVariables ) ; return indexOfString . length === 0 ? 0 : source . indexOf ( indexOfString ) + 1 ; } }