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

com.kero.security.lang.parsers.metaline.MetalineParserBase Maven / Gradle / Ivy

package com.kero.security.lang.parsers.metaline;

import com.kero.security.lang.collections.TokenSequence;
import com.kero.security.lang.nodes.metaline.MetalineNode;
import com.kero.security.lang.parsers.KsdlNodeParserBase;
import com.kero.security.lang.tokens.KeyWordToken;
import com.kero.security.lang.tokens.NameToken;

public abstract class MetalineParserBase extends KsdlNodeParserBase implements MetalineParser {

	protected String name;
	
	public MetalineParserBase(String name) {
		
		this.name = name;
	}
	
	public boolean isMatch(TokenSequence tokens) {
	
		if(!tokens.isToken(0, KeyWordToken.METALINE)) return false;
		if(!tokens.isToken(1, NameToken.class)) return false;
		if(!((NameToken) tokens.get(1)).getRaw().equals(name)) return false;
		
		return true;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy