Lect 1.2 Lang Specification_stud_supp

Lect 1.2 Lang Specification_stud_supp - CPE425/CSC301/SC433...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
CPE425/CSC301/SC433 Programming Languages Lecture 1.2 Language Specification (supplements)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Language Specification 2 Left – Right Recursive Left - recursive <expression>::= [<expression> <addoperator>] <term> Right - recursive <expression>::= < term >[<addoperator> < expression >] What is the Derivation Tree for 8 – 4 – 2 ? ¾ Left – recursive => left - associative ¾ Right – recursive => right - associative
Background image of page 2
Language Specification 3 Using Left Recursive Calculator Grammar 2 ¾ 8 – 4 – 2 = ? 8 4 2 = digit addoperator digit addoperator digit unsigned unsigned unsigned value value value term term term expression expression expression ? <expression>::= [<expression> <addoperator>] <term> ( )
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Language Specification 4 Left – Recursive using Calculator Grammar 2 ¾ 8 – 4 – 2 = ? 8 4 2 = digit addoperator digit addoperator digit unsigned unsigned unsigned value value value term term term expression expression expression calculation <expression>::= [<expression> <addoperator>] <term> ( )
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 8

Lect 1.2 Lang Specification_stud_supp - CPE425/CSC301/SC433...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online