/*
Unary
For '-' '!' 'not' 'empty', then Value
480939
final public void Unary() throws ParseException {
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case MINUS:
      jj_consume_token(MINUS);
                  AstNegative jjtn001 = new AstNegative(JJTNEGATIVE);
                  boolean jjtc001 = true;
                  jjtree.openNodeScope(jjtn001);
      try {
        Unary();
      } catch (Throwable jjte001) {
                  if (jjtc001) {
                    jjtree.clearNodeScope(jjtn001);
                    jjtc001 = false;
                  } else {
                    jjtree.popNode();
                  }
                  if (jjte001 instanceof RuntimeException) {
                    {if (true) throw (RuntimeException)jjte001;}
                  }
                  if (jjte001 instanceof ParseException) {
                    {if (true) throw (ParseException)jjte001;}
                  }
                  {if (true) throw (Error)jjte001;}
      } finally {
                  if (jjtc001) {
                    jjtree.closeNodeScope(jjtn001, true);
                  }
      }
      break;
    case NOT0:
    case NOT1:
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case NOT0:
        jj_consume_token(NOT0);
        break;
      case NOT1:
        jj_consume_token(NOT1);
        break;
      default:
        jj_la1[31] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
                          AstNot jjtn002 = new AstNot(JJTNOT);
                          boolean jjtc002 = true;
                          jjtree.openNodeScope(jjtn002);
      try {
        Unary();
      } catch (Throwable jjte002) {
                          if (jjtc002) {
                            jjtree.clearNodeScope(jjtn002);
                            jjtc002 = false;
                          } else {
                            jjtree.popNode();
                          }
                          if (jjte002 instanceof RuntimeException) {
                            {if (true) throw (RuntimeException)jjte002;}
                          }
                          if (jjte002 instanceof ParseException) {
                            {if (true) throw (ParseException)jjte002;}
                          }
                          {if (true) throw (Error)jjte002;}
      } finally {
                          if (jjtc002) {
                            jjtree.closeNodeScope(jjtn002, true);
                          }
      }
      break;
    case EMPTY:
      jj_consume_token(EMPTY);
                  AstEmpty jjtn003 = new AstEmpty(JJTEMPTY);
                  boolean jjtc003 = true;
                  jjtree.openNodeScope(jjtn003);
      try {
        Unary();
      } catch (Throwable jjte003) {
                  if (jjtc003) {
                    jjtree.clearNodeScope(jjtn003);
                    jjtc003 = false;
                  } else {
                    jjtree.popNode();
                  }
                  if (jjte003 instanceof RuntimeException) {
                    {if (true) throw (RuntimeException)jjte003;}
                  }
                  if (jjte003 instanceof ParseException) {
                    {if (true) throw (ParseException)jjte003;}
                  }
                  {if (true) throw (Error)jjte003;}
      } finally {
                  if (jjtc003) {
                    jjtree.closeNodeScope(jjtn003, true);
                  }
      }
      break;
    case START_SET_OR_MAP:
    case INTEGER_LITERAL:
    case FLOATING_POINT_LITERAL:
    case STRING_LITERAL:
    case TRUE:
    case FALSE:
    case NULL:
    case LPAREN:
    case LBRACK:
    case IDENTIFIER:
      Value();
      break;
    default:
      jj_la1[32] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
  }
731857
private UnaryExpression resolveUnary(FunctionRef fun) {
        UnaryExpression operator = null;
        try {
            Class clazz = Class.forName("org.hl7.elm.r1." + fun.getName());
            if (UnaryExpression.class.isAssignableFrom(clazz)) {
                operator = (UnaryExpression) clazz.newInstance();
                checkNumberOfOperands(fun, 1);
                operator.setOperand(fun.getOperand().get(0));
                builder.resolveUnaryCall("System", fun.getName(), operator);
                return operator;
            }
        } catch (Exception e) {
            // Do nothing but fall through
        }
        return null;
    }
360248
def p_expression_unand(self, p):
        ''
        p[0] = Unand(p[2], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
1264674
private static String negate(String conditionTemplate) {
    if (conditionTemplate.startsWith("!")
        && !BOOLEAN_BINARY_OPERATOR.matcher(conditionTemplate).find()) {
      return conditionTemplate.substring(1);
    } else if (ANY_OPERATOR.matcher(conditionTemplate).find()) {
      // The condition might already enclosed in a bracket, but we can't simply check for opening
      // and closing brackets at the start and end of the string, as that misses cases like
      // (a || b) && (c || d). Attempting to determine if the initial and closing bracket are paired
      // requires understanding character constants and strings constants, so for simplicity we
      // just add unnecessary brackets.
      return "!(" + conditionTemplate + ")";
    } else {
      return "!" + conditionTemplate;
    }
  }
1234405
function standardizeInput(input) {
  if ([undefined, null].indexOf(input) !== -1) {
    input = null;
  }
  else if (_.isNaN(input)) {
    input = null;
  }
  else if (_.isString(input)) {
    input = input.trim();

    // Written empty values
    if (["unspecified", "unknown", "none", "null", "empty", ""].indexOf(input.toLowerCase()) !== -1) {
      input = null;
    }
  }

  return input;
}
725573
private static String checkNotEmpty(String v, String name) {
    Preconditions.checkNotNull(v, name);
    Preconditions.checkArgument(!v.isEmpty(), "%s cannot be empty", name);
    return v;
  }
184218
protected static String verifyNonEmpty(String value, String argName) {
        if (value != null) {
            value = value.trim();
            if (value.isEmpty()) {
                value = null;
            }
        }
        if (value == null) {
            throw new IllegalArgumentException(argName);
        }
        return value;
    }
1166060
public final void unaryExpressionNotPlusMinus() throws RecognitionException {
		int unaryExpressionNotPlusMinus_StartIndex = input.index();

		try {
			if ( state.backtracking>0 && alreadyParsedRule(input, 125) ) { return; }

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1204:5: ( '~' unaryExpression | '!' unaryExpression | castExpression | primary ( selector )* ( '++' | '--' )? )
			int alt159=4;
			switch ( input.LA(1) ) {
			case 126:
				{
				alt159=1;
				}
				break;
			case 29:
				{
				alt159=2;
				}
				break;
			case 36:
				{
				switch ( input.LA(2) ) {
				case 65:
				case 67:
				case 71:
				case 77:
				case 85:
				case 92:
				case 94:
				case 105:
					{
					int LA159_20 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case Identifier:
					{
					int LA159_21 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case 40:
					{
					int LA159_22 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case 44:
					{
					int LA159_23 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case 41:
					{
					int LA159_24 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case 45:
					{
					int LA159_25 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case 126:
					{
					int LA159_26 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case 29:
					{
					int LA159_27 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case 36:
					{
					int LA159_28 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case 53:
					{
					int LA159_29 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case 111:
					{
					int LA159_30 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case 108:
					{
					int LA159_31 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case 80:
					{
					int LA159_32 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case 79:
					{
					int LA159_33 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case 70:
					{
					int LA159_34 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case DecimalLiteral:
				case HexLiteral:
				case OctalLiteral:
					{
					int LA159_35 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case FloatingPointLiteral:
					{
					int LA159_36 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case CharacterLiteral:
					{
					int LA159_37 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case StringLiteral:
					{
					int LA159_38 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case 82:
				case 115:
					{
					int LA159_39 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case 98:
					{
					int LA159_40 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case 97:
					{
					int LA159_41 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				case 118:
					{
					int LA159_42 = input.LA(3);
					if ( (synpred240_Java()) ) {
						alt159=3;
					}
					else if ( (true) ) {
						alt159=4;
					}

					}
					break;
				default:
					if (state.backtracking>0) {state.failed=true; return;}
					int nvaeMark = input.mark();
					try {
						input.consume();
						NoViableAltException nvae =
							new NoViableAltException("", 159, 3, input);
						throw nvae;
					} finally {
						input.rewind(nvaeMark);
					}
				}
				}
				break;
			case CharacterLiteral:
			case DecimalLiteral:
			case FloatingPointLiteral:
			case HexLiteral:
			case Identifier:
			case OctalLiteral:
			case StringLiteral:
			case 53:
			case 65:
			case 67:
			case 70:
			case 71:
			case 77:
			case 79:
			case 80:
			case 82:
			case 85:
			case 92:
			case 94:
			case 97:
			case 98:
			case 105:
			case 108:
			case 111:
			case 115:
			case 118:
				{
				alt159=4;
				}
				break;
			default:
				if (state.backtracking>0) {state.failed=true; return;}
				NoViableAltException nvae =
					new NoViableAltException("", 159, 0, input);
				throw nvae;
			}
			switch (alt159) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1204:9: '~' unaryExpression
					{
					match(input,126,FOLLOW_126_in_unaryExpressionNotPlusMinus5549); if (state.failed) return;
					pushFollow(FOLLOW_unaryExpression_in_unaryExpressionNotPlusMinus5551);
					unaryExpression();
					state._fsp--;
					if (state.failed) return;
					}
					break;
				case 2 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1205:8: '!' unaryExpression
					{
					match(input,29,FOLLOW_29_in_unaryExpressionNotPlusMinus5560); if (state.failed) return;
					pushFollow(FOLLOW_unaryExpression_in_unaryExpressionNotPlusMinus5562);
					unaryExpression();
					state._fsp--;
					if (state.failed) return;
					}
					break;
				case 3 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1206:9: castExpression
					{
					pushFollow(FOLLOW_castExpression_in_unaryExpressionNotPlusMinus5572);
					castExpression();
					state._fsp--;
					if (state.failed) return;
					}
					break;
				case 4 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1207:9: primary ( selector )* ( '++' | '--' )?
					{
					pushFollow(FOLLOW_primary_in_unaryExpressionNotPlusMinus5582);
					primary();
					state._fsp--;
					if (state.failed) return;
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1207:17: ( selector )*
					loop157:
					while (true) {
						int alt157=2;
						int LA157_0 = input.LA(1);
						if ( (LA157_0==47||LA157_0==59) ) {
							alt157=1;
						}

						switch (alt157) {
						case 1 :
							// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1207:17: selector
							{
							pushFollow(FOLLOW_selector_in_unaryExpressionNotPlusMinus5584);
							selector();
							state._fsp--;
							if (state.failed) return;
							}
							break;

						default :
							break loop157;
						}
					}

					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1207:27: ( '++' | '--' )?
					int alt158=2;
					int LA158_0 = input.LA(1);
					if ( (LA158_0==41||LA158_0==45) ) {
						alt158=1;
					}
					switch (alt158) {
						case 1 :
							// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:
							{
							if ( input.LA(1)==41||input.LA(1)==45 ) {
								input.consume();
								state.errorRecovery=false;
								state.failed=false;
							}
							else {
								if (state.backtracking>0) {state.failed=true; return;}
								MismatchedSetException mse = new MismatchedSetException(null,input);
								throw mse;
							}
							}
							break;

					}

					}
					break;

			}
		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			if ( state.backtracking>0 ) { memoize(input, 125, unaryExpressionNotPlusMinus_StartIndex); }

		}
	}
674840
function(v) {
		return _.isNil(v) || (_.isString(v) && _.isEmpty(v));
	}
443231
function isDoubleLogicalNegating(node) {
		return node.operator === "!" &&
			node.argument.type === "UnaryExpression" &&
			node.argument.operator === "!";
	}
362641
private Expression compileUnary(UnaryOperation unary, int opPos)
          throws TransformerException
  {

    int rightPos = getFirstChildPos(opPos);

    unary.setRight(compile(rightPos));

    return unary;
  }
613037
public static Short checkNull(Short value, Short elseValue) {
        return isNull(value) ? elseValue : value;
    }
743914
def _check_not_empty(string):
    
    string = string.strip()

    if len(string) == 0:
        message = 'The string should not be empty'
        raise pp.ParseException(message)
4384
function isEmpty (value) {
  return value === undefined ||
    (typeof value === "object" && Object.keys(value).length === 0) ||
    (typeof value === "string" && value.trim().length === 0) ||
    (Buffer.isBuffer(value) && value.length === 0);
}
1247109
function isNaN(value, message, id) {
    if (message === void 0) { message = ''; }
    if (id === void 0) { id = ''; }
    if (this.enabled && !Number.isNaN(value)) {
        throw TypeException.unexpectedType(assertionTypes.IS_NAN, value, '<NaN>', message, id);
    }
}
1078565
function parseUnary() {
                    var token, expr;

                    token = lexer.peek();
                    if (matchOp(token, '-') || matchOp(token, '+')) {
                        token = lexer.next();
                        expr = parseUnary();
                        return new MathLib.Expression({
                            subtype: 'unaryOperator',
                            value: token.value,
                            content: expr
                        });
                    }

                    return parsePrimary();
                }
931268
def visit_unaryop(self, node):
        """"""
        if node.op == "not":
            operator = "not "
        else:
            operator = node.op
        return "%s%s" % (operator, self._precedence_parens(node, node.operand))