mirror of
https://github.com/DanilaFe/abacus
synced 2026-01-27 09:05:19 +00:00
Implement a few nodes for the pattern matching.
This commit is contained in:
25
src/org/nwapw/abacus/lexing/pattern/PatternNode.java
Normal file
25
src/org/nwapw/abacus/lexing/pattern/PatternNode.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package org.nwapw.abacus.lexing.pattern;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class PatternNode<T> {
|
||||
|
||||
protected ArrayList<PatternNode<T>> outputStates;
|
||||
|
||||
public PatternNode(){
|
||||
outputStates = new ArrayList<>();
|
||||
}
|
||||
|
||||
public boolean matches(char other){
|
||||
return false;
|
||||
}
|
||||
|
||||
public char range(){
|
||||
return '\0';
|
||||
}
|
||||
|
||||
public void addInto(ArrayList<PatternNode<T>> into){
|
||||
into.add(this);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user