You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I spotted a few issues in the code of the RegularExpressionParser class introduced in 4.6.
(this one is fixed in the enclosed patched file) the class is unusable since the result of lexer.nextToken() is never used. As a consequence of that, any call to parse yields 'null'.
The dot notation parsing is flaky. For instance, the following two examples relate toi the handling of epsilon expressions but are not orthogonal to one another.
// Prints "null.(32)*"
System.out.println(new PatchedRegexParser(new StringReader("(.32*)")).parse(false));
// Warns of a syntax error then prints "32.(null).*"
System.out.println(new PatchedRegexParser(new StringReader("(32.*)")).parse(false));
In some cases (ie when a dot is missing) the parser silently drops a whole portion of the text to parse. For example, consider the following example:
// Prints "(17)*.23" and nothing more.
System.out.println(new PatchedRegexParser(new StringReader("(32.14*)17*.23")).parse(false));
Btw, I wonder if reusing the . and + symbols for summation and concatenation was judicious. Indeed, these symbols have different meaning in POSIX-style regexes (and I assume most people would expect that meaning)
Concerns : JaCoP 4.6 (Java 11).
I spotted a few issues in the code of the RegularExpressionParser class introduced in 4.6.
Btw, I wonder if reusing the . and + symbols for summation and concatenation was judicious. Indeed, these symbols have different meaning in POSIX-style regexes (and I assume most people would expect that meaning)
PatchedRegexParser.java.txt
The text was updated successfully, but these errors were encountered: