1
0
mirror of https://github.com/DanilaFe/abacus synced 2025-06-30 16:04:40 -07:00
Abacus/src/main/java/org/nwapw/abacus/parsing/Parser.java

24 lines
574 B
Java
Raw Normal View History

package org.nwapw.abacus.parsing;
2017-08-02 11:04:35 -07:00
import org.nwapw.abacus.Abacus;
import org.nwapw.abacus.tree.TreeNode;
import java.util.List;
/**
* An itnerface that provides the ability to convert a list of tokens
* into a parse tree.
2017-07-30 21:11:32 -07:00
*
* @param <T> the type of tokens accepted by this parser.
*/
public interface Parser<T> {
/**
* Constructs a tree out of the given tokens.
2017-07-30 21:11:32 -07:00
*
* @param tokens the tokens to construct a tree from.
* @return the constructed tree, or null on error.
*/
2017-08-02 11:04:35 -07:00
public TreeNode constructTree(List<T> tokens,Abacus trace);
}