class_docstr: Validator which can be used for validation according to variables in
  the grammar. Each variable can have its own validator.
  
  :param compiled_grammar: `GrammarCompleter` instance.
  :param validators: `dict` mapping variable names of the grammar to the
                     `Validator` instances to be used for each variable.
code: def __init__(self, compiled_grammar, validators):
      assert isinstance(compiled_grammar, _CompiledGrammar)
      assert isinstance(validators, dict)
  
      self.compiled_grammar = compiled_grammar
      self.validators = validators
  
imports: from __future__ import unicode_literals
  from prompt_toolkit.validation import Validator, ValidationError
  from prompt_toolkit.document import Document
  from .compiler import _CompiledGrammar
label_desc: Use image node_id 1 to create a new GrammarValidator object from inherited base classes: Validator with example: obj = GrammarValidator(compiled_grammar, validators)