use of java.util.regex.MatchResult in project logisim-evolution by reds-heig.
the class VhdlParser method parseVector.
private int parseVector(Scanner scanner, StringBuilder type) throws IllegalVhdlContentException {
if (scanner.findWithinHorizon(Pattern.compile(VECTOR_PATTERN, Pattern.CASE_INSENSITIVE), 0) == null)
throw new IllegalVhdlContentException(Strings.get("vectorDeclarationException"));
MatchResult result = scanner.match();
if (result.groupCount() != 3)
throw new IllegalVhdlContentException(Strings.get("vectorDeclarationException"));
type.append(getType(result.group(1).toLowerCase()));
return Integer.parseInt(result.group(2)) - Integer.parseInt(result.group(3)) + 1;
}
use of java.util.regex.MatchResult in project ow by vtst.
the class EasyScanner method scan.
public EasyScanResult scan(Pattern pattern) {
prepareToScan();
MatchResult m = null;
if (scanner.findWithinHorizon(pattern, 0) != null) {
m = scanner.match();
}
EasyScanResult r = new EasyScanResult(input, m);
if (m != null)
seekInput(m.start());
return r;
}
Aggregations