cleanup: move is_header_file() to parser.h

This function is sufficiently small for an inline function, but then
it can be placed into parser.h to be used by everybody.
macros: support for '#undef'

Provide a way to undefine a macro.
This is done with a special flag, because:

1. there can be multiple different definitions of a macro
2. the pointer to a hashed_macro is supposed to be persistent until the
   next call to clearmacros (with the exception of macro arguments).
Make late distinction between ID and TYPEID

When a macro is defined, a typedef might not be defined yet. Still, when
the macro is used, the identifier must be treated as a type name if it
is a typedef.
Add BLOCK expression type

There is some need to mark compound statements, e.g. to set correct
variable scope (for declarations inside a block). Previously, the
following two codes would produce the same parse tree:

    statementA;
    statementB;
    statementC;

and:

    statementA;
    {
        statementB;
    }
    statementC;

After this change, statementB is put inside a BLOCK expression, which
is in turn added to the list with statementA and statementB.
Recognize statement expressions

A compound statement enclosed in parentheses may appear as an expression
in GNU C. Since it is used to define the min() macro, we must recognize
this extension.
Recognize both "__typeof__" and "typeof"

The latter is not portable, but actually used in crash...
Fix handling of "typeof"

Quoting the GCC Info page:

  [T]he [`typeof'] construct acts semantically like a type name defined
  with `typedef'.

Do exactly that - make "typeof" an alternate input for typedef_name.
dupdynstr: do not copy the CPP condition

The CPP condition should not be copied from the original, but rather
taken from the current state.

FIXME: The function needs a better name, because it doesn't really
duplicate the existing dynstr. It makes a derived copy as if the same
text were parsed in the current context.
Mark result of CPP concatenation as fake

The result of the '##' operator should not be copied to the output.
Change the parsing order

This change is needed to fix parser errors on "cs", which is defined
in lkcd_x86_trace.h as:

#define cs      M_REG, R_CS

This fails later in unwind_x86_64.h, which contains:

        unsigned long cs;
Fix write paths in ia64 unwind access functions

The adaptation of the unwind functions has not been completed, resulting
in a mix of local accesses with dumpfile accesses. This is not a big
deal for the resulting crash binary, since these code paths are never hit
anyway, but it does confuse variable tracking, resulting in fatal errors
like this:

unw_access_gr_v1: conflicting type change for 'unsigned long addr':
  first 'tptr', now 'tulong'
cleanup: remove code that handles macros in expressions

Macros are no longer represented in the parse tree, so we cannot even
get a function type in an expression.
cleanup: kill type_none

This symbol is not used anywhere, so kill it.
is_host_type: ignore the type of a typecast

The target typecast type is not relevant to determine whether a variable
is host-specific or target-specific. In particular, this construct is
broken:

    uaddr_t *sbp, *asp;
/* ... */
    asp = (uaddr_t*)((uaddr_t)sbp + (STACK_SIZE - (saddr - sp)));

This first casts sbp to an integral type, so that the offset is
added as an absolute number and not multiplied by sizeof(uaddr_t).

Of course, it would be much cleaner to typecast sbp to a "char *"
instead, but...
Clear macros after parsing all files

Macro definitions are not needed after the parse tree is created.
In fact, they may invalidate subsequent re-parsing, because once
expanded items should not be treated as macros.
Mark expanded macro text with a flag

Expanded macros should be flagged, so they can be skipped when
reparsing a piece of the text.
Move dynstr flags in its own type

No code change, only grouping them together in a separate type.
Change handling of the fake flag

The fake flag is no longer implicitly set in dupdynstr(), but rather
taken from a global default, which is manipulated in expand_macro()
and restored to the original value when expand_macro() terminates.
Copy dynstr flags from lex_input_first if available

When reparsing an existing text, get the default flags from the previous
dynstr object.

This also means that the default should be set from init_vars(), so that
we don't have to care about the initial state of the flags when parsing
a new file from scratch.
Copy dynstr flags for type replacement

Make sure that the replaced type get the same flags as the original.
This is necessary to cope with replacements inside macro expansion.

If the default is used, replacing a type inside the fully-expanded
macro results in bogus target types being added to the output after
the macro usage.