
from .CopyableGrammar import CopyableGrammar as _G



class Grammar(_G):
    def __copy__(self):
        return self.copy()

    def copy(self, terminals=False, nonterminals=False, rules=False):
        c = self._copy(terminals=terminals, nonterminals=nonterminals, rules=rules)
        return Grammar(terminals=list(c.new_terms),
                       nonterminals=list(c.new_nonterms),
                       rules=list(c.new_rules),
                       start_symbol=c.start)

    def copy_rules(self):
        return self.copy(rules=True)

    def __deepcopy__(self, memodict={}):
        return self.copy(terminals=True, nonterminals=True, rules=True)


from .CopyableGrammar import CopyableGrammar as _G



class Grammar(_G):
    def __copy__(self):
        return self.copy()

    def copy(self, terminals=False, nonterminals=False, rules=False):
        c = self._copy(terminals=terminals, nonterminals=nonterminals, rules=rules)
        return Grammar(terminals=list(c.new_terms),
                       nonterminals=list(c.new_nonterms),
                       rules=list(c.new_rules),
                       start_symbol=c.start)

    def __deepcopy__(self, memodict={}):
        return self.copy(terminals=True, nonterminals=True, rules=True)

Remove method for copying rules only
Remove method for copying rules only

  
  from .CopyableGrammar import CopyableGrammar as _G
  
  
  
  class Grammar(_G):
      def __copy__(self):
          return self.copy()
  
      def copy(self, terminals=False, nonterminals=False, rules=False):
          c = self._copy(terminals=terminals, nonterminals=nonterminals, rules=rules)
          return Grammar(terminals=list(c.new_terms),
                         nonterminals=list(c.new_nonterms),
                         rules=list(c.new_rules),
                         start_symbol=c.start)
  
-     def copy_rules(self):
-         return self.copy(rules=True)
- 
      def __deepcopy__(self, memodict={}):
          return self.copy(terminals=True, nonterminals=True, rules=True)
  
Remove method for copying rules only
## Code Before:

from .CopyableGrammar import CopyableGrammar as _G



class Grammar(_G):
    def __copy__(self):
        return self.copy()

    def copy(self, terminals=False, nonterminals=False, rules=False):
        c = self._copy(terminals=terminals, nonterminals=nonterminals, rules=rules)
        return Grammar(terminals=list(c.new_terms),
                       nonterminals=list(c.new_nonterms),
                       rules=list(c.new_rules),
                       start_symbol=c.start)

    def copy_rules(self):
        return self.copy(rules=True)

    def __deepcopy__(self, memodict={}):
        return self.copy(terminals=True, nonterminals=True, rules=True)

## Instruction:
Remove method for copying rules only
## Code After:

from .CopyableGrammar import CopyableGrammar as _G



class Grammar(_G):
    def __copy__(self):
        return self.copy()

    def copy(self, terminals=False, nonterminals=False, rules=False):
        c = self._copy(terminals=terminals, nonterminals=nonterminals, rules=rules)
        return Grammar(terminals=list(c.new_terms),
                       nonterminals=list(c.new_nonterms),
                       rules=list(c.new_rules),
                       start_symbol=c.start)

    def __deepcopy__(self, memodict={}):
        return self.copy(terminals=True, nonterminals=True, rules=True)
