diff --git a/docco/horizontal/src/main/java/expression/Addition.java.html b/docco/horizontal/src/main/java/expression/Addition.java.html index f24cde6..dbd356e 100644 --- a/docco/horizontal/src/main/java/expression/Addition.java.html +++ b/docco/horizontal/src/main/java/expression/Addition.java.html @@ -1,4 +1,4 @@ -Addition.java

Addition

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

An Addition consists of a leftHandSide and a rightHandSide expression, which are supposed to be added.

For example

+Addition.java

Addition

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

An Addition consists of a leftHandSide and a rightHandSide expression, which are supposed to be added.

For example

new Addition(new Identifier("x"), new Int(2))
 

represents the code

x + 2
diff --git a/docco/horizontal/src/main/java/expression/Expression.java.html b/docco/horizontal/src/main/java/expression/Expression.java.html
index e23f2a0..aa1b3b6 100644
--- a/docco/horizontal/src/main/java/expression/Expression.java.html
+++ b/docco/horizontal/src/main/java/expression/Expression.java.html
@@ -1,4 +1,4 @@
-Expression.java

Expression

Expression can be written as the following Algebraic Data Type (ADT)

+Expression.java

Expression

Expression can be written as the following Algebraic Data Type (ADT)

Expression = Addition(leftHandSide: Expression, rightHandSide: Expression)
            | Subtraction(leftHandSide: Expression, rightHandSide: Expression)
            | Identifier(name: String)
diff --git a/docco/horizontal/src/main/java/expression/Identifier.java.html b/docco/horizontal/src/main/java/expression/Identifier.java.html
index fdedade..59aa136 100644
--- a/docco/horizontal/src/main/java/expression/Identifier.java.html
+++ b/docco/horizontal/src/main/java/expression/Identifier.java.html
@@ -1,4 +1,4 @@
-Identifier.java

Identifier

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

An Identifier consists only of the name of the identifier. This class is only needed as a wrapper which allows us to use an identifier as an expression.

public class Identifier extends Expression {
+Identifier.java

Identifier

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

An Identifier consists only of the name of the identifier. This class is only needed as a wrapper which allows us to use an identifier as an expression.

public class Identifier extends Expression {
     public final String name;
 
     public Identifier(String name) {
diff --git a/docco/horizontal/src/main/java/expression/Int.java.html b/docco/horizontal/src/main/java/expression/Int.java.html
index 076e1d1..80dcd82 100644
--- a/docco/horizontal/src/main/java/expression/Int.java.html
+++ b/docco/horizontal/src/main/java/expression/Int.java.html
@@ -1,4 +1,4 @@
-Int.java

Int(eger)

In order to avoid confusion with Java's Integer auto-boxing class for the primitive int this wrapper is called Int instead of Integer.

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

An Int consists only of its value. This class is only needed as a wrapper which allows us to use an integer as an expression.

public class Int extends Expression {
+Int.java

Int(eger)

In order to avoid confusion with Java's Integer auto-boxing class for the primitive int this wrapper is called Int instead of Integer.

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

An Int consists only of its value. This class is only needed as a wrapper which allows us to use an integer as an expression.

public class Int extends Expression {
     public final int value;
 
     public Int(int value) {
diff --git a/docco/horizontal/src/main/java/expression/Subtraction.java.html b/docco/horizontal/src/main/java/expression/Subtraction.java.html
index 7c646c5..5da1f5d 100644
--- a/docco/horizontal/src/main/java/expression/Subtraction.java.html
+++ b/docco/horizontal/src/main/java/expression/Subtraction.java.html
@@ -1,4 +1,4 @@
-Subtraction.java

Subtraction

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

A Subtraction consists of a leftHandSide and a rightHandSide expression, which are supposed to be subtracted.

For example

+Subtraction.java

Subtraction

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

A Subtraction consists of a leftHandSide and a rightHandSide expression, which are supposed to be subtracted.

For example

new Subtraction(new Identifier("x"), new Int(2))
 

represents the code

x - 2
diff --git a/docco/horizontal/src/main/java/interpreter/Evaluator.java.html b/docco/horizontal/src/main/java/interpreter/Evaluator.java.html
index 27b33fe..edbb84f 100644
--- a/docco/horizontal/src/main/java/interpreter/Evaluator.java.html
+++ b/docco/horizontal/src/main/java/interpreter/Evaluator.java.html
@@ -1,4 +1,4 @@
-Evaluator.java

Evaluator

The evaluator implements the semantics defined by the function eval: Expr * V -> Z, where V = Id -> Z is the set of all variable valuations to the set Z set of integers. eval is inductively defined as follows:

+Evaluator.java

Evaluator

The evaluator implements the semantics defined by the function eval: Expr * V -> Z, where V = Id -> Z is the set of all variable valuations to the set Z set of integers. eval is inductively defined as follows:

eval(e1 "+" e2, v) = eval(e1, v) + eval(e2, v)
 eval(e1 "-" e2, v) = eval(e1, v) − eval(e2, v)
 eval(x, v) = v(x)
diff --git a/docco/horizontal/src/main/java/interpreter/Interpreter.java.html b/docco/horizontal/src/main/java/interpreter/Interpreter.java.html
index 86d1ec7..28efca1 100644
--- a/docco/horizontal/src/main/java/interpreter/Interpreter.java.html
+++ b/docco/horizontal/src/main/java/interpreter/Interpreter.java.html
@@ -1,4 +1,4 @@
-Interpreter.java

Interpreter

The interpreter consists of the Interpreter defined in this file that can run a Program and the Evaluator that can evaluate an Expression.

The interpreter implements the semantics defined by the function sem: Prog * V -> V, where V = Id -> Z is the set of all variable valuations to the set Z set of integers. sem is inductively defined as follows:

+Interpreter.java

Interpreter

The interpreter consists of the Interpreter defined in this file that can run a Program and the Evaluator that can evaluate an Expression.

The interpreter implements the semantics defined by the function sem: Prog * V -> V, where V = Id -> Z is the set of all variable valuations to the set Z set of integers. sem is inductively defined as follows:

sem(x ":=" e, v) = v.update(x, eval(e, v))
 sem(c1 ";" c2) = sem(c2, sem(c1, v))
 sem("if" "(" e ")" "then" "{" c1 "}" else "{" c2 "}") =
diff --git a/docco/horizontal/src/main/java/interpreter/InterpreterException.java.html b/docco/horizontal/src/main/java/interpreter/InterpreterException.java.html
index 2823d99..c852954 100644
--- a/docco/horizontal/src/main/java/interpreter/InterpreterException.java.html
+++ b/docco/horizontal/src/main/java/interpreter/InterpreterException.java.html
@@ -1,4 +1,4 @@
-InterpreterException.java

InterpreterException

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

The InterpreterException is raised if anything goes wrong during the evaluation of an Expression or running a Program.

public class InterpreterException extends RuntimeException {
+InterpreterException.java

InterpreterException

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

The InterpreterException is raised if anything goes wrong during the evaluation of an Expression or running a Program.

public class InterpreterException extends RuntimeException {
     public InterpreterException(String error) {
         super(error);
     }
diff --git a/docco/horizontal/src/main/java/interpreter/Visitor.java.html b/docco/horizontal/src/main/java/interpreter/Visitor.java.html
index a03ce17..79ebfb6 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 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 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> {
     @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/horizontal/src/main/java/parser/Parser.java.html b/docco/horizontal/src/main/java/parser/Parser.java.html
index 5308042..9093f17 100644
--- a/docco/horizontal/src/main/java/parser/Parser.java.html
+++ b/docco/horizontal/src/main/java/parser/Parser.java.html
@@ -1,4 +1,4 @@
-Parser.java

Parser

In order to parse simple while programs we use a Recursive descent parser. The syntax of our while programs are defined by the following grammar in Extended Backus-Naur Form (EBNF):

+Parser.java

Parser

In order to parse simple while programs we use a Recursive descent parser. The syntax of our while programs are defined by the following grammar in Extended Backus-Naur Form (EBNF):

Prog = Id ":=" Expr |
        Prog ";" Prog |
       "if" "(" Expr ")" "then" "{" Prog "}" "else" "{" Prog "}" |
diff --git a/docco/horizontal/src/main/java/parser/SyntaxException.java.html b/docco/horizontal/src/main/java/parser/SyntaxException.java.html
index 7c3c781..bf95ef2 100644
--- a/docco/horizontal/src/main/java/parser/SyntaxException.java.html
+++ b/docco/horizontal/src/main/java/parser/SyntaxException.java.html
@@ -1,4 +1,4 @@
-SyntaxException.java

SyntaxException

------------------Show Code ( lines)------------------
package parser;
1

A SyntaxException is raised by the function in the Parser if an expected was not found at the current position.

public class SyntaxException extends RuntimeException {
+SyntaxException.java

SyntaxException

------------------Show Code ( lines)------------------
package parser;
1

A SyntaxException is raised by the function in the Parser if an expected was not found at the current position.

public class SyntaxException extends RuntimeException {
     public final String expected;
     public final int position;
 
diff --git a/docco/horizontal/src/main/java/program/Assignment.java.html b/docco/horizontal/src/main/java/program/Assignment.java.html
index 526a86e..40b3263 100644
--- a/docco/horizontal/src/main/java/program/Assignment.java.html
+++ b/docco/horizontal/src/main/java/program/Assignment.java.html
@@ -1,4 +1,4 @@
-Assignment.java

Assignment

------------------Show Header Code ( lines)------------------
package program;
+Assignment.java

Assignment

------------------Show Header Code ( lines)------------------
package program;
 
 import expression.Expression;
 import expression.Identifier;
1

An Assignment consists of an identifier and an expression which should be evaluated and the result stored in the variable named by the identifier.

For example

diff --git a/docco/horizontal/src/main/java/program/Composition.java.html b/docco/horizontal/src/main/java/program/Composition.java.html index f326c25..ad9f8ca 100644 --- a/docco/horizontal/src/main/java/program/Composition.java.html +++ b/docco/horizontal/src/main/java/program/Composition.java.html @@ -1,4 +1,4 @@ -Composition.java

Composition

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

A Composition combines two programs (first and second) with the intended semantics of sequential composition.

public class Composition extends Program {
+Composition.java

Composition

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

A Composition combines two programs (first and second) with the intended semantics of sequential composition.

public class Composition extends Program {
     public final Program first;
     public final Program second;
 
diff --git a/docco/horizontal/src/main/java/program/Conditional.java.html b/docco/horizontal/src/main/java/program/Conditional.java.html
index b55135c..3cc317d 100644
--- a/docco/horizontal/src/main/java/program/Conditional.java.html
+++ b/docco/horizontal/src/main/java/program/Conditional.java.html
@@ -1,4 +1,4 @@
-Conditional.java

Conditional

------------------Show Header Code ( lines)------------------
package program;
+Conditional.java

Conditional

------------------Show Header Code ( lines)------------------
package program;
 
 import expression.Expression;
1

A Conditional consists of the condition expression and the two programs thenCase and elseCase with the intended semantics of execution the elseCase if the expression evaluates to 0 and the thenCase otherwise.

public class Conditional extends Program {
     public final Expression condition;
diff --git a/docco/horizontal/src/main/java/program/Loop.java.html b/docco/horizontal/src/main/java/program/Loop.java.html
index c164e70..cee02eb 100644
--- a/docco/horizontal/src/main/java/program/Loop.java.html
+++ b/docco/horizontal/src/main/java/program/Loop.java.html
@@ -1,4 +1,4 @@
-Loop.java

Loop

------------------Show Header Code ( lines)------------------
package program;
+Loop.java

Loop

------------------Show Header Code ( lines)------------------
package program;
 
 import expression.Expression;
1

A Loop consists of a condition and a program with the intended semantics of execution the program while the condition evaluates to a non-zero value.

public class Loop extends Program {
     public final Expression condition;
diff --git a/docco/horizontal/src/main/java/program/Program.java.html b/docco/horizontal/src/main/java/program/Program.java.html
index 41341a4..5c3620d 100644
--- a/docco/horizontal/src/main/java/program/Program.java.html
+++ b/docco/horizontal/src/main/java/program/Program.java.html
@@ -1,4 +1,4 @@
-Program.java

Program

Program can be written as the following Algebraic Data Type (ADT)

+Program.java

Program

Program can be written as the following Algebraic Data Type (ADT)

Program = Assignment(identifier: Identifier, expression: Expression)
         | Composition(first: Program, second: Program)
         | Loop(condition: Expression, program: Program)
diff --git a/docco/vertical/src/main/java/expression/Addition.java.html b/docco/vertical/src/main/java/expression/Addition.java.html
index 6f993a1..a112452 100644
--- a/docco/vertical/src/main/java/expression/Addition.java.html
+++ b/docco/vertical/src/main/java/expression/Addition.java.html
@@ -1,4 +1,4 @@
-Addition.java

Addition

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

An Addition consists of a leftHandSide and a rightHandSide expression, which are supposed to be added.

For example

+Addition.java

Addition

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

An Addition consists of a leftHandSide and a rightHandSide expression, which are supposed to be added.

For example

new Addition(new Identifier("x"), new Int(2))
 

represents the code

x + 2
diff --git a/docco/vertical/src/main/java/expression/Expression.java.html b/docco/vertical/src/main/java/expression/Expression.java.html
index 0259f84..5255ef7 100644
--- a/docco/vertical/src/main/java/expression/Expression.java.html
+++ b/docco/vertical/src/main/java/expression/Expression.java.html
@@ -1,4 +1,4 @@
-Expression.java

Expression

Expression can be written as the following Algebraic Data Type (ADT)

+Expression.java

Expression

Expression can be written as the following Algebraic Data Type (ADT)

Expression = Addition(leftHandSide: Expression, rightHandSide: Expression)
            | Subtraction(leftHandSide: Expression, rightHandSide: Expression)
            | Identifier(name: String)
diff --git a/docco/vertical/src/main/java/expression/Identifier.java.html b/docco/vertical/src/main/java/expression/Identifier.java.html
index a0fe4f4..40f6077 100644
--- a/docco/vertical/src/main/java/expression/Identifier.java.html
+++ b/docco/vertical/src/main/java/expression/Identifier.java.html
@@ -1,4 +1,4 @@
-Identifier.java

Identifier

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

An Identifier consists only of the name of the identifier. This class is only needed as a wrapper which allows us to use an identifier as an expression.

public class Identifier extends Expression {
+Identifier.java

Identifier

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

An Identifier consists only of the name of the identifier. This class is only needed as a wrapper which allows us to use an identifier as an expression.

public class Identifier extends Expression {
     public final String name;
 
     public Identifier(String name) {
diff --git a/docco/vertical/src/main/java/expression/Int.java.html b/docco/vertical/src/main/java/expression/Int.java.html
index c2161d6..0e60993 100644
--- a/docco/vertical/src/main/java/expression/Int.java.html
+++ b/docco/vertical/src/main/java/expression/Int.java.html
@@ -1,4 +1,4 @@
-Int.java

Int(eger)

In order to avoid confusion with Java's Integer auto-boxing class for the primitive int this wrapper is called Int instead of Integer.

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

An Int consists only of its value. This class is only needed as a wrapper which allows us to use an integer as an expression.

public class Int extends Expression {
+Int.java

Int(eger)

In order to avoid confusion with Java's Integer auto-boxing class for the primitive int this wrapper is called Int instead of Integer.

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

An Int consists only of its value. This class is only needed as a wrapper which allows us to use an integer as an expression.

public class Int extends Expression {
     public final int value;
 
     public Int(int value) {
diff --git a/docco/vertical/src/main/java/expression/Subtraction.java.html b/docco/vertical/src/main/java/expression/Subtraction.java.html
index 0bffd92..439e6b7 100644
--- a/docco/vertical/src/main/java/expression/Subtraction.java.html
+++ b/docco/vertical/src/main/java/expression/Subtraction.java.html
@@ -1,4 +1,4 @@
-Subtraction.java

Subtraction

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

A Subtraction consists of a leftHandSide and a rightHandSide expression, which are supposed to be subtracted.

For example

+Subtraction.java

Subtraction

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

A Subtraction consists of a leftHandSide and a rightHandSide expression, which are supposed to be subtracted.

For example

new Subtraction(new Identifier("x"), new Int(2))
 

represents the code

x - 2
diff --git a/docco/vertical/src/main/java/interpreter/Evaluator.java.html b/docco/vertical/src/main/java/interpreter/Evaluator.java.html
index 2a8d643..46a4601 100644
--- a/docco/vertical/src/main/java/interpreter/Evaluator.java.html
+++ b/docco/vertical/src/main/java/interpreter/Evaluator.java.html
@@ -1,4 +1,4 @@
-Evaluator.java

Evaluator

The evaluator implements the semantics defined by the function eval: Expr * V -> Z, where V = Id -> Z is the set of all variable valuations to the set Z set of integers. eval is inductively defined as follows:

+Evaluator.java

Evaluator

The evaluator implements the semantics defined by the function eval: Expr * V -> Z, where V = Id -> Z is the set of all variable valuations to the set Z set of integers. eval is inductively defined as follows:

eval(e1 "+" e2, v) = eval(e1, v) + eval(e2, v)
 eval(e1 "-" e2, v) = eval(e1, v) − eval(e2, v)
 eval(x, v) = v(x)
diff --git a/docco/vertical/src/main/java/interpreter/Interpreter.java.html b/docco/vertical/src/main/java/interpreter/Interpreter.java.html
index d0c9ae8..85fc3bf 100644
--- a/docco/vertical/src/main/java/interpreter/Interpreter.java.html
+++ b/docco/vertical/src/main/java/interpreter/Interpreter.java.html
@@ -1,4 +1,4 @@
-Interpreter.java

Interpreter

The interpreter consists of the Interpreter defined in this file that can run a Program and the Evaluator that can evaluate an Expression.

The interpreter implements the semantics defined by the function sem: Prog * V -> V, where V = Id -> Z is the set of all variable valuations to the set Z set of integers. sem is inductively defined as follows:

+Interpreter.java

Interpreter

The interpreter consists of the Interpreter defined in this file that can run a Program and the Evaluator that can evaluate an Expression.

The interpreter implements the semantics defined by the function sem: Prog * V -> V, where V = Id -> Z is the set of all variable valuations to the set Z set of integers. sem is inductively defined as follows:

sem(x ":=" e, v) = v.update(x, eval(e, v))
 sem(c1 ";" c2) = sem(c2, sem(c1, v))
 sem("if" "(" e ")" "then" "{" c1 "}" else "{" c2 "}") =
diff --git a/docco/vertical/src/main/java/interpreter/InterpreterException.java.html b/docco/vertical/src/main/java/interpreter/InterpreterException.java.html
index 39670f3..b602e00 100644
--- a/docco/vertical/src/main/java/interpreter/InterpreterException.java.html
+++ b/docco/vertical/src/main/java/interpreter/InterpreterException.java.html
@@ -1,4 +1,4 @@
-InterpreterException.java

InterpreterException

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

The InterpreterException is raised if anything goes wrong during the evaluation of an Expression or running a Program.

public class InterpreterException extends RuntimeException {
+InterpreterException.java

InterpreterException

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

The InterpreterException is raised if anything goes wrong during the evaluation of an Expression or running a Program.

public class InterpreterException extends RuntimeException {
     public InterpreterException(String error) {
         super(error);
     }
diff --git a/docco/vertical/src/main/java/interpreter/Visitor.java.html b/docco/vertical/src/main/java/interpreter/Visitor.java.html
index edb1211..64e511a 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 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 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> {
     @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/parser/Parser.java.html b/docco/vertical/src/main/java/parser/Parser.java.html
index a23dc30..04354ec 100644
--- a/docco/vertical/src/main/java/parser/Parser.java.html
+++ b/docco/vertical/src/main/java/parser/Parser.java.html
@@ -1,4 +1,4 @@
-Parser.java

Parser

In order to parse simple while programs we use a Recursive descent parser. The syntax of our while programs are defined by the following grammar in Extended Backus-Naur Form (EBNF):

+Parser.java

Parser

In order to parse simple while programs we use a Recursive descent parser. The syntax of our while programs are defined by the following grammar in Extended Backus-Naur Form (EBNF):

Prog = Id ":=" Expr |
        Prog ";" Prog |
       "if" "(" Expr ")" "then" "{" Prog "}" "else" "{" Prog "}" |
diff --git a/docco/vertical/src/main/java/parser/SyntaxException.java.html b/docco/vertical/src/main/java/parser/SyntaxException.java.html
index 52ff072..f23db95 100644
--- a/docco/vertical/src/main/java/parser/SyntaxException.java.html
+++ b/docco/vertical/src/main/java/parser/SyntaxException.java.html
@@ -1,4 +1,4 @@
-SyntaxException.java

SyntaxException

------------------Show Code ( lines)------------------
package parser;
1

A SyntaxException is raised by the function in the Parser if an expected was not found at the current position.

public class SyntaxException extends RuntimeException {
+SyntaxException.java

SyntaxException

------------------Show Code ( lines)------------------
package parser;
1

A SyntaxException is raised by the function in the Parser if an expected was not found at the current position.

public class SyntaxException extends RuntimeException {
     public final String expected;
     public final int position;
 
diff --git a/docco/vertical/src/main/java/program/Assignment.java.html b/docco/vertical/src/main/java/program/Assignment.java.html
index 66b6b4c..c12fe10 100644
--- a/docco/vertical/src/main/java/program/Assignment.java.html
+++ b/docco/vertical/src/main/java/program/Assignment.java.html
@@ -1,4 +1,4 @@
-Assignment.java

Assignment

------------------Show Header Code ( lines)------------------
package program;
+Assignment.java

Assignment

------------------Show Header Code ( lines)------------------
package program;
 
 import expression.Expression;
 import expression.Identifier;
1

An Assignment consists of an identifier and an expression which should be evaluated and the result stored in the variable named by the identifier.

For example

diff --git a/docco/vertical/src/main/java/program/Composition.java.html b/docco/vertical/src/main/java/program/Composition.java.html index ce4ad9e..b06e3a6 100644 --- a/docco/vertical/src/main/java/program/Composition.java.html +++ b/docco/vertical/src/main/java/program/Composition.java.html @@ -1,4 +1,4 @@ -Composition.java

Composition

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

A Composition combines two programs (first and second) with the intended semantics of sequential composition.

public class Composition extends Program {
+Composition.java

Composition

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

A Composition combines two programs (first and second) with the intended semantics of sequential composition.

public class Composition extends Program {
     public final Program first;
     public final Program second;
 
diff --git a/docco/vertical/src/main/java/program/Conditional.java.html b/docco/vertical/src/main/java/program/Conditional.java.html
index c27e7de..68303bf 100644
--- a/docco/vertical/src/main/java/program/Conditional.java.html
+++ b/docco/vertical/src/main/java/program/Conditional.java.html
@@ -1,4 +1,4 @@
-Conditional.java

Conditional

------------------Show Header Code ( lines)------------------
package program;
+Conditional.java

Conditional

------------------Show Header Code ( lines)------------------
package program;
 
 import expression.Expression;
1

A Conditional consists of the condition expression and the two programs thenCase and elseCase with the intended semantics of execution the elseCase if the expression evaluates to 0 and the thenCase otherwise.

public class Conditional extends Program {
     public final Expression condition;
diff --git a/docco/vertical/src/main/java/program/Loop.java.html b/docco/vertical/src/main/java/program/Loop.java.html
index bda629d..7841db5 100644
--- a/docco/vertical/src/main/java/program/Loop.java.html
+++ b/docco/vertical/src/main/java/program/Loop.java.html
@@ -1,4 +1,4 @@
-Loop.java

Loop

------------------Show Header Code ( lines)------------------
package program;
+Loop.java

Loop

------------------Show Header Code ( lines)------------------
package program;
 
 import expression.Expression;
1

A Loop consists of a condition and a program with the intended semantics of execution the program while the condition evaluates to a non-zero value.

public class Loop extends Program {
     public final Expression condition;
diff --git a/docco/vertical/src/main/java/program/Program.java.html b/docco/vertical/src/main/java/program/Program.java.html
index af55fb5..ef23dd4 100644
--- a/docco/vertical/src/main/java/program/Program.java.html
+++ b/docco/vertical/src/main/java/program/Program.java.html
@@ -1,4 +1,4 @@
-Program.java

Program

Program can be written as the following Algebraic Data Type (ADT)

+Program.java

Program

Program can be written as the following Algebraic Data Type (ADT)

Program = Assignment(identifier: Identifier, expression: Expression)
         | Composition(first: Program, second: Program)
         | Loop(condition: Expression, program: Program)