Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Spot
Spot
Commits
ecaedbba
Commit
ecaedbba
authored
Feb 23, 2005
by
Alexandre Duret-Lutz
Browse files
* src/ltlvisit/length.cc (length_visitor): Rewrite using
postfix_visitor.
parent
dd1bc787
Changes
2
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
ecaedbba
2005-02-23 Alexandre Duret-Lutz <adl@src.lip6.fr>
* src/ltlvisit/length.cc (length_visitor): Rewrite using
postfix_visitor.
2005-02-22 Alexandre Duret-Lutz <adl@src.lip6.fr>
* src/tgbaalgos/tau03opt.cc (tau03_opt_search): Add options "weights"
...
...
src/ltlvisit/length.cc
View file @
ecaedbba
...
...
@@ -20,8 +20,7 @@
// 02111-1307, USA.
#include
"length.hh"
#include
"ltlast/allnodes.hh"
#include
"ltlast/visitor.hh"
#include
"ltlvisit/postfix.hh"
namespace
spot
{
...
...
@@ -29,17 +28,11 @@ namespace spot
{
namespace
{
class
length_visitor
:
public
const
_visitor
class
length_visitor
:
public
postfix
_visitor
{
public:
length_visitor
()
{
result_
=
0
;
}
virtual
~
length_visitor
()
:
result_
(
0
)
{
}
...
...
@@ -49,37 +42,10 @@ namespace spot
return
result_
;
}
void
visit
(
const
atomic_prop
*
)
{
result_
=
1
;
}
void
visit
(
const
constant
*
)
{
result_
=
1
;
}
void
visit
(
const
unop
*
uo
)
{
result_
=
1
+
length
(
uo
->
child
());
}
void
visit
(
const
binop
*
bo
)
{
result_
=
1
+
length
(
bo
->
first
())
+
length
(
bo
->
second
());
}
void
visit
(
const
multop
*
mo
)
virtual
void
doit_default
(
formula
*
)
{
unsigned
mos
=
mo
->
size
();
++
result_
;
for
(
unsigned
i
=
0
;
i
<
mos
;
++
i
)
result_
+=
length
(
mo
->
nth
(
i
));
}
protected:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment