JFlex_manual.pdf JFlex is a lexical analyser generator for Java1 written in Java. It is also a rewrite of the very useful tool JLex [3] which was developed by Elliot Berk at Princeton University. As Vern Paxson states for his C/C++ tool flex [11]: t
========================================================================= == NOTICE file corresponding to section 4(d) of the Apache License, == == Version 2.0, in this case for the Apache Xalan Java distribution. == ================================
杰利克斯
一个用Python编写的Java源代码的词法分析器
例子
代码
from jlex . lexer import lex_source_file
from jlex . type import Type
tokens = lex_source_file ( 'Example.java' )
for token in tokens :
if token . type not in [ Type . SPACE , Type . NEW_LINE ]:
print