A {@link Parser} that runs 3 parser objects sequentially.
178647
public static <T> Parser<T> sequence(Parser<?> p1, Parser<?> p2, Parser<T> p3) {
    return sequence(p1, p2, p3, InternalFunctors.<Object, Object, T>lastOfThree());
  }
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);
	}
478294
@Deprecated
  public static <A,B> Parser<Pair<A,B>> pair(Parser<? extends A> p1, Parser<? extends B> p2) {
    return sequence(p1, p2, Pair::new);
  }
443919
public static void parse(Reader src, StatementHandler handler)
    throws IOException {
    new NTriplesParser(src, handler).parse();
  }
801106
@Override
  public synchronized void start() {
    if (thread != null) {
      throw new IllegalThreadStateException("Parser already started");
    }

    String name = getThreadName() + "(" + getUri().toString() + ")";

    CountDownLatch startSignal = new CountDownLatch(1);
    Runnable runnable = getRunnable(startSignal);

    thread = new Thread(runnable, name);
    thread.start();

    // Block until the thread has started
    try {
      startSignal.await();
    } catch (InterruptedException e) {
      Thread.currentThread().interrupt();
    }
  }
746925
public final ParserModel train(final TrainingParameters params,
      final TrainingParameters taggerParams,
      final TrainingParameters chunkerParams) {
    if (getParserFactory() == null) {
      throw new IllegalStateException(
          "The ParserFactory must be instantiated!!");
    }
    if (getTaggerFactory() == null) {
      throw new IllegalStateException(
          "The TaggerFactory must be instantiated!");
    }
    ParserModel trainedModel = null;
    ParserEvaluator parserEvaluator = null;
    try {
      trainedModel = ShiftReduceParser.train(this.lang, this.trainSamples,
          this.rules, params, this.parserFactory, taggerParams,
          this.taggerFactory, chunkerParams, this.chunkerFactory);
      final ShiftReduceParser parser = new ShiftReduceParser(trainedModel);
      parserEvaluator = new ParserEvaluator(parser);
      parserEvaluator.evaluate(this.testSamples);
    } catch (final IOException e) {
      System.err.println("IO error while loading training and test sets!");
      e.printStackTrace();
      System.exit(1);
    }
    System.out.println("Final Result: \n" + parserEvaluator.getFMeasure());
    return trainedModel;
  }
288586
public void parse() throws CompilationFailedException {
        if (this.phase > Phases.PARSING) {
            throw new GroovyBugError("parsing is already complete");
        }

        if (this.phase == Phases.INITIALIZATION) {
            nextPhase();
        }

        //
        // Create a reader on the source and run the parser.

        Reader reader = null;
        try {
            reader = source.getReader();

            // let's recreate the parser each time as it tends to keep around state
            parserPlugin = getConfiguration().getPluginFactory().createParserPlugin();

            cst = parserPlugin.parseCST(this, reader);

            reader.close();

        }
        catch (IOException e) {
            getErrorCollector().addFatalError(new SimpleMessage(e.getMessage(), this));
        }
        finally {
            if (reader != null) {
                try {
                    reader.close();
                }
                catch (IOException e) {
                    // Ignore
                }
            }
        }
    }
799702
public static <T> Parser<T> or(Iterable<? extends Parser<? extends T>> alternatives) {
    return or(toArray(alternatives));
  }
364018
private void initializeParser(JsonParser parser) throws IOException {
    if (wrapperKeys.isEmpty()) {
      return;
    }
    boolean failed = true;
    try {
      String match = parser.skipToKey(wrapperKeys);
      Preconditions.checkArgument(
          match != null && parser.getCurrentToken() != JsonToken.END_OBJECT,
          "wrapper key(s) not found: %s",
          wrapperKeys);
      failed = false;
    } finally {
      if (failed) {
        parser.close();
      }
    }
  }
306002
private void addDefaultParsers() {
		parsers = new ArrayList<IParser>();
		parsers.add(new GeldKarteParser(this));
		parsers.add(new EmvParser(this));
	}
479105
private void parse(TokenStream tokenStream) throws ParserException {
	try {
	    Parser parser = new SLR1Parser(uhuraGrammar);
	    parserTree = parser.parse(tokenStream);
	} catch (GrammarException e) {
	    logger.error(e.getMessage(), e);
	    throw new RuntimeException("UhuraGrammar is broken!!!");
	}
    }
1046330
@Deprecated
  public static Parser<?> runnable(final Runnable runnable) {
    return new Parser<Object>() {      
      @Override boolean apply(ParseContext ctxt) {
        runnable.run();
        return true;
      }
      
      @Override public String toString() {
        return runnable.toString();
      }
    };
  }
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;
    }
354802
@SuppressWarnings({"unchecked", "rawtypes"})
  @Private static <T> Parser<T>[] toArray(Iterable<? extends Parser<? extends T>> parsers) {
    if (parsers instanceof Collection<?>) {
      return toArray((Collection) parsers);
    }
    return toArrayWithIteration(parsers);
  }
1059010
static Matcher combineAdjacentCharSeqs(Matcher matcher) {
    if (matcher instanceof SeqMatcher) {
      List<Matcher> matchers = matcher.<SeqMatcher>as().matchers();
      List<Matcher> ms = new ArrayList<>();
      CharSeqMatcher cs1 = null;
      for (Matcher m : matchers) {
        if (m instanceof CharSeqMatcher) {
          if (cs1 == null) {
            cs1 = m.as();
          } else {
            CharSeqMatcher cs2 = m.as();
            cs1 = new CharSeqMatcher(cs1.pattern() + cs2.pattern());
          }
        } else {
          if (cs1 != null) {
            ms.add(cs1);
            cs1 = null;
          }
          ms.add(m);
        }
      }
      if (cs1 != null) {
        ms.add(cs1);
      }
      return SeqMatcher.create(ms);
    }
    return matcher;
  }
694583
static Matcher combineAdjacentStart(Matcher matcher) {
    if (matcher instanceof SeqMatcher) {
      List<Matcher> matchers = matcher.<SeqMatcher>as().matchers();
      if (!matchers.isEmpty() && matchers.get(0) instanceof StartMatcher) {
        List<Matcher> ms = new ArrayList<>();
        ms.add(StartMatcher.INSTANCE);
        int pos = 0;
        for (Matcher m : matchers) {
          if (m instanceof StartMatcher) {
            ++pos;
          } else {
            break;
          }
        }
        ms.addAll(matchers.subList(pos, matchers.size()));
        return SeqMatcher.create(ms);
      }
    }
    return matcher;
  }
1089739
def _parse_multifile(self, desired_type: Type[T], obj: PersistedObject,
                         parsing_plan_for_children: Dict[str, AnyParser._RecursiveParsingPlan],
                         logger: Logger, options: Dict[str, Dict[str, Any]]) -> T:
        
        raise Exception('This should never happen, since this parser relies on underlying parsers')