tg: automatic language detection by using two gram based heuristic

Matlab parser was disabled becuase both ObjectiveC parser and Matlab
parser uses .m as extension.

With this patch, ctags can detect proper parser for a given input file
by using two gram based heuristic. If there are more than two parsers
are for given filename, this heuristic will be used.

A parser must have a built-in two gram table which represents the
characteristic of its language. It must be defined at `tg_entries'
field of parserDefinition. ctags generates a two gram table
for an input file, too. ctags compares these tables and choose
proper parser.

ctags calculates the score which represents how strong a given input
file has the characteristic of a given language; here the language is
Matlab or ObjectiveC. ctags calculates the score for each language;
and finds which language shows the highest score.

Built-in two gram table can be generated by tg command introduced
in this patch.

    $ ./tg generate Test/objc.m
    ./tg generate Test/objc.m
    static unsigned char __tg_table [65536] =
    {
	    [    2603] =        1, /* N + */
	    [    2605] =        1, /* N - */
    ...

Generated table can be copyed and pasted to your parser definition.
Typical input file is needed to build a good table.

Typos in tg.c are suggested by Vitor.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
tg: add corpus for generating tg_table of objc parser

The most of code taken from Test/obj*.m.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
tg: add corpus for generating tg_table of matlab parser

Taken from Test/matlab*.m.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
enable matlab parser

At caaf50762338a17672263c57bff5ebce70e5a396 matlab parser
is temporary remoted. Now multiple parser per file extension
is supported in multiple ways.

1. editor modline(vi and emacs),
2. shbang line, and
3. heuristic using two gram.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Merge pull request #53 from masatake/tg

tg: automatic language detection by using two gram based heuristic