ing. For parse actions that have side effects, it is
  important to only call the parse action once it is determined that it is being
  called as part of a successful parse. For parse actions that perform additional
  validation, then call_during_try should be passed as True, so that the validation
  code is included in the preliminary "try" parses.

Note: the default parsing behavior is to expand tabs in the input string
before starting the parsing process.  See :class:`parse_string` for more
information on parsing strings containing ``<TAB>`` s, and suggested
methods to maintain a consistent view of the parsed string, the parse
location, and line and column positions within the parsed string.

Example::

    # parse dates in the form YYYY/MM/DD

    # use parse action to convert toks from str to int at parse time
    def convert_to_int(toks):
        return int(toks[0])

    # use a parse action to verify that the date is a valid date
    def is_valid_date(instring, loc, toks):
        from datetime import date
        year, month, day = toks[::2]
        try:
            date(year, month, day)
        except ValueError:
            raise ParseException(instring, loc, "invalid date given")

    integer = Word(nums)
    date_str = integer + '/' + integer + '/' + integer

    # add parse actions
    integer.set_parse_action(convert_to_int)
    date_str.set_parse_action(is_valid_date)

    # note that integer fields are now ints, not strings
    date_str.run_tests('''
        # successful parse - note that integer fields were converted to ints
        1999/12/31

        # fail - invalid date
        1999/13/31
        ''')
Nc