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>
modelbuilder: get_mmodule_by_name get a mgroup as context

Signed-off-by: Jean Privat <jean@pryen.org>
modelbuilder: search_module_in_paths return ModulePath

Instead of a simple String

Signed-off-by: Jean Privat <jean@pryen.org>
modelbuilder: split `search_mmodule_by_name` from `get_mmodule_by_name`

Signed-off-by: Jean Privat <jean@pryen.org>