mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-04 14:07:25 +02:00
upd README
This commit is contained in:
70
Behavioral/Interpreter/README.rst
Normal file
70
Behavioral/Interpreter/README.rst
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
`Interpreter`__
|
||||||
|
============
|
||||||
|
|
||||||
|
Purpose
|
||||||
|
-------
|
||||||
|
|
||||||
|
For a given language, it defines the representation of its grammar,
|
||||||
|
as well as an interpreter for the sentences of that language.
|
||||||
|
|
||||||
|
Examples
|
||||||
|
--------
|
||||||
|
|
||||||
|
- An example of a binary logic interpreter, each definition is defined by its own class
|
||||||
|
|
||||||
|
UML Diagram
|
||||||
|
-----------
|
||||||
|
|
||||||
|
.. image:: uml/uml.png
|
||||||
|
:alt: Alt Interpreter UML Diagram
|
||||||
|
:align: center
|
||||||
|
|
||||||
|
Code
|
||||||
|
----
|
||||||
|
|
||||||
|
You can also find this code on `GitHub`_
|
||||||
|
|
||||||
|
AbstractExp.php
|
||||||
|
|
||||||
|
.. literalinclude:: AbstractExp.php
|
||||||
|
:language: php
|
||||||
|
:linenos:
|
||||||
|
|
||||||
|
Context.php
|
||||||
|
|
||||||
|
.. literalinclude:: Context.php
|
||||||
|
:language: php
|
||||||
|
:linenos:
|
||||||
|
|
||||||
|
|
||||||
|
VariableExp.php
|
||||||
|
|
||||||
|
.. literalinclude:: VariableExp.php
|
||||||
|
:language: php
|
||||||
|
:linenos:
|
||||||
|
|
||||||
|
|
||||||
|
AndExp.php
|
||||||
|
|
||||||
|
.. literalinclude:: AndExp.php
|
||||||
|
:language: php
|
||||||
|
:linenos:
|
||||||
|
|
||||||
|
|
||||||
|
OrExp.php
|
||||||
|
|
||||||
|
.. literalinclude:: OrExp.php
|
||||||
|
:language: php
|
||||||
|
:linenos:
|
||||||
|
|
||||||
|
Test
|
||||||
|
----
|
||||||
|
|
||||||
|
Tests/InterpreterTest.php
|
||||||
|
|
||||||
|
.. literalinclude:: Tests/InterpreterTest.php
|
||||||
|
:language: php
|
||||||
|
:linenos:
|
||||||
|
|
||||||
|
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/Behavioral/Interpreter
|
||||||
|
.. __: https://en.wikipedia.org/wiki/Interpreter_pattern
|
@@ -7,6 +7,7 @@ communication.
|
|||||||
|
|
||||||
* [ChainOfResponsibilities](ChainOfResponsibilities) [:notebook:](http://en.wikipedia.org/wiki/Chain_of_responsibility_pattern)
|
* [ChainOfResponsibilities](ChainOfResponsibilities) [:notebook:](http://en.wikipedia.org/wiki/Chain_of_responsibility_pattern)
|
||||||
* [Command](Command) [:notebook:](http://en.wikipedia.org/wiki/Command_pattern)
|
* [Command](Command) [:notebook:](http://en.wikipedia.org/wiki/Command_pattern)
|
||||||
|
* [Interpreter](Interpreter) [:notebook:](https://en.wikipedia.org/wiki/Interpreter_pattern)
|
||||||
* [Iterator](Iterator) [:notebook:](http://en.wikipedia.org/wiki/Iterator_pattern)
|
* [Iterator](Iterator) [:notebook:](http://en.wikipedia.org/wiki/Iterator_pattern)
|
||||||
* [Mediator](Mediator) [:notebook:](http://en.wikipedia.org/wiki/Mediator_pattern)
|
* [Mediator](Mediator) [:notebook:](http://en.wikipedia.org/wiki/Mediator_pattern)
|
||||||
* [Memento](Memento) [:notebook:](http://en.wikipedia.org/wiki/Memento_pattern)
|
* [Memento](Memento) [:notebook:](http://en.wikipedia.org/wiki/Memento_pattern)
|
||||||
|
@@ -11,6 +11,7 @@ carrying out this communication.
|
|||||||
|
|
||||||
ChainOfResponsibilities/README
|
ChainOfResponsibilities/README
|
||||||
Command/README
|
Command/README
|
||||||
|
Interpreter/README
|
||||||
Iterator/README
|
Iterator/README
|
||||||
Mediator/README
|
Mediator/README
|
||||||
Memento/README
|
Memento/README
|
||||||
@@ -22,4 +23,4 @@ carrying out this communication.
|
|||||||
TemplateMethod/README
|
TemplateMethod/README
|
||||||
Visitor/README
|
Visitor/README
|
||||||
|
|
||||||
.. __: http://en.wikipedia.org/wiki/Behavioral_pattern
|
.. __: http://en.wikipedia.org/wiki/Behavioral_pattern
|
||||||
|
@@ -79,6 +79,7 @@ The patterns can be structured in roughly three different categories. Please cli
|
|||||||
|
|
||||||
* [ChainOfResponsibilities](Behavioral/ChainOfResponsibilities) [:notebook:](http://en.wikipedia.org/wiki/Chain_of_responsibility_pattern)
|
* [ChainOfResponsibilities](Behavioral/ChainOfResponsibilities) [:notebook:](http://en.wikipedia.org/wiki/Chain_of_responsibility_pattern)
|
||||||
* [Command](Behavioral/Command) [:notebook:](http://en.wikipedia.org/wiki/Command_pattern)
|
* [Command](Behavioral/Command) [:notebook:](http://en.wikipedia.org/wiki/Command_pattern)
|
||||||
|
* [Interpreter](Behavioral/Interpreter) [:notebook:](https://en.wikipedia.org/wiki/Interpreter_pattern)
|
||||||
* [Iterator](Behavioral/Iterator) [:notebook:](http://en.wikipedia.org/wiki/Iterator_pattern)
|
* [Iterator](Behavioral/Iterator) [:notebook:](http://en.wikipedia.org/wiki/Iterator_pattern)
|
||||||
* [Mediator](Behavioral/Mediator) [:notebook:](http://en.wikipedia.org/wiki/Mediator_pattern)
|
* [Mediator](Behavioral/Mediator) [:notebook:](http://en.wikipedia.org/wiki/Mediator_pattern)
|
||||||
* [Memento](Behavioral/Memento) [:notebook:](http://en.wikipedia.org/wiki/Memento_pattern)
|
* [Memento](Behavioral/Memento) [:notebook:](http://en.wikipedia.org/wiki/Memento_pattern)
|
||||||
@@ -113,4 +114,4 @@ The patterns can be structured in roughly three different categories. Please cli
|
|||||||
| es_MX | Spanish-Mexican | [Docs :notebook:](https://designpatternsphp.readthedocs.io/es_MX/latest/README.html) |
|
| es_MX | Spanish-Mexican | [Docs :notebook:](https://designpatternsphp.readthedocs.io/es_MX/latest/README.html) |
|
||||||
| tr | Turkish | [Docs :notebook:](https://designpatternsphp.readthedocs.io/tr/latest/README.html) |
|
| tr | Turkish | [Docs :notebook:](https://designpatternsphp.readthedocs.io/tr/latest/README.html) |
|
||||||
| bg | Bulgarian | [Docs :notebook:](https://designpatternsphp.readthedocs.io/bg/latest/README.html) |
|
| bg | Bulgarian | [Docs :notebook:](https://designpatternsphp.readthedocs.io/bg/latest/README.html) |
|
||||||
| fr | French | [Docs :notebook:](https://designpatternsphp.readthedocs.io/fr/latest/README.html) |
|
| fr | French | [Docs :notebook:](https://designpatternsphp.readthedocs.io/fr/latest/README.html) |
|
||||||
|
Reference in New Issue
Block a user