Hello all:
Im trying to understand a program that parses declarations and outputs english-word descriptions. It would take a declarations such as:
and this would have an output of: fp: pointer to function returning int.Code:int ( * fp )( );
The book says that the program is "based on the grammar that specifies a declarator... In words, a dcl is a direct-dcl, perhaps preceded by *'s. A direct-dcl is a name, or a parenthesized dcl, or a direct-dcl followed by parentheses, or a direct-dcl followed by brackets with an optional size.
This grammar can be used to parse declarations"
When I read a declaration, I can understand what I'm seeing. But when I start reading about dcl's and direct-dcl's, I don't understand what they are talking about. Can someone please help clear up these terms for me?
Also if you are aware of the dcl program I'm referring to, a walkthrough of the program logic would be nice.