mirror of
https://github.com/DanilaFe/abacus
synced 2024-06-28 21:56:23 -07:00
19 lines
345 B
Java
19 lines
345 B
Java
|
package org.nwapw.abacus.lexing.pattern;
|
||
|
|
||
|
public class RangeNode<T> extends PatternNode<T> {
|
||
|
|
||
|
private char from;
|
||
|
private char to;
|
||
|
|
||
|
public RangeNode(char from, char to){
|
||
|
this.from = from;
|
||
|
this.to = to;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public boolean matches(char other) {
|
||
|
return other >= from && other <= to;
|
||
|
}
|
||
|
|
||
|
}
|