parser: clean and factorize services in parser_prod

Mainly, generalize cloned services in the class ANodes
Also rationalize the generated nit code.

The diff seems big because some reindentation

Signed-off-by: Jean Privat <jean@pryen.org>
parser: production `implicit_main_class` is nullable

Signed-off-by: Jean Privat <jean@pryen.org>
parser: production `formaldefs` is nullable

Signed-off-by: Jean Privat <jean@pryen.org>
parser: new nullable production `kwend_o` to factorize `kwend?`

Signed-off-by: Jean Privat <jean@pryen.org>
parser: new nullable production `string_o` to factorize `string?`

Signed-off-by: Jean Privat <jean@pryen.org>
parser: production `extern_calls` is nullable

Signed-off-by: Jean Privat <jean@pryen.org>
parser: production `params` is nullable

Signed-off-by: Jean Privat <jean@pryen.org>
parser: production `annotation_withend` is nullable

Signed-off-by: Jean Privat <jean@pryen.org>
parser: new nullable production `annotations_o`

Signed-off-by: Jean Privat <jean@pryen.org>
parser: new nullable production `extern_code_block_o`

Signed-off-by: Jean Privat <jean@pryen.org>
parser: new nullable production `qualified_o`

Somme `qualified?` remain (yet) because of conflicts, see next commits.

Signed-off-by: Jean Privat <jean@pryen.org>
parser: remove useless production `writable2`

just accepts visibility in all versions

Signed-off-by: Jean Privat <jean@pryen.org>
parser: accepts `kwredef` in front of importation clauses

OK, this is crazy.
The point is to avoid the inlining of the production `redef`.
Because `redef` is used a lot, the gain worth the crazyness.

TODO: catch the usage of `redef` and crash after parsing.

Signed-off-by: Jean Privat <jean@pryen.org>
parser: new production `qid` to factorize `qualified? id`

`qid` is still transformed into an simple `id` (thus the qualified is lost).
Latter the qualification should be preserved in the AST.

Signed-off-by: Jean Privat <jean@pryen.org>
parser: new production `qclassid` to factorize `qualified? classid`

See previous commit for details.

Signed-off-by: Jean Privat <jean@pryen.org>
parser: new nullable production `typing_o`

Signed-off-by: Jean Privat <jean@pryen.org>
parser: regenerate with changes in the grammar and file generation

Before:

~~~~
$ time nitg nitg.nit
user	0m10.784s
$ wc parser/parser.nit
29702  93153 922785
$ grep 'super ReduceAction' parser/parser.nit -c
780
~~~~

After:

~~~~
$ time nitg nitg.nit
user	0m7.956s
$ wc parser/parser.nit
10660  32841 319408
$ grep 'super ReduceAction' parser/parser.nit -c
376
~~~~

Signed-off-by: Jean Privat <jean@pryen.org>
Merge: Clean generated parser

This series reduce the size of the generated parser.

* First, factorize generated clones (the first commit)
* Second, reduce inlining in the grammar (the other commits)

This was a tidy process because each slight modification in the grammar yields to numerous conflicts often
difficult to understand. But the results worth the pain:

Time of `nitg nitg.nit`
before: 0m10.784s
after: 0m7.956s
gain: 26%

Number of subclasses of `ReduceAction`
before: 780
after: 376
gain: 52%

Pull-Request: #388
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>