OrList newline = new OrList(1, "newline");
OrList comment = new OrList(2, "comment");
Repeat ws = new Repeat(3, "ws");
Optional s = new Optional(4, "s");
Str ff = new Str(5, "\"");
ElementList str = new ElementList(6, "str");
OrList letter = new OrList(7, "letter");
Range digit = new Range(8, "digit", "0", "9");
ElementList name = new ElementList(9, "name");
ElementList uname = new ElementList(10, "uname");
Optional _public = new Optional(11, "public");
ElementList packagestatement = new ElementList(12, "packagestatement");
ElementList packagename = new ElementList(13, "packagename");
ElementList fullclassname = new ElementList(14, "fullclassname");
ElementList importstatement = new ElementList(15, "importstatement", importstatementImportstatement);
Optional imports = new Optional(16, "imports");
ElementList parameter = new ElementList(17, "parameter");
ElementList parameters = new ElementList(18, "parameters");
ElementList statement = new ElementList(19, "statement");
Optional skipCurlyBrace = new Optional(20, "skipCurlyBrace");
ElementList stateStatement = new ElementList(21, "stateStatement");
ElementList stateConstructor = new ElementList(22, "stateConstructor");
ElementList asMethod = new ElementList(23, "asMethod");
ElementList behaviourMethod = new ElementList(24, "behaviourMethod");
ElementList behaviour = new ElementList(25, "behaviour");
// *** Statements ***
// newline = "\r\n" | "\n"
newline.add(27, new Str(26, "\r\n"));
newline.add(29, new Str(28, "\n"));
// comment = ("/*" [(comment | !"*/")+] "*/") | ("//" [!newline+] newline|END)
ElementList comment_1 = new ElementList(30, "comment_1");
comment_1.add(32, new Str(31, "/*"));
Optional comment_1_1 = new Optional(33, "comment_1_1");
Repeat comment_1_1_1 = new Repeat(34, "comment_1_1_1");
OrList comment_1_1_1_1 = new OrList(35, "comment_1_1_1_1");
comment_1_1_1_1.add(36, comment);
comment_1_1_1_1.add(38, new Str(37, "*/", NOT));
comment_1_1_1.add(39, comment_1_1_1_1);
comment_1_1.add(40, comment_1_1_1);
comment_1.add(41, comment_1_1);
comment_1.add(43, new Str(42, "*/"));
comment.add(44, comment_1);
ElementList comment_2 = new ElementList(45, "comment_2");
comment_2.add(47, new Str(46, "//"));
Optional comment_2_1 = new Optional(48, "comment_2_1");
Repeat comment_2_1_1 = new Repeat(49, "comment_2_1_1");
comment_2_1_1.add(50, newline, NOT);
comment_2_1.add(51, comment_2_1_1);
comment_2.add(52, comment_2_1);
OrList comment_2_2 = new OrList(53, "comment_2_2");
comment_2_2.add(54, newline);
comment_2_2.add(56, new End(55, "comment_2_2"));
comment_2.add(57, comment_2_2);
comment.add(58, comment_2);
// ws = (newline | " " | "\t" | comment)+
OrList ws_1 = new OrList(59, "ws_1");
ws_1.add(60, newline);
ws_1.add(62, new Str(61, " "));
ws_1.add(64, new Str(63, "\t"));
ws_1.add(65, comment);
ws.add(66, ws_1);
// s = [ws]
s.add(67, ws);
// ff = "\""
// str = ff (("\\\"" | !(ff|newline))+):strval ff
str.add(68, ff);
Repeat str_1 = new Repeat(69, "str_1");
OrList str_1_1 = new OrList(70, "str_1_1");
str_1_1.add(72, new Str(71, "\\\""));
OrList str_1_1_1 = new OrList(73, "str_1_1_1", NOT);
str_1_1_1.add(74, ff);
str_1_1_1.add(75, newline);
str_1_1.add(76, str_1_1_1);
str_1.add(77, str_1_1);
str.add(78, str_1);
str.add(79, ff);
// letter = "a".."z" | "A".."Z" | "_" | "$"
letter.add(81, new Range(80, "letter", "a", "z"));
letter.add(83, new Range(82, "letter", "A", "Z"));
letter.add(85, new Str(84, "_"));
letter.add(87, new Str(86, "$"));
// digit = "0".."9"
// name = letter [letter | digit]+
name.add(88, letter);
Optional name_1 = new Optional(89, "name_1");
Repeat name_1_1 = new Repeat(90, "name_1_1");
OrList name_1_1_1 = new OrList(91, "name_1_1_1");
name_1_1_1.add(92, letter);
name_1_1_1.add(93, digit);
name_1_1.add(94, name_1_1_1);
name_1.add(95, name_1_1);
name.add(96, name_1);
// uname = "A".."Z" [letter | digit]+
uname.add(98, new Range(97, "uname", "A", "Z"));
Optional uname_1 = new Optional(99, "uname_1");
Repeat uname_1_1 = new Repeat(100, "uname_1_1");
OrList uname_1_1_1 = new OrList(101, "uname_1_1_1");
uname_1_1_1.add(102, letter);
uname_1_1_1.add(103, digit);
uname_1_1.add(104, uname_1_1_1);
uname_1.add(105, uname_1_1);
uname.add(106, uname_1);
// public = ["public" ws]
_public.add(108, new Str(107, "public"));
_public.add(109, ws);
// packagestatement = "package" ws packagename:statement s ";"
packagestatement.add(111, new Str(110, "package"));
packagestatement.add(112, ws);
packagestatement.add(113, packagename, behaviourPackagestatementStatement);
packagestatement.add(114, s);
packagestatement.add(116, new Str(115, ";"));
// packagename = name ["." name|"*"]+
packagename.add(117, name);
Optional packagename_1 = new Optional(118, "packagename_1");
Repeat packagename_1_1 = new Repeat(119, "packagename_1_1");
packagename_1_1.add(121, new Str(120, "."));
OrList packagename_1_1_1 = new OrList(122, "packagename_1_1_1");
packagename_1_1_1.add(123, name);
packagename_1_1_1.add(125, new Str(124, "*"));
packagename_1_1.add(126, packagename_1_1_1);
packagename_1.add(127, packagename_1_1);
packagename.add(128, packagename_1);
// fullclassname = packagename
fullclassname.add(129, packagename);
// importstatement = "import" ws ["static":static ws] fullclassname s ";"
importstatement.add(131, new Str(130, "import"));
importstatement.add(132, ws);
Optional importstatement_1 = new Optional(133, "importstatement_1");
importstatement_1.add(135, new Str(134, "static", importstatementImportstatementStatic));
importstatement_1.add(136, ws);
importstatement.add(137, importstatement_1);
importstatement.add(138, fullclassname, importstatementImportstatementFullclassname);
importstatement.add(139, s);
importstatement.add(141, new Str(140, ";"));
// imports = [s importstatement]+
Repeat imports_1 = new Repeat(142, "imports_1");
imports_1.add(143, s);
imports_1.add(144, importstatement, importsImportsImportstatement);
imports.add(145, imports_1);
// parameter = s name:type ws name:variable s
parameter.add(146, s);
parameter.add(147, name, parameterParameterType);
parameter.add(148, ws);
parameter.add(149, name, parameterParameterVariable);
parameter.add(150, s);
// parameters = [parameter] ["," s parameter]+
Optional parameters_1 = new Optional(151, "parameters_1");
parameters_1.add(152, parameter, parametersParametersParameter);
parameters.add(153, parameters_1);
Optional parameters_2 = new Optional(154, "parameters_2");
Repeat parameters_2_1 = new Repeat(155, "parameters_2_1");
parameters_2_1.add(157, new Str(156, ","));
parameters_2_1.add(158, s);
parameters_2_1.add(159, parameter, parametersParametersParameter);
parameters_2.add(160, parameters_2_1);
parameters.add(161, parameters_2);
// statement = "{" s [(statement | str | !"}")+]:innerStatement "}"
statement.add(163, new Str(162, "{"));
statement.add(164, s);
Optional statement_1 = new Optional(165, "statement_1", statementStatementInnerStatement);
Repeat statement_1_1 = new Repeat(166, "statement_1_1");
OrList statement_1_1_1 = new OrList(167, "statement_1_1_1");
statement_1_1_1.add(168, statement, statementStatementStatement);
statement_1_1_1.add(169, str);
statement_1_1_1.add(171, new Str(170, "}", NOT));
statement_1_1.add(172, statement_1_1_1);
statement_1.add(173, statement_1_1);
statement.add(174, statement_1);
statement.add(176, new Str(175, "}"));
// skipCurlyBrace = [!"{"+]
Repeat skipCurlyBrace_1 = new Repeat(177, "skipCurlyBrace_1");
skipCurlyBrace_1.add(179, new Str(178, "{", NOT));
skipCurlyBrace.add(180, skipCurlyBrace_1);
// stateStatement = public "class" ws name [ws "extends" ws uname:extendsClass] skipCurlyBrace "{" [!stateConstructor:x+] stateConstructor
stateStatement.add(181, _public);
stateStatement.add(183, new Str(182, "class"));
stateStatement.add(184, ws);
stateStatement.add(185, name);
Optional stateStatement_1 = new Optional(186, "stateStatement_1");
stateStatement_1.add(187, ws);
stateStatement_1.add(189, new Str(188, "extends"));
stateStatement_1.add(190, ws);
stateStatement_1.add(191, uname, behaviourStateStatementExtendsClass);
stateStatement.add(192, stateStatement_1);
stateStatement.add(193, skipCurlyBrace);
stateStatement.add(195, new Str(194, "{"));
Optional stateStatement_2 = new Optional(196, "stateStatement_2");
Repeat stateStatement_2_1 = new Repeat(197, "stateStatement_2_1");
stateStatement_2_1.add(198, stateConstructor, NOT);
stateStatement_2.add(199, stateStatement_2_1);
stateStatement.add(200, stateStatement_2);
stateStatement.add(201, stateConstructor);
// stateConstructor = s public name s "(" s ["final" s] name:stateClass ws name parameters skipCurlyBrace statement
stateConstructor.add(202, s);
stateConstructor.add(203, _public);
stateConstructor.add(204, name);
stateConstructor.add(205, s);
stateConstructor.add(207, new Str(206, "("));
stateConstructor.add(208, s);
Optional stateConstructor_1 = new Optional(209, "stateConstructor_1");
stateConstructor_1.add(211, new Str(210, "final"));
stateConstructor_1.add(212, s);
stateConstructor.add(213, stateConstructor_1);
stateConstructor.add(214, name, behaviourStateConstructorStateClass);
stateConstructor.add(215, ws);
stateConstructor.add(216, name);
stateConstructor.add(217, parameters, behaviourStateConstructorParameters);
stateConstructor.add(218, skipCurlyBrace);
stateConstructor.add(219, statement, stateConstructorStateConstructorStatement);
// asMethod =
// [!newline+ newline]:comment s
// ["public"|"private" ws] uname:returnclass ws ("as" uname):methodName s "(" s parameters s ")" s statement
Optional asMethod_1 = new Optional(220, "asMethod_1", asMethodAsMethodComment);
Repeat asMethod_1_1 = new Repeat(221, "asMethod_1_1");
asMethod_1_1.add(222, newline, NOT);
asMethod_1.add(223, asMethod_1_1);
asMethod_1.add(224, newline);
asMethod.add(225, asMethod_1);
asMethod.add(226, s);
Optional asMethod_2 = new Optional(227, "asMethod_2");
OrList asMethod_2_1 = new OrList(228, "asMethod_2_1");
asMethod_2_1.add(230, new Str(229, "public"));
asMethod_2_1.add(232, new Str(231, "private"));
asMethod_2.add(233, asMethod_2_1);
asMethod_2.add(234, ws);
asMethod.add(235, asMethod_2);
asMethod.add(236, uname, asMethodAsMethodReturnclass);
asMethod.add(237, ws);
ElementList asMethod_3 = new ElementList(238, "asMethod_3", asMethodAsMethodMethodName);
asMethod_3.add(240, new Str(239, "as"));
asMethod_3.add(241, uname);
asMethod.add(242, asMethod_3);
asMethod.add(243, s);
asMethod.add(245, new Str(244, "("));
asMethod.add(246, s);
asMethod.add(247, parameters, asMethodAsMethodParameters);