詞法分析器JFLEX

一、homepage and downloadhtml

home page:http://jflex.de/docu.htmljava

download:http://jflex.de/download.htmlsql

使用手冊:http://jflex.de/manual.htmlide

二、解壓和配置環境變量flex

解壓以後,編輯文件bin\jflex.bat,在其中設置java_home和jflex_home環境變量,JAVA_HOME默認爲C:\JAVA,JFLEX_HOME默認爲C:\JFLEX。spa

JAVA_HOME contains the directory where your Java JDK is installed (for instance C:\java) andcode

JFLEX_HOME the directory that contains JFlex (in the example: C:\JFlex)orm

三、生成詞法解析文件htm

運行命令:jflex lexer.flex,則產生JFlexLexer.java的詞法解析文件get

  
  
           
  
  
  1. D:\jflex1.4.3\example>jflex lexer.flex 
  2. Reading "lexer.flex" 
  3. Constructing NFA : 955 states in NFA 
  4. Converting NFA to DFA : 
  5. ............................................................................ 
  6. ............................................................................ 
  7. ............................................................................ 
  8. ............................................................. 
  9. 447 states before minimization, 350 states in minimized DFA 
  10. Writing code to "JFlexLexer.java"
相關文章
相關標籤/搜索