⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clexer.lex

📁 it is a basic java browser
💻 LEX
📖 第 1 页 / 共 3 页
字号:
<YYINITIAL, MIDDLE_OF_LINE> "delete" {    nextState = MIDDLE_OF_LINE;	lastToken = CToken.RESERVED_WORD_DELETE;	String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));	yybegin(nextState);    return(t);}<YYINITIAL, MIDDLE_OF_LINE> "dynamic_cast" {    nextState = MIDDLE_OF_LINE;	lastToken = CToken.RESERVED_WORD_DYNAMIC_CAST;	String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));	yybegin(nextState);    return(t);}<YYINITIAL, MIDDLE_OF_LINE> "friend" {    nextState = MIDDLE_OF_LINE;	lastToken = CToken.RESERVED_WORD_FRIEND;	String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));	yybegin(nextState);    return(t);}<YYINITIAL, MIDDLE_OF_LINE> "inline" {    nextState = MIDDLE_OF_LINE;	lastToken = CToken.RESERVED_WORD_INLINE;	String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));	yybegin(nextState);    return(t);}<YYINITIAL, MIDDLE_OF_LINE> "mutable" {    nextState = MIDDLE_OF_LINE;	lastToken = CToken.RESERVED_WORD_MUTABLE;	String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));	yybegin(nextState);    return(t);}<YYINITIAL, MIDDLE_OF_LINE> "namespace" {    nextState = MIDDLE_OF_LINE;	lastToken = CToken.RESERVED_WORD_NAMESPACE;	String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));	yybegin(nextState);    return(t);}<YYINITIAL, MIDDLE_OF_LINE> "new" {    nextState = MIDDLE_OF_LINE;	lastToken = CToken.RESERVED_WORD_NEW;	String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));	yybegin(nextState);    return(t);}<YYINITIAL, MIDDLE_OF_LINE> "operator" {    nextState = MIDDLE_OF_LINE;	lastToken = CToken.RESERVED_WORD_OPERATOR;	String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));	yybegin(nextState);    return(t);}<YYINITIAL, MIDDLE_OF_LINE> "overload" {    nextState = MIDDLE_OF_LINE;	lastToken = CToken.RESERVED_WORD_OVERLOAD;	String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));	yybegin(nextState);    return(t);}<YYINITIAL, MIDDLE_OF_LINE> "private" {    nextState = MIDDLE_OF_LINE;	lastToken = CToken.RESERVED_WORD_PRIVATE;	String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));	yybegin(nextState);    return(t);}<YYINITIAL, MIDDLE_OF_LINE> "protected" {    nextState = MIDDLE_OF_LINE;	lastToken = CToken.RESERVED_WORD_PROTECTED;	String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));	yybegin(nextState);    return(t);}<YYINITIAL, MIDDLE_OF_LINE> "public" {    nextState = MIDDLE_OF_LINE;	lastToken = CToken.RESERVED_WORD_PUBLIC;	String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));	yybegin(nextState);    return(t);}<YYINITIAL, MIDDLE_OF_LINE> "reinterpret_cast" {    nextState = MIDDLE_OF_LINE;	lastToken = CToken.RESERVED_WORD_REINTERPRET_CAST;	String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));	yybegin(nextState);    return(t);}<YYINITIAL, MIDDLE_OF_LINE> "static_cast" {    nextState = MIDDLE_OF_LINE;	lastToken = CToken.RESERVED_WORD_STATIC_CAST;	String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));	yybegin(nextState);    return(t);}<YYINITIAL, MIDDLE_OF_LINE> "template" {    nextState = MIDDLE_OF_LINE;	lastToken = CToken.RESERVED_WORD_TEMPLATE;	String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));	yybegin(nextState);    return(t);}<YYINITIAL, MIDDLE_OF_LINE> "this" {    nextState = MIDDLE_OF_LINE;	lastToken = CToken.RESERVED_WORD_THIS;	String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));	yybegin(nextState);    return(t);}<YYINITIAL, MIDDLE_OF_LINE> "try" {    nextState = MIDDLE_OF_LINE;	lastToken = CToken.RESERVED_WORD_TRY;	String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));	yybegin(nextState);    return(t);}<YYINITIAL, MIDDLE_OF_LINE> "virtual" {    nextState = MIDDLE_OF_LINE;	lastToken = CToken.RESERVED_WORD_VIRTUAL;	String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));	yybegin(nextState);    return(t);}<YYINITIAL, MIDDLE_OF_LINE> "bool" {    nextState = MIDDLE_OF_LINE;	lastToken = CToken.RESERVED_WORD_BOOL;	String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));	yybegin(nextState);    return(t);}<YYINITIAL, MIDDLE_OF_LINE> "char" {    nextState = MIDDLE_OF_LINE;	lastToken = CToken.RESERVED_WORD_CHAR;	String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));	yybegin(nextState);    return(t);}<YYINITIAL, MIDDLE_OF_LINE> "double" {    nextState = MIDDLE_OF_LINE;	lastToken = CToken.RESERVED_WORD_DOUBLE;	String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));	yybegin(nextState);    return(t);}<YYINITIAL, MIDDLE_OF_LINE> "float" {    nextState = MIDDLE_OF_LINE;	lastToken = CToken.RESERVED_WORD_FLOAT;	String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));	yybegin(nextState);    return(t);}<YYINITIAL, MIDDLE_OF_LINE> "int" {    nextState = MIDDLE_OF_LINE;	lastToken = CToken.RESERVED_WORD_INT;	String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));	yybegin(nextState);    return(t);}<YYINITIAL, MIDDLE_OF_LINE> "long" {    nextState = MIDDLE_OF_LINE;	lastToken = CToken.RESERVED_WORD_LONG;	String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));	yybegin(nextState);    return(t);}<YYINITIAL, MIDDLE_OF_LINE> "short" {    nextState = MIDDLE_OF_LINE;	lastToken = CToken.RESERVED_WORD_SHORT;	String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));	yybegin(nextState);    return(t);}<YYINITIAL, MIDDLE_OF_LINE> "signed" {    nextState = MIDDLE_OF_LINE;	lastToken = CToken.RESERVED_WORD_SIGNED;	String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));	yybegin(nextState);    return(t);}<YYINITIAL, MIDDLE_OF_LINE> "unsigned" {    nextState = MIDDLE_OF_LINE;	lastToken = CToken.RESERVED_WORD_UNSIGNED;	String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));	yybegin(nextState);    return(t);}<YYINITIAL, MIDDLE_OF_LINE> "void" {    nextState = MIDDLE_OF_LINE;	lastToken = CToken.RESERVED_WORD_VOID;	String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));	yybegin(nextState);    return(t);}<YYINITIAL, MIDDLE_OF_LINE> {Identifier} {     nextState = MIDDLE_OF_LINE;    lastToken = CToken.IDENTIFIER;    String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));    yybegin(nextState);    return (t);}<YYINITIAL, MIDDLE_OF_LINE> {DecimalNum} {    nextState = MIDDLE_OF_LINE;    lastToken = CToken.LITERAL_INTEGER_DECIMAL;    String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));    yybegin(nextState);    return (t);}<YYINITIAL, MIDDLE_OF_LINE> {OctalNum} {    nextState = MIDDLE_OF_LINE;    lastToken = CToken.LITERAL_INTEGER_OCTAL;    String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));    yybegin(nextState);    return (t);}<YYINITIAL, MIDDLE_OF_LINE> {HexNum} {    nextState = MIDDLE_OF_LINE;    lastToken = CToken.LITERAL_INTEGER_HEXIDECIMAL;    String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));    yybegin(nextState);    return (t);}<YYINITIAL, MIDDLE_OF_LINE> {Float} {    nextState = MIDDLE_OF_LINE;    lastToken = CToken.LITERAL_FLOATING_POINT;    String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));    yybegin(nextState);    return (t);}<YYINITIAL, MIDDLE_OF_LINE> {Character} {     nextState = MIDDLE_OF_LINE;    lastToken = CToken.LITERAL_CHARACTER;    String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));    yybegin(nextState);    return (t);}<YYINITIAL, MIDDLE_OF_LINE> {String} {     nextState = MIDDLE_OF_LINE;    lastToken = CToken.LITERAL_STRING;    String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));    yybegin(nextState);    return (t);}<YYINITIAL, MIDDLE_OF_LINE> ({NonBreakingWhiteSpace}+) {     lastToken = CToken.WHITE_SPACE;    String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));	return (t);}<YYINITIAL, MIDDLE_OF_LINE, PREPROCESSOR> ({WhiteSpace}+) {     nextState = YYINITIAL;    lastToken = CToken.WHITE_SPACE;    String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));	yybegin(nextState);    return (t);}<YYINITIAL, MIDDLE_OF_LINE, PREPROCESSOR> {Comment} {     nextState = YYINITIAL;    lastToken = CToken.COMMENT_END_OF_LINE;    String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));    yybegin(nextState);    return (t);}<YYINITIAL, MIDDLE_OF_LINE> {DocComment} {    nextState = MIDDLE_OF_LINE;    lastToken = CToken.COMMENT_DOCUMENTATION;    String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));    yybegin(nextState);    return (t);}<YYINITIAL, MIDDLE_OF_LINE> {TradComment} {    nextState = MIDDLE_OF_LINE;    lastToken = CToken.COMMENT_TRADITIONAL;    String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));    yybegin(nextState);    return (t);}<PREPROCESSOR> {TradComment} {    lastToken = CToken.COMMENT_TRADITIONAL;    String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));    return (t);}<YYINITIAL, MIDDLE_OF_LINE> {UnclosedString} {     /* most of these errors have to be caught down near the end of the file.     * This way, previous expressions of the same length have precedence.     * This is really useful for catching anything bad by just allowing it      * to slip through the cracks.      */     nextState = MIDDLE_OF_LINE;    lastToken = CToken.ERROR_UNCLOSED_STRING;    String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));    yybegin(nextState);    return (t);}<YYINITIAL, MIDDLE_OF_LINE> {MalformedUnclosedString} {     nextState = MIDDLE_OF_LINE;    lastToken = CToken.ERROR_MALFORMED_UNCLOSED_STRING;    String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));    yybegin(nextState);    return (t);}<YYINITIAL, MIDDLE_OF_LINE> {MalformedString} {     nextState = MIDDLE_OF_LINE;    lastToken = CToken.ERROR_MALFORMED_STRING;    String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));    yybegin(nextState);    return (t);}<YYINITIAL, MIDDLE_OF_LINE> {UnclosedCharacter} {     nextState = MIDDLE_OF_LINE;    lastToken = CToken.ERROR_UNCLOSED_CHARACTER;    String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));    yybegin(nextState);    return (t);}<YYINITIAL, MIDDLE_OF_LINE> {MalformedUnclosedCharacter} {     nextState = MIDDLE_OF_LINE;    lastToken = CToken.ERROR_MALFORMED_UNCLOSED_CHARACTER;    String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));    yybegin(nextState);    return (t);}<YYINITIAL, MIDDLE_OF_LINE> {MalformedCharacter} {     nextState = MIDDLE_OF_LINE;    lastToken = CToken.ERROR_MALFORMED_CHARACTER;    String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));    yybegin(nextState);    return (t);}<YYINITIAL, MIDDLE_OF_LINE> {ErrorFloat} {     nextState = MIDDLE_OF_LINE;    lastToken = CToken.ERROR_FLOAT;    String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));    yybegin(nextState);    return (t);}<YYINITIAL, MIDDLE_OF_LINE> {ErrorIdentifier} {     nextState = MIDDLE_OF_LINE;    lastToken = CToken.ERROR_IDENTIFIER;    String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));    yybegin(nextState);    return (t);}<YYINITIAL, MIDDLE_OF_LINE, PREPROCESSOR> {OpenComment} {     nextState = MIDDLE_OF_LINE;    lastToken = CToken.ERROR_UNCLOSED_COMMENT;    String text = yytext();	CToken t = (new CToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));    yybegin(nextState);    return (t);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -