Академический Документы
Профессиональный Документы
Культура Документы
COMPILERS EXAM
Date
/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}$/ mm/dd/yyyy
Time
/^([1-9]|1[0-2]):[0-5]\d(:[0-5]\d(\.\d{1,3})?)?$/ HH:MM or HH:MM:SS or
HH:MM:SS.mmm
Months
^((31(?!\ (Feb(ruary)?|Apr(il)?|June?|(Sep(?=\b|t)t?|Nov)(ember)?)))|
((30|29)(?!\ Feb(ruary)?))|(29(?=\ Feb(ruary)?\ (((1[6-9]|[2- 9]\d)(0[48]|
[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)))))|(0?[1-9])|
1\d|2[0-8])\ (Jan(uary)?|Feb(ruary)?|Ma(r(ch)?|y)|Apr(il)?|Ju((ly?)|(ne?))|
Aug(ust)?|Oct(ober)?|(Sep(?=\b|t)t?|Nov|Dec)(ember)?)\ ((1[6-9]|[2-
9]\d)\d{2})$
3. What are the main roles and functions of lexical analysis and
syntax analysis?
7. What are the main differences between parse trees and syntax
trees?
advantages Disadvantages
NFA is suitable for the regular NFA is not suitable for the regular
expressions that are used for expressions that are frequently
several times and for the small- used.
size main-memory embedded
systems.
NFA DFA
Allows a symbol to label several DFA does not allow the above two
adges out of a state and allows situations.
adges with ε
12. Please use the following grammar to draw down the parse tree
of the expression 1+2*3-4
Carlos Gutiérrez 4
Solution:
Solution: