/*
-------------------
PARSE METHODS
-------------------
500781
public void parseStandalone(
            final IEngineConfiguration configuration,
            final String ownerTemplate,
            final String template,
            final Set<String> templateSelectors,
            final ITemplateResource resource,
            final TemplateMode templateMode,
            final boolean useDecoupledLogic,
            final ITemplateHandler handler) {

        Validate.notNull(configuration, "Engine Configuration cannot be null");
        // ownerTemplate CAN be null if this is a first-level template
        Validate.notNull(template, "Template cannot be null");
        Validate.notNull(resource, "Template Resource cannot be null");
        Validate.isTrue(templateSelectors == null || templateSelectors.isEmpty(),
                        "Template selectors cannot be specified for a template using RAW template mode: template " +
                        "insertion operations must be always performed on whole template files, not fragments");
        Validate.notNull(templateMode, "Template Mode cannot be null");
        Validate.isTrue(templateMode == TemplateMode.RAW, "Template Mode has to be RAW");
        Validate.isTrue(!useDecoupledLogic, "Cannot use decoupled logic in template mode " + templateMode);
        Validate.notNull(handler, "Template Handler cannot be null");

        parse(configuration, ownerTemplate, template, templateSelectors, resource, 0, 0, templateMode, handler);

    }
1257712
@Override
	protected void parse(Node node) {
		NamedNodeMap attributes = node.getAttributes();
		width = getValueRecursiveAsInteger(attributes.getNamedItem("width"));
		height = getValueRecursiveAsInteger(attributes.getNamedItem("height"));
		mimeType = getValueRecursive(attributes.getNamedItem("mime-type"));
		extension = getValueRecursive(attributes.getNamedItem("extension"));
		setParsed(true);
	}
144875
public function parse()
    {
        /*
         * If the object has already been parsed in this request return the cached data.
         */
        if (array_key_exists($this->filePath, self::$cache)) {
            self::$cache[$this->filePath]['source'] = 'request-cache';
            return self::$cache[$this->filePath];
        }

        /*
         * Try to load the parsed data from the cache
         */
        $path = $this->getCacheFilePath();

        $result = [
            'filePath' => $path,
            'className' => null,
            'source' => null,
            'offset' => 0
        ];

        /*
         * There are two types of possible caching scenarios, either stored
         * in the cache itself, or stored as a cache file. In both cases,
         * make sure the cache is not stale and use it.
         */
        if (is_file($path)) {
            $cachedInfo = $this->getCachedFileInfo();
            $hasCache = $cachedInfo !== null;

            /*
             * Valid cache, return result
             */
            if ($hasCache && $cachedInfo['mtime'] == $this->object->mtime) {
                $result['className'] = $cachedInfo['className'];
                $result['source'] = 'cache';

                return self::$cache[$this->filePath] = $result;
            }

            /*
             * Cache expired, cache file not stale, refresh cache and return result
             */
            if (!$hasCache && filemtime($path) >= $this->object->mtime) {
                $className = $this->extractClassFromFile($path);
                if ($className) {
                    $result['className'] = $className;
                    $result['source'] = 'file-cache';

                    $this->storeCachedInfo($result);
                    return $result;
                }
            }
        }

        $result['className'] = $this->rebuild($path);
        $result['source'] = 'parser';

        $this->storeCachedInfo($result);
        return $result;
    }
1132325
public void parse(String str) {
		if (buffer.length() > 0) {
			str = buffer.toString().concat(str);
			buffer = new StringBuilder();
		}
		Reader reader = new StringReader(str);
		try {
			try {
				parse(reader);
			} finally {
				reader.close();
			}
		} catch (IOException ex) {
			/* ignore */
		}
	}
577442
function parse(fileString, callback) {
	try {
		return callback(null, Yaml.safeLoad(fileString));
	} catch (err) {
		return callback(err);
	}
}
1284137
@Override
	public Object parse(String source) throws Exception {
		Source s = sources.poll();
		final char[] chars = source.toCharArray();
		if (s == null) {
			s = new Source(chars);
		} else {
			s.set(chars);
		}
		final Object result = parseNext(s);
		if (sources.size() > Config.POOL_SIZE) {
			return result;
		}
		sources.add(s);
		return result;
	}
604472
def parse(self):
        
        if self.parse_string is not None and self._parse is None:
            self._parse = Tree.parse(self._parse_string)
        return self._parse
1298538
private void parseMethod()
    throws IOException
  {
    int accessFlags = readShort();
    int nameIndex = readShort();
    int descriptorIndex = readShort();

    JavaMethod method = new JavaMethod(_loader);
    method.setJavaClass(_class);
    method.setName(_cp.getUtf8(nameIndex).getValue());
    method.setDescriptor(_cp.getUtf8(descriptorIndex).getValue());
    method.setAccessFlags(accessFlags);

    int attributesCount = readShort();

    for (int i = 0; i < attributesCount; i++) {
      Attribute attr = parseAttribute();

      method.addAttribute(attr);
      
      if (attr instanceof ExceptionsAttribute) {
        ExceptionsAttribute exn = (ExceptionsAttribute) attr;

        ArrayList<String> exnNames = exn.getExceptionList();

        if (exnNames.size() > 0) {
          JClass []exnClasses = new JClass[exnNames.size()];

          for (int j = 0; j < exnNames.size(); j++) {
            String exnName = exnNames.get(j).replace('/', '.');

            exnClasses[j] = _loader.forName(exnName);
          }

          method.setExceptionTypes(exnClasses);
        }
      }
    }

    _class.addMethod(method);
  }
1231752
public function parse()
    {
        if (isset($this->view)) return;

        if ($this->viewParser instanceof StyleAwareInterface
            and $this->styleParser) {

            $style = $this->styleParser->parse($this->stylePath);

            if ($style) $this->viewParser->setStyle($style);
        }

        $view = $this->viewParser->parse($this->viewPath);

        if ($view instanceof ControllerAwareInterface) {
            $view->setController($this->controller);
        }

        $this->view = $view;
    }
446146
function parse(method, req, res, options) {
    return new Promise(function(resolve, reject) {
        BodyParser[method](options)(req, res, function(err) {
            if (err) {
                return reject(err);
            }

            return resolve();
        });
    });
}
554378
@Override
    protected void parse() throws ProtocolException {
        cursor = offset;
        optimalEncodingMessageSize = 4;

        // version
        version = readUint32();
        // peek at marker
        byte marker = payload[cursor];
        boolean useSegwit = marker == 0;
        // marker, flag
        if (useSegwit) {
            readBytes(2);
            optimalEncodingMessageSize += 2;
        }
        // txin_count, txins
        parseInputs();
        // txout_count, txouts
        parseOutputs();
        // script_witnesses
        if (useSegwit)
            parseWitnesses();
        // lock_time
        lockTime = readUint32();
        optimalEncodingMessageSize += 4;

        length = cursor - offset;
    }
410109
function parse (el, parseFn, context, canBreak) {
  if (!el) { return; }

  if (!Array.isArray(el)) {
    parseFn.call(context, el);
  } else if (canBreak) {
    el.some(parseFn, context);
  } else {
    el.forEach(parseFn, context);
  }
}
592918
function parseArray (parser) {
  const length = parseLength(parser)
  if (length === undefined) {
    return
  }
  if (length < 0) {
    return null
  }
  const responses = new Array(length)
  return parseArrayElements(parser, responses, 0)
}
1110619
public void parse(byte[] data) throws ParseException {
        Text text = new Text();
        text.strain(data, 0, data.length);
        init(text);
    }
411520
@SuppressWarnings({ "rawtypes", "unchecked" })
    protected Object parseCollection(GetterMethodCover method, 
            Collection collection) {
        if(method.isArrayObjectCollection()) {
            return parseArrayObjectCollection(method, collection);
        }
        else if(method.isObjectCollection()) {
            return parseObjectCollection(method, collection);
        }
        else if(method.isByteCollection()) {
            return collectionToPrimitiveByteArray(collection);
        }
        else if(method.isCharCollection()) {
            return charCollectionToPrimitiveByteArray(collection);
        }
        else if(method.isArrayCollection()) {
            return parseArrayCollection(method, collection);
        }
        return collection;
    }
416374
@SuppressWarnings("rawtypes")
    protected void parseMethod(Object value, GetterMethodCover method,
            ISFSObject sfsObject) {
        Object answer = value;
        if(method.isColection()) {
            answer = parseCollection(method, (Collection)value);
        }
        else if(method.isTwoDimensionsArray()) {
            answer = parseTwoDimensionsArray(method, value);
        }
        else if(method.isArray()) {
            answer = parseArray(method, value);
        }
        else if(method.isObject()) {
            answer = parseObject(method, value);
        }
        else if(method.isChar()) {
            answer = (byte)(((Character)value).charValue());
        }
        SFSDataType type = getSFSDataType(method);
        sfsObject.put(method.getKey(), new SFSDataWrapper(type, answer));
    }
675930
@RequestMapping(produces = MediaType.APPLICATION_JSON_VALUE, value = "/parse", method = RequestMethod.GET)
  public String parse(@RequestParam("sentence") String sentence, HttpServletRequest request) {
    if (sentence == null || sentence.trim().isEmpty()) {
      return StringUtils.EMPTY;
    }

    sentence = sentence.trim();
    LOGGER.info("Parse [" + sentence + "]");
    DTree tree = PARSER.parse(sentence);

    DTreeEntity parseTreeEntity = new DTreeEntity(tree, "SAMPLE_AUTHOR");
    dNodeEntityRepository.save(parseTreeEntity.dNodeEntities);
    dTreeEntityRepository.save(parseTreeEntity);

    return "[" + toJSON(tree.get(0)) + "]";
  }