aboutsummaryrefslogtreecommitdiffstats
path: root/Llk
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2016-01-09 08:58:15 +0100
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2016-01-11 09:53:32 +0100
commit109b8c8dc4bdc9c5be1d6b9a1500d27e54d0f804 (patch)
treef1da97dabf844e5a4170ad4ceaaed7912d9e6b92 /Llk
parent7ba9ee26671dee92aadc92592b58a807b4c8dc69 (diff)
downloadCompiler-109b8c8dc4bdc9c5be1d6b9a1500d27e54d0f804.zip
Compiler-109b8c8dc4bdc9c5be1d6b9a1500d27e54d0f804.tar.gz
Compiler-109b8c8dc4bdc9c5be1d6b9a1500d27e54d0f804.tar.bz2
Quality: Run devtools:cs.
Diffstat (limited to 'Llk')
-rw-r--r--Llk/Lexer.php6
-rw-r--r--Llk/Llk.php4
-rw-r--r--Llk/Parser.php6
-rw-r--r--Llk/Rule/Analyzer.php8
-rw-r--r--Llk/Rule/Choice.php4
-rw-r--r--Llk/Rule/Concatenation.php4
-rw-r--r--Llk/Rule/Ekzit.php4
-rw-r--r--Llk/Rule/Entry.php4
-rw-r--r--Llk/Rule/Invocation.php6
-rw-r--r--Llk/Rule/Repetition.php4
-rw-r--r--Llk/Rule/Rule.php4
-rw-r--r--Llk/Rule/Token.php4
-rw-r--r--Llk/Sampler/BoundedExhaustive.php4
-rw-r--r--Llk/Sampler/Coverage.php6
-rw-r--r--Llk/Sampler/Exception.php4
-rw-r--r--Llk/Sampler/Sampler.php4
-rw-r--r--Llk/Sampler/Uniform.php8
-rw-r--r--Llk/TreeNode.php8
18 files changed, 46 insertions, 46 deletions
diff --git a/Llk/Lexer.php b/Llk/Lexer.php
index 4e715a8..4da324b 100644
--- a/Llk/Lexer.php
+++ b/Llk/Lexer.php
@@ -8,7 +8,7 @@
*
* New BSD License
*
- * Copyright © 2007-2015, Hoa community. All rights reserved.
+ * Copyright © 2007-2016, Hoa community. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -43,7 +43,7 @@ use Hoa\Compiler;
*
* PP lexer.
*
- * @copyright Copyright © 2007-2015 Hoa community
+ * @copyright Copyright © 2007-2016 Hoa community
* @license New BSD License
*/
class Lexer
@@ -87,7 +87,7 @@ class Lexer
* @return array
* @throws \Hoa\Compiler\Exception\UnrecognizedToken
*/
- public function lexMe($text, Array $tokens)
+ public function lexMe($text, array $tokens)
{
$this->_text = $text;
$this->_tokens = $tokens;
diff --git a/Llk/Llk.php b/Llk/Llk.php
index b2c3c0d..4037d40 100644
--- a/Llk/Llk.php
+++ b/Llk/Llk.php
@@ -8,7 +8,7 @@
*
* New BSD License
*
- * Copyright © 2007-2015, Hoa community. All rights reserved.
+ * Copyright © 2007-2016, Hoa community. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -50,7 +50,7 @@ use Hoa\Stream;
* skipped token (::token::), kept token (<token>), token unification (token[i])
* and rule unification (rule()[j]).
*
- * @copyright Copyright © 2007-2015 Hoa community
+ * @copyright Copyright © 2007-2016 Hoa community
* @license New BSD License
*/
class Llk
diff --git a/Llk/Parser.php b/Llk/Parser.php
index aaab998..339f070 100644
--- a/Llk/Parser.php
+++ b/Llk/Parser.php
@@ -8,7 +8,7 @@
*
* New BSD License
*
- * Copyright © 2007-2015, Hoa community. All rights reserved.
+ * Copyright © 2007-2016, Hoa community. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -43,7 +43,7 @@ use Hoa\Compiler;
*
* PP parser.
*
- * @copyright Copyright © 2007-2015 Hoa community
+ * @copyright Copyright © 2007-2016 Hoa community
* @license New BSD License
*/
class Parser
@@ -128,7 +128,7 @@ class Parser
* @param array $rules Rules.
* @return void
*/
- public function __construct(Array $tokens = [], Array $rules = [])
+ public function __construct(array $tokens = [], array $rules = [])
{
$this->_tokens = $tokens;
$this->_rules = $rules;
diff --git a/Llk/Rule/Analyzer.php b/Llk/Rule/Analyzer.php
index 6b7e3d5..3cea55e 100644
--- a/Llk/Rule/Analyzer.php
+++ b/Llk/Rule/Analyzer.php
@@ -8,7 +8,7 @@
*
* New BSD License
*
- * Copyright © 2007-2015, Hoa community. All rights reserved.
+ * Copyright © 2007-2016, Hoa community. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -43,7 +43,7 @@ use Hoa\Compiler;
*
* Analyze rules and transform them into atomic rules operations.
*
- * @copyright Copyright © 2007-2015 Hoa community
+ * @copyright Copyright © 2007-2016 Hoa community
* @license New BSD License
*/
class Analyzer
@@ -91,7 +91,7 @@ class Analyzer
* @param array $tokens Tokens.
* @return void
*/
- public function __construct(Array $tokens)
+ public function __construct(array $tokens)
{
$this->_tokens = $tokens;
@@ -115,7 +115,7 @@ class Analyzer
* @return void
* @throws \Hoa\Compiler\Exception
*/
- public function analyzeRules(Array $rules)
+ public function analyzeRules(array $rules)
{
if (empty($rules)) {
throw new Compiler\Exception\Rule('No rules specified!', 0);
diff --git a/Llk/Rule/Choice.php b/Llk/Rule/Choice.php
index 1cd6b44..2d9d520 100644
--- a/Llk/Rule/Choice.php
+++ b/Llk/Rule/Choice.php
@@ -8,7 +8,7 @@
*
* New BSD License
*
- * Copyright © 2007-2015, Hoa community. All rights reserved.
+ * Copyright © 2007-2016, Hoa community. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -41,7 +41,7 @@ namespace Hoa\Compiler\Llk\Rule;
*
* The choice rule.
*
- * @copyright Copyright © 2007-2015 Hoa community
+ * @copyright Copyright © 2007-2016 Hoa community
* @license New BSD License
*/
class Choice extends Rule
diff --git a/Llk/Rule/Concatenation.php b/Llk/Rule/Concatenation.php
index 7cd1f50..00aab9b 100644
--- a/Llk/Rule/Concatenation.php
+++ b/Llk/Rule/Concatenation.php
@@ -8,7 +8,7 @@
*
* New BSD License
*
- * Copyright © 2007-2015, Hoa community. All rights reserved.
+ * Copyright © 2007-2016, Hoa community. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -41,7 +41,7 @@ namespace Hoa\Compiler\Llk\Rule;
*
* The concatenation rule.
*
- * @copyright Copyright © 2007-2015 Hoa community
+ * @copyright Copyright © 2007-2016 Hoa community
* @license New BSD License
*/
class Concatenation extends Rule
diff --git a/Llk/Rule/Ekzit.php b/Llk/Rule/Ekzit.php
index e900747..3308e5a 100644
--- a/Llk/Rule/Ekzit.php
+++ b/Llk/Rule/Ekzit.php
@@ -8,7 +8,7 @@
*
* New BSD License
*
- * Copyright © 2007-2015, Hoa community. All rights reserved.
+ * Copyright © 2007-2016, Hoa community. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -40,7 +40,7 @@ namespace Hoa\Compiler\Llk\Rule;
*
* The ekzit (exit) rule.
*
- * @copyright Copyright © 2007-2015 Hoa community
+ * @copyright Copyright © 2007-2016 Hoa community
* @license New BSD License
*/
class Ekzit extends Invocation
diff --git a/Llk/Rule/Entry.php b/Llk/Rule/Entry.php
index 974a031..b92a41b 100644
--- a/Llk/Rule/Entry.php
+++ b/Llk/Rule/Entry.php
@@ -8,7 +8,7 @@
*
* New BSD License
*
- * Copyright © 2007-2015, Hoa community. All rights reserved.
+ * Copyright © 2007-2016, Hoa community. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -41,7 +41,7 @@ namespace Hoa\Compiler\Llk\Rule;
*
* The entry rule.
*
- * @copyright Copyright © 2007-2015 Hoa community
+ * @copyright Copyright © 2007-2016 Hoa community
* @license New BSD License
*/
class Entry extends Invocation
diff --git a/Llk/Rule/Invocation.php b/Llk/Rule/Invocation.php
index ac9a3c5..a7752f7 100644
--- a/Llk/Rule/Invocation.php
+++ b/Llk/Rule/Invocation.php
@@ -8,7 +8,7 @@
*
* New BSD License
*
- * Copyright © 2007-2015, Hoa community. All rights reserved.
+ * Copyright © 2007-2016, Hoa community. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -41,7 +41,7 @@ namespace Hoa\Compiler\Llk\Rule;
*
* Parent of entry and ekzit rules.
*
- * @copyright Copyright © 2007-2015 Hoa community
+ * @copyright Copyright © 2007-2016 Hoa community
* @license New BSD License
*/
abstract class Invocation
@@ -96,7 +96,7 @@ abstract class Invocation
public function __construct(
$rule,
$data,
- Array $todo = null,
+ array $todo = null,
$depth = -1
) {
$this->_rule = $rule;
diff --git a/Llk/Rule/Repetition.php b/Llk/Rule/Repetition.php
index b7dad89..67df0ff 100644
--- a/Llk/Rule/Repetition.php
+++ b/Llk/Rule/Repetition.php
@@ -8,7 +8,7 @@
*
* New BSD License
*
- * Copyright © 2007-2015, Hoa community. All rights reserved.
+ * Copyright © 2007-2016, Hoa community. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -41,7 +41,7 @@ namespace Hoa\Compiler\Llk\Rule;
*
* The repetition rule.
*
- * @copyright Copyright © 2007-2015 Hoa community
+ * @copyright Copyright © 2007-2016 Hoa community
* @license New BSD License
*/
class Repetition extends Rule
diff --git a/Llk/Rule/Rule.php b/Llk/Rule/Rule.php
index 025ba3b..ac1e457 100644
--- a/Llk/Rule/Rule.php
+++ b/Llk/Rule/Rule.php
@@ -8,7 +8,7 @@
*
* New BSD License
*
- * Copyright © 2007-2015, Hoa community. All rights reserved.
+ * Copyright © 2007-2016, Hoa community. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -43,7 +43,7 @@ use Hoa\Consistency;
*
* Rule parent.
*
- * @copyright Copyright © 2007-2015 Hoa community
+ * @copyright Copyright © 2007-2016 Hoa community
* @license New BSD License
*/
abstract class Rule
diff --git a/Llk/Rule/Token.php b/Llk/Rule/Token.php
index db9b2fd..7b33c99 100644
--- a/Llk/Rule/Token.php
+++ b/Llk/Rule/Token.php
@@ -8,7 +8,7 @@
*
* New BSD License
*
- * Copyright © 2007-2015, Hoa community. All rights reserved.
+ * Copyright © 2007-2016, Hoa community. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -44,7 +44,7 @@ use Hoa\File;
*
* The token rule.
*
- * @copyright Copyright © 2007-2015 Hoa community
+ * @copyright Copyright © 2007-2016 Hoa community
* @license New BSD License
*/
class Token extends Rule
diff --git a/Llk/Sampler/BoundedExhaustive.php b/Llk/Sampler/BoundedExhaustive.php
index 83bc8e7..307e2b0 100644
--- a/Llk/Sampler/BoundedExhaustive.php
+++ b/Llk/Sampler/BoundedExhaustive.php
@@ -8,7 +8,7 @@
*
* New BSD License
*
- * Copyright © 2007-2015, Hoa community. All rights reserved.
+ * Copyright © 2007-2016, Hoa community. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -48,7 +48,7 @@ use Hoa\Visitor;
* This algorithm is based on multiset (set with repetition).
* Repetition unfolding: upper bound of + and * is set to n.
*
- * @copyright Copyright © 2007-2015 Hoa community
+ * @copyright Copyright © 2007-2016 Hoa community
* @license New BSD License
*/
class BoundedExhaustive
diff --git a/Llk/Sampler/Coverage.php b/Llk/Sampler/Coverage.php
index aebde16..b5d3393 100644
--- a/Llk/Sampler/Coverage.php
+++ b/Llk/Sampler/Coverage.php
@@ -8,7 +8,7 @@
*
* New BSD License
*
- * Copyright © 2007-2015, Hoa community. All rights reserved.
+ * Copyright © 2007-2016, Hoa community. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -56,7 +56,7 @@ use Hoa\Iterator;
* • + is unfolded 1 or 2 times;
* • {x,y} is unfolded x, x + 1, y - 1 and y times.
*
- * @copyright Copyright © 2007-2015 Hoa community
+ * @copyright Copyright © 2007-2016 Hoa community
* @license New BSD License
*/
class Coverage
@@ -463,7 +463,7 @@ class Coverage
* @param array $rules Rules to consider.
* @return array
*/
- protected function extract(Array $rules)
+ protected function extract(array $rules)
{
$out = [];
diff --git a/Llk/Sampler/Exception.php b/Llk/Sampler/Exception.php
index cb2b8ca..d1b229a 100644
--- a/Llk/Sampler/Exception.php
+++ b/Llk/Sampler/Exception.php
@@ -8,7 +8,7 @@
*
* New BSD License
*
- * Copyright © 2007-2015, Hoa community. All rights reserved.
+ * Copyright © 2007-2016, Hoa community. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -43,7 +43,7 @@ use Hoa\Compiler;
*
* Extending the \Hoa\Compiler\Exception class.
*
- * @copyright Copyright © 2007-2015 Hoa community
+ * @copyright Copyright © 2007-2016 Hoa community
* @license New BSD License
*/
class Exception extends Compiler\Exception
diff --git a/Llk/Sampler/Sampler.php b/Llk/Sampler/Sampler.php
index 4e8bcf2..9a09111 100644
--- a/Llk/Sampler/Sampler.php
+++ b/Llk/Sampler/Sampler.php
@@ -8,7 +8,7 @@
*
* New BSD License
*
- * Copyright © 2007-2015, Hoa community. All rights reserved.
+ * Copyright © 2007-2016, Hoa community. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -45,7 +45,7 @@ use Hoa\Visitor;
*
* Sampler parent.
*
- * @copyright Copyright © 2007-2015 Hoa community
+ * @copyright Copyright © 2007-2016 Hoa community
* @license New BSD License
*/
abstract class Sampler
diff --git a/Llk/Sampler/Uniform.php b/Llk/Sampler/Uniform.php
index 08f3513..908d767 100644
--- a/Llk/Sampler/Uniform.php
+++ b/Llk/Sampler/Uniform.php
@@ -8,7 +8,7 @@
*
* New BSD License
*
- * Copyright © 2007-2015, Hoa community. All rights reserved.
+ * Copyright © 2007-2016, Hoa community. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -49,7 +49,7 @@ use Hoa\Visitor;
* which guide the exploration.
* Repetition unfolding: upper bound of + and * is set to n.
*
- * @copyright Copyright © 2007-2015 Hoa community
+ * @copyright Copyright © 2007-2016 Hoa community
* @license New BSD License
*/
class Uniform extends Sampler
@@ -133,8 +133,8 @@ class Uniform extends Sampler
} elseif ($rule instanceof Compiler\Llk\Rule\Concatenation) {
$children = $rule->getContent();
$out = null;
- $Γ = $data['Γ'];
- $γ = $Γ[$this->_sampler->getInteger(0, count($Γ) - 1)];
+ $Γ = $data['Γ'];
+ $γ = $Γ[$this->_sampler->getInteger(0, count($Γ) - 1)];
foreach ($children as $i => $child) {
$out .= $this->uniform($this->_rules[$child], $γ[$i]);
diff --git a/Llk/TreeNode.php b/Llk/TreeNode.php
index 837c48a..a1c7dfd 100644
--- a/Llk/TreeNode.php
+++ b/Llk/TreeNode.php
@@ -8,7 +8,7 @@
*
* New BSD License
*
- * Copyright © 2007-2015, Hoa community. All rights reserved.
+ * Copyright © 2007-2016, Hoa community. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -43,7 +43,7 @@ use Hoa\Visitor;
*
* Provide a generic node for the AST produced by LL(k) parser.
*
- * @copyright Copyright © 2007-2015 Hoa community
+ * @copyright Copyright © 2007-2016 Hoa community
* @license New BSD License
*/
class TreeNode implements Visitor\Element
@@ -97,7 +97,7 @@ class TreeNode implements Visitor\Element
public function __construct(
$id,
$value = null,
- Array $children = [],
+ array $children = [],
TreeNode $parent = null
) {
$this->setId($id);
@@ -221,7 +221,7 @@ class TreeNode implements Visitor\Element
* @param array $children Children.
* @return array
*/
- public function setChildren(Array $children)
+ public function setChildren(array $children)
{
$old = $this->_children;
$this->_children = $children;