private Context translateSingleAssignment ( WyilFile . LVal lval , Expr rval , Context context ) { // FIXME: this method is a bit of a kludge. It would be nicer, // eventually, to have all right-hand side expression represented in // WyTP directly. This could potentially be done by including an update // operation in WyTP ... ? switch ( lval . getOpcode ( ) ) { case WyilFile . EXPR_arrayaccess : case WyilFile . EXPR_arrayborrow : return translateArrayAssign ( ( WyilFile . Expr . ArrayAccess ) lval , rval , context ) ; case WyilFile . EXPR_dereference : return translateDereference ( ( WyilFile . Expr . Dereference ) lval , rval , context ) ; case WyilFile . EXPR_recordaccess : case WyilFile . EXPR_recordborrow : return translateRecordAssign ( ( WyilFile . Expr . RecordAccess ) lval , rval , context ) ; case WyilFile . EXPR_variablemove : case WyilFile . EXPR_variablecopy : return translateVariableAssign ( ( WyilFile . Expr . VariableAccess ) lval , rval , context ) ; default : throw new SyntacticException ( "unknown lval encountered (" + lval + ")" , context . getEnclosingFile ( ) . getEntry ( ) , lval ) ; } }
Translate an individual assignment from one rval to exactly one lval .