import { Expression , ValueConverter , Conditional , AccessScope , AccessMember , AccessKeyed , CallMember , BindingBehavior , Binary , LiteralPrimitive , LiteralString } from 'aurelia-binding' ; export class ExpressionVisitor { public visitChain ( chain ) { this . visitArgs ( chain . expressions ) ; } public visitBindingBehavior ( behavior ) { behavior . expression . accept ( this ) ; this . visitArgs ( behavior . args ) ; } public visitValueConverter ( converter ) { converter . expression . accept ( this ) ; this . visitArgs ( converter . args ) ; } public visitAssign ( assign ) { assign . target . accept ( this ) ; assign . value . accept ( this ) ; } public visitConditional ( conditional ) { conditional . condition . accept ( this ) ; conditional . yes . accept ( this ) ; conditional . no . accept ( this ) ; } public visitAccessThis ( access ) { access . ancestor = access . ancestor ; } public visitAccessScope ( access ) { access . name = access . name ; } public visitAccessMember ( access ) { access . object . accept ( this ) ; } public visitAccessKeyed ( access ) { access . object . accept ( this ) ; access . key . accept ( this ) ; } public visitCallScope ( call ) { this . visitArgs ( call . args ) ; } public visitCallFunction ( call ) { call . func . accept ( this ) ; this . visitArgs ( call . args ) ; } public visitCallMember ( call ) { call . object . accept ( this ) ; this . visitArgs ( call . args ) ; } public visitPrefix ( prefix ) { prefix . expression . accept ( this ) ; } public visitBinary ( binary ) { binary . left . accept ( this ) ; binary . right . accept ( this ) ; } public visitLiteralPrimitive ( literal ) { literal . value = literal . value ; } public visitLiteralArray ( literal ) { this . visitArgs ( literal . elements ) ; } public visitLiteralObject ( literal ) { this . visitArgs ( literal . values ) ; } public visitLiteralString ( literal ) { literal . value = literal . value ; } private visitArgs ( args ) { for ( let i = 0 ; i < args . length ; i ++ ) { args [ i ] . accept ( this ) ; } } }