Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
P parabix-devel
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 9
    • Issues 9
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • cameron
  • parabix-devel
  • Wiki
  • Bracket Matching

Bracket Matching · Changes

Page history
Update Bracket Matching authored Mar 08, 2022 by lperesde's avatar lperesde
Show whitespace changes
Inline Side-by-side
Showing with 21 additions and 4 deletions
+21 -4
  • Bracket-Matching.md Bracket-Matching.md +21 -4
  • No files found.
Bracket-Matching.md
View page @ a4b9a5f4
...@@ -59,17 +59,34 @@ ND BixNum[0] .................... ...@@ -59,17 +59,34 @@ 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)
zeroND = bnc.EQ(ND, 0);
begin = ~Advance(<1>, 1) begin = ~Advance(<1>, 1)
firstValue = ScanTo(begin, valueToken) valueAtZero = valueToken & zeroND
nonNestingValue = ScanTo(Advance(firstValue, 1), valueToken) stopAtEOF = ~EOFbit
errSimpleValue = nonNestingValue & ~otherND
// If we have simple value at depth 0, we cannot have any other token
firstValue = ScanTo(begin, valueAtZero)
nonNestedValue = ScanTo(Advance(firstValue, 1), anyToken)
errValue = ScanThru(Advance(nonNestedValue, 1), stopAtEOF)
// If we have any symbol, we cannot have any value at depth 0
firstSymbol = ScanTo(begin, symbols)
valueAtZeroAfterSymbol = ScanTo(Advance(firstSymbol, 1), valueAtZero)
errSymbol = ScanThru(Advance(valueAtZeroAfterSymbol, 1), stopAtEOF)
// EOFbit is always at depth 0, otherwise we have unmatched parens
errEOF = EOFbit & otherND
// combine all possible errors at depth zero
errSimpleValue = errValue | errSymbol | errEOF
``` ```
......
Clone repository
  • Bracket Matching
  • CSV Validation
  • CSVediting
  • CSVparsing
  • Character Code Compilers
  • KernelLibrary
  • Pablo
  • ParabixTransform
  • Parallel Deletion
  • Parallel Hashing
  • Performance Testing Script
  • Shuffle Pattern Library
  • StaticCCC
  • String Insertion
  • UCD: Unicode Property Database and Compilers
View All Pages