Examples of ElementList


Examples of net.sf.laja.parser.engine2.element.ElementList

    Data.ExpressionExpressionPlus expressionExpressionPlus = data2.new ExpressionExpressionPlus("expressionExpressionPlus");
    Data.ExpressionExpressionMinus expressionExpressionMinus = data2.new ExpressionExpressionMinus("expressionExpressionMinus");

    // *** Declarations and Statements ***
    Repeat integer = new Repeat(1, "integer");
    ElementList number = new ElementList(2, "number");
    ElementList oneArgumentFunction = new ElementList(3, "oneArgumentFunction");
    ElementList twoArgumentsFunction = new ElementList(4, "twoArgumentsFunction");
    OrList expression1 = new OrList(5, "expression1");
    ElementList expression2 = new ElementList(6, "expression2");
    ElementList expression3 = new ElementList(7, "expression3");
    ElementList expression = new ElementList(8, "expression");

    // integer = "0".."9"+
    integer.add(10, new Range(9, "integer", "0", "9"));

    // number = integer ["." integer]
    number.add(11, integer);
    Optional number_1 = new Optional(12, "number_1");
    number_1.add(14, new Str(13, "."));
    number_1.add(15, integer);
    number.add(16, number_1);

    // oneArgumentFunction =
    //   ("abs":abs | "acos":acos | "asin":asin | "atan":atan |
    //   "ceil":ceil | "cos":cos | "exp":exp | "floor":floor | "log":log |
    //   "rint":rint | "round":round | "sin":sin | "sqrt":sqrt |
    //   "tan":tan | "toDegrees":toDegrees | "toRadians":toRadians) "(" expression:argument ")"
    OrList oneArgumentFunction_1 = new OrList(17, "oneArgumentFunction_1");
    oneArgumentFunction_1.add(19, new Str(18, "abs", oneArgumentFunctionOneArgumentFunctionAbs));
    oneArgumentFunction_1.add(21, new Str(20, "acos", oneArgumentFunctionOneArgumentFunctionAcos));
    oneArgumentFunction_1.add(23, new Str(22, "asin", oneArgumentFunctionOneArgumentFunctionAsin));
    oneArgumentFunction_1.add(25, new Str(24, "atan", oneArgumentFunctionOneArgumentFunctionAtan));
    oneArgumentFunction_1.add(27, new Str(26, "ceil", oneArgumentFunctionOneArgumentFunctionCeil));
    oneArgumentFunction_1.add(29, new Str(28, "cos", oneArgumentFunctionOneArgumentFunctionCos));
    oneArgumentFunction_1.add(31, new Str(30, "exp", oneArgumentFunctionOneArgumentFunctionExp));
    oneArgumentFunction_1.add(33, new Str(32, "floor", oneArgumentFunctionOneArgumentFunctionFloor));
    oneArgumentFunction_1.add(35, new Str(34, "log", oneArgumentFunctionOneArgumentFunctionLog));
    oneArgumentFunction_1.add(37, new Str(36, "rint", oneArgumentFunctionOneArgumentFunctionRint));
    oneArgumentFunction_1.add(39, new Str(38, "round", oneArgumentFunctionOneArgumentFunctionRound));
    oneArgumentFunction_1.add(41, new Str(40, "sin", oneArgumentFunctionOneArgumentFunctionSin));
    oneArgumentFunction_1.add(43, new Str(42, "sqrt", oneArgumentFunctionOneArgumentFunctionSqrt));
    oneArgumentFunction_1.add(45, new Str(44, "tan", oneArgumentFunctionOneArgumentFunctionTan));
    oneArgumentFunction_1.add(47, new Str(46, "toDegrees", oneArgumentFunctionOneArgumentFunctionToDegrees));
    oneArgumentFunction_1.add(49, new Str(48, "toRadians", oneArgumentFunctionOneArgumentFunctionToRadians));
    oneArgumentFunction.add(50, oneArgumentFunction_1);
    oneArgumentFunction.add(52, new Str(51, "("));
    oneArgumentFunction.add(53, expression, oneArgumentFunctionOneArgumentFunctionArgument);
    oneArgumentFunction.add(55, new Str(54, ")"));

    // twoArgumentsFunction =
    //   ("atan2":atan2 | "IEEEremainder":ieeeRemainder | "max":max | "min":min |
    //   "pow":pow) "(" expression:arg1 "," expression:arg2 ")"
    OrList twoArgumentsFunction_1 = new OrList(56, "twoArgumentsFunction_1");
    twoArgumentsFunction_1.add(58, new Str(57, "atan2", twoArgumentsFunctionTwoArgumentsFunctionAtan2));
    twoArgumentsFunction_1.add(60, new Str(59, "IEEEremainder"));
    twoArgumentsFunction_1.add(62, new Str(61, "max", twoArgumentsFunctionTwoArgumentsFunctionMax));
    twoArgumentsFunction_1.add(64, new Str(63, "min", twoArgumentsFunctionTwoArgumentsFunctionMin));
    twoArgumentsFunction_1.add(66, new Str(65, "pow", twoArgumentsFunctionTwoArgumentsFunctionPow));
    twoArgumentsFunction.add(67, twoArgumentsFunction_1);
    twoArgumentsFunction.add(69, new Str(68, "("));
    twoArgumentsFunction.add(70, expression, twoArgumentsFunctionTwoArgumentsFunctionArg1);
    twoArgumentsFunction.add(72, new Str(71, ","));
    twoArgumentsFunction.add(73, expression, twoArgumentsFunctionTwoArgumentsFunctionArg2);
    twoArgumentsFunction.add(75, new Str(74, ")"));

    // expression1 = "random()":random | oneArgumentFunction | twoArgumentsFunction | number | ("(" expression ")")
    expression1.add(77, new Str(76, "random()", expression1Expression1Random));
    expression1.add(78, oneArgumentFunction, expression1Expression1OneArgumentFunction);
    expression1.add(79, twoArgumentsFunction, expression1Expression1TwoArgumentsFunction);
    expression1.add(80, number, expression1Expression1Number);
    ElementList expression1_1 = new ElementList(81, "expression1_1");
    expression1_1.add(83, new Str(82, "("));
    expression1_1.add(84, expression, expression1Expression1Expression);
    expression1_1.add(86, new Str(85, ")"));
    expression1.add(87, expression1_1);

    // expression2 = expression1 ["^":expo expression1]+
    expression2.add(88, expression1, expression2Expression2Expression1);
    Optional expression2_1 = new Optional(89, "expression2_1");
View Full Code Here

Examples of net.sf.laja.parser.engine2.element.ElementList

  private net.sf.laja.parser.engine2.element.Element getGrammar1() {
    // *** Output classes ***

    // *** Declarations and Statements ***
    Repeat integer = new Repeat(1, "integer");
    ElementList number = new ElementList(2, "number");
    ElementList oneArgumentFunction = new ElementList(3, "oneArgumentFunction");
    ElementList twoArgumentsFunction = new ElementList(4, "twoArgumentsFunction");
    OrList expression1 = new OrList(5, "expression1");
    ElementList expression2 = new ElementList(6, "expression2");
    ElementList expression3 = new ElementList(7, "expression3");
    ElementList expression = new ElementList(8, "expression");

    // integer = "0".."9"+
    integer.add(10, new Range(9, "integer", "0", "9"));

    // number = integer ["." integer]
    number.add(11, integer);
    Optional number_1 = new Optional(12, "number_1");
    number_1.add(14, new Str(13, "."));
    number_1.add(15, integer);
    number.add(16, number_1);

    // oneArgumentFunction =
    //   ("abs":abs | "acos":acos | "asin":asin | "atan":atan |
    //   "ceil":ceil | "cos":cos | "exp":exp | "floor":floor | "log":log |
    //   "rint":rint | "round":round | "sin":sin | "sqrt":sqrt |
    //   "tan":tan | "toDegrees":toDegrees | "toRadians":toRadians) "(" expression:argument ")"
    OrList oneArgumentFunction_1 = new OrList(17, "oneArgumentFunction_1");
    oneArgumentFunction_1.add(19, new Str(18, "abs"));
    oneArgumentFunction_1.add(21, new Str(20, "acos"));
    oneArgumentFunction_1.add(23, new Str(22, "asin"));
    oneArgumentFunction_1.add(25, new Str(24, "atan"));
    oneArgumentFunction_1.add(27, new Str(26, "ceil"));
    oneArgumentFunction_1.add(29, new Str(28, "cos"));
    oneArgumentFunction_1.add(31, new Str(30, "exp"));
    oneArgumentFunction_1.add(33, new Str(32, "floor"));
    oneArgumentFunction_1.add(35, new Str(34, "log"));
    oneArgumentFunction_1.add(37, new Str(36, "rint"));
    oneArgumentFunction_1.add(39, new Str(38, "round"));
    oneArgumentFunction_1.add(41, new Str(40, "sin"));
    oneArgumentFunction_1.add(43, new Str(42, "sqrt"));
    oneArgumentFunction_1.add(45, new Str(44, "tan"));
    oneArgumentFunction_1.add(47, new Str(46, "toDegrees"));
    oneArgumentFunction_1.add(49, new Str(48, "toRadians"));
    oneArgumentFunction.add(50, oneArgumentFunction_1);
    oneArgumentFunction.add(52, new Str(51, "("));
    oneArgumentFunction.add(53, expression);
    oneArgumentFunction.add(55, new Str(54, ")"));

    // twoArgumentsFunction =
    //   ("atan2":atan2 | "IEEEremainder":ieeeRemainder | "max":max | "min":min |
    //   "pow":pow) "(" expression:arg1 "," expression:arg2 ")"
    OrList twoArgumentsFunction_1 = new OrList(56, "twoArgumentsFunction_1");
    twoArgumentsFunction_1.add(58, new Str(57, "atan2"));
    twoArgumentsFunction_1.add(60, new Str(59, "IEEEremainder"));
    twoArgumentsFunction_1.add(62, new Str(61, "max"));
    twoArgumentsFunction_1.add(64, new Str(63, "min"));
    twoArgumentsFunction_1.add(66, new Str(65, "pow"));
    twoArgumentsFunction.add(67, twoArgumentsFunction_1);
    twoArgumentsFunction.add(69, new Str(68, "("));
    twoArgumentsFunction.add(70, expression);
    twoArgumentsFunction.add(72, new Str(71, ","));
    twoArgumentsFunction.add(73, expression);
    twoArgumentsFunction.add(75, new Str(74, ")"));

    // expression1 = "random()":random | oneArgumentFunction | twoArgumentsFunction | number | ("(" expression ")")
    expression1.add(77, new Str(76, "random()"));
    expression1.add(78, oneArgumentFunction);
    expression1.add(79, twoArgumentsFunction);
    expression1.add(80, number);
    ElementList expression1_1 = new ElementList(81, "expression1_1");
    expression1_1.add(83, new Str(82, "("));
    expression1_1.add(84, expression);
    expression1_1.add(86, new Str(85, ")"));
    expression1.add(87, expression1_1);

    // expression2 = expression1 ["^":expo expression1]+
    expression2.add(88, expression1);
    Optional expression2_1 = new Optional(89, "expression2_1");
View Full Code Here

Examples of net.sf.laja.parser.engine2.element.ElementList

        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");
        Optional _public = new Optional(10, "public");
        ElementList packagestatement = new ElementList(11, "packagestatement");
        ElementList packagename = new ElementList(12, "packagename");
        ElementList fullclassname = new ElementList(13, "fullclassname");
        ElementList importstatement = new ElementList(14, "importstatement", importstatementImportstatement);
        Optional imports = new Optional(15, "imports");
        ElementList type = new ElementList(16, "type");
        ElementList initialValue = new ElementList(17, "initialValue");
        ElementList attribute = new ElementList(18, "attribute");
        ElementList attributeComment = new ElementList(19, "attributeComment");
        ElementList statement = new ElementList(20, "statement");
        ElementList isvalid = new ElementList(21, "isvalid");
        ElementList uname = new ElementList(22, "uname");
        ElementList getter = new ElementList(23, "getter");
        ElementList parameters = new ElementList(24, "parameters");
        ElementList argument = new ElementList(25, "argument");
        ElementList method = new ElementList(26, "method");
        ElementList stateMethod = new ElementList(27, "stateMethod");
        ElementList convertMethod = new ElementList(28, "convertMethod");
        ElementList classStatement = new ElementList(29, "classStatement");
        ElementList stateTemplate = new ElementList(30, "stateTemplate");

        // *** Statements ***

        // newline = "\r\n" | "\n"
        newline.add(32, new Str(31, "\r\n"));
        newline.add(34, new Str(33, "\n"));

        // comment = ("/*" [(comment | !"*/")+] "*/") | ("//" [!newline+] newline|END)
        ElementList comment_1 = new ElementList(35, "comment_1");
        comment_1.add(37, new Str(36, "/*"));
        Optional comment_1_1 = new Optional(38, "comment_1_1");
        Repeat comment_1_1_1 = new Repeat(39, "comment_1_1_1");
        OrList comment_1_1_1_1 = new OrList(40, "comment_1_1_1_1");
        comment_1_1_1_1.add(41, comment);
        comment_1_1_1_1.add(43, new Str(42, "*/", NOT));
        comment_1_1_1.add(44, comment_1_1_1_1);
        comment_1_1.add(45, comment_1_1_1);
        comment_1.add(46, comment_1_1);
        comment_1.add(48, new Str(47, "*/"));
        comment.add(49, comment_1);
        ElementList comment_2 = new ElementList(50, "comment_2");
        comment_2.add(52, new Str(51, "//"));
        Optional comment_2_1 = new Optional(53, "comment_2_1");
        Repeat comment_2_1_1 = new Repeat(54, "comment_2_1_1");
        comment_2_1_1.add(55, newline, NOT);
        comment_2_1.add(56, comment_2_1_1);
        comment_2.add(57, comment_2_1);
        OrList comment_2_2 = new OrList(58, "comment_2_2");
        comment_2_2.add(59, newline);
        comment_2_2.add(61, new End(60, "comment_2_2"));
        comment_2.add(62, comment_2_2);
        comment.add(63, comment_2);

        // ws = (newline | " " | "\t" | comment)+
        OrList ws_1 = new OrList(64, "ws_1");
        ws_1.add(65, newline);
        ws_1.add(67, new Str(66, " "));
        ws_1.add(69, new Str(68, "\t"));
        ws_1.add(70, comment);
        ws.add(71, ws_1);

        // s = [ws]
        s.add(72, ws);

        // ff = "\""

        // str = ff (("\\\"" | !(ff|newline))+):strval ff
        str.add(73, ff);
        Repeat str_1 = new Repeat(74, "str_1");
        OrList str_1_1 = new OrList(75, "str_1_1");
        str_1_1.add(77, new Str(76, "\\\""));
        OrList str_1_1_1 = new OrList(78, "str_1_1_1", NOT);
        str_1_1_1.add(79, ff);
        str_1_1_1.add(80, newline);
        str_1_1.add(81, str_1_1_1);
        str_1.add(82, str_1_1);
        str.add(83, str_1);
        str.add(84, ff);

        // letter = "a".."z" | "A".."Z" | "_" | "$"
        letter.add(86, new Range(85, "letter", "a", "z"));
        letter.add(88, new Range(87, "letter", "A", "Z"));
        letter.add(90, new Str(89, "_"));
        letter.add(92, new Str(91, "$"));

        // digit = "0".."9"

        // name = letter [letter | digit]+
        name.add(93, letter);
        Optional name_1 = new Optional(94, "name_1");
        Repeat name_1_1 = new Repeat(95, "name_1_1");
        OrList name_1_1_1 = new OrList(96, "name_1_1_1");
        name_1_1_1.add(97, letter);
        name_1_1_1.add(98, digit);
        name_1_1.add(99, name_1_1_1);
        name_1.add(100, name_1_1);
        name.add(101, name_1);

        // public = ["public" ws]
        _public.add(103, new Str(102, "public"));
        _public.add(104, ws);

        // packagestatement = "package" ws packagename s ";"
        packagestatement.add(106, new Str(105, "package"));
        packagestatement.add(107, ws);
        packagestatement.add(108, packagename, stateTemplatePackagestatementPackagename);
        packagestatement.add(109, s);
        packagestatement.add(111, new Str(110, ";"));

        // packagename = name ["." name]+
        packagename.add(112, name);
        Optional packagename_1 = new Optional(113, "packagename_1");
        Repeat packagename_1_1 = new Repeat(114, "packagename_1_1");
        packagename_1_1.add(116, new Str(115, "."));
        packagename_1_1.add(117, name);
        packagename_1.add(118, packagename_1_1);
        packagename.add(119, packagename_1);

        // fullclassname = packagename
        fullclassname.add(120, packagename);

        // importstatement = "import" ws ["static":static ws] fullclassname s ";"
        importstatement.add(122, new Str(121, "import"));
        importstatement.add(123, ws);
        Optional importstatement_1 = new Optional(124, "importstatement_1");
        importstatement_1.add(126, new Str(125, "static", importstatementImportstatementStatic));
        importstatement_1.add(127, ws);
        importstatement.add(128, importstatement_1);
        importstatement.add(129, fullclassname, importstatementImportstatementFullclassname);
        importstatement.add(130, s);
        importstatement.add(132, new Str(131, ";"));

        // imports = [s importstatement]+
        Repeat imports_1 = new Repeat(133, "imports_1");
        imports_1.add(134, s);
        imports_1.add(135, importstatement, importsImportsImportstatement);
        imports.add(136, imports_1);

        // type = name [s "<" s type s ">"] [ s "," s type ]
        type.add(137, name);
        Optional type_1 = new Optional(138, "type_1");
        type_1.add(139, s);
        type_1.add(141, new Str(140, "<"));
        type_1.add(142, s);
        type_1.add(143, type);
        type_1.add(144, s);
        type_1.add(146, new Str(145, ">"));
        type.add(147, type_1);
        Optional type_2 = new Optional(148, "type_2");
        type_2.add(149, s);
        type_2.add(151, new Str(150, ","));
        type_2.add(152, s);
        type_2.add(153, type);
        type.add(154, type_2);

        // initialValue = "=" s !";"+:value
        initialValue.add(156, new Str(155, "="));
        initialValue.add(157, s);
        Repeat initialValue_1 = new Repeat(158, "initialValue_1", attributeInitialValueValue);
        initialValue_1.add(160, new Str(159, ";", NOT));
        initialValue.add(161, initialValue_1);

        // attribute = type ws name:variable s [initialValue s] ";" attributeComment|s
        attribute.add(162, type, attributeAttributeType);
        attribute.add(163, ws);
        attribute.add(164, name, attributeAttributeVariable);
        attribute.add(165, s);
        Optional attribute_1 = new Optional(166, "attribute_1");
        attribute_1.add(167, initialValue);
        attribute_1.add(168, s);
        attribute.add(169, attribute_1);
        attribute.add(171, new Str(170, ";"));
        OrList attribute_2 = new OrList(172, "attribute_2");
        attribute_2.add(173, attributeComment);
        attribute_2.add(174, s);
        attribute.add(175, attribute_2);

        // attributeComment = ([" " | "\t"]+ "//" [!newline+]):comment newline|END
        ElementList attributeComment_1 = new ElementList(176, "attributeComment_1", attributeAttributeCommentComment);
        Optional attributeComment_1_1 = new Optional(177, "attributeComment_1_1");
        Repeat attributeComment_1_1_1 = new Repeat(178, "attributeComment_1_1_1");
        OrList attributeComment_1_1_1_1 = new OrList(179, "attributeComment_1_1_1_1");
        attributeComment_1_1_1_1.add(181, new Str(180, " "));
        attributeComment_1_1_1_1.add(183, new Str(182, "\t"));
        attributeComment_1_1_1.add(184, attributeComment_1_1_1_1);
        attributeComment_1_1.add(185, attributeComment_1_1_1);
        attributeComment_1.add(186, attributeComment_1_1);
        attributeComment_1.add(188, new Str(187, "//"));
        Optional attributeComment_1_2 = new Optional(189, "attributeComment_1_2");
        Repeat attributeComment_1_2_1 = new Repeat(190, "attributeComment_1_2_1");
        attributeComment_1_2_1.add(191, newline, NOT);
        attributeComment_1_2.add(192, attributeComment_1_2_1);
        attributeComment_1.add(193, attributeComment_1_2);
        attributeComment.add(194, attributeComment_1);
        OrList attributeComment_2 = new OrList(195, "attributeComment_2");
        attributeComment_2.add(196, newline);
        attributeComment_2.add(198, new End(197, "attributeComment_2"));
        attributeComment.add(199, attributeComment_2);
View Full Code Here

Examples of net.sf.laja.parser.engine2.element.ElementList

        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");
        Optional _public = new Optional(10, "public");
        ElementList packagestatement = new ElementList(11, "packagestatement");
        ElementList packagename = new ElementList(12, "packagename");
        ElementList fullclassname = new ElementList(13, "fullclassname");
        ElementList importstatement = new ElementList(14, "importstatement");
        Optional imports = new Optional(15, "imports");
        ElementList type = new ElementList(16, "type");
        ElementList initialValue = new ElementList(17, "initialValue");
        ElementList attribute = new ElementList(18, "attribute");
        ElementList attributeComment = new ElementList(19, "attributeComment");
        ElementList statement = new ElementList(20, "statement");
        ElementList isvalid = new ElementList(21, "isvalid");
        ElementList uname = new ElementList(22, "uname");
        ElementList getter = new ElementList(23, "getter");
        ElementList parameters = new ElementList(24, "parameters");
        ElementList argument = new ElementList(25, "argument");
        ElementList method = new ElementList(26, "method");
        ElementList stateMethod = new ElementList(27, "stateMethod");
        ElementList convertMethod = new ElementList(28, "convertMethod");
        ElementList classStatement = new ElementList(29, "classStatement");
        ElementList stateTemplate = new ElementList(30, "stateTemplate");

        // *** Statements ***

        // newline = "\r\n" | "\n"
        newline.add(32, new Str(31, "\r\n"));
        newline.add(34, new Str(33, "\n"));

        // comment = ("/*" [(comment | !"*/")+] "*/") | ("//" [!newline+] newline|END)
        ElementList comment_1 = new ElementList(35, "comment_1");
        comment_1.add(37, new Str(36, "/*"));
        Optional comment_1_1 = new Optional(38, "comment_1_1");
        Repeat comment_1_1_1 = new Repeat(39, "comment_1_1_1");
        OrList comment_1_1_1_1 = new OrList(40, "comment_1_1_1_1");
        comment_1_1_1_1.add(41, comment);
        comment_1_1_1_1.add(43, new Str(42, "*/", NOT));
        comment_1_1_1.add(44, comment_1_1_1_1);
        comment_1_1.add(45, comment_1_1_1);
        comment_1.add(46, comment_1_1);
        comment_1.add(48, new Str(47, "*/"));
        comment.add(49, comment_1);
        ElementList comment_2 = new ElementList(50, "comment_2");
        comment_2.add(52, new Str(51, "//"));
        Optional comment_2_1 = new Optional(53, "comment_2_1");
        Repeat comment_2_1_1 = new Repeat(54, "comment_2_1_1");
        comment_2_1_1.add(55, newline, NOT);
        comment_2_1.add(56, comment_2_1_1);
        comment_2.add(57, comment_2_1);
        OrList comment_2_2 = new OrList(58, "comment_2_2");
        comment_2_2.add(59, newline);
        comment_2_2.add(61, new End(60, "comment_2_2"));
        comment_2.add(62, comment_2_2);
        comment.add(63, comment_2);

        // ws = (newline | " " | "\t" | comment)+
        OrList ws_1 = new OrList(64, "ws_1");
        ws_1.add(65, newline);
        ws_1.add(67, new Str(66, " "));
        ws_1.add(69, new Str(68, "\t"));
        ws_1.add(70, comment);
        ws.add(71, ws_1);

        // s = [ws]
        s.add(72, ws);

        // ff = "\""

        // str = ff (("\\\"" | !(ff|newline))+):strval ff
        str.add(73, ff);
        Repeat str_1 = new Repeat(74, "str_1");
        OrList str_1_1 = new OrList(75, "str_1_1");
        str_1_1.add(77, new Str(76, "\\\""));
        OrList str_1_1_1 = new OrList(78, "str_1_1_1", NOT);
        str_1_1_1.add(79, ff);
        str_1_1_1.add(80, newline);
        str_1_1.add(81, str_1_1_1);
        str_1.add(82, str_1_1);
        str.add(83, str_1);
        str.add(84, ff);

        // letter = "a".."z" | "A".."Z" | "_" | "$"
        letter.add(86, new Range(85, "letter", "a", "z"));
        letter.add(88, new Range(87, "letter", "A", "Z"));
        letter.add(90, new Str(89, "_"));
        letter.add(92, new Str(91, "$"));

        // digit = "0".."9"

        // name = letter [letter | digit]+
        name.add(93, letter);
        Optional name_1 = new Optional(94, "name_1");
        Repeat name_1_1 = new Repeat(95, "name_1_1");
        OrList name_1_1_1 = new OrList(96, "name_1_1_1");
        name_1_1_1.add(97, letter);
        name_1_1_1.add(98, digit);
        name_1_1.add(99, name_1_1_1);
        name_1.add(100, name_1_1);
        name.add(101, name_1);

        // public = ["public" ws]
        _public.add(103, new Str(102, "public"));
        _public.add(104, ws);

        // packagestatement = "package" ws packagename s ";"
        packagestatement.add(106, new Str(105, "package"));
        packagestatement.add(107, ws);
        packagestatement.add(108, packagename);
        packagestatement.add(109, s);
        packagestatement.add(111, new Str(110, ";"));

        // packagename = name ["." name]+
        packagename.add(112, name);
        Optional packagename_1 = new Optional(113, "packagename_1");
        Repeat packagename_1_1 = new Repeat(114, "packagename_1_1");
        packagename_1_1.add(116, new Str(115, "."));
        packagename_1_1.add(117, name);
        packagename_1.add(118, packagename_1_1);
        packagename.add(119, packagename_1);

        // fullclassname = packagename
        fullclassname.add(120, packagename);

        // importstatement = "import" ws ["static":static ws] fullclassname s ";"
        importstatement.add(122, new Str(121, "import"));
        importstatement.add(123, ws);
        Optional importstatement_1 = new Optional(124, "importstatement_1");
        importstatement_1.add(126, new Str(125, "static"));
        importstatement_1.add(127, ws);
        importstatement.add(128, importstatement_1);
        importstatement.add(129, fullclassname);
        importstatement.add(130, s);
        importstatement.add(132, new Str(131, ";"));

        // imports = [s importstatement]+
        Repeat imports_1 = new Repeat(133, "imports_1");
        imports_1.add(134, s);
        imports_1.add(135, importstatement);
        imports.add(136, imports_1);

        // type = name [s "<" s type s ">"] [ s "," s type ]
        type.add(137, name);
        Optional type_1 = new Optional(138, "type_1");
        type_1.add(139, s);
        type_1.add(141, new Str(140, "<"));
        type_1.add(142, s);
        type_1.add(143, type);
        type_1.add(144, s);
        type_1.add(146, new Str(145, ">"));
        type.add(147, type_1);
        Optional type_2 = new Optional(148, "type_2");
        type_2.add(149, s);
        type_2.add(151, new Str(150, ","));
        type_2.add(152, s);
        type_2.add(153, type);
        type.add(154, type_2);

        // initialValue = "=" s !";"+:value
        initialValue.add(156, new Str(155, "="));
        initialValue.add(157, s);
        Repeat initialValue_1 = new Repeat(158, "initialValue_1");
        initialValue_1.add(160, new Str(159, ";", NOT));
        initialValue.add(161, initialValue_1);

        // attribute = type ws name:variable s [initialValue s] ";" attributeComment|s
        attribute.add(162, type);
        attribute.add(163, ws);
        attribute.add(164, name);
        attribute.add(165, s);
        Optional attribute_1 = new Optional(166, "attribute_1");
        attribute_1.add(167, initialValue);
        attribute_1.add(168, s);
        attribute.add(169, attribute_1);
        attribute.add(171, new Str(170, ";"));
        OrList attribute_2 = new OrList(172, "attribute_2");
        attribute_2.add(173, attributeComment);
        attribute_2.add(174, s);
        attribute.add(175, attribute_2);

        // attributeComment = ([" " | "\t"]+ "//" [!newline+]):comment newline|END
        ElementList attributeComment_1 = new ElementList(176, "attributeComment_1");
        Optional attributeComment_1_1 = new Optional(177, "attributeComment_1_1");
        Repeat attributeComment_1_1_1 = new Repeat(178, "attributeComment_1_1_1");
        OrList attributeComment_1_1_1_1 = new OrList(179, "attributeComment_1_1_1_1");
        attributeComment_1_1_1_1.add(181, new Str(180, " "));
        attributeComment_1_1_1_1.add(183, new Str(182, "\t"));
        attributeComment_1_1_1.add(184, attributeComment_1_1_1_1);
        attributeComment_1_1.add(185, attributeComment_1_1_1);
        attributeComment_1.add(186, attributeComment_1_1);
        attributeComment_1.add(188, new Str(187, "//"));
        Optional attributeComment_1_2 = new Optional(189, "attributeComment_1_2");
        Repeat attributeComment_1_2_1 = new Repeat(190, "attributeComment_1_2_1");
        attributeComment_1_2_1.add(191, newline, NOT);
        attributeComment_1_2.add(192, attributeComment_1_2_1);
        attributeComment_1.add(193, attributeComment_1_2);
        attributeComment.add(194, attributeComment_1);
        OrList attributeComment_2 = new OrList(195, "attributeComment_2");
        attributeComment_2.add(196, newline);
        attributeComment_2.add(198, new End(197, "attributeComment_2"));
        attributeComment.add(199, attributeComment_2);
View Full Code Here

Examples of net.sf.laja.parser.engine2.element.ElementList

    Data.DefaultSyntaxErrorRowContent defaultSyntaxErrorRowContent = data2.new DefaultSyntaxErrorRowContent("defaultSyntaxErrorRowContent");
    Data.DefaultSyntaxErrorDefaultSyntaxErrorLine defaultSyntaxErrorDefaultSyntaxErrorLine = data2.new DefaultSyntaxErrorDefaultSyntaxErrorLine("defaultSyntaxErrorDefaultSyntaxErrorLine");

    // *** Declarations and Statements ***
    OrList cr = new OrList(1, "cr");
    ElementList row = new ElementList(2, "row");
    ElementList defaultSyntaxError = new ElementList(3, "defaultSyntaxError");

    // cr = "\r\n" | "\n"
    cr.add(5, new Str(4, "\r\n"));
    cr.add(7, new Str(6, "\n"));

    // row = [!cr+]:content cr
    Optional row_1 = new Optional(8, "row_1", defaultSyntaxErrorRowContent);
    Repeat row_1_1 = new Repeat(9, "row_1_1");
    row_1_1.add(10, cr, NOT);
    row_1.add(11, row_1_1);
    row.add(12, row_1);
    row.add(13, cr);

    // defaultSyntaxError = [row+] [!END+]:line END
    Optional defaultSyntaxError_1 = new Optional(14, "defaultSyntaxError_1");
    Repeat defaultSyntaxError_1_1 = new Repeat(15, "defaultSyntaxError_1_1");
    defaultSyntaxError_1_1.add(16, row);
    defaultSyntaxError_1.add(17, defaultSyntaxError_1_1);
    defaultSyntaxError.add(18, defaultSyntaxError_1);
    Optional defaultSyntaxError_2 = new Optional(19, "defaultSyntaxError_2", defaultSyntaxErrorDefaultSyntaxErrorLine);
    Repeat defaultSyntaxError_2_1 = new Repeat(20, "defaultSyntaxError_2_1");
    defaultSyntaxError_2_1.add(22, new End(21, "defaultSyntaxError_2_1", NOT));
    defaultSyntaxError_2.add(23, defaultSyntaxError_2_1);
    defaultSyntaxError.add(24, defaultSyntaxError_2);
    defaultSyntaxError.add(26, new End(25, "defaultSyntaxError"));


    return new TopElement(data2, defaultSyntaxError);
  }
View Full Code Here

Examples of net.sf.laja.parser.engine2.element.ElementList

  private net.sf.laja.parser.engine2.element.Element getGrammar1() {
    // *** Output classes ***

    // *** Declarations and Statements ***
    OrList cr = new OrList(1, "cr");
    ElementList row = new ElementList(2, "row");
    ElementList defaultSyntaxError = new ElementList(3, "defaultSyntaxError");

    // cr = "\r\n" | "\n"
    cr.add(5, new Str(4, "\r\n"));
    cr.add(7, new Str(6, "\n"));

    // row = [!cr+]:content cr
    Optional row_1 = new Optional(8, "row_1");
    Repeat row_1_1 = new Repeat(9, "row_1_1");
    row_1_1.add(10, cr, NOT);
    row_1.add(11, row_1_1);
    row.add(12, row_1);
    row.add(13, cr);

    // defaultSyntaxError = [row+] [!END+]:line END
    Optional defaultSyntaxError_1 = new Optional(14, "defaultSyntaxError_1");
    Repeat defaultSyntaxError_1_1 = new Repeat(15, "defaultSyntaxError_1_1");
    defaultSyntaxError_1_1.add(16, row);
    defaultSyntaxError_1.add(17, defaultSyntaxError_1_1);
    defaultSyntaxError.add(18, defaultSyntaxError_1);
    Optional defaultSyntaxError_2 = new Optional(19, "defaultSyntaxError_2");
    Repeat defaultSyntaxError_2_1 = new Repeat(20, "defaultSyntaxError_2_1");
    defaultSyntaxError_2_1.add(22, new End(21, "defaultSyntaxError_2_1", NOT));
    defaultSyntaxError_2.add(23, defaultSyntaxError_2_1);
    defaultSyntaxError.add(24, defaultSyntaxError_2);
    defaultSyntaxError.add(26, new End(25, "defaultSyntaxError"));


    return new TopElement(data1, defaultSyntaxError);
  }
View Full Code Here

Examples of org.itsnat.core.domutil.ElementList

        ItsNatDocument itsNatDoc = request.getItsNatDocument();
        Document doc = itsNatDoc.getDocument();

        Element cdListElem = ItsNatTreeWalker.getLastChildElement(doc.getDocumentElement());
        ElementGroupManager factory = itsNatDoc.getElementGroupManager();
        ElementList discList = factory.createElementList(cdListElem,true);

        addCD("Help","The Beatles",new String[] {"A Hard Day's Night","Let It Be"},discList);
        addCD("Making Movies","Dire Straits",new String[] {"Tunnel Of Love","Romeo & Juliet"},discList);
    }
View Full Code Here

Examples of org.itsnat.core.domutil.ElementList

        ItsNatDOMUtil.setTextContent(artistElem,artist);
        Element songsElem = ItsNatTreeWalker.getNextSiblingElement(artistElem);

        ItsNatDocument itsNatDoc = discList.getItsNatDocument();
        ElementGroupManager factory = itsNatDoc.getElementGroupManager();
        ElementList songList = factory.createElementList(songsElem,true);
        for(int i = 0; i < songs.length; i++)
        {
            songList.addElement(songs[i]);
        }
    }
View Full Code Here

Examples of org.itsnat.core.domutil.ElementList

        ItsNatDocFragmentTemplate fragTemplate = servlet.getItsNatDocFragmentTemplate("manual.core.xmlFragExample");
        DocumentFragment docFrag = fragTemplate.loadDocumentFragment(itsNatDoc);
        discsElem.insertBefore(docFrag,cdListElem); // docFrag is empty now

        ElementGroupManager factory = itsNatDoc.getElementGroupManager();
        ElementList discList = factory.createElementList(cdListElem,true);

        addCD("Help","The Beatles",new String[] {"A Hard Day's Night","Let It Be"},discList);
        addCD("Making Movies","Dire Straits",new String[] {"Tunnel Of Love","Romeo & Juliet"},discList);
    }
View Full Code Here

Examples of org.itsnat.core.domutil.ElementList

        ItsNatDOMUtil.setTextContent(artistElem,artist);
        Element songsElem = ItsNatTreeWalker.getNextSiblingElement(artistElem);

        ItsNatDocument itsNatDoc = discList.getItsNatDocument();
        ElementGroupManager factory = itsNatDoc.getElementGroupManager();
        ElementList songList = factory.createElementList(songsElem,true);
        for(int i = 0; i < songs.length; i++)
            songList.addElement(songs[i]);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.