summaryrefslogtreecommitdiff
path: root/src/nfa.c
diff options
context:
space:
mode:
authorManoj Srivastava <srivasta@debian.org>2016-07-28 16:27:42 -0700
committerManoj Srivastava <srivasta@debian.org>2016-07-28 16:27:42 -0700
commit6228bc837a1bfd806c6b6f92fea9f6a42f099e7e (patch)
tree8bd744e2835403d769bd59e69ffb98dd3698e890 /src/nfa.c
parent86ca4f322bbec8f52a76c1bf2a879bf464d9bb65 (diff)
parent609af5775f7277679dc3bd966b36f04cf7ccf2a8 (diff)
merge tag v2.6.1
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
Diffstat (limited to 'src/nfa.c')
-rw-r--r--src/nfa.c56
1 files changed, 20 insertions, 36 deletions
diff --git a/src/nfa.c b/src/nfa.c
index ee06578..816c356 100644
--- a/src/nfa.c
+++ b/src/nfa.c
@@ -36,8 +36,8 @@
/* declare functions that have forward references */
-int dupmachine PROTO ((int));
-void mkxtion PROTO ((int, int));
+int dupmachine(int);
+void mkxtion(int, int);
/* add_accept - add an accepting state to a machine
@@ -45,8 +45,7 @@ void mkxtion PROTO ((int, int));
* accepting_number becomes mach's accepting number.
*/
-void add_accept (mach, accepting_number)
- int mach, accepting_number;
+void add_accept (int mach, int accepting_number)
{
/* Hang the accepting number off an epsilon state. if it is associated
* with a state that has a non-epsilon out-transition, then the state
@@ -77,8 +76,7 @@ void add_accept (mach, accepting_number)
* num - the number of copies of singl to be present in newsng
*/
-int copysingl (singl, num)
- int singl, num;
+int copysingl (int singl, int num)
{
int copy, i;
@@ -93,9 +91,7 @@ int copysingl (singl, num)
/* dumpnfa - debugging routine to write out an nfa */
-void dumpnfa (state1)
- int state1;
-
+void dumpnfa (int state1)
{
int sym, tsp1, tsp2, anum, ns;
@@ -148,8 +144,7 @@ void dumpnfa (state1)
* states accessible by the arrays firstst and lastst
*/
-int dupmachine (mach)
- int mach;
+int dupmachine (int mach)
{
int i, init, state_offset;
int state = 0;
@@ -196,9 +191,8 @@ int dupmachine (mach)
* context has variable length.
*/
-void finish_rule (mach, variable_trail_rule, headcnt, trailcnt,
- pcont_act)
- int mach, variable_trail_rule, headcnt, trailcnt, pcont_act;
+void finish_rule (int mach, int variable_trail_rule, int headcnt, int trailcnt,
+ int pcont_act)
{
char action_text[MAXLINE];
@@ -292,7 +286,7 @@ void finish_rule (mach, variable_trail_rule, headcnt, trailcnt,
if (!continued_action)
add_action ("YY_RULE_SETUP\n");
- line_directive_out ((FILE *) 0, 1);
+ line_directive_out(NULL, 1);
}
@@ -312,8 +306,7 @@ void finish_rule (mach, variable_trail_rule, headcnt, trailcnt,
* FIRST is set to new by the operation. last is unmolested.
*/
-int link_machines (first, last)
- int first, last;
+int link_machines (int first, int last)
{
if (first == NIL)
return last;
@@ -339,8 +332,7 @@ int link_machines (first, last)
* The "beginning" states are the epsilon closure of the first state
*/
-void mark_beginning_as_normal (mach)
- int mach;
+void mark_beginning_as_normal (int mach)
{
switch (state_type[mach]) {
case STATE_NORMAL:
@@ -381,8 +373,7 @@ void mark_beginning_as_normal (mach)
* more mkbranch's. Compare with mkor()
*/
-int mkbranch (first, second)
- int first, second;
+int mkbranch (int first, int second)
{
int eps;
@@ -409,8 +400,7 @@ int mkbranch (first, second)
* new - a new state which matches the closure of "state"
*/
-int mkclos (state)
- int state;
+int mkclos (int state)
{
return mkopt (mkposcl (state));
}
@@ -430,8 +420,7 @@ int mkclos (state)
* 2. mach is destroyed by the call
*/
-int mkopt (mach)
- int mach;
+int mkopt (int mach)
{
int eps;
@@ -467,8 +456,7 @@ int mkopt (mach)
* the number of epsilon states needed
*/
-int mkor (first, second)
- int first, second;
+int mkor (int first, int second)
{
int eps, orend;
@@ -523,8 +511,7 @@ int mkor (first, second)
* new - a machine matching the positive closure of "state"
*/
-int mkposcl (state)
- int state;
+int mkposcl (int state)
{
int eps;
@@ -553,8 +540,7 @@ int mkposcl (state)
* if "ub" is INFINITE_REPEAT then "new" matches "lb" or more occurrences of "mach"
*/
-int mkrep (mach, lb, ub)
- int mach, lb, ub;
+int mkrep (int mach, int lb, int ub)
{
int base_mach, tail, copy, i;
@@ -600,8 +586,7 @@ int mkrep (mach, lb, ub)
* that it admittedly is)
*/
-int mkstate (sym)
- int sym;
+int mkstate (int sym)
{
if (++lastnfa >= current_mns) {
if ((current_mns += MNS_INCREMENT) >= maximum_mns)
@@ -677,8 +662,7 @@ current_mns);
* stateto - the state to which the transition is to be made
*/
-void mkxtion (statefrom, stateto)
- int statefrom, stateto;
+void mkxtion (int statefrom, int stateto)
{
if (trans1[statefrom] == NO_TRANSITION)
trans1[statefrom] = stateto;
@@ -695,7 +679,7 @@ void mkxtion (statefrom, stateto)
/* new_rule - initialize for a new rule */
-void new_rule ()
+void new_rule (void)
{
if (++num_rules >= current_max_rules) {
++num_reallocs;