import { OclExecutionContext } from '../OclExecutionContext' ; export abstract class Expression { private readonly type : string ; constructor ( ) { this . type = this . constructor . name ; } accept ( obj ? ) { return true ; } abstract evaluate ( visitor , localVariables ? ) ; } export abstract class SourceBasedExpression extends Expression { private readonly source : any ; constructor ( source ) { super ( ) ; this . source = source ; } getSource ( ) { return this . source ; } } export abstract class BodyBasedExpression extends SourceBasedExpression { private body : Expression ; setBody ( body ) { this . body = body ; } getBody ( ) { return this . body ; } _evaluateBodyAndSource ( visitor , localVariables ? ) { const body = this . getSource ( ) . evaluate ( visitor , localVariables ) ; const source = this . getBody ( ) . evaluate ( visitor , localVariables ) ; return { source , body } ; } } export abstract class IteratorExpression extends BodyBasedExpression { private iterators : Array < any > ; setIterators ( iterators ) { this . iterators = iterators ; } getIterators ( ) { return this . iterators ; } }