Tidy up preproc_apply.c; write helloworld.P

A compiler warning about an unused `namelen' variable and a comment about
some `super' variable which is not declared are fixed in preproc_apply.c.

The helloworld.P is much more interesting in this commit: it is a state-of-
the-art source code which I will take as reference when implementing the P
compiler. When it compiles correctly, we have version 0.9 ready! Ambitious
goal as this file contains already *lots* of stuff from P.
Check backreference numbers for #subst

Using an invalid backreference number will not access invalid submatch data
anymore but silently ignore it. There is such a case in preproc.P now.

And I just noticed: the only (?) non-circular use of the \0 backreference is
to wrap it into quotes... But since there is a use, I won't forbid it.
Add space after function-like macro expansion

Add a space after expansion of function-like macros to avoid extension of
tokens as in this pathological example:

  #define f(a) a
  f(a)b

formerly became "ab" which is wrong because it creates a new identifier
where it shouldn't. Instead if should read "a b"... which it does now.

This problem does not exist with object-like macros as they're are already
known to be delimited identifiers. This phenomenon is wanted with #subst.

`upp' was changed to accept stuff from stdin so that I can test better and
it mimics `cpp' in this regard.

I outlined a point about why I don't use external libraries (such as libcpp)
in the README.
Raise an error if a macro or pattern is empty

Formerly, #define and #subst allowed lines like

  #define
  #subst

with trailing spaces to be parsed. These are now detected as error for at
least the macro name or substitution pattern must be given.
Update helloworld.P and vim's P syntax files

I noticed that sqrt() may be implemented as a sequential function. This is
good, as I can test the implementation of that with helloworld.P, too.

Preprocessor directives and the #if 0 comment syntax is now supported by the
vim highlighter.
Add idea about Collatz conjecture test as P sample

The title says it all. I just wanted to commit it. P seems like a simple
dynamic programming language... Let's hope we can tune it to be a fast one,
too.
Small notes for LANGUAGE

Just some random notes about implementation of the P compiler. I tend more
and more to like the language and want to get my hands on the interesting
parts to eventually see a P program running in my life :-)
Make supported directives extensible more easily

We now have, instead of logic, merely data that commands the parsing of
directives - and it works.
New trie data structure

We have a trie in lib/trie.c now (I don't know if it's classified as a
Patricia Trie or whatever, sorry; I did this out of my head with the
Patricia design in mind).

Despite its general usefulness, it specifically (read: for the present
source tree) provides a more efficient manner to organise pp_{define,subst}
structures in a fashion more aware of the fact that they are mostly searched
for text. (Benchmarks, if I care to do them, will show if we sholdn't use
another search tree or hashtable instead, both of which will be needed in
the future anyway... There will be time for optimisation at a later stage.)

Incorporation into the preprocessor is yet to be done (together with the
slab). It is also needed there to fix a function-like macro parsing issue
(the code there is not aware of parameter names, only of their lengths - you
can imagine that this just asks for trouble). The parameter names can
temporarily be stored in a trie. So much for the rationale.
Silence compiler on trietest.c

Using integers as void * made the compiler go mad. Fixed now.
Fix dangerous typo in apply_subst()

Look at the diff, really :-) There was an `i' where a `0' needed to be
before the trailing memcpy() invocation in apply_subst(). Good thing we
have valgrind!
Don't allow a macro to have different equally-named parameters

This fixes cases such as

  #define f(a, a)	a

which would segfault with the former implementation and are also
theoretically non-sense.

The code was totally unaware of the parameter names, it only cared about
their lengths. It couldn't even check if there was a name at all
("#define f(,) a" may have worked but correctly raises an error now).

A trie is used to store the parameter names temporarily.
Respect masked characters in __in_quotes()

This commit adds logic to __in_quotes(), so that "\"" isn't taken as three
quotes, but still "\\"" is and "\\\""" is, too, and so forth...
Fix macro argument recognition

Don't restrict macro arguments to identifier-like objects anymore, i.e.
allow macros to be called within macro invocations, and totally obscure
things like

  $ ./upp <<EOF
  #define f(x, y)		\
  do {				\
  	void *__x = (x);	\
  	y(__x);			\
  } while (0)
  f(({(char **) {"\",[", "abc"}}), action);
  EOF

which now yields the desired result gracefully:

do { void *__x = (({(char **) {"\",[", "abc"}})); action (__x); } while (0);
Fix destruction of function-like macros without a map

Function-like macros which have none of their arguments occuring in their
definition would get an invalid ->map address from get_define(). (This
trivially includes function-like macros without any arguments.)

This special invalid address wasn't checked for previously, resulting in
segfaults with code like

  $ ./upp <<EOF
  #define f(x) "x"
  f(12)
  EOF

or

  $ ./upp <<EOF
  #define f(x, y)	no occurence of any argument
  f(12, 13)
  EOF

Now, this is taken into account and the invalid address isn't tried to be
freed.