All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.petitparser.parser.primitive.EpsilonParser Maven / Gradle / Ivy

package org.petitparser.parser.primitive;

import org.petitparser.context.Context;
import org.petitparser.context.Result;
import org.petitparser.parser.Parser;

/**
 * A parser that consumes nothing and always succeeds.
 */
public class EpsilonParser extends Parser {

  @Override
  public Result parseOn(Context context) {
    return context.success(null);
  }

  @Override
  public EpsilonParser copy() {
    return new EpsilonParser();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy