Skip to content

Commit

Permalink
Add definition for Read sets and Follow sets
Browse files Browse the repository at this point in the history
  • Loading branch information
yui-knk committed Dec 30, 2024
1 parent ebdadac commit de00af2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/lrama/states.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ def initialize(grammar, trace_state: false)
# value is array of [state.id, nterm.token_id].
@reads_relation = {}

# `Read(p, A) =s DR(p, A) ∪ ∪{Read(r, C) | (p, A) reads (r, C)}`
#
# `@read_sets` is a hash whose
# key is [state.id, nterm.token_id],
# value is bitmap of term.
Expand All @@ -62,6 +64,8 @@ def initialize(grammar, trace_state: false)
# value is array of [state.id, nterm.token_id].
@lookback_relation = {}

# `Follow(p, A) =s Read(p, A) ∪ ∪{Follow(p', B) | (p, A) includes (p', B)}`
#
# `@follow_sets` is a hash whose
# key is [state.id, rule.id],
# value is bitmap of term.
Expand Down

0 comments on commit de00af2

Please sign in to comment.