protected static OpSymbol checkAndResolveToFixity ( CandidateOpSymbol candidate , OpSymbol . Fixity ... fixities ) throws SourceCodeException { OpSymbol result = null ; for ( OpSymbol . Fixity fixity : fixities ) { result = candidate . getPossibleOperators ( ) . get ( fixity ) ; if ( result != null ) { break ; } } if ( result == null ) { throw new SourceCodeException ( "Operator " + candidate + " must be one of " + Arrays . toString ( fixities ) + ", but does not have the required form." , null , null , null , candidate . getSourceCodePosition ( ) ) ; } return result ; }
Checks if a candidate operator symbol can have one of the specified fixities and resolve it to an oeprator with that fixity if so . If it cannot be resolved an exception is raised .