Rename lexer state "accepts" to "token"
This commit is contained in:
parent
4d716f6c10
commit
48704295bb
@ -118,7 +118,7 @@ class <%= @classname %>
|
||||
{
|
||||
uint transition_table_index;
|
||||
uint n_transitions;
|
||||
uint accepts;
|
||||
uint token;
|
||||
uint code_id;
|
||||
}
|
||||
|
||||
@ -133,7 +133,7 @@ class <%= @classname %>
|
||||
<% state_table.each do |state_table_entry| %>
|
||||
State(<%= state_table_entry[:transition_table_index] %>u,
|
||||
<%= state_table_entry[:n_transitions] %>u,
|
||||
<%= state_table_entry[:accepts] %>u,
|
||||
<%= state_table_entry[:token] %>u,
|
||||
<%= state_table_entry[:code_id] %>u),
|
||||
<% end %>
|
||||
];
|
||||
@ -236,9 +236,9 @@ class <%= @classname %>
|
||||
attempt_match_info.delta_col++;
|
||||
}
|
||||
current_state = dest;
|
||||
if (states[current_state].accepts != _TOKEN_NONE)
|
||||
if (states[current_state].token != _TOKEN_NONE)
|
||||
{
|
||||
attempt_match_info.token = states[current_state].accepts;
|
||||
attempt_match_info.token = states[current_state].token;
|
||||
attempt_match_info.code_id = states[current_state].code_id;
|
||||
longest_match_info = attempt_match_info;
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ class Propane
|
||||
state_table = []
|
||||
states = @dfa.enumerate
|
||||
states.each do |state, id|
|
||||
accepts =
|
||||
token =
|
||||
if state.accepts.nil?
|
||||
TOKEN_NONE
|
||||
elsif state.accepts.drop?
|
||||
@ -31,7 +31,7 @@ class Propane
|
||||
state_table << {
|
||||
transition_table_index: transition_table.size,
|
||||
n_transitions: state.transitions.size,
|
||||
accepts: accepts,
|
||||
token: token,
|
||||
code_id: code_id,
|
||||
}
|
||||
state.transitions.each do |transition|
|
||||
|
Loading…
x
Reference in New Issue
Block a user