Package jflex

Class SemCheck


  • public final class SemCheck
    extends java.lang.Object
    Performs simple semantic analysis on regular expressions.
    Version:
    JFlex 1.7.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static Macros macros  
    • Constructor Summary

      Constructors 
      Constructor Description
      SemCheck()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void check​(RegExps rs, Macros m, java.io.File f)
      Performs semantic analysis for all expressions.
      static boolean isFiniteChoice​(RegExp re)
      Returns true iff the expression is a finite choice of fixed length expressions.
      static int length​(RegExp re)
      Returns length if expression has fixed length, -1 otherwise.
      static boolean maybeEmtpy​(RegExp re)
      Checks if the expression potentially matches the empty string.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • macros

        private static Macros macros
    • Constructor Detail

      • SemCheck

        public SemCheck()
    • Method Detail

      • check

        public static void check​(RegExps rs,
                                 Macros m,
                                 java.io.File f)
        Performs semantic analysis for all expressions.

        Currently checks for empty expressions only.

        Parameters:
        rs - the reg exps to be checked
        m - the macro table (in expanded form)
        f - the spec file containing the rules
      • maybeEmtpy

        public static boolean maybeEmtpy​(RegExp re)
        Checks if the expression potentially matches the empty string.
        Parameters:
        re - a RegExp object.
        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 - a RegExp object.
        Returns:
        a int.
      • isFiniteChoice

        public static boolean isFiniteChoice​(RegExp re)
        Returns true iff the expression is a finite choice of fixed length expressions.

        Negation operators are treated as always variable length.

        Parameters:
        re - a RegExp object.
        Returns:
        a boolean.