Lec11 - CMPSC 461: Programming Language Concepts Lecture 11...

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

View Full Document Right Arrow Icon
CMPSC 461: Programming Language Concepts Lecture 11 Instructor: Prof. Swarat Chaudhuri
Background image of page 1

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

View Full DocumentRight Arrow Icon
Concrete syntax to abstract syntax (var + 25) * 67 Scanning Parsing * + 67 25 var
Background image of page 2
Scanning “if” in a C program is an atomic item, a terminal. Scanning: breaking down a character sequence into such terminals (a.k.a. tokens ). while ( bar ( x ) ) // now we have a comment Identifier Identifier
Background image of page 3

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

View Full DocumentRight Arrow Icon
Regular expressions a * b c a * “A non -negative number of a’s , followed by b followed by c, followed by a non-negative number of a’s.” (a * c U abc) (¬ a * c ) Grammar: Regexp ::= (Regexp) * | (Regexp U Regexp) | (Regexp Regexp) | ¬ (Regexp)
Background image of page 4
Finite automaton Alphabet: set A of symbols Formal language: set L of finite strings over A. Automaton: a device that can read strings, accepting precisely the strings in L. Finite automaton: this device has a finite number of states.
Background image of page 5

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

View Full DocumentRight Arrow Icon
Finite automata a c b a c b a
Background image of page 6
Regular expressions = finite automata All regular expressions can be converted to equivalent finite automata. (How?) Regular languages Automaton for (ac * b U a): a c b a
Background image of page 7

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

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 16

Lec11 - CMPSC 461: Programming Language Concepts Lecture 11...

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

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