- * ccl_token_simple: tokenize CCL raw tokens
- */
-struct ccl_token *ccl_token_simple (const char *command)
-{
- const char *cp = command;
- struct ccl_token *first = NULL;
- struct ccl_token *last = NULL;
-
- while (1)
- {
- while (*cp && strchr (" \t\r\n", *cp))
- {
- cp++;
- continue;
- }
- if (!first)
- {
- first = last = (struct ccl_token *)xmalloc (sizeof (*first));
- ccl_assert (first);
- last->prev = NULL;
- }
- else
- {
- last->next = (struct ccl_token *)xmalloc (sizeof(*first));
- ccl_assert (last->next);
- last->next->prev = last;
- last = last->next;
- }
- last->next = NULL;
- last->name = cp;
- last->len = 1;
- switch (*cp++)
- {
- case '\0':
- last->kind = CCL_TOK_EOL;
- return first;
- case '\"':
- last->kind = CCL_TOK_TERM;
- last->name = cp;
- last->len = 0;
- while (*cp && *cp != '\"')
- {
- cp++;
- ++ last->len;
- }
- if (*cp == '\"')
- cp++;
- break;
- default:
- while (*cp && !strchr (" \t\n\r", *cp))
- {
- cp++;
- ++ last->len;
- }
- last->kind = CCL_TOK_TERM;
- }
- }
- return first;
-}
-
-
-/*