Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
R
rapidjson
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
rapidjson
Commits
03ecc2e4
Commit
03ecc2e4
authored
Jul 19, 2014
by
thebusytypist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add TOC and missing hash tags.
parent
d29e5f96
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
14 deletions
+16
-14
internals.md
doc/internals.md
+16
-14
No files found.
doc/internals.md
View file @
03ecc2e4
...
...
@@ -2,32 +2,34 @@
This section records some design and implementation details.
# Value
[
TOC
]
#
# Data Layout
#
Value {#Value}
##
Flags
##
Data Layout {#DataLayout}
#
Allocator
#
# Flags {#Flags}
#
# MemoryPoolAllocator
#
Allocator {#Allocator}
#
Parsing Optimization
#
# MemoryPoolAllocator {#MemoryPoolAllocator}
#
# Skip Whitespace with SIMD
#
Parsing Optimization {#ParsingOptimization}
##
Pow10()
##
Skip Whitespace with SIMD {#SkipwhitespaceWithSIMD}
##
Local Stream Copy
##
Pow10() {#Pow10}
#
Parser
#
# Local Stream Copy {#LocalStreamCopy}
## Iterative Parser
# Parser {#Parser}
## Iterative Parser {#IterativeParser}
The iterative parser is a recursive descent LL(1) parser
implemented in a non-recursive manner.
### Grammar
### Grammar
{#IterativeParserGrammar}
The grammar used for this parser is based on strict JSON syntax:
~~~
~~~~~~~
...
...
@@ -47,7 +49,7 @@ value -> STRING | NUMBER | NULL | BOOLEAN | object | array
Note that left factoring is applied to non-terminals
`values`
and
`members`
to make the grammar be LL(1).
### Parsing Table
### Parsing Table
{#IterativeParserParsingTable}
Based on the grammar, we can construct the FIRST and FOLLOW set.
...
...
@@ -101,7 +103,7 @@ Finally the parsing table can be constructed from FIRST and FOLLOW set:
There is a great
[
tool
](
http://hackingoff.com/compilers/predict-first-follow-set
)
for above grammar analysis.
### Implementation
### Implementation
{#IterativeParserImplementation}
Based on the parsing table, a direct(or conventional) implementation
that pushes the production body in reverse order
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment