private OpArgNode generateOpArg(SymbolNode targetSymbol,TreeNode opArgSyntaxNode,ModuleNode mn) throws AbortException {
  if (opArgSyntaxNode.isKind(N_Lambda)) {
    return new OpArgNode(generateLambda(opArgSyntaxNode,mn),opArgSyntaxNode,mn);
  }
  ;
  if (!(opArgSyntaxNode.isKind(N_GeneralId) || opArgSyntaxNode.isKind(N_GenInfixOp) || opArgSyntaxNode.isKind(N_GenPrefixOp)|| opArgSyntaxNode.isKind(N_GenNonExpPrefixOp)|| opArgSyntaxNode.isKind(N_GenPostfixOp))) {
    errors.addError(opArgSyntaxNode.getLocation(),"Arity " + targetSymbol.getArity() + " operator (not an expression) is expected"+ " \nto substitute for CONSTANT '"+ targetSymbol.getName()+ "'.");
    return nullOpArg;
  }
  if (opArgSyntaxNode.getKind() == N_GeneralId) {
    if (targetSymbol.getArity() <= 0) {
      errors.addAbort(opArgSyntaxNode.getLocation(),"Internal error: expected to find arity > 0.",true);
    }
    ;
    LevelNode ln=selectorToNode(genIdToSelector((SyntaxTreeNode)opArgSyntaxNode),targetSymbol.getArity(),false,false,mn);
    if (!(ln instanceof OpArgNode)) {
      if (errors.getNumErrors() > 0) {
        return nullOpArg;
      }
      errors.addAbort(opArgSyntaxNode.getLocation(),"Internal error: " + "Expected an operator argument but " + "found something else.");
    }
    ;
    return (OpArgNode)ln;
  }
  ;
  GenID genID=generateGenID(opArgSyntaxNode,mn);
  if (genID.getFullyQualifiedOp() != null && genID.getArgs().length == 0) {
    return new OpArgNode(genID.getFullyQualifiedOp(),opArgSyntaxNode,mn);
  }
 else   if (genID.getArgs().length > 0) {
    errors.addError(opArgSyntaxNode.getLocation(),"Arity " + targetSymbol.getArity() + " operator (not an expression) is expected"+ " to substitute for CONSTANT '"+ targetSymbol.getName()+ "'.");
    return nullOpArg;
  }
 else {
    return nullOpArg;
  }
}

private OpArgNode generateOpArg ( SymbolNode targetSymbol , TreeNode opArgSyntaxNode , ModuleNode mn ) throws AbortException { if ( opArgSyntaxNode . isKind ( N_Lambda ) ) { return new OpArgNode ( generateLambda ( opArgSyntaxNode , mn ) , opArgSyntaxNode , mn ) ; } ; if ( ! ( opArgSyntaxNode . isKind ( N_GeneralId ) || opArgSyntaxNode . isKind ( N_GenInfixOp ) || opArgSyntaxNode . isKind ( N_GenPrefixOp ) || opArgSyntaxNode . isKind ( N_GenNonExpPrefixOp ) || opArgSyntaxNode . isKind ( N_GenPostfixOp ) ) ) { errors . addError ( opArgSyntaxNode . getLocation ( ) , "Arity " + targetSymbol . getArity ( ) + " operator (not an expression) is expected" + " \nto substitute for CONSTANT '" + targetSymbol . getName ( ) + "'." ) ; return nullOpArg ; } if ( opArgSyntaxNode . getKind ( ) == N_GeneralId ) { if ( targetSymbol . getArity ( ) <= 0 ) { errors . addAbort ( opArgSyntaxNode . getLocation ( ) , "Internal error: expected to find arity > 0." , true ) ; } ; LevelNode ln = selectorToNode ( genIdToSelector ( ( SyntaxTreeNode ) opArgSyntaxNode ) , targetSymbol . getArity ( ) , false , false , mn ) ; if ( ! ( ln instanceof OpArgNode ) ) { if ( errors . getNumErrors ( ) > 0 ) { return nullOpArg ; } errors . addAbort ( opArgSyntaxNode . getLocation ( ) , "Internal error: " + "Expected an operator argument but " + "found something else." ) ; } ; return ( OpArgNode ) ln ; } ; GenID genID = generateGenID ( opArgSyntaxNode , mn ) ; if ( genID . getFullyQualifiedOp ( ) != null && genID . getArgs ( ) . length == 0 ) { return new OpArgNode ( genID . getFullyQualifiedOp ( ) , opArgSyntaxNode , mn ) ; } else if ( genID . getArgs ( ) . length > 0 ) { errors . addError ( opArgSyntaxNode . getLocation ( ) , "Arity " + targetSymbol . getArity ( ) + " operator (not an expression) is expected" + " to substitute for CONSTANT '" + targetSymbol . getName ( ) + "'." ) ; return nullOpArg ; } else { return nullOpArg ; } }
return an opargnode constructed from a generalid tree to be used in the rhs of a substitution
