正在加载图片...
Syntax Analyzer versus Lexical Analyzer Which constructs of a program should be recognized by the lexical analyzer,and which ones by the syntax analyzer? Both of them do similar things;But the lexical analyzer deals with simple non-recursive constructs of the language. The syntax analyzer deals with recursive constructs of the language. The lexical analyzer simplifies the job of the syntax analyzer. The lexical analyzer recognizes the smallest meaningful units(tokens)in a source program. -The syntax analyzer works on the smallest meaningful units(tokens)in a source program to recognize meaningful structures in our programming language CS308 Compiler Theory 8Syntax Analyzer versus Lexical Analyzer • Which constructs of a program should be recognized by the lexical anal d hi h b h l lyzer, an d whi c h ones by t he syntax ana lyzer? – Both of them do similar things; But the lexical analyzer deals with simple non-recursive constructs of the lan g g ua ge. – The syntax analyzer deals with recursive constructs of the language. – The lexical analyzer simplifies the job of the syntax analyzer. – The le ical anal er recogni es the smallest meaningf l nits (tokens) in a so rce program The le xical analyzer recogni zes the smallest meaningful units (tokens) in a so urce program. – The syntax analyzer works on the smallest meaningful units (tokens) in a source program to recognize meaningful structures in our programming language. CS308 Compiler Theory 8
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有