From b08cac9f12d3be9db1309e23f20c487629b9d914 Mon Sep 17 00:00:00 2001 From: Malte Schmitz Date: Sun, 17 Dec 2017 21:15:28 +0100 Subject: [PATCH] Regenerate docco --- docco/horizontal/src/main/java/interpreter/Visitor.java.html | 2 +- docco/vertical/src/main/java/interpreter/Visitor.java.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docco/horizontal/src/main/java/interpreter/Visitor.java.html b/docco/horizontal/src/main/java/interpreter/Visitor.java.html index 7370df8..23836e5 100644 --- a/docco/horizontal/src/main/java/interpreter/Visitor.java.html +++ b/docco/horizontal/src/main/java/interpreter/Visitor.java.html @@ -1,4 +1,4 @@ -Visitor.java

Visitor

The interpreter (and the evaluator) are performing structural recursion on the inductive data structure Program and Expression, respectively. We want to define one interpreter function that behaves differently depending on the argument. In functional languages this is done with Pattern Matching and in Java this is typically implemented using the Visitor Pattern.

------------------Show Header Code ( lines)------------------
package interpreter;
1

This Visitor is implemented using [Reflection](https://en.wikipedia.org/wiki/Reflection_(computer_programming)). That is kind of cheating, but simplifies the classical Visitor pattern a lot. Of course the performance is bad, but performance is not an issue in this little demonstration and actually there are a lot of other performance issues as well.

public abstract class Visitor<T> {
+Visitor.java

Visitor

The interpreter (and the evaluator) are performing structural recursion on the inductive data structure Program and Expression, respectively. We want to define one interpreter function that behaves differently depending on the argument. In functional languages this is done with Pattern Matching and in Java this is typically implemented using the Visitor Pattern.

------------------Show Header Code ( lines)------------------
package interpreter;
1

This Visitor is implemented using Reflection. That is kind of cheating, but simplifies the classical Visitor pattern a lot. Of course the performance is bad, but performance is not an issue in this little demonstration and actually there are a lot of other performance issues as well.

public abstract class Visitor<T> {
     @SuppressWarnings("unchecked")
     public T visit(Object object) {
         try {
2

Get the name of the class of the given object, search for a method with this name in self and call it.

            return (T) this.getClass().getMethod("visit" + object.getClass().getSimpleName(), object.getClass()).invoke(this, object);
diff --git a/docco/vertical/src/main/java/interpreter/Visitor.java.html b/docco/vertical/src/main/java/interpreter/Visitor.java.html
index 6e2522b..1b5ed4e 100644
--- a/docco/vertical/src/main/java/interpreter/Visitor.java.html
+++ b/docco/vertical/src/main/java/interpreter/Visitor.java.html
@@ -1,4 +1,4 @@
-Visitor.java

Visitor

The interpreter (and the evaluator) are performing structural recursion on the inductive data structure Program and Expression, respectively. We want to define one interpreter function that behaves differently depending on the argument. In functional languages this is done with Pattern Matching and in Java this is typically implemented using the Visitor Pattern.

------------------Show Header Code ( lines)------------------
package interpreter;
1

This Visitor is implemented using [Reflection](https://en.wikipedia.org/wiki/Reflection_(computer_programming)). That is kind of cheating, but simplifies the classical Visitor pattern a lot. Of course the performance is bad, but performance is not an issue in this little demonstration and actually there are a lot of other performance issues as well.

public abstract class Visitor<T> {
+Visitor.java

Visitor

The interpreter (and the evaluator) are performing structural recursion on the inductive data structure Program and Expression, respectively. We want to define one interpreter function that behaves differently depending on the argument. In functional languages this is done with Pattern Matching and in Java this is typically implemented using the Visitor Pattern.

------------------Show Header Code ( lines)------------------
package interpreter;
1

This Visitor is implemented using Reflection. That is kind of cheating, but simplifies the classical Visitor pattern a lot. Of course the performance is bad, but performance is not an issue in this little demonstration and actually there are a lot of other performance issues as well.

public abstract class Visitor<T> {
     @SuppressWarnings("unchecked")
     public T visit(Object object) {
         try {
2

Get the name of the class of the given object, search for a method with this name in self and call it.

            return (T) this.getClass().getMethod("visit" + object.getClass().getSimpleName(), object.getClass()).invoke(this, object);