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

org.unlaxer.tinyexpression.parser.IdentifierParser Maven / Gradle / Ivy

package org.unlaxer.tinyexpression.parser;

import java.util.List;

import org.unlaxer.Name;
import org.unlaxer.parser.Parser;
import org.unlaxer.parser.Parsers;
import org.unlaxer.parser.combinator.LazyChain;
import org.unlaxer.parser.combinator.ZeroOrMore;
import org.unlaxer.parser.posix.AlphabetNumericUnderScoreParser;
import org.unlaxer.parser.posix.AlphabetUnderScoreParser;

public class IdentifierParser extends LazyChain {

	private static final long serialVersionUID = -5555275182104345815L;

	public IdentifierParser() {
		super();
	}

	public IdentifierParser(Name name) {
		super(name);
	}
	
	List parsers;
	
	@Override
	public void initialize() {
		parsers = 
			new Parsers(
				Parser.get(AlphabetUnderScoreParser.class),
				new ZeroOrMore(
					Parser.get(AlphabetNumericUnderScoreParser.class)
				)
			);
	}

	@Override
	public List getLazyParsers() {
		return parsers; 
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy