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

📄 lexercode.java

📁 SkipOOMiniJOOL教学语言的编译器前端
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
package edu.ustc.cs.minijool.lexer;

/**
 * This class is generated automatically by LexerCodeGenerator.
 */
public class LexerCode {
	private NFAState start, end;
	private NFAState Start = new NFAState();
	private NFAState End   = new NFAState();
	public NFAState getNFA() {
		{ // NFA for STATIC
			{ // "static"
				start = new NFAState();
				end = new NFAState();
				NFAState cs32 = start;
				NFAState ns32;
				ns32 = new NFAState();
				cs32.addTransition((char)115, ns32);
				cs32 = ns32;
				ns32 = new NFAState();
				cs32.addTransition((char)116, ns32);
				cs32 = ns32;
				ns32 = new NFAState();
				cs32.addTransition((char)97, ns32);
				cs32 = ns32;
				ns32 = new NFAState();
				cs32.addTransition((char)116, ns32);
				cs32 = ns32;
				ns32 = new NFAState();
				cs32.addTransition((char)105, ns32);
				cs32 = ns32;
				cs32.addTransition((char)99, end);
			}
			end.makeFinal(2147483647, 1);
			Start.addTransition(NFAState.EPSILON, start);
			end.addTransition(NFAState.EPSILON, End);
		}
		{ // NFA for INT
			{ // "int"
				start = new NFAState();
				end = new NFAState();
				NFAState cs33 = start;
				NFAState ns33;
				ns33 = new NFAState();
				cs33.addTransition((char)105, ns33);
				cs33 = ns33;
				ns33 = new NFAState();
				cs33.addTransition((char)110, ns33);
				cs33 = ns33;
				cs33.addTransition((char)116, end);
			}
			end.makeFinal(2147483646, 2);
			Start.addTransition(NFAState.EPSILON, start);
			end.addTransition(NFAState.EPSILON, End);
		}
		{ // NFA for BOOLEAN
			{ // "boolean"
				start = new NFAState();
				end = new NFAState();
				NFAState cs34 = start;
				NFAState ns34;
				ns34 = new NFAState();
				cs34.addTransition((char)98, ns34);
				cs34 = ns34;
				ns34 = new NFAState();
				cs34.addTransition((char)111, ns34);
				cs34 = ns34;
				ns34 = new NFAState();
				cs34.addTransition((char)111, ns34);
				cs34 = ns34;
				ns34 = new NFAState();
				cs34.addTransition((char)108, ns34);
				cs34 = ns34;
				ns34 = new NFAState();
				cs34.addTransition((char)101, ns34);
				cs34 = ns34;
				ns34 = new NFAState();
				cs34.addTransition((char)97, ns34);
				cs34 = ns34;
				cs34.addTransition((char)110, end);
			}
			end.makeFinal(2147483645, 3);
			Start.addTransition(NFAState.EPSILON, start);
			end.addTransition(NFAState.EPSILON, End);
		}
		{ // NFA for VOID
			{ // "void"
				start = new NFAState();
				end = new NFAState();
				NFAState cs35 = start;
				NFAState ns35;
				ns35 = new NFAState();
				cs35.addTransition((char)118, ns35);
				cs35 = ns35;
				ns35 = new NFAState();
				cs35.addTransition((char)111, ns35);
				cs35 = ns35;
				ns35 = new NFAState();
				cs35.addTransition((char)105, ns35);
				cs35 = ns35;
				cs35.addTransition((char)100, end);
			}
			end.makeFinal(2147483644, 4);
			Start.addTransition(NFAState.EPSILON, start);
			end.addTransition(NFAState.EPSILON, End);
		}
		{ // NFA for CLASS
			{ // "class"
				start = new NFAState();
				end = new NFAState();
				NFAState cs36 = start;
				NFAState ns36;
				ns36 = new NFAState();
				cs36.addTransition((char)99, ns36);
				cs36 = ns36;
				ns36 = new NFAState();
				cs36.addTransition((char)108, ns36);
				cs36 = ns36;
				ns36 = new NFAState();
				cs36.addTransition((char)97, ns36);
				cs36 = ns36;
				ns36 = new NFAState();
				cs36.addTransition((char)115, ns36);
				cs36 = ns36;
				cs36.addTransition((char)115, end);
			}
			end.makeFinal(2147483643, 5);
			Start.addTransition(NFAState.EPSILON, start);
			end.addTransition(NFAState.EPSILON, End);
		}
		{ // NFA for EXTENDS
			{ // "extends"
				start = new NFAState();
				end = new NFAState();
				NFAState cs37 = start;
				NFAState ns37;
				ns37 = new NFAState();
				cs37.addTransition((char)101, ns37);
				cs37 = ns37;
				ns37 = new NFAState();
				cs37.addTransition((char)120, ns37);
				cs37 = ns37;
				ns37 = new NFAState();
				cs37.addTransition((char)116, ns37);
				cs37 = ns37;
				ns37 = new NFAState();
				cs37.addTransition((char)101, ns37);
				cs37 = ns37;
				ns37 = new NFAState();
				cs37.addTransition((char)110, ns37);
				cs37 = ns37;
				ns37 = new NFAState();
				cs37.addTransition((char)100, ns37);
				cs37 = ns37;
				cs37.addTransition((char)115, end);
			}
			end.makeFinal(2147483642, 6);
			Start.addTransition(NFAState.EPSILON, start);
			end.addTransition(NFAState.EPSILON, End);
		}
		{ // NFA for NEW
			{ // "new"
				start = new NFAState();
				end = new NFAState();
				NFAState cs38 = start;
				NFAState ns38;
				ns38 = new NFAState();
				cs38.addTransition((char)110, ns38);
				cs38 = ns38;
				ns38 = new NFAState();
				cs38.addTransition((char)101, ns38);
				cs38 = ns38;
				cs38.addTransition((char)119, end);
			}
			end.makeFinal(2147483641, 7);
			Start.addTransition(NFAState.EPSILON, start);
			end.addTransition(NFAState.EPSILON, End);
		}
		{ // NFA for THIS
			{ // "this"
				start = new NFAState();
				end = new NFAState();
				NFAState cs39 = start;
				NFAState ns39;
				ns39 = new NFAState();
				cs39.addTransition((char)116, ns39);
				cs39 = ns39;
				ns39 = new NFAState();
				cs39.addTransition((char)104, ns39);
				cs39 = ns39;
				ns39 = new NFAState();
				cs39.addTransition((char)105, ns39);
				cs39 = ns39;
				cs39.addTransition((char)115, end);
			}
			end.makeFinal(2147483640, 8);
			Start.addTransition(NFAState.EPSILON, start);
			end.addTransition(NFAState.EPSILON, End);
		}
		{ // NFA for IF
			{ // "if"
				start = new NFAState();
				end = new NFAState();
				NFAState cs40 = start;
				NFAState ns40;
				ns40 = new NFAState();
				cs40.addTransition((char)105, ns40);
				cs40 = ns40;
				cs40.addTransition((char)102, end);
			}
			end.makeFinal(2147483639, 9);
			Start.addTransition(NFAState.EPSILON, start);
			end.addTransition(NFAState.EPSILON, End);
		}
		{ // NFA for ELSE
			{ // "else"
				start = new NFAState();
				end = new NFAState();
				NFAState cs41 = start;
				NFAState ns41;
				ns41 = new NFAState();
				cs41.addTransition((char)101, ns41);
				cs41 = ns41;
				ns41 = new NFAState();
				cs41.addTransition((char)108, ns41);
				cs41 = ns41;
				ns41 = new NFAState();
				cs41.addTransition((char)115, ns41);
				cs41 = ns41;
				cs41.addTransition((char)101, end);
			}
			end.makeFinal(2147483638, 10);
			Start.addTransition(NFAState.EPSILON, start);
			end.addTransition(NFAState.EPSILON, End);
		}
		{ // NFA for WHILE
			{ // "while"
				start = new NFAState();
				end = new NFAState();
				NFAState cs42 = start;
				NFAState ns42;
				ns42 = new NFAState();
				cs42.addTransition((char)119, ns42);
				cs42 = ns42;
				ns42 = new NFAState();
				cs42.addTransition((char)104, ns42);
				cs42 = ns42;
				ns42 = new NFAState();
				cs42.addTransition((char)105, ns42);
				cs42 = ns42;
				ns42 = new NFAState();
				cs42.addTransition((char)108, ns42);
				cs42 = ns42;
				cs42.addTransition((char)101, end);
			}
			end.makeFinal(2147483637, 11);
			Start.addTransition(NFAState.EPSILON, start);
			end.addTransition(NFAState.EPSILON, End);
		}
		{ // NFA for RETURN
			{ // "return"
				start = new NFAState();
				end = new NFAState();
				NFAState cs43 = start;
				NFAState ns43;
				ns43 = new NFAState();
				cs43.addTransition((char)114, ns43);
				cs43 = ns43;
				ns43 = new NFAState();
				cs43.addTransition((char)101, ns43);
				cs43 = ns43;
				ns43 = new NFAState();
				cs43.addTransition((char)116, ns43);
				cs43 = ns43;
				ns43 = new NFAState();
				cs43.addTransition((char)117, ns43);
				cs43 = ns43;
				ns43 = new NFAState();
				cs43.addTransition((char)114, ns43);
				cs43 = ns43;
				cs43.addTransition((char)110, end);
			}
			end.makeFinal(2147483636, 12);
			Start.addTransition(NFAState.EPSILON, start);
			end.addTransition(NFAState.EPSILON, End);
		}
		{ // NFA for NULL
			{ // "null"
				start = new NFAState();
				end = new NFAState();
				NFAState cs44 = start;
				NFAState ns44;
				ns44 = new NFAState();
				cs44.addTransition((char)110, ns44);
				cs44 = ns44;
				ns44 = new NFAState();
				cs44.addTransition((char)117, ns44);
				cs44 = ns44;
				ns44 = new NFAState();
				cs44.addTransition((char)108, ns44);
				cs44 = ns44;
				cs44.addTransition((char)108, end);
			}
			end.makeFinal(2147483635, 13);
			Start.addTransition(NFAState.EPSILON, start);
			end.addTransition(NFAState.EPSILON, End);
		}
		{ // NFA for PRINT
			{ // "print"
				start = new NFAState();
				end = new NFAState();
				NFAState cs45 = start;
				NFAState ns45;
				ns45 = new NFAState();
				cs45.addTransition((char)112, ns45);
				cs45 = ns45;
				ns45 = new NFAState();
				cs45.addTransition((char)114, ns45);
				cs45 = ns45;
				ns45 = new NFAState();
				cs45.addTransition((char)105, ns45);
				cs45 = ns45;
				ns45 = new NFAState();
				cs45.addTransition((char)110, ns45);
				cs45 = ns45;
				cs45.addTransition((char)116, end);
			}
			end.makeFinal(2147483634, 14);
			Start.addTransition(NFAState.EPSILON, start);
			end.addTransition(NFAState.EPSILON, End);
		}
		{ // NFA for IDENTIFIER
		{
			{
				// Concatenation
		{
			{
				// OR node
				{
					// Range transition
					start = new NFAState();
					end = new NFAState();
					start.addTransitionRange('a', 'z', end);
				}
				NFAState ls5 = start;
				NFAState le5 = end;
				{
					// Range transition
					start = new NFAState();
					end = new NFAState();
					start.addTransitionRange('A', 'Z', end);
				}
				NFAState rs5 = start;
				NFAState re5 = end;
				start = new NFAState();
				end = new NFAState();
				start.addTransition(NFAState.EPSILON, ls5);
				start.addTransition(NFAState.EPSILON, rs5);
				le5.addTransition(NFAState.EPSILON, end);
				re5.addTransition(NFAState.EPSILON, end);
			}
		}
				NFAState ls8 = start;
				NFAState le8 = end;
				{
					{ // * or + node
						{
							// OR node
		{
			{
				// Range transition
				start = new NFAState();
				end = new NFAState();
				start.addTransitionRange('0', '9', end);
			}
		}
							NFAState ls10 = start;
							NFAState le10 = end;
		{
			{
				// OR node
				{
					// Range transition
					start = new NFAState();
					end = new NFAState();
					start.addTransitionRange('a', 'z', end);
				}
				NFAState ls5 = start;
				NFAState le5 = end;
				{
					// Range transition
					start = new NFAState();
					end = new NFAState();
					start.addTransitionRange('A', 'Z', end);
				}
				NFAState rs5 = start;
				NFAState re5 = end;
				start = new NFAState();
				end = new NFAState();
				start.addTransition(NFAState.EPSILON, ls5);
				start.addTransition(NFAState.EPSILON, rs5);
				le5.addTransition(NFAState.EPSILON, end);
				re5.addTransition(NFAState.EPSILON, end);
			}
		}
							NFAState rs10 = start;
							NFAState re10 = end;
							start = new NFAState();
							end = new NFAState();
							start.addTransition(NFAState.EPSILON, ls10);
							start.addTransition(NFAState.EPSILON, rs10);
							le10.addTransition(NFAState.EPSILON, end);
							re10.addTransition(NFAState.EPSILON, end);
						}
						NFAState os11 = start;
						NFAState oe11 = end;
						start = new NFAState();
						end = new NFAState();
						start.addTransition(NFAState.EPSILON, os11);
						oe11.addTransition(NFAState.EPSILON, end);
						oe11.addTransition(NFAState.EPSILON, os11);
						// * node
						start.addTransition(NFAState.EPSILON, end);
					}
				}

⌨️ 快捷键说明

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