mirror of
https://github.com/DanilaFe/abacus
synced 2026-01-28 01:25:19 +00:00
Add a lot of comments. More to come.
This commit is contained in:
@@ -1,13 +1,28 @@
|
||||
package org.nwapw.abacus.lexing.pattern;
|
||||
|
||||
/**
|
||||
* A node that represents a successful match.
|
||||
* @param <T> the type that's used to tell which pattern this node belongs to.
|
||||
*/
|
||||
public class EndNode<T> extends PatternNode<T> {
|
||||
|
||||
/**
|
||||
* The ID of the pattenr that has been matched.
|
||||
*/
|
||||
private T patternId;
|
||||
|
||||
/**
|
||||
* Creates a new end node with the given ID.
|
||||
* @param patternId the pattern ID.
|
||||
*/
|
||||
public EndNode(T patternId){
|
||||
this.patternId = patternId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the pattern ID.
|
||||
* @return the pattern ID.
|
||||
*/
|
||||
public T getPatternId(){
|
||||
return patternId;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user