each cases indicate whether it is possible or not to generate a regular expression or a DFA. i. Detect the balance of N parenthesis in a string that has N parenthesis nested and any characters in between the parenthesis. ii. Is it possible to detect binary strings with the same quantity of 0’s and 1’s (it does not matter the order or sequence).
we now? After lexical analysis, we have a series of tokens. But we can not: I. define a regular expression matching all expressions with properly balanced parentheses. II. i.e., define a regular expression matching all functions with properly nested block structure. void a () { b (c); for (;;) {a=(-(1+2)+5); } }
we now? Now, we want to: I. Review the structure described by that series of tokens II. Report errors if those tokens do not properly encode a structure
Derivation LINE Keyword (type) ID ( something Keyword (type) ID ) { something . . . . } Word token void keyword m ID ( delimiter int keyword X ID ) delimiter { delimiter . . . . . . . . } delimiter
slides can only be used as study material for the Compilers course at Universidad Panamericana. They cannot be distributed or used for another purpose.