下载此文档

编译原理课件PPT 第3章.ppt


文档分类:IT计算机 | 页数:约85页 举报非法文档有奖
1/85
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/85 下载此文档
文档列表 文档介绍
编译原理课件PPT 第3章.pptCHAPTER3LEXICALANALYSIS Section0Approachestoimplementalexicalanalyzer1、SimpleapproachConstructadiagramthatillustratesthestructureofthetokensofthesourcelanguage,andthentohand-translatethediagramintoaprogramforfindingtokensNotes:EfficientlexicalanalyzerscanbeproducedinthismannerCHAPTER3LEXICALANALYSIS Section0Approachestoimplementalexicalanalyzer2、Pattern-directedprogrammingapproachPatternMatchingtechniqueSpecifyanddesignprogramthatexecuteactionstriggeredbypatternsinstringsIntroduceapattern-pilerforLexcangenerateanefficientfiniteautomationrecognizerfortheregularexpressionsCHAPTER3LEXICALANALYSIS piler1、MaintaskToreadtheinputcharactersToproduceasequenceoftokensusedbytheparserforsyntaxanalysisAsanassistantofparserCHAPTER3LEXICALANALYSIS Section1Theroleofthelexicalanalyzer2、InteractionoflexicalanalyzerwithparserLexicalanalyzerParserSymboltableSourceprogramtokenGetnexttokenCHAPTER3LEXICALANALYSIS Section1Theroleofthelexicalanalyzer3、ProcessesinlexicalanalyzersScanningPre-pilerwithsourceprogramAlinenumbercanbeassociatedwithanerrormessageLexicalanalysisCHAPTER3LEXICALANALYSIS Section1Theroleofthelexicalanalyzer4、TermsofthelexicalanalyzerTokenTypesofwordsinsourceprogramKeywords,operators,identifiers,constants,literalstrings,punctuationsymbols(mas,semicolons)LexemeActualwordsinsourceprogramPatternAruledescribingthesetoflexemesthatcanrepresentaparticulartokeninsourceprogramRelation{<.<=,>,>=,==,<>}CHAPTER3LEXICALANALYSIS Section1Theroleofthelexicalanalyzer5、AttributesforTokensApointertothesymbol-=M*C**2<id,pointertosymbol-tableentryforE><assign_op,><id,pointertosymbol-tableentryforM><multi_op,><id,pointertosymbol-tableentryforC><exp_op,><num,integervalue2>CHAPTER3LEXICALANALYSIS Section1Theroleofthelexicalanalyzer6、LexicalErrorsDeletinganextraneouscharacterInsertingamissingcharacterReplacinganincorrectcharacterbyacorrectcharacterTransposingtwoadjacentcharacters(suchas,fi=>if)Pre-scanningCHAPTER3LEXICALANALYSIS Section1Thero

编译原理课件PPT 第3章 来自淘豆网www.taodocs.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数85
  • 收藏数0 收藏
  • 顶次数0
  • 上传人dyx110
  • 文件大小635 KB
  • 时间2020-09-23