Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a WIP.
⚠️ I was obliged to use the last version of gdlc.g because contary to what is stated above, the last optimized code by Marc is twice as fast as the one referred to above.
⚠️ The last remaining problem with the ANTLR code is that it will become very very slow during the Parser phase when there is even a small number of (matched) parenthesis. For example a=(3) is instantaneous, a=((((3)))) is very slow.
⚠️ At the moment the format.g issues nondeterminism warnings when compiling by antlr, this is OK as the order of branching makes the formats (issue #830) behave OK, so no further maintainance is needed.
All the open issues directly related to ANTLR should be closed by this PR.
For the sake of maintainance, the version of 27/09/2013 (just before some complicated optimization introduced by Mark Schellens) has been used as template (upon which all the subsequent small changes have been reported and the open issues are solved). This to avoid a dependency between the ANTLR code and the antlr-generated code (code based on internal values of '_tokenSet_XX' that may be changing with the number and order of tokens generated by antlr). Indeed, nobody can IMHO debug such complicated dependencies. The loss in performance induced by this pseudo-regression has to be estimated (it seems negligible) and weighted against the advantages of having more chances to maintain correctly the code, even going to ANTLR3 or 4 more easily.