P
Paulo Matos
Hi all,
I'm trying to work out a parser for function declarations but it turns
out that it is harder than I initially thought.
I'm looking at 3rd Ed of Stroustrup, page 808.
I'm trying to parse something like:
int foo(int, int);
const double *xpto(mytype *, mytype &) const;
But I'm not being able to find my way around the grammar.
First, I can't find a function-declaration non-terminal. The closest is
function-definition, but that will need the function-body, which cannot
end up with ;.
I guess this has something to do with direct-declarator, but still I
can't see how ';' shows up in the end.
Any help on where to start would be extremmely helpful.
Regards,
Paulo Matos
I'm trying to work out a parser for function declarations but it turns
out that it is harder than I initially thought.
I'm looking at 3rd Ed of Stroustrup, page 808.
I'm trying to parse something like:
int foo(int, int);
const double *xpto(mytype *, mytype &) const;
But I'm not being able to find my way around the grammar.
First, I can't find a function-declaration non-terminal. The closest is
function-definition, but that will need the function-body, which cannot
end up with ;.
I guess this has something to do with direct-declarator, but still I
can't see how ';' shows up in the end.
Any help on where to start would be extremmely helpful.
Regards,
Paulo Matos