Unformatted text preview: expression – this will help with justifying that your grammar for IF is also LL(1). The language is deﬁned in the handout distributed in class and is also provided below. Consider a (portion of) language IF for branching instructions: 10: if (x+1 > y) then 20 else 30; 20: if (3*x-z > 3.1) then 20 else 50; 30: if (3-y+1 == 25*z-11) then 50 else action2; 40: if (x+1 > y) then action3 else 30; 50: if (z+1 < y) then 60 else 30; 60: if (x*2+11 != y) then 50 else exit; The general structure of a program is that it consists of a number of labeled lines, each starting with a label followed by an if-then-else statement. The ﬁrst part after if is a relation expression (comparison of two expres-sions). The actions are either ’jumps’ marked by numbers corresponding to labels, action# (where # is a number), or exit . 1...
View Full Document
- Fall '09
- Computer Science, Formal grammar, Department of Computer Science, Context-free grammar, UK Homework Assignment, University of Kentucky.— —Please