Package jflex.core
Class SemCheck
- java.lang.Object
-
- jflex.core.SemCheck
-
public final class SemCheck extends java.lang.ObjectPerforms simple semantic analysis on regular expressions.- Version:
- JFlex 1.9.1
-
-
Constructor Summary
Constructors Modifier Constructor Description privateSemCheck()Prevent instantiation of static-only class
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcheck(RegExps rs, java.io.File f)Performs semantic analysis for all expressions.static booleanisFiniteChoice(RegExp re)Returns true iff the expression is a finite choice of fixed length expressions.static intlength(RegExp re)Returns length if expression has fixed length, -1 otherwise.static booleanmaybeEmtpy(RegExp re)Checks if the expression potentially matches the empty string.
-
-
-
Method Detail
-
check
public static void check(RegExps rs, java.io.File f)
Performs semantic analysis for all expressions.Currently checks for empty expressions only.
- Parameters:
rs- the reg exps to be checkedf- the spec file containing the rules
-
maybeEmtpy
public static boolean maybeEmtpy(RegExp re)
Checks if the expression potentially matches the empty string.- Parameters:
re- aRegExpobject.- Returns:
- a boolean.
-
length
public static int length(RegExp re)
Returns length if expression has fixed length, -1 otherwise.Negation operators are treated as always variable length.
- Parameters:
re- aRegExpobject.- Returns:
- a int.
-
-