I am still juveline to compilers and formal languages. I’ve tried to write context-free grammar (CFG) for a multi-dimensional array, but I am not sure of my solution, so could you suggest your CFG for multi-dimensional array?
<type>:: = int | float | string <array>:: = <type> [<identifier>] | <array> | [<identifier>] <identifier>::= <letter> | <identifier><letter>|<identifier><digit> <letter>::= a|...|z <digit>::= 0|...|9
Is this implementation is a true one for multi-dimensional array?
My second question is regarding function invocation as well? I have written the following declaration for function:
<funDeclaration>::= <type> <identifier>(<params>) <statement> | <identifier> (<params> )<statement>
Without demonstrating , just for clarity and to keep the question short, how to write function invocation?
The post Declaring multi-dimensional array using CFG appeared first on 100% Private Proxies - Fast, Anonymous, Quality, Unlimited USA Private Proxy!.