public static List < TupleValueExpression > getTupleValueExpressions ( AbstractExpression input ) { ArrayList < TupleValueExpression > tves = new ArrayList < TupleValueExpression > ( ) ; // recursive stopping steps if ( input == null ) { return tves ; } else if ( input instanceof TupleValueExpression ) { tves . add ( ( TupleValueExpression ) input ) ; return tves ; } // recursive calls tves . addAll ( getTupleValueExpressions ( input . m_left ) ) ; tves . addAll ( getTupleValueExpressions ( input . m_right ) ) ; if ( input . m_args != null ) { for ( AbstractExpression argument : input . m_args ) { tves . addAll ( getTupleValueExpressions ( argument ) ) ; } } return tves ; }
Recursively walk an expression and return a list of all the tuple value expressions it contains .