slight reorganization

This commit is contained in:
Josh Holtrop 2010-04-07 21:03:31 -04:00
parent 1907029d56
commit f4249274bd

View File

@ -32,7 +32,16 @@ bool parse_input(char * buff, int size)
"\\s*$"}, /* possible trailing ws */ "\\s*$"}, /* possible trailing ws */
{&rule, "^\\s*(\\S+)\\s*:=(.*)$"} {&rule, "^\\s*(\\S+)\\s*:=(.*)$"}
}; };
const int ovec_size = 30;
int ovector[ovec_size];
int lineno = 1;
char * newline;
char * input = buff;
string sn;
map<string, Section> sections;
sections["none"] = none;
sections["tokens"] = tokens;
sections["rules"] = rules;
Section section = none; Section section = none;
for (int i = 0; i < sizeof(exprs)/sizeof(exprs[0]); i++) for (int i = 0; i < sizeof(exprs)/sizeof(exprs[0]); i++)
@ -48,16 +57,6 @@ bool parse_input(char * buff, int size)
} }
} }
const int ovec_size = 30;
int ovector[ovec_size];
int lineno = 1;
char * newline;
char * input = buff;
string sn;
map<string, Section> sections;
sections["none"] = none;
sections["tokens"] = tokens;
sections["rules"] = rules;
while ((newline = strstr(input, "\n")) != NULL) while ((newline = strstr(input, "\n")) != NULL)
{ {
int line_length = newline - input; int line_length = newline - input;