From dcbda5b255289a43d485595ece765431a2c3cdfa Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Sat, 29 Jul 2017 21:36:39 -0700 Subject: [PATCH] Add comments to the two parsing interfaces. --- src/org/nwapw/abacus/parsing/Parser.java | 10 ++++++++++ src/org/nwapw/abacus/parsing/Tokenizer.java | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/src/org/nwapw/abacus/parsing/Parser.java b/src/org/nwapw/abacus/parsing/Parser.java index 0103a7d..d4a72d0 100644 --- a/src/org/nwapw/abacus/parsing/Parser.java +++ b/src/org/nwapw/abacus/parsing/Parser.java @@ -4,7 +4,17 @@ 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. + * @param the type of tokens accepted by this parser. + */ public interface Parser { + /** + * Constructs a tree out of the given tokens. + * @param tokens the tokens to construct a tree from. + * @return the constructed tree, or null on error. + */ public TreeNode constructTree(List tokens); } diff --git a/src/org/nwapw/abacus/parsing/Tokenizer.java b/src/org/nwapw/abacus/parsing/Tokenizer.java index 4baef10..0f1b270 100644 --- a/src/org/nwapw/abacus/parsing/Tokenizer.java +++ b/src/org/nwapw/abacus/parsing/Tokenizer.java @@ -2,8 +2,17 @@ package org.nwapw.abacus.parsing; import java.util.List; +/** + * Interface that provides the ability to convert a string into a list of tokens. + * @param the type of the tokens produced. + */ public interface Tokenizer { + /** + * Converts a string into tokens. + * @param string the string to convert. + * @return the list of tokens, or null on error. + */ public List tokenizeString(String string); }