MCPcopy Create free account
hub / github.com/IBM/Project_CodeNet / precompile

Function precompile

tools/tokenizer/antlr4tojson.c:143–156  ·  view source on GitHub ↗

Pre-compile the token_RE regular expression.

Source from the content-addressed store, hash-verified

141
142// Pre-compile the token_RE regular expression.
143static regex_t *precompile(void)
144{
145 regex_t *re = malloc(sizeof(regex_t));
146 int errcode = regcomp(re, token_RE, REG_EXTENDED|REG_NEWLINE);
147 if (errcode) { // Really should never happen...
148 char buf[BUFSIZ];
149 regerror(errcode, re, buf, sizeof(buf));
150 fprintf(stderr, "(F) Pattern for token_RE does not compile.\n");
151 regfree(re);
152 free(re);
153 exit(1);
154 }
155 return re;
156}
157
158static regex_t *compiled_token_RE;
159

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected