[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
style: comment and names changes in map_goto
From: |
Akim Demaille |
Subject: |
style: comment and names changes in map_goto |
Date: |
Tue, 12 Feb 2019 06:23:01 +0100 |
commit fb83319d9cdb592673f7c534e2690b2fd065cfaf
Author: Akim Demaille <address@hidden>
Date: Sun Feb 10 13:38:17 2019 +0100
style: comment and names changes in map_goto
* src/lalr.h, src/lalr.c: Use clearer names.
diff --git a/src/lalr.c b/src/lalr.c
index 03e807de..ff0e4d86 100644
--- a/src/lalr.c
+++ b/src/lalr.c
@@ -122,7 +122,7 @@ set_goto_map (void)
goto_number
-map_goto (state_number s0, symbol_number sym)
+map_goto (state_number src, symbol_number sym)
{
goto_number low = goto_map[sym - ntokens];
goto_number high = goto_map[sym - ntokens + 1] - 1;
@@ -132,9 +132,9 @@ map_goto (state_number s0, symbol_number sym)
aver (low <= high);
goto_number middle = (low + high) / 2;
state_number s = from_state[middle];
- if (s == s0)
+ if (s == src)
return middle;
- else if (s < s0)
+ else if (s < src)
low = middle + 1;
else
high = middle - 1;
diff --git a/src/lalr.h b/src/lalr.h
index c8ca6277..84a66f7c 100644
--- a/src/lalr.h
+++ b/src/lalr.h
@@ -96,8 +96,8 @@ extern state_number *from_state;
/** State number it leads to. */
extern state_number *to_state;
-/** Find the goto number of the goto from S on non-terminal SYM. */
-goto_number map_goto (state_number s, symbol_number sym);
+/** The number of the goto from state SRC labeled with nterm SYM. */
+goto_number map_goto (state_number src, symbol_number sym);
/* goto_follows[i] is the set of tokens following goto i. */
extern bitsetv goto_follows;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- style: comment and names changes in map_goto,
Akim Demaille <=