aboutsummaryrefslogtreecommitdiffstats
path: root/Llk
Commit message (Collapse)AuthorAgeFiles
* Quality: Run `hoa devtools:cs`.Ivan Enderlin2016-08-1511
|
* Documentation: Update API documentation.Ivan Enderlin2016-08-152
|
* Llk: Update exception messages.Ivan Enderlin2016-08-141
|
* Llk: PP parser only accepts horizontal spaces…Ivan Enderlin2016-08-141
| | | | … for line instructions.
* Llk: Correctly order and merge skip tokens.Ivan Enderlin2016-08-141
| | | | | | | | | | | | | | | | | | | | | | First, skip tokens were not correctly merge. For instance: %skip a b %skip c d %skip e f would have produced the following skip token: %token skip (?:f)|(?:d)|b which is correct but not fantastics. Now, the following skip token is produced: %token skip (?:f|(?:d|b)) Second, since the user declares `a` before `c`, this order must be preserved. Thus, the final following skip token is produced: %token skip (?:(?:b|d)|f)
* Llk: The whole class must be abstract.Ivan Enderlin2016-08-141
| | | | It only contains static methods, it makes no sense to instanciate it.
* Analyzer: Fix current rule name.Ivan Enderlin2016-08-141
|
* Analyzer: More detailed exception messages.Ivan Enderlin2016-08-141
|
* PP: Sync `node` token with the analyzer.Ivan Enderlin2016-08-141
|
* Rule: Fix an exception message in the analyzer.Ivan Enderlin2016-08-121
|
* Rule: Update API documentation.Ivan Enderlin2016-08-121
|
* PP: A named token can no longer be unified.Ivan Enderlin2016-08-121
|
* Quality: Fix CS.Ivan Enderlin2016-08-122
|
* Rule: Restore infinite max in a repetition.Ivan Enderlin2016-08-121
| | | | | `-1` is a special value representing infinity. This is useful for repetition like `*`, `+` or `{x,}`.
* Quality: Fix CS and API documentation.Ivan Enderlin2016-08-121
|
* Rule: Cast and bound min and max in a repetition.Ivan Enderlin2016-08-121
|
* TreeNode: Value default value must be `null`.Ivan Enderlin2016-08-091
| | | | | | An empty array would be better but it might break backward compatibility for some users, so `null` is kept. This is fine this way too.
* TreeNode: Avoid undefined child access.Ivan Enderlin2016-08-081
|
* TreeNode: Avoid undefined token value access.Ivan Enderlin2016-08-081
|
* TreeNode: Force the value to be an array.Ivan Enderlin2016-08-081
|
* Documentation: Update API and exception message.Ivan Enderlin2016-07-151
|
* Rule: Use `is_int` to detect if transitional.Ivan Enderlin2016-07-151
| | | | | | `is_numeric` tests if the value is an integer or a string representing an integer. Since the rule is always an integer if transitional, `is_int` can replace `is_numeric`. This is faster.
* Parser: Remove calls to `getCurrentToken` method.Ivan Enderlin2016-07-151
| | | | Thanks to the iterator API, we can grab the appropriated datum directly.
* Parser: Cut backtrack if k is reached.Ivan Enderlin2016-07-151
|
* Parser: Simplify a return condition.Ivan Enderlin2016-07-151
|
* Llk: Save pragmas when saving the parser.Ivan Enderlin2016-07-151
|
* Llk: Add the `parser.lookahead` pragma.Ivan Enderlin2016-07-152
| | | | | | `parser.lookahead` is used by the parser to define the `k` in LL(k), i.e. number of tokens to lookahead. By default, it is set to 1024. Memory can be reduced by using an appropriated value.
* Llk: Change pragma `unicode` for `lexer.unicode`.Ivan Enderlin2016-07-152
|
* Llk: Implement pragmas.Ivan Enderlin2016-07-153
| | | | | | | Pragmas are useful when the grammar needs to change the behavior of the compiler-compiler. For instance, the first pragma we introduce is `unicode`. It is used by the lexer to turn the Unicode mode on for the regular expressions.
* Llk: Introduce the “save” parser!Ivan Enderlin2016-07-151
| | | | | | | | | | | | | | | This is a compiler-compiler. It means we have a grammar and we transform it into a compiler. The grammar is written in PP. The resulting compiler is a `Hoa\Compiler\Llk\Parser` object. When calling the `load` static method, PP is compiled into a `Parser` object in memory. We can serialize it to avoid further compilations. However, the new `save` static method generates PHP code which construct a `Parser` object representing the PP grammar. Why is it different? PHP can cache the opcodes only on PHP codes, not from unserialized codes. So making a `new MyCompiler` will be faster than calling `unserialize`, especially when we have opcache enabled.
* Llk: Token rule can be constructured as kept.Ivan Enderlin2016-07-153
| | | | | This way, we avoid the call of `setKept` and can set this flag directly from the constructor.
* Grammar: Reduce memory with transitional rules.Ivan Enderlin2016-07-151
| | | | | | To compute a name for transitional rules, we were previously counting the number of rules and we were adding 1. Counting is costly. Now we use a counter as an object attribute.
* Grammar: Reduce calls.Ivan Enderlin2016-07-151
| | | | | | Removing the `getCurrentToken`, `getNextToken` and `consumeToken` methods do not make the code less readable, while it saves a lot of calls, and thus it saves CPU cycles and memory.
* Quality: Clean internal API.Ivan Enderlin2016-07-157
|
* Quality: Fix CS.Ivan Enderlin2016-07-151
|
* Parser: Use the lexer as an iterator.Ivan Enderlin2016-01-221
|
* Grammar: Use the lexer as an iterator.Ivan Enderlin2016-01-221
|
* Lexer: Transform it into an iterator (generator).Ivan Enderlin2016-01-221
|
* PP: Remove the author.Ivan Enderlin2016-01-171
|
* Update copyright.Ivan Enderlin2016-01-171
|
* Quality: Run devtools:cs.Ivan Enderlin2016-01-1118
|
* Consistency: Use `Hoa\Consistency`.Ivan Enderlin2016-01-113
|
* Documentation: Format API.Ivan Enderlin2015-12-161
|
* Fix Llk\Llk::parsePP unrecognized instructions exceptionlovenunu2015-12-151
| | | | The stream was used in Llk\Llk::parsePP but was not passed to the function: https://github.com/hoaproject/Compiler/blob/master/Llk/Llk.php#L211
* Fix phpDoc.Metalaka2015-08-138
|
* Add skipToken generation.Metalaka2015-08-131
| | | | | | | Skip token of the grammar should be used between token values instead of an hard-coded space. If present we use the skip token from the current namespace and then we generate a value according to his PCRE expression.
* Move to PSR-1 and PSR-2.Ivan Enderlin2015-05-0518
|
* Happy new year!Ivan Enderlin2015-01-0519
|
* Fix a bug in the unification.Ivan Enderlin2014-11-111
| | | | | | The `skip` counter, introduced as an optmization to avoid unnecessary assertions, was decremented correctly but not incremented/restored well. This patch fix this bug.
* Add the `getCompiler` method.Ivan Enderlin2014-09-291
|