... | @@ -49,29 +49,27 @@ _// string.json_ |
... | @@ -49,29 +49,27 @@ _// string.json_ |
|
|
|
|
|
Thus, when we apply NestingDepth kernel to this stream, we get the output:
|
|
Thus, when we apply NestingDepth kernel to this stream, we get the output:
|
|
```
|
|
```
|
|
Bracket Stream .....................
|
|
Bracket Stream ....................
|
|
Nesting Depth 000000000000000000000
|
|
Nesting Depth 00000000000000000000
|
|
ND BixNum[2] .....................
|
|
ND BixNum[2] ....................
|
|
ND BixNum[1] .....................
|
|
ND BixNum[1] ....................
|
|
ND BixNum[0] .....................
|
|
ND BixNum[0] ....................
|
|
```
|
|
```
|
|
|
|
|
|
Assume that `valueToken` is a bit stream that marks the end position of
|
|
Assume that `valueToken` is a bit stream that marks the end position of
|
|
any legal JSON numeral, string or keyword, then the example above would look like:
|
|
any legal JSON numeral, string or keyword, then the example above would look like:
|
|
```
|
|
```
|
|
valueToken ...................1.
|
|
valueToken ...................1
|
|
EOFbit ....................1
|
|
|
|
```
|
|
```
|
|
|
|
|
|
Then we can validate if we have valid non-nesting values by checking:
|
|
Then we can validate if we have valid non-nesting values by checking:
|
|
|
|
|
|
```
|
|
```
|
|
otherND = bnc.UGT(ND, 0)
|
|
otherND = bnc.UGT(ND, 0)
|
|
mix = otherND | valueToken // if only one bit is set, then we don't have other ND
|
|
|
|
begin = ~Advance(<1>, 1)
|
|
begin = ~Advance(<1>, 1)
|
|
firstValue = ScanTo(begin, mix)
|
|
firstValue = ScanTo(begin, valueToken)
|
|
nonNestingValue = AdvanceThenScanThru(firstValue, ws) & EOFbit
|
|
nonNestingValue = ScanTo(Advance(firstValue, 1), valueToken)
|
|
err = EOFBit ^ nonNestingValue
|
|
errSimpleValue = nonNestingValue & ~otherND
|
|
```
|
|
```
|
|
|
|
|
|
|
|
|
... | | ... | |