#! /usr/bin/env python

from abjad import *

r'''If no pickled parser tables have been created, e.g. because Abjad has just
been downloaded and installed for the first time, PLY will print an error
message along the lines of "WARNING: yacc parser tables out of date.". This can
cause doctests to fail should the warning appear during the middle of those
tests.

This script simply finds each Parser subclass in Abjad and instantiates it,
thereby causing PLY to create and persist the appropriate parser tables.
'''

class_ = lilypondparsertools.LilyPondParser
print('Priming {} parser tables.'.format(class_.__name__))
class_()

class_ = lilypondparsertools.SchemeParser
print('Priming {} parser tables.'.format(class_.__name__))
class_()

class_ = rhythmtreetools.RhythmTreeParser
print('Priming {} parser tables.'.format(class_.__name__))
class_()

class_ = lilypondparsertools.ReducedLyParser
print('Priming {} parser tables.'.format(class_.__name__))
class_()