Because this parser is not specific to HOA anymore. * src/hoaparse/Makefile.am, src/hoaparse/fmterror.cc, src/hoaparse/hoaparse.yy, src/hoaparse/parsedecl.hh, src/parseaut/public.hh, src/hoaparse/hoascan.ll, src/tests/hoaparse.test: Rename to... * src/parseaut/Makefile.am, src/parseaut/fmterror.cc, src/parseaut/parseaut.yy, src/parseaut/parsedecl.hh, src/hoaparse/public.hh, src/parseaut/scanaut.ll, src/tests/parseaut.test: ... these, and also adjust the name internally. For instance hoa_aut_ptr is now parsed_aut_ptr; hoa_stream_parser is now automaton_stream_parser, and hoa_parse() has become parse_aut(). * NEWS, README, configure.ac, doc/org/tut20.org, src/Makefile.am, src/bin/autfilt.cc, src/bin/common_aoutput.cc, src/bin/common_aoutput.hh, src/bin/common_conv.cc, src/bin/ltlcross.cc, src/bin/ltldo.cc, src/tests/Makefile.am, src/tests/complementation.cc, src/tests/ltl2tgba.cc, src/tests/readsave.test, wrap/python/ajax/spot.in, wrap/python/spot.py, wrap/python/spot_impl.i, wrap/python/tests/automata-io.ipynb, wrap/python/tests/parsetgba.py: Adjust.
45 lines
1.3 KiB
Python
Executable file
45 lines
1.3 KiB
Python
Executable file
# -*- mode: python; coding: utf-8 -*-
|
|
# Copyright (C) 2012, 2014, 2015 Laboratoire de Recherche et Développement
|
|
# de l'Epita (LRDE).
|
|
#
|
|
# This file is part of Spot, a model checking library.
|
|
#
|
|
# Spot is free software; you can redistribute it and/or modify it
|
|
# under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation; either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# Spot is distributed in the hope that it will be useful, but WITHOUT
|
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
|
# License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
import os
|
|
import spot
|
|
|
|
contents = '''
|
|
HOA: v1 name: "a U b" States: 2 Start: 1 AP: 2 "a" "b" acc-name: Buchi
|
|
Acceptance: 1 Inf(0) properties: trans-labels explicit-labels state-acc
|
|
deterministic --BODY-- State: 0 {0} [t] 0 State: 1 [1] 0 [0&!1] 1 --END--
|
|
'''
|
|
|
|
filename = 'parsetgba.hoa'
|
|
|
|
out = open(filename, 'w+')
|
|
out.write(contents)
|
|
out.close()
|
|
|
|
p = spot.empty_parse_aut_error_list()
|
|
a = spot.parse_aut(filename, p, spot.make_bdd_dict())
|
|
|
|
assert not p
|
|
|
|
spot.print_dot(spot.get_cout(), a.aut)
|
|
|
|
del p
|
|
del a
|
|
|
|
os.unlink(filename)
|