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
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
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 490 |
Nodes: | 16 (1 / 15) |
Uptime: | 70:30:10 |
Calls: | 9,678 |
Calls today: | 2 |
Files: | 13,722 |
Messages: | 6,172,128 |