Quantcast
Channel: Declaring – 100% Private Proxies – Fast, Anonymous, Quality, Unlimited USA Private Proxy!
Viewing all articles
Browse latest Browse all 10

Declaring multi-dimensional array using CFG

$
0
0

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!.


Viewing all articles
Browse latest Browse all 10

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>