spaghetti_stack 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/spaghetti_stack.rb +1 -1
- data/lib/spaghetti_stack/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 494b92ee39864728a47a2a70513efa999801566d309fdff54465398c8c4703b0
|
4
|
+
data.tar.gz: 6dd8ab252a53367092c059030a968eec271fda0e682d77d275b677f0f88179af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d874a020559c073164b9d02560a050c85258aa476c38f18c864983eb9a31de36a2ea7821a20078ce80c2b7847e228c54526141c35994599bc7227ca4c978416
|
7
|
+
data.tar.gz: 1c79c6b8eef769161ef44cadfb595279f2e7dbda0acf4ad46b4dc66f134d5afe9031a7835dafe6584e338c62f45a5f1fad0c83f773282d8443ef8a0ae171cca8
|
data/README.md
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
# SpaghettiStack
|
2
2
|
|
3
3
|
This is a Ruby implementation of a [SpaghettiStack](https://en.wikipedia.org/wiki/Parent_pointer_tree)(also called *parent pointer tree* or *cactus stack*). A SpaghettiStack can be thought as a linked list where each element (call nodes) keeps a reference pointing to their parent (possibly null), but not to their children. This means that a node can only access to it's parent, but not it's children.
|
4
|
-
Another particularity of this kind of stack is that when nodes are popped, they're kept in-memory instead of being destroyed, thus preserving the link to their parent. That's why this data structure is used by compilers to create symbol tables for each lexical scopes, because it allows them to revisit previous scopes
|
4
|
+
Another particularity of this kind of stack is that when nodes are popped, they're kept in-memory instead of being destroyed, thus preserving the link to their parent. That's why this data structure is used by compilers to create symbol tables for each lexical scopes, because it allows them to revisit previous scopes to resolve references.
|
5
5
|
## Installation
|
6
6
|
|
7
7
|
Add this line to your application's Gemfile:
|
8
8
|
|
9
9
|
```ruby
|
10
|
-
gem 'spaghetti_stack'
|
10
|
+
gem 'spaghetti_stack', '~> 0.1.2'
|
11
11
|
```
|
12
12
|
|
13
13
|
And then execute:
|
data/lib/spaghetti_stack.rb
CHANGED