Related articles |
---|
C-- compiler germans@cs.vu.nl (1994-10-05) |
Re: C-- compiler nickb@harlequin.co.uk (1994-10-11) |
Newsgroups: | comp.compilers |
From: | nickb@harlequin.co.uk (Nick Barnes) |
Keywords: | C |
Organization: | Harlequin Ltd, Barrington Hall, Cambridge UK |
References: | 94-10-037 |
Date: | Tue, 11 Oct 1994 10:01:35 GMT |
germans@cs.vu.nl (Germans DM) writes:
int stupid_function(;)
{
/* blah, blah */
}
[...]
The compiler goes: I expect a type specifier -> int, OK.
I expect an identifier -> stupid_function, OK.
I expect either a ; or a ( -> (, OK, it's a new function.
I expect a ) -> ERROR!
Here the compiler can do two things, either he can insert a ) and go on or
it can exchange the ; for a ) and go on.
Or it can scan forwards some limited distance looking for an
acceptable token.
Or it can ditch the partially-built tree and scan forwards
indefinitely looking for the start of a new top-level declaration.
Nick Barnes nickb@harlequin.co.uk
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.