private WyilFile . Expr . VariableAccess extractAssignedVariable ( WyilFile . LVal lval ) { // switch ( lval . getOpcode ( ) ) { case WyilFile . EXPR_arrayaccess : case WyilFile . EXPR_arrayborrow : Expr . ArrayAccess ae = ( Expr . ArrayAccess ) lval ; return extractAssignedVariable ( ( LVal ) ae . getSource ( ) ) ; case WyilFile . EXPR_dereference : return null ; case WyilFile . EXPR_recordaccess : case WyilFile . EXPR_recordborrow : Expr . RecordAccess ar = ( Expr . RecordAccess ) lval ; return extractAssignedVariable ( ( LVal ) ar . getSource ( ) ) ; case WyilFile . EXPR_variablemove : case WyilFile . EXPR_variablecopy : return ( WyilFile . Expr . VariableAccess ) lval ; default : throw new SyntacticException ( "unknown lval encountered (" + lval + ")" , ( ( WyilFile ) lval . getHeap ( ) ) . getEntry ( ) , lval ) ; } }
Determine the variable at the root of a given sequence of assignments or return null if there is no statically determinable variable .