DOC PREVIEW
LSU CSC 4101 - Programming Languages

This preview shows page 1 out of 4 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

11Programming LanguagesTevfik KoşarLecture - IIIJanuary 24th, 20062Roadmap• Creating Language Grammars– Regular Expressions– Context Free Grammars– Parse Trees– Ambiguity23Expressing Digitsdigit -> digit -> 1digit -> 2digit -> 3digit -> 4digit -> 5digit -> 6digit -> 7digit -> 8digit -> 90digit -> 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Regular Expression4Expressing Numbersdigit -> 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 two-digit-number -> digit digitnumber -> digit digit** : Kleene star (zero more repetitions of the symbol to its left) natural_number -> non_zero_digit digit*non_zero_digit -> 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 TerminalsNon-terminalsnatural_number ->35Operators• op -> + | - | * | /• expr -> number op number op number6Context Free Grammars• Adds recursion to regular expressionsexpr -> number op number op numberexpr -> number | expr op expr47Example3 + 4 * 5  derive thisexpr -> number | expr op expr  from thisexpr -> expr op expr-> expr op number-> expr * number-> expr op expr * num-> expr op num * num-> expr + num * num-> num + num * num(3) (4)


View Full Document

LSU CSC 4101 - Programming Languages

Download Programming Languages
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Programming Languages and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Programming Languages 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?