mapEntry : (ID | STR | INT | LONG | FLOAT | DOUBLE | TRUE | FALSE | NULL) ':' expr
设计目标为 map 定义与初始化，所以 ID 仅当成 STR 不进行求值
541663
void buildMapEntry(LinkedHashMap<Object, Expr> map) {
		Expr keyExpr = expr();
		Object key;
		if (keyExpr instanceof Id) {
			key = ((Id)keyExpr).getId();
		} else if (keyExpr instanceof Const) {
			key = ((Const)keyExpr).getValue();
		} else {
			throw new ParseException("Expression error: the value of map key must be identifier, String, Boolean, null or Number", location);
		}
		
		match(Sym.COLON);
		Expr value = expr();
		if (value == null) {
			throw new ParseException("Expression error: the value on the right side of map entry can not be blank", location);
		}
		map.put(key, value);
	}
792013
Entry<K, V> getEntry(Object key) {
	Object k = maskNull(key);
	int h = hash(k);
	Entry<K, V>[] tab = getTable();
	int index = indexFor(h, tab.length);
	Entry<K, V> e = tab[index];
	while (e != null && !(e.hash == h && eq(k, e.get())))
	    e = e.next;
	return e;
    }
17245
private static Map<?, ?> mapOfEntries( Entry<?, ?>... entries ) {
        Map<Object, Object> looseTypedMap = new LinkedHashMap<>( entries.length );
        for (Entry<?, ?> entry : entries)
            looseTypedMap.put(entry.getKey(), entry.getValue());
        return looseTypedMap;
    }
531290
static String encodeEntry(Entry<String, Point2d[]> entry) {
        StringBuilder sb = new StringBuilder();
        sb.append(entry.getKey());
        sb.append(' ');
        sb.append(encodeCoordinates(entry.getValue()));
        return sb.toString();
    }
959133
def map(self, mapper: Callable[[Any], Any]) -> 'Identity':
        """"""
        value = self._value
        try:
            result = mapper(value)
        except TypeError:
            result = partial(mapper, value)

        return Identity(result)
701777
private String substitute(String exp,
                              List<DSLMappingEntry> entries,
                              int line,
                              Map<String, Integer> use,
                              boolean showSingleSteps) {
        if ( entries.size() == 0 ) {
            if ( line > 0 ) {
                this.addError( new ExpanderException( "No mapping entries for expanding: " + exp,
                                                      line ) );
            }
            return exp;
        }
        if ( showSingleSteps ) {
            logger.info( "to expand: |" + exp + "|" );
        }
        Map<String, String> key2value = new HashMap<String, String>();
        for ( final DSLMappingEntry entry : entries ) {
            Map<String, Integer> vars = entry.getVariables();
            String mappingKey = entry.getMappingKey();
            String vp = entry.getValuePattern();
            Pattern kp = entry.getKeyPattern();
            Matcher m = kp.matcher( exp );
            int startPos = 0;
            boolean match;
            Integer count;
            if ( showUsage ) {
                count = use.get( mappingKey );
                if ( count == null ) use.put( mappingKey, 0 );
            }
            while ( startPos < exp.length() && m.find( startPos ) ) {
                match = true;
                if ( showSingleSteps ) {
                    logger.info( "  matches: " + kp.toString() );
                }
                if ( showUsage ) {
                    use.put( mappingKey,
                             use.get( mappingKey ) + 1 );
                }
                // Replace the range of group 0.  
                String target = m.group( 0 );
                if ( !vars.keySet().isEmpty() ) {
                    // Build a pattern matching any variable enclosed in braces.
                    StringBuilder sb = new StringBuilder();
                    String del = "\\{(";
                    for ( String key : vars.keySet() ) {
                        sb.append( del ).append( Pattern.quote( key ) );
                        del = "|";
                    }
                    sb.append( ")" ).append( funcPatStr ).append( "\\}" );
                    Pattern allkeyPat = Pattern.compile( sb.toString() );
                    vp = entry.getValuePattern();
                    Matcher allkeyMat = allkeyPat.matcher( vp );

                    // While the pattern matches, get the actual key and replace by '$' + index
                    while ( allkeyMat.find() ) {
                        String theKey = allkeyMat.group( 1 );
                        String theFunc = allkeyMat.group( 2 );
                        String foundValue = m.group( vars.get( theKey ) );
                        String theValue = applyFunc( theFunc,
                                                     foundValue );
                        String newVp = vp.substring( 0,
                                                     allkeyMat.start() ) + theValue + vp.substring( allkeyMat.end() );
                        allkeyMat.reset( newVp );
                        key2value.put( theKey,
                                       foundValue );
                        if (newVp.equals(vp)) {
                            break;
                        } else {
                            vp = newVp;
                        }
                    }
                }

                // Try to find any matches from previous lines.
                Matcher varRefMat = varRefPat.matcher( vp );
                while ( varRefMat.find() ) {
                    String theKey = varRefMat.group( 1 );
                    String theFunc = varRefMat.group( 2 );
                    for ( int ientry = substitutions.size() - 1; ientry >= 0; ientry-- ) {
                        String foundValue = substitutions.get( ientry ).get( theKey );
                        if ( foundValue != null ) {
                            String theValue = applyFunc( theFunc,
                                                         foundValue );
                            // replace it
                            vp = vp.substring( 0,
                                               varRefMat.start() ) + theValue + vp.substring( varRefMat.end() );
                            varRefMat.reset( vp );
                            break;
                        }
                    }
                }

                // add the new set of substitutions
                if ( key2value.size() > 0 ) {
                    substitutions.add( key2value );
                }

                // now replace the target
                exp = exp.substring( 0,
                                     m.start() ) + vp + exp.substring( m.end() );
                if ( match && showSingleSteps ) {
                    logger.info( "   result: |" + exp + "|" );
                }
                startPos = m.start() + vp.length();
                m.reset( exp );
            }
        }
        return exp;
    }
1180917
public IntSet getExpanded(SpatialEntry entry) {
    IntSet exp = expanded.get(getPageID(entry));
    return (exp != null) ? exp : IntSets.EMPTY_SET;
  }
364447
@Override
    public Object map(Object input) {
        Number n = (Number) input;
        if (inputSchema.getMetaData(columnNumber).isValid(new IntWritable(n.intValue()))) {
            return input;
        } else {
            return value;
        }
    }
1125202
function queryDatabase(db, expr) {
  // TODO(benvanik): allow the user to switch zone.
  var zone = db.getZones()[0];

  // If the user provided an expression on the command line, use that.
  if (expr && expr.length) {
    issue(expr);
    return 0;
  }

  var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
  });
  rl.on('line', function(line) {
    line = line.trim();
    if (line == 'q' || line == 'quit') {
      rl.close();
      return;
    }

    issue(line);

    rl.prompt();
  });
  rl.on('close', function() {
    console.log('');
    db.dispose();
    process.exit(0);
  });
  rl.setPrompt('> ');
  rl.prompt();

  function issue(expr) {
    console.log('Expression: ' + expr);

    var result;
    try {
      result = zone.query(expr);
    } catch (e) {
      console.log(e);
      return;
    }

    var xexpr = result.getCompiledExpression();
    console.log(xexpr.toString());
    console.log('');

    var resultValue = result.getValue();
    if (resultValue instanceof wtf.db.EventIterator) {
      var it = resultValue;
      if (!it.getCount()) {
        console.log('Nothing matched');
      } else {
        console.log('Results: (' + it.getCount() + ' total)');
        for (; !it.done(); it.next()) {
          util.logEvent(it, zone);
        }
      }
    } else if (typeof resultValue == 'boolean' ||
        typeof resultValue == 'number' ||
        typeof resultValue == 'string') {
      console.log('Result:');
      logResult(resultValue);
    } else if (!resultValue) {
      // Note we test this after so that 0/strings/etc are handled.
      console.log('Nothing matched');
    } else if (resultValue.length) {
      console.log('Results: (' + resultValue.length + ' total)');
      for (var n = 0; n < resultValue.length; n++) {
        logResult(resultValue[n]);
      }
    } else {
      console.log('Result:');
      logResult(resultValue);
    }

    console.log('');
    console.log('Took ' + result.getDuration().toFixed(3) + 'ms');
  }
}
1206698
function _jsifyMapEntry(javaMapEntry) {
        var mapEntry = {
            key: jsify(javaMapEntry.getKey()),
            value: jsify(javaMapEntry.getValue())
        };
        return mapEntry;
    }
293836
public Map.Entry<K, V> ceil(K k) {
        if (contains(k)) {
            return mHashMap.get(k).mPrevious;
        }
        return null;
    }
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)
678001
@SuppressWarnings("unchecked") // worse case should be a ClassCastException
  /*
   * TODO(cpovirk): Consider requiring key to be a K here. But AtomicLongMapSubject isn't currently
   * parameterized, and if we're going to add a type parameter, I'd rather wait until after we
   * (hopefully) remove the other existing type parameters.
   */
  public void containsEntry(Object key, long value) {
    checkNotNull(key, "AtomicLongMap does not support null keys");
    long actualValue = ((AtomicLongMap<Object>) actual()).get(key);
    if (actualValue != value) {
      failWithActual("expected to contain entry", immutableEntry(key, value));
    }
  }
1154592
private OriginalMapping getOriginalMappingForEntry(Entry entry) {
    if (entry.getSourceFileId() == UNMAPPED) {
      return null;
    } else {
      // Adjust the line/column here to be start at 1.
      Builder x = OriginalMapping.newBuilder()
        .setOriginalFile(sources[entry.getSourceFileId()])
        .setLineNumber(entry.getSourceLine() + 1)
        .setColumnPosition(entry.getSourceColumn() + 1);
      if (entry.getNameId() != UNMAPPED) {
        x.setIdentifier(names[entry.getNameId()]);
      }
      return x.build();
    }
  }
1083645
public static Map mapEntries(Mapper mapper, Map map) {
        return mapEntries(mapper, map, false);
    }
1028954
private Object mapToId(Object tmp) {
        if (tmp instanceof Double) {
            return new Integer(((Double)tmp).intValue());
        } else {
            return Context.toString(tmp);
        }
    }
153574
final public ExpressionToken MapKey() throws ParseException {
        Token t = null;
        ExpressionToken eTok = null;
        jj_consume_token(LBRACKET);
        t = jj_consume_token(STRING_LITERAL);
        jj_consume_token(RBRACKET);
        eTok = new MapKeyToken(t.image);
        {
            if(true) return eTok;
        }
        throw new Error("Missing return statement in function");
    }