Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Homework III on Attribute Grammar | CS 5363, Assignments of Computer Science

Material Type: Assignment; Professor: Yi; Class: Programming Lang & Compilers; Subject: Computer Science; University: University of Texas - San Antonio; Term: Fall 2008;

Typology: Assignments

Pre 2010

Uploaded on 08/19/2009

koofers-user-bdo
koofers-user-bdo 🇺🇸

10 documents

1 / 1

Toggle sidebar

Related documents


Partial preview of the text

Download Homework III on Attribute Grammar | CS 5363 and more Assignments Computer Science in PDF only on Docsity! Homework 3 : Attribute Grammar (20pts) Due Oct 20, 2008 Suppose we have the following context-free grammar which accepts nested lists such as (a (b d) (e (f))). List ::= single single ::= VAR | ( multi ) multi ::= single | multi single Here each V AR can be matched to an arbitrary variable name (e.g., a, b, c). 1. Add translation schemes to evaluate the number of variables contained in each nested list input. For example, for (a (b d) (e (f))), the number of variables should be 5. 2. Add translation schemes to evaluate the subscript of each variable in a nested list; that is, for each variable x in a given input, the number of other variables contained before x. For example, for (a (b d) (e (f))), the subscripts for a, b, d, e, f are 0, 1, 2, 3, and 4 respectively. 1
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved