def __init__(self, name, *values, **options):
        """Create a new rule definition. Simply instantiating a new rule definition
        will add it to the current ``GramFuzzer`` instance.

        :param str name: The name of the rule being defined
        :param list values: The list of values that define the value of the rule
            (will be concatenated when built)
        :param str cat: The category to create the rule in (default=``"default"``).
        :param bool no_prune: If this rule should not be pruned *EVEN IF* it is found to be
            unreachable (default=``False``)
        """
        self.name = name
        self.options = options
        self.values = list(values)

        self.sep = self.options.setdefault("sep", self.sep)
        self.cat = self.options.setdefault("cat", self.cat)
        self.no_prune = self.options.setdefault("no_prune", self.no_prune)

        self.fuzzer = GramFuzzer.instance()

        frame,mod_path,_,_,_,_ = inspect.stack()[1]
        module_name = os.path.basename(mod_path).replace(".pyc", "").replace(".py", "")
        if "TOP_CAT" in frame.f_locals:
            self.fuzzer.cat_group_defaults[module_name] = frame.f_locals["TOP_CAT"]
        self.fuzzer.add_definition(self.cat, self.name, self, no_prune=self.no_prune, gram_file=module_name)
def __init__ ( self , name , * values , ** options ) : self . name = name self . options = options self . values = list ( values ) self . sep = self . options . setdefault ( "sep" , self . sep ) self . cat = self . options . setdefault ( "cat" , self . cat ) self . no_prune = self . options . setdefault ( "no_prune" , self . no_prune ) self . fuzzer = GramFuzzer . instance ( ) frame , mod_path , _ , _ , _ , _ = inspect . stack ( ) [ 1 ] module_name = os . path . basename ( mod_path ) . replace ( ".pyc" , "" ) . replace ( ".py" , "" ) if "TOP_CAT" in frame . f_locals : self . fuzzer . cat_group_defaults [ module_name ] = frame . f_locals [ "TOP_CAT" ] self . fuzzer . add_definition ( self . cat , self . name , self , no_prune = self . no_prune , gram_file = module_name )
Create a new rule definition. Simply instantiating a new rule definition
        will add it to the current ``GramFuzzer`` instance.

        :param str name: The name of the rule being defined
        :param list values: The list of values that define the value of the rule
            (will be concatenated when built)
        :param str cat: The category to create the rule in (default=``"default"``).
        :param bool no_prune: If this rule should not be pruned *EVEN IF* it is found to be
            unreachable (default=``False``)