mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-02-23 09:12:34 +01:00
add comment in class "NoTerminalExpression/TerminalExpression" and upd README.rst
This commit is contained in:
parent
cf331541cd
commit
6410890a06
@ -2,6 +2,9 @@
|
||||
|
||||
namespace DesignPatterns\Behavioral\Interpreter;
|
||||
|
||||
/**
|
||||
* This NoTerminalExpression
|
||||
*/
|
||||
class AndExp extends AbstractExp
|
||||
{
|
||||
public function __construct(private AbstractExp $first, private AbstractExp $second)
|
||||
|
@ -2,6 +2,9 @@
|
||||
|
||||
namespace DesignPatterns\Behavioral\Interpreter;
|
||||
|
||||
/**
|
||||
* This NoTerminalExpression
|
||||
*/
|
||||
class OrExp extends AbstractExp
|
||||
{
|
||||
public function __construct(private AbstractExp $first, private AbstractExp $second)
|
||||
|
@ -4,7 +4,8 @@
|
||||
Purpose
|
||||
-------
|
||||
|
||||
For a given language, it defines the representation of its grammar,
|
||||
For a given language, it defines the representation of its grammar as
|
||||
"No Terminal Expression" and "Terminal Expression",
|
||||
as well as an interpreter for the sentences of that language.
|
||||
|
||||
Examples
|
||||
|
@ -2,6 +2,9 @@
|
||||
|
||||
namespace DesignPatterns\Behavioral\Interpreter;
|
||||
|
||||
/**
|
||||
* This TerminalExpression
|
||||
*/
|
||||
class VariableExp extends AbstractExp
|
||||
{
|
||||
public function __construct(private string $name)
|
||||
|
Loading…
x
Reference in New Issue
Block a user