【導讀】Speaker:Lung-ShengChien. ReferenceURL:. Onlinemanual:. OutLine. Whatislex. Regularexpression. Finitestatemachine. Contentofflex. Application. foreachlineinafile. iflinecontains“//”notinastring,then. iflinecontains“/*”notinastring,then. endfor. anotherfile.Pseudo-code. Whatislex. expressions(正規(guī)表示法).expressions.From. definition. TokenPatternLexeme(詞彙). integer(0-9)+234. identifier[a-zA-Z]?[a-zA-Z0-9]*x1. meaning. Lexicalanalyzer. Syntaxanalyzer(文法分析). Semanticanalyzer(語意分析). Codeoptimizer. Codegenerator. Sourcecode. machinecode. PhasesofaCompiler. Lexisacrucialtool. toextracttoken. token. symboltable. asknextcharacter. character. asknexttoken. token. asknextcharacter. character. Fileprocessorof. Linearprogramming. asknexttoken. token. g++. inputtoken. -don?tuselibrary. -don?-mixCwithC++code. flexinRedHat9. Linkwithlibrary. Library. 按Ctrl+D. Thisisabook\n. byebye\n. 按enter. definitionsection. %%. rulesection. %%. usercode. grammarofinputfile. Usercode. sourcefile. patternaction. \n{++num_lines;++num_chars;}. patternaction. .{++num_chars;}. wildcardcharacter,representany. defaultmain. Q1:canwepi