expr1 : MINUS expr %prec UMINUS
             | PLUS expr %prec UMINUS
             | NEG expr
             | HANDLE ident
             | PLUSPLUS ident
             | MINUSMINUS ident
15906
def p_expr1(p):
    
    p[0] = node.expr(op=p[1], args=node.expr_list([p[2]]))
713
def p_expression_ulnot(self, p):
        ''
        p[0] = Ulnot(p[2], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
309636
def p_if_expr_header(p):
    
    global ENABLED

    IFDEFS.append((ENABLED, p.lineno(1)))
    ENABLED = bool(int(p[2])) if p[2].isdigit() else ID_TABLE.defined(p[2])
65952
private ExprKraken parseMulExpr()
  {
    ExprKraken left = parseSimpleTerm();

    while (true) {
      Token token = scanToken();

      switch (token) {
      case STAR:
        left = new BinaryExpr(BinaryOp.MUL, left, parseSimpleTerm());
        break;
      case DIV:
        left = new BinaryExpr(BinaryOp.DIV, left, parseSimpleTerm());
        break;
      case MOD:
        left = new BinaryExpr(BinaryOp.MOD, left, parseSimpleTerm());
        break;

      default:
        _token = token;
        return left;
      }
    }
  }
1314001
def __expr_str(cls, expr, level):
        ''''''
        ident = ' ' * level * 4

        if isinstance(expr, tuple):
            return '{}{}'.format(ident, str(expr))

        if expr.etype[0] in ['pvar', 'constant']:
            return '{}Expression(etype={}, args={})'.format(ident, expr.etype, expr.args)

        if not isinstance(expr, Expression):
            return '{}{}'.format(ident, str(expr))

        args = list(cls.__expr_str(arg, level + 1) for arg in expr.args)
        args = '\n'.join(args)
        return '{}Expression(etype={}, args=\n{})'.format(ident, expr.etype, args)
327921
def p_exprge(p):
    
    a = int(p[1]) if p[1].isdigit() else 0
    b = int(p[3]) if p[3].isdigit() else 0

    p[0] = '1' if a >= b else '0'
179650
def p_new_expr_nobf(self, p):
        
        if len(p) == 2:
            p[0] = p[1]
        else:
            p[0] = ast.NewExpr(p[2])
1204766
def p_assignment_expr_noin(self, p):
        
        if len(p) == 2:
            p[0] = p[1]
        else:
            p[0] = self.asttypes.Assign(left=p[1], op=p[2], right=p[3])
            p[0].setpos(p, 2)
728988
def p_statement_expr(self, t):
    ''''''
    if len(t)<3 :
      self.accu.add(Term('input', [t[1]]))
      print('input', t[1])
    else :
      #print(t[1], t[2], t[3]
      self.accu.add(Term('edge', ["gen(\""+t[1]+"\")","gen(\""+t[3]+"\")"]))
      self.accu.add(Term('obs_elabel', ["gen(\""+t[1]+"\")","gen(\""+t[3]+"\")",t[2]]))
372874
def p_expression_uminus(self, p):
        ''' 
        '''
        _LOGGER.debug("expresion -> - expresion")

        if p[2].type == TypedClass.NUMBER: 
            p[0] = TypedClass(-p[2].value, TypedClass.NUMBER)
        else:
            raise TypeError("operator invalid for this type")
134830
function (expr, length, fillChar) {
  fillChar = fillChar || ' ';
  var string = '' + expr;
  if (string.length > length) {
    return left(string, length);
  } else {
    while (string.length < length) {
      string = fillChar + string;
    }
  }
  return string;
}
54584
def p_new_expr_nobf(self, p):
        
        if len(p) == 2:
            p[0] = p[1]
        else:
            p[0] = self.asttypes.NewExpr(p[2])
            p[0].setpos(p)
76300
def p_expression_plus(self, p):
        ''
        p[0] = Plus(p[1], p[3], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
854041
def p_function_expr_2(self, p):
        
        if len(p) == 8:
            p[0] = self.asttypes.FuncExpr(
                identifier=p[2], parameters=None, elements=p[6])
        else:
            p[0] = self.asttypes.FuncExpr(
                identifier=p[2], parameters=p[4], elements=p[7])
        p[0].setpos(p)
1323114
def p_partselect_minus(self, p):
        ''
        p[0] = Partselect(p[1], p[3], Minus(
            p[3], p[5], lineno=p.lineno(1)), lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
455635
private String formatString(String exp)
    {
        exp = exp.replaceAll("\\s",""); // why
        exp = exp.toLowerCase();

        int count = 0;

        if(exp.substring(0, 1).equals("-")) { // if expression starts with a minus sign, it is a unary one
            exp = "$" + exp.substring(1); // replace
        }

        for(int i = 0; i < exp.length(); i++) {
            if(exp.substring(i,  i + 1).equals("("))
                count++;
            else if(exp.substring(i, i + 1).equals(")"))
                count--;
        }
        while(count > 0) {
            exp += ")";
            count--;
        }

        // At the operators, when the operator is "-" and it is preceded by another operator,
        // or preceded by a left parenthesis, or when it is the first character of the input
        // it is a unary minus rather than binary. In this case, I change it to another
        // character, '$', and make its precedence the same as that of '^'.
        for(int i = 0; i < exp.length() - 1; i++) {
            String tmp1 = exp.substring(i, i + 1);
            String tmp2 = exp.substring(i + 1, i + 2);
            if(tmp2.equals("-") && (ExpressionParser.isOperator(tmp1) || tmp1.equals("(")))
                exp = exp.substring(0, i + 1) + "$" + exp.substring(i + 2);
            else if((tmp1.matches("[0-9]+") || tmp1.equals(var)) && (tmp2.equals("(") || tmp2.equals(var)))
                exp = exp.substring(0, i + 1) + "*" + exp.substring(i + 1);
        }

        return exp;
    }
302857
private static boolean isAlpha(int c) {
        return (c >= '0' && c <= '9') ||
               (c >= 'A' && c <= 'Z') ||
               (c == ' ') ||
               (c == '$') ||
               (c == '%') ||
               (c == '*') ||
               (c == '+') ||
               (c == '-') ||
               (c == '.') ||
               (c == '/') ||
               (c == ':');
    }