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

com.github.uscexp.grappa.extension.nodes.AstCommandTreeNode Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (C) 2014 - 2016 by haui - all rights reserved
 */
package com.github.uscexp.grappa.extension.nodes;

import com.github.uscexp.grappa.extension.annotations.AstCommand;

/**
 * base class for all {@link AstCommand} annotated parser rules.
 * the subclass has to contain the command logic.
 * 
 * @author haui
 *
 */
public abstract class AstCommandTreeNode extends AstTreeNode {

	public AstCommandTreeNode(String rule, String value) {
		super(rule, value);
	}
	
	public AstTreeNode getSibling(int index) {
		AstTreeNode sibling = null;
		if(getParent() != null && getParent().getChildren() != null && getParent().getChildren().size() > index) {
			sibling = getParent().getChildren().get(index);
		}
		return sibling;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy