parser_util: add `interactive_parse` to have a simple AST from the user

Signed-off-by: Jean Privat <jean@pryen.org>
test_parser: add option `-i` for interactive parsing

Signed-off-by: Jean Privat <jean@pryen.org>
tests: tests -i on test_parser

Signed-off-by: Jean Privat <jean@pryen.org>
lib/math: intro ceil and floor

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
contrib/inkscape_tools: use floor and ceil to better cut images

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
contrib/inkscape_tools: remove all to_i_strip_e

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
android: intro annotations to gather project metadata

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
android: intro annotation to get project version

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
nitg: introduce phases for Compiler classes

Move the compiler invocation in each specific module (with phases)

Move the command-lice processing to abstract_compiler.

What remain in final `nitg` modules is the imports and the selection of
the default engine.

Signed-off-by: Jean Privat <jean@pryen.org>
nith: introduce `nith` the ligHt Nit compiler

nith is just nitg with less features so, less phases to run,
and less code to compile (for a boostrap or test perspective).

Some numbers, note: `--skip-dead-methods` is used to produce less C code.

~~~
$ time nitg nitg.nit --skip-dead-methods
user	0m8.080s
$ time nitg nith.nit --skip-dead-methods
user	0m6.920s
~~~

Signed-off-by: Jean Privat <jean@pryen.org>
android: intro annotation to customize Android manifest

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
android: use the metadata to customize the generated Android project

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
android: use custom manifest lines

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
examples/mnit_simple: use android project annotations

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
examples/mnit_simple: use vibration and android_manifest annotation

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Merge: Fix to inkscape_tools and introduce Float::ceil|floor

Previously image generation would cut off some extremities of the source drawing.

Pull-Request: #426
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
modelbuilder: name the main module like the first module.

It is the way done by the compilers, and a lot of parts use
`mainmodule.name` to name things when `-m` is used.

So, in order to not broke the compilers parts,
generalize the idea in phases.

Note: the implicit main-module have no projets associated, so things
should not use "<main>" to identify then.

Signed-off-by: Jean Privat <jean@pryen.org>
abs_comp: move call of `supports_libunwind` in the right place

Signed-off-by: Jean Privat <jean@pryen.org>
Merge: Customize the generated Android project

Annotations:
* `app_name("My Name")` will be used to set the project full name and the shortcut name on Android.
* `app_version(1, 5)` or `app_version(1, 5, git_revision)` sets the project `versionName` in the manifest. It does not set the `versionCode`, this will require a way to track the project.
* `java_package` specifies the package of the generated APK (the package should be unique to each applications). The plan is to also use it to specify the Java namespace of the generated code.
* `android_manifest("some lines")` adds custom lines to the manifest. And  `android_manifest_application("some lines")` adds lines to the application sub section of the manifest.

I'll have to add this information as a manual somewhere. Should it be in the documentation of the `android` module or on the website?

Pull-Request: #427
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Merge: Interactive parser

Just to play with `parse_something`

~~~
$ test_parser -i -n
--> hello world
Got ABlockExpr
--> "hello world"
Got AStringExpr
--> for x in [1,2,3] do
... print x
... end
Got ABlockExpr
--> fun foo do
... print "hello"
... end
Got AModule
--> for x in in in p
        for x in in in p
                 ^: Syntax error: unexpected keyword 'in'.
--> :q
~~~

Pull-Request: #424
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>