Parses the compiler output.
181522
def solc_parse_output(compiler_output):
    
    # At the moment some solc output like --hashes or -- gas will not output
    # json at all so if used with those arguments the logic here will break.
    # Perhaps solidity will slowly switch to a json only output and this comment
    # can eventually go away and we will not need to add more logic here at
    # all.
    result = yaml.safe_load(compiler_output)['contracts']

    if 'bin' in tuple(result.values())[0]:
        for value in result.values():
            value['bin_hex'] = value['bin']

            # decoding can fail if the compiled contract has unresolved symbols
            try:
                value['bin'] = decode_hex(value['bin_hex'])
            except (TypeError, ValueError):
                pass

    for json_data in ('abi', 'devdoc', 'userdoc'):
        # the values in the output can be configured through the
        # --combined-json flag, check that it's present in the first value and
        # assume all values are consistent
        if json_data not in tuple(result.values())[0]:
            continue

        for value in result.values():
            value[json_data] = yaml.safe_load(value[json_data])

    return result
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, "");
    }
795980
def Parse(self, cmd, args, stdout, stderr, return_val, time_taken,
            knowledge_base):
    """"""
    _ = stderr, time_taken, args, knowledge_base  # Unused.
    self.CheckReturn(cmd, return_val)
    column_lengths = []
    i = 0
    for i, line in enumerate(stdout.decode("utf-8").splitlines()):
      if line.startswith("+++-"):
        # This is a special header line that determines column size.
        for col in line.split("-")[1:]:
          if not re.match("=*", col):
            raise parser.ParseError("Invalid header parsing for %s at line "
                                    "%s" % (cmd, i))
          column_lengths.append(len(col))
        break

    if not column_lengths:
      return

    packages = []

    remaining_lines = stdout.splitlines()[i + 1:]
    for i, line in enumerate(remaining_lines):
      cols = line.split(None, len(column_lengths))

      # The status column is ignored in column_lengths.
      if len(column_lengths) == 4:
        # Installed, Name, Version, Architecture, Description
        status, name, version, arch, desc = cols
      elif len(column_lengths) == 3:
        # Older versions of dpkg don't print Architecture
        status, name, version, desc = cols
        arch = None
      else:
        raise ValueError("Bad number of columns in dpkg --list output: %s" %
                         len(column_lengths))

      # Status is potentially 3 columns, but always at least two, desired and
      # actual state. We only care about actual state.
      if status[1] == "i":
        status = rdf_client.SoftwarePackage.InstallState.INSTALLED
      else:
        status = rdf_client.SoftwarePackage.InstallState.UNKNOWN
      packages.append(
          rdf_client.SoftwarePackage(
              name=name,
              description=desc,
              version=version,
              architecture=arch,
              install_state=status))

    if packages:
      yield rdf_client.SoftwarePackages(packages=packages)
1046362
def _parse(self, source, name, filename):
        """"""
        return Parser(self, source, name, encode_filename(filename)).parse()
115525
private function parsing() : void
    {
        $lines = explode("\n", $this->raw);

        foreach ($lines as $line) {
            // check "at" mark
            if (false === strpos($line, '@')) {
                continue;
            }

            // check inline annotation
            if ($anp = strpos($line, '//')) {
                $line = substr($line, 0, $anp);
            }

            // trim blanks
            $line = trim(ltrim($line, ' *'));

            // analyze expr
            if (false === $fws = strpos($line, ' ')) {
                // @some-key
                $key = substr($line, 1);
                $val = true;
            } else {
                // @some-key some-val
                $key = substr($line, 1, $fws - 1);
                $val = trim(substr($line, $fws));
            }

            $this->lines[] = [$key, $val];

            $this->declares[$key][] = $val;
        }
    }
1244359
private ParseTree parseFunctionDeclaration() {
    SourcePosition start = getTreeStartLocation();
    eat(Keywords.FUNCTION.type);
    boolean isGenerator = eatOpt(TokenType.STAR) != null;

    FunctionDeclarationTree.Builder builder =
        FunctionDeclarationTree.builder(FunctionDeclarationTree.Kind.DECLARATION).setName(eatId());
    parseFunctionTail(builder, isGenerator ? FunctionFlavor.GENERATOR : FunctionFlavor.NORMAL);
    return builder.build(getTreeLocation(start));
  }
345199
def parse
      parsed_output = []

      File.open(@filename).each_line.with_index do |line, num|
        next if line.lstrip[0] != "#"

        if expr = line.match(EXPRESSION)
          parsed_output.push [num, expr["expression"]]
        elsif result = line.match(RESULT)
          parsed_output.last.push(result["result"])
        end
      end
      parsed_output
    end
604376
def parse_debug(self, inputstring):
        """"""
        return self.parse(inputstring, self.file_parser, {"strip": True}, {"header": "none", "initial": "none", "final_endline": False})
15953
public Iterable<? extends CompilationUnitTree> parse() throws IOException {
        try {
            prepareCompiler();
            List<JCCompilationUnit> units = compiler.parseFiles(fileObjects);
            for (JCCompilationUnit unit: units) {
                JavaFileObject file = unit.getSourceFile();
                if (notYetEntered.containsKey(file))
                    notYetEntered.put(file, unit);
            }
            return units;
        }
        finally {
            parsed = true;
            if (compiler != null && compiler.log != null)
                compiler.log.flush();
        }
    }
767443
private void parseResults() {
        logger.entering();

        if (result.getStatus() == ITestResult.SUCCESS) {
            this.status = "Passed";
        } else if (result.getStatus() == ITestResult.FAILURE) {
            this.status = "Failed";
        } else if (result.getStatus() == ITestResult.SKIP) {
            this.status = "Skipped";
        } else if (result.getStatus() == ITestResult.STARTED) {
            this.status = "Running";
        }

        Calendar c = Calendar.getInstance();
        c.setTimeInMillis(result.getStartMillis());
        this.startTime = ReporterDateFormatter.getISO8601String(c.getTime());
        c.setTimeInMillis(result.getEndMillis());
        this.endTime = ReporterDateFormatter.getISO8601String(c.getTime());

        if (result.getMethod().getDescription() != null) {
            this.description = result.getMethod().getDescription();
        }

        if (result.getThrowable() != null) {
            this.exception = result.getThrowable().getClass().toString() + ":"
                    + result.getThrowable().getLocalizedMessage();
            this.stacktrace = getStackTraceInfo(result.getThrowable());
        }

        loadMethodInfo(result);

        logger.exiting();
    }
364740
public Script parse(final GroovyCodeSource codeSource) throws CompilationFailedException {
        return InvokerHelper.createScript(parseClass(codeSource), context);
    }
1280337
protected function parse(): void
    {
        switch ($this->notation) {

            case self::NOTATION_DOT_DECIMAL:
                $this->fromDotDecimal($this->value);
                break;

            case self::NOTATION_BINARY:
                $this->fromBinary($this->value);
                break;

            case self::NOTATION_CIDR_SHORT:
                $this->fromCidrShort($this->value);
                break;

            case self::NOTATION_CIDR_LONG:
                $this->fromCidrLong($this->value);
                break;

            case self::NOTATION_CIDR_BINARY:
                $this->fromCidrBinary($this->value);
                break;

            default:
                $this->notation = self::NOTATION_INVALID;
        }
    }
668077
@Override
    <T> T parseRemaining(Class<T> declaredType) throws Exception {
        // the array and version has already been read
        overrideBasePackage = declaredType.getPackage().getName() + ".";
        // ref count + class map
        parseClassDescriptions();

        // parse
        Object parsed = parseObject(declaredType, null, null, null, true);
        return declaredType.cast(parsed);
    }
1278142
static void parse(final Readable readable, final ParseListener listener)
		throws IOException
	{
		if (readable == null)
		{
			throw new IllegalArgumentException("readable must not be null");
		}
		FastqParserLineProcessor lineProcessor = new FastqParserLineProcessor(listener);
		CharStreams.readLines(readable, lineProcessor);
		if (lineProcessor.getState() == State.COMPLETE)
		{
			listener.complete();
			lineProcessor.setState(State.DESCRIPTION);
		}
		if (lineProcessor.getState() != State.DESCRIPTION)
		{
			throw new IOException("truncated sequence"); // at line " + lineNumber);
		}
	}
700610
private void parse()
    {
        this.elements = new ArrayList<>();

        try {
            for (Tokenizer tokenizer = new Tokenizer(this.rawVersion); tokenizer.next();) {
                Element element = new Element(tokenizer);
                this.elements.add(element);
                if (element.getVersionType() != Type.STABLE) {
                    this.type = element.getVersionType();
                }
            }

            trimPadding(this.elements);
        } catch (Exception e) {
            // Make sure to never fail no matter what
            LOGGER.error("Failed to parse version [" + this.rawVersion + "]", e);
            this.elements.add(new Element(this.rawVersion));
        }
    }
1117630
public void parse(Class clazz, PrintWriter output, String headerName, String projectName) throws Exception {
        long startTime = System.currentTimeMillis();
        
        Group[] groups = parseMethods(clazz);
        long finishTime = System.currentTimeMillis();

        lastExecutionTime = finishTime - startTime;
        
        String result = toPropertiesString(groups, headerName, projectName);

        writeProperties(output, result);
    }
41665
function parse() {
    $this->output = '';
    # drop tags
    $this->parser->html = preg_replace('#<('.implode('|', $this->drop).')[^>]*>.*</\\1>#sU', '', $this->parser->html);
    while ($this->parser->nextNode()) {
      switch ($this->parser->nodeType) {
        case 'doctype':
          break;
        case 'pi':
        case 'comment':
          if ($this->keepHTML) {
            $this->flushLinebreaks();
            $this->out($this->parser->node);
            $this->setLineBreaks(2);
          }
          # else drop
          break;
        case 'text':
          $this->handleText();
          break;
        case 'tag':
          if (in_array($this->parser->tagName, $this->ignore)) {
            break;
          }
          if ($this->parser->isStartTag) {
            $this->flushLinebreaks();
          }
          if ($this->skipConversion) {
            $this->isMarkdownable(); # update notConverted
            $this->handleTagToText();
            continue;
          }
          if (!$this->parser->keepWhitespace && $this->parser->isBlockElement && $this->parser->isStartTag) {
            $this->parser->html = ltrim($this->parser->html);
          }
          if ($this->isMarkdownable()) {
            if ($this->parser->isBlockElement && $this->parser->isStartTag && !$this->lastWasBlockTag && !empty($this->output)) {
              if (!empty($this->buffer)) {
                $str =& $this->buffer[count($this->buffer) -1];
              } else {
                $str =& $this->output;
              }
              if (substr($str, -strlen($this->indent)-1) != "\n".$this->indent) {
                $str .= "\n".$this->indent;
              }
            }
            $func = 'handleTag_'.$this->parser->tagName;
            $this->$func();
            if ($this->linksAfterEachParagraph && $this->parser->isBlockElement && !$this->parser->isStartTag && empty($this->parser->openTags)) {
              $this->flushStacked();
            }
            if (!$this->parser->isStartTag) {
              $this->lastClosedTag = $this->parser->tagName;
            }
          } else {
            $this->handleTagToText();
            $this->lastClosedTag = '';
          }
          break;
        default:
          trigger_error('invalid node type', E_USER_ERROR);
          break;
      }
      $this->lastWasBlockTag = $this->parser->nodeType == 'tag' && $this->parser->isStartTag && $this->parser->isBlockElement;
    }
    if (!empty($this->buffer)) {
      trigger_error('buffer was not flushed, this is a bug. please report!', E_USER_WARNING);
      while (!empty($this->buffer)) {
        $this->out($this->unbuffer());
      }
    }
    ### cleanup
    $this->output = rtrim(str_replace('&amp;', '&', str_replace('&lt;', '<', str_replace('&gt;', '>', $this->output))));
    # end parsing, flush stacked tags
    $this->flushStacked();
    $this->stack = array();
  }