I am doing 2b. Reading through we have to create the CFG grammarthat genartes the language. Set up 2 examples. Create 2 parse treesand an abstract syntax tree. AST. I am stuck on generating the part4. The Abstract syntax trees for one of my parse trees. Can I get alittle help in generating an AST for the final part? If there isany other advice that I can get that I may have missed it would begreatly appreciated but mainly the AST, or part 4 of the questionis what I am stuck on
2. For each of the following languages, i) give a context free grammar that generates the language, ii) use two examples to show that your CFG can be used to derive to your example, iii) generate parse trees for both of your examples, and iv) generate ASTs for one of your examples. (36 points) B) {ai bi ck i, j, k ≥ 0 and i + j = k} b.) {ai bi ck | i, j, k ≥ 0 and i + j = k} =>ai bi ci+j ai bicic ai bicicl G=(V, Σ, R, S) with set of variables V = {S.X} where S is the start variable; set of terminals [= {a,b,c}; and rules S → aSc | X x → bXc € abcc SaScaAc→abAcc →abcc abbccc SaScaAcabAcc abbAccc → abbccc abcc S منے abbccc kakashi.
I am doing 2b. Reading through we have to create the CFG grammar that genartes the language. Set up 2 examples. Create 2
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am