nitcc: escape also `<` and `>` in dot

Signed-off-by: Jean Privat <jean@pryen.org>
nitcc: ignore `\r` in grammars (to be compatible with mac or windows format)

Signed-off-by: Jean Privat <jean@pryen.org>
nitcc: accept but ignore the Tree part

Signed-off-by: Jean Privat <jean@pryen.org>
nitcc: accepts literal hexadecimal chars (ex `#x0A`)

Signed-off-by: Jean Privat <jean@pryen.org>
nitcc: tests various literal strings

Signed-off-by: Jean Privat <jean@pryen.org>
nitcc: do not use object_id in Automaton::to_dot

So diffing dot files is possible

Signed-off-by: Jean Privat <jean@pryen.org>
nitcc: add Automaton::trim to remove useless states

Signed-off-by: Jean Privat <jean@pryen.org>
nitcc: promote `except` to Automaton

Signed-off-by: Jean Privat <jean@pryen.org>
nitcc: implements complex minus with except

Signed-off-by: Jean Privat <jean@pryen.org>
nitcc: Accept special token End, but implement it as an epsilon

Signed-off-by: Jean Privat <jean@pryen.org>
nitcc: does not crash if a production has no alternatives

Signed-off-by: Jean Privat <jean@pryen.org>
nitcc: add Alternative::phony for those in the AST but not in the automaton

Signed-off-by: Jean Privat <jean@pryen.org>
nitcc: add precedence on the grammar

This use a special syntax where alternatives ar grouped in classes of
precedences that goes from the most priority to the least priority.

Those classes starts with the keyword `Left`, `Right` or `Unary` and
groups the alternatives that follows.

eg:

~~~
e =
	{int:} int |
	{par:} '(' e ')'
Unary
	{neg:} '-' e
Right
	{pow:} e '^' e
Left
	{mul:} e '*' e |
	{div:} e '/' e
Left
	{add:} e '+' e |
	{sub:} e '-' e ;
~~~

Signed-off-by: Jean Privat <jean@pryen.org>
nitcc/tests: add re.sablecc to test precedences

Signed-off-by: Jean Privat <jean@pryen.org>
nitcc/tests: some update of error messages

Signed-off-by: Jean Privat <jean@pryen.org>
nitcc: update examples to use precedence

Signed-off-by: Jean Privat <jean@pryen.org>
nitcc: add prerecence in the README

Signed-off-by: Jean Privat <jean@pryen.org>
tests: update sav/nitcc_parser_gen.res

Signed-off-by: Jean Privat <jean@pryen.org>
Merge: precedence and other things to nitcc

A lot of small things.
The best part is the introduction of syntactic precedence.

Pull-Request: #555
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>