Commit e997676c authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

Support LBT formula in ltl2tgba.html.

Suggested by Joachim Klein.

* wrap/python/ajax/spot.in: Try parse_lbt() when parse() fails.
* NEWS: Mention it.
parent e78548eb
New in spot 1.2.4a (not yet released)
* Documentation
* New feature:
- The online ltl2tgba translator will automatically attempt to
parse a formula using LBT's syntax if it cannot parse it using
the normal infix syntax.
* Documentation:
- The man page for ltl2tgba has some new notes and references
about TGBA and about monitors.
......
#!@PYTHON@
# -*- mode: python; coding: utf-8 -*-
# Copyright (C) 2011, 2012, 2013 Laboratoire de Recherche et
# Copyright (C) 2011, 2012, 2013, 2014 Laboratoire de Recherche et
# Développement de l'Epita (LRDE).
#
# This file is part of Spot, a model checking library.
......@@ -405,9 +405,15 @@ pel = spot.empty_parse_error_list()
f = spot.parse(formula, pel, env)
if pel:
unbufprint('<div class="parse-error">')
err = spot.format_parse_errors(spot.get_cout(), formula, pel)
unbufprint('</div>')
# Try the LBT parser in case someone is throwing LBT formulas at us.
pel2 = spot.empty_parse_error_list()
g = spot.parse_lbt(formula, pel2, env)
if pel2:
unbufprint('<div class="parse-error">')
err = spot.format_parse_errors(spot.get_cout(), formula, pel)
unbufprint('</div>')
else:
f = g
# Do not continue if we could not parse anything sensible.
if not f:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment