**************** ParserUtils
486012
private FieldDescriptorProto.Builder setMessageFieldBuilder(
      final FieldDescriptorProto.Builder fieldBuilder, final String name, final String number,
      final String label, final String typeName) {
    return fieldBuilder.setName(name)
        .setLabel(FieldDescriptorProto.Label.valueOf("LABEL_" + label.toUpperCase()))
        .setNumber(Integer.decode(number))
        // .setType(FieldDescriptorProto.Type.TYPE_MESSAGE) this could be ENUM or MESSAGE, so we
        // don't set it!
        .setTypeName(typeName);
  }
1252218
private List<String> parseRows(JsonParser jp, List<String> result) throws IOException {
        while(jp.nextToken() == JsonToken.START_OBJECT) {
            while(jp.nextToken() == JsonToken.FIELD_NAME)
            {
                String fieldName = jp.getCurrentName();
                jp.nextToken();
                if ("id".equals(fieldName)) {
                    result.add(jp.getText());
                } else {
                    jp.skipChildren();
                }
            }
        }
        return result;
    }
569055
@Override
    public Parser newDelimitedParser(final InputStream pzmapXMLStream, final InputStream dataSourceStream, final char delimiter, final char qualifier,
            final boolean ignoreFirstRecord) {
        return new DelimiterParser(pzmapXMLStream, dataSourceStream, delimiter, qualifier, ignoreFirstRecord);
    }
1328399
@Override
    public void initializeParsers(ExtensionParsingContext context) {
        for (JGroupsSchema schema : JGroupsSchema.SCHEMAS) {
            context.setSubsystemXmlMapping(SUBSYSTEM_NAME, schema.getNamespaceUri(), new JGroupsSubsystemXMLReader(schema));
        }
    }
254286
@SuppressWarnings("unused") // called through reflection by RequestServer
  public ParseV3 parse(int version, ParseV3 parse) {
    ParserInfo parserInfo = ParserService.INSTANCE.getByName(parse.parse_type).info();
    ParseSetup setup = new ParseSetup(parserInfo,
                                      parse.separator, parse.single_quotes,
                                      parse.check_header, parse.number_columns,
                                      delNulls(parse.column_names),
                                      ParseSetup.strToColumnTypes(parse.column_types),
                                      parse.domains, parse.na_strings,
                                      null,
                                      new ParseWriter.ParseErr[0], parse.chunk_size,
                                      parse.decrypt_tool != null ? parse.decrypt_tool.key() : null, parse.skipped_columns,
                                      parse.custom_non_data_line_markers != null ? parse.custom_non_data_line_markers.getBytes(): null);

    if (parse.source_frames == null) throw new H2OIllegalArgumentException("Data for Frame '" + parse.destination_frame.name + "' is not available. Please check that the path is valid (for all H2O nodes).'");
    Key[] srcs = new Key[parse.source_frames.length];
    for (int i = 0; i < parse.source_frames.length; i++)
      srcs[i] = parse.source_frames[i].key();

    if ((setup.getParseType().name().toLowerCase().equals("svmlight") ||
            (setup.getParseType().name().toLowerCase().equals("avro") ))
            && ((setup.getSkippedColumns() != null) && (setup.getSkippedColumns().length >0)))
      throw new H2OIllegalArgumentException("Parser: skipped_columns are not supported for SVMlight or Avro parsers.");

    if (setup.getSkippedColumns() !=null &&
            ((setup.get_parse_columns_indices()==null) || (setup.get_parse_columns_indices().length==0)))
      throw new H2OIllegalArgumentException("Parser:  all columns in the file are skipped and no H2OFrame" +
              " can be returned."); // Need this to send error message to R

    parse.job = new JobV3(ParseDataset.parse(
            parse.destination_frame.key(), srcs, parse.delete_on_done, setup, parse.blocking
    )._job);
    if (parse.blocking) {
      Frame fr = DKV.getGet(parse.destination_frame.key());
      parse.rows = fr.numRows();
    }

    return parse;
  }
258774
final Parser<T> asDelimiter() {
    return new Parser<T>() {
      @Override boolean apply(ParseContext ctxt) {
        return ctxt.applyAsDelimiter(Parser.this);
      }
      @Override public String toString() {
        return Parser.this.toString();
      }
    };
  }
1184892
private void setupParse ()
    {
    if (parent == null) {
        throw new NullPointerException("No parent for filter");
    }
    parent.setEntityResolver(this);
    parent.setDTDHandler(this);
    parent.setContentHandler(this);
    parent.setErrorHandler(this);
    }
736221
public void parse(String uri, int offset, int length) {
        clear();
        int end = offset + length;
        _uri = uri.substring(offset, end);
        parse(State.START, uri, offset, end);
    }
644715
private void applyParser()
	{
		this.snapshot.clear();
		Map<String, String> originals = new HashMap<String, String>(this.resolvers.size());
		for ( Entry<String, VariableValue> resolver : this.resolvers.entrySet() )
		{
			originals.put(resolver.getKey(), resolver.getValue().getOriginal());
		}
		putAll(originals);
	}
1299759
@Override
    protected Source parseFrom( TokenStream tokens,
                                TypeSystem typeSystem ) {
        Position firstSourcePosition = tokens.nextPosition();
        Source source = super.parseFrom(tokens, typeSystem);
        if (tokens.matches(',') && source instanceof NamedSelector) {
            NamedSelector selector = (NamedSelector)source;
            JoinableSources joinedSources = new JoinableSources(selector, firstSourcePosition);
            while (tokens.canConsume(',')) {
                // This is a JCR-SQL-style JOIN ...
                Position nextSourcePosition = tokens.nextPosition();
                NamedSelector nextSource = parseNamedSelector(tokens, typeSystem);
                joinedSources.add(nextSource, nextSourcePosition);
            }
            source = joinedSources;
        }
        return source;
    }
519859
function Parser(text) {
        if (typeof text !== 'string') {
            throw new Error('not a string');
        }
        this.text = text.trim();
        this.level = 0;
        this.place = 0;
        this.root = null;
        this.stack = [];
        this.currentObject = null;
        this.state = NEUTRAL;
    }
306002
private void addDefaultParsers() {
		parsers = new ArrayList<IParser>();
		parsers.add(new GeldKarteParser(this));
		parsers.add(new EmvParser(this));
	}
700972
private function parseWsdl(): void
    {
        $this->printer->writeln('Parsing WSDL.');
        $client = new \SoapClient((string) $this->wsdl);

        foreach ($client->__getTypes() as $rawType) {
            $type = $this->parser->parseType($rawType);

            if ($type instanceof Struct) {
                $this->wsdl->addStruct($type);
            } elseif ($type instanceof Property) {
                $this->wsdl->addSimpleType($type);
            }
        }

        foreach ($client->__getFunctions() as $rawFunction) {
            $method = $this->parser->parseFunction($rawFunction);
            $this->wsdl->addMethod($method);
        }
    }
17863
public static void main(String[] pArgs) {
        if (pArgs.length > 1) {
            String type = pArgs[0];
            String family = pArgs[1];
            boolean incuded = includes(family, type);
            System.out.println(
                    "Mime type family " + family
                    + (incuded ? " includes " : " does not include ")
                    + "type " + type
            );
        }
        if (pArgs.length > 0) {
            String str = pArgs[0];

            if (str.indexOf('/') >= 0) {
                // MIME
                String extension = getExtension(str);
                System.out.println("Default extension for MIME type '" + str + "' is "
                        + (extension != null ? ": '" + extension + "'" : "unknown") + ".");
                System.out.println("All possible: " + getExtensions(str));
            }
            else {
                // EXT
                String mimeType = getMIMEType(str);
                System.out.println("Default MIME type for extension '" + str + "' is "
                        + (mimeType != null ? ": '" + mimeType + "'" : "unknown") + ".");
                System.out.println("All possible: " + getMIMETypes(str));
            }

            return;
        }

        Set set = sMIMEToExt.keySet();
        String[] mimeTypes = new String[set.size()];
        int i = 0;
        for (Iterator iterator = set.iterator(); iterator.hasNext(); i++) {
            String mime = (String) iterator.next();
            mimeTypes[i] = mime;
        }
        Arrays.sort(mimeTypes);

        System.out.println("Known MIME types (" + mimeTypes.length + "):");
        for (int j = 0; j < mimeTypes.length; j++) {
            String mimeType = mimeTypes[j];

            if (j != 0) {
                System.out.print(", ");
            }

            System.out.print(mimeType);
        }

        System.out.println("\n");

        set = sExtToMIME.keySet();
        String[] extensions = new String[set.size()];
        i = 0;
        for (Iterator iterator = set.iterator(); iterator.hasNext(); i++) {
            String ext = (String) iterator.next();
            extensions[i] = ext;
        }
        Arrays.sort(extensions);

        System.out.println("Known file types (" + extensions.length + "):");
        for (int j = 0; j < extensions.length; j++) {
            String extension = extensions[j];

            if (j != 0) {
                System.out.print(", ");
            }

            System.out.print(extension);
        }
        System.out.println();
    }
781029
public void parse (Reader reader) {
		try {
			char[] data = new char[1024];
			int offset = 0;
			while (true) {
				int length = reader.read(data, offset, data.length - offset);
				if (length == -1) break;
				if (length == 0) {
					char[] newData = new char[data.length * 2];
					System.arraycopy(data, 0, newData, 0, data.length);
					data = newData;
				} else
					offset += length;
			}
			parse(data, 0, offset);
		} catch (IOException ex) {
			throw new SerializationException(ex);
		} finally {
			StreamUtils.closeQuietly(reader);
		}
	}
185326
@Override
    protected void parse() {
        maximumInstances = getInt(PARAM_MAXIMUM_INSTANCES, DEFAULT_MAXIMUM_INSTANCES);
        mergeRelatedIssues = getBoolean(PARAM_MERGE_RELATED_ISSUES, true);
        overridesFilename = getString(PARAM_OVERRIDES_FILENAME, "");
    }
45867
function Parser() {
  if (!(this instanceof Parser))
    return new Parser();

  EventEmitter.call(this);

  this.waiting = 9;
  this.header = null;
  this.pending = [];
  this.total = 0;
}