• Proof that the neos universal compiler parser correctly parses and emit

    From Mr Flibble@21:1/5 to All on Sat Feb 15 19:10:30 2025
    Hi!

    The CST includes all syntactical elements from the grammar along with
    any semantic tagging specified in the grammar which is then simplified
    to the AST that contains semantics only:

    Parse time: 0.001 seconds (168000 characters/second, 7000
    lines/second)
    1|
    2| xyzzY0 foo()
    3| {
    4| 1234; /* comment one */
    5| x := 1 + 2 + 3 - 4 - 5 + 6; // comment two
    6| y := 7 + -42.001 * 1.0 * (5-1+2) + -x + x * 2;
    7| }

    language.function.definition = [xyzzY0 foo()\n {\n 1234; /*
    comment one */\n x := ...]
    language.function.prototype = [xyzzY0 foo()]
    language.function.return.type = [xyzzY0]
    language.function.name = [foo]
    language.function.parameters = [()]
    language.function.body = [{\n 1234; /* comment one */\n x :=
    1 + 2 + 3 - 4 - 5...]
    number.integer = [1234]
    object.assign = [x := 1 + 2 + 3 - 4 - 5 + 6]
    object = [x]
    math.addition = [1 + 2 + 3 - 4 - 5 + 6]
    math.operator.add = [+]
    math.operator.subtract = [-]
    math.operator.subtract = [-]
    math.operator.add = [+]
    math.operator.add = [+]
    number.integer = [1]
    number.integer = [2]
    number.integer = [3]
    number.integer = [4]
    number.integer = [5]
    number.integer = [6]
    object.assign = [y := 7 + -42.001 * 1.0 * (5-1+2) + -x + x * 2]
    object = [y]
    math.addition = [7 + -42.001 * 1.0 * (5-1+2) + -x + x * 2]
    math.operator.add = [+]
    math.operator.add = [+]
    math.operator.add = [+]
    number.integer = [7]
    math.multiplication = [-42.001 * 1.0 * (5-1+2)]
    math.operator.multiply = [*]
    math.operator.multiply = [*]
    math.operator.negate = [-42.001]
    number.float = [-42.001]
    number.float = [1.0]
    math.addition = [5-1+2]
    math.operator.add = [+]
    math.operator.subtract = [-]
    number.integer = [5]
    number.integer = [1]
    number.integer = [2]
    math.operator.negate = [-x]
    object = [x]
    math.multiplication = [x * 2]
    math.operator.multiply = [*]
    object = [x]
    number.integer = [2]

    /Flibble

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mr Flibble@21:1/5 to All on Sun Feb 16 00:32:20 2025
    On Sat, 15 Feb 2025 19:10:30 +0000, Mr Flibble <leigh@i42.co.uk>
    wrote:

    Hi!

    The CST includes all syntactical elements from the grammar along with
    any semantic tagging specified in the grammar which is then simplified
    to the AST that contains semantics only:

    Parse time: 0.001 seconds (168000 characters/second, 7000
    lines/second)
    1|
    2| xyzzY0 foo()
    3| {
    4| 1234; /* comment one */
    5| x := 1 + 2 + 3 - 4 - 5 + 6; // comment two
    6| y := 7 + -42.001 * 1.0 * (5-1+2) + -x + x * 2;
    7| }

    language.function.definition = [xyzzY0 foo()\n {\n 1234; /*
    comment one */\n x := ...]
    language.function.prototype = [xyzzY0 foo()]
    language.function.return.type = [xyzzY0]
    language.function.name = [foo]
    language.function.parameters = [()]
    language.function.body = [{\n 1234; /* comment one */\n x :=
    1 + 2 + 3 - 4 - 5...]
    number.integer = [1234]
    object.assign = [x := 1 + 2 + 3 - 4 - 5 + 6]
    object = [x]
    math.addition = [1 + 2 + 3 - 4 - 5 + 6]
    math.operator.add = [+]
    math.operator.subtract = [-]
    math.operator.subtract = [-]
    math.operator.add = [+]
    math.operator.add = [+]
    number.integer = [1]
    number.integer = [2]
    number.integer = [3]
    number.integer = [4]
    number.integer = [5]
    number.integer = [6]
    object.assign = [y := 7 + -42.001 * 1.0 * (5-1+2) + -x + x * 2]
    object = [y]
    math.addition = [7 + -42.001 * 1.0 * (5-1+2) + -x + x * 2]
    math.operator.add = [+]
    math.operator.add = [+]
    math.operator.add = [+]
    number.integer = [7]
    math.multiplication = [-42.001 * 1.0 * (5-1+2)]
    math.operator.multiply = [*]
    math.operator.multiply = [*]
    math.operator.negate = [-42.001]
    number.float = [-42.001]
    number.float = [1.0]
    math.addition = [5-1+2]
    math.operator.add = [+]
    math.operator.subtract = [-]
    number.integer = [5]
    number.integer = [1]
    number.integer = [2]
    math.operator.negate = [-x]
    object = [x]
    math.multiplication = [x * 2]
    math.operator.multiply = [*]
    object = [x]
    number.integer = [2]

    /Flibble

    There was an error in the grammer; can you spot it? :)

    /Flibble

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mr Flibble@21:1/5 to All on Sun Feb 16 00:34:27 2025
    On Sun, 16 Feb 2025 00:32:20 +0000, Mr Flibble <leigh@i42.co.uk>
    wrote:

    On Sat, 15 Feb 2025 19:10:30 +0000, Mr Flibble <leigh@i42.co.uk>
    wrote:

    Hi!

    The CST includes all syntactical elements from the grammar along with
    any semantic tagging specified in the grammar which is then simplified
    to the AST that contains semantics only:

    Parse time: 0.001 seconds (168000 characters/second, 7000
    lines/second)
    1|
    2| xyzzY0 foo()
    3| {
    4| 1234; /* comment one */
    5| x := 1 + 2 + 3 - 4 - 5 + 6; // comment two
    6| y := 7 + -42.001 * 1.0 * (5-1+2) + -x + x * 2;
    7| }

    language.function.definition = [xyzzY0 foo()\n {\n 1234; /* >>comment one */\n x := ...]
    language.function.prototype = [xyzzY0 foo()]
    language.function.return.type = [xyzzY0]
    language.function.name = [foo]
    language.function.parameters = [()]
    language.function.body = [{\n 1234; /* comment one */\n x :=
    1 + 2 + 3 - 4 - 5...]
    number.integer = [1234]
    object.assign = [x := 1 + 2 + 3 - 4 - 5 + 6]
    object = [x]
    math.addition = [1 + 2 + 3 - 4 - 5 + 6]
    math.operator.add = [+]
    math.operator.subtract = [-]
    math.operator.subtract = [-]
    math.operator.add = [+]
    math.operator.add = [+]
    number.integer = [1]
    number.integer = [2]
    number.integer = [3]
    number.integer = [4]
    number.integer = [5]
    number.integer = [6]
    object.assign = [y := 7 + -42.001 * 1.0 * (5-1+2) + -x + x * 2]
    object = [y]
    math.addition = [7 + -42.001 * 1.0 * (5-1+2) + -x + x * 2]
    math.operator.add = [+]
    math.operator.add = [+]
    math.operator.add = [+]
    number.integer = [7]
    math.multiplication = [-42.001 * 1.0 * (5-1+2)]
    math.operator.multiply = [*]
    math.operator.multiply = [*]
    math.operator.negate = [-42.001]
    number.float = [-42.001]
    number.float = [1.0]
    math.addition = [5-1+2]
    math.operator.add = [+]
    math.operator.subtract = [-]
    number.integer = [5]
    number.integer = [1]
    number.integer = [2]
    math.operator.negate = [-x]
    object = [x]
    math.multiplication = [x * 2]
    math.operator.multiply = [*]
    object = [x]
    number.integer = [2]

    /Flibble

    There was an error in the grammer; can you spot it? :)

    /Flibble

    Grammar*

    /Flibble

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)