#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <malloc.h>
#include <stdarg.h>
#include "toyparse.h"
#include "toyparse_internal.h"
Include dependency graph for toyparse.c:
Go to the source code of this file.
Functions | |
int | CheckLineSyntax (TokenType *tarray,...) |
Define PRINT_COMMENTS to print comments at runtime. Used for debugging. A generalized function to check the syntax of an array of token types. | |
TokenType * | LineToTypes (const char *str, const char **table[]) |
Converts a line of text to an array of token-types. | |
void | FreeType (TokenType *types) |
Frees an array of token-types and everything it contains. | |
TokenType * | TokensToType (const char **tokens, const char **table[]) |
Converts a list of string-tokens to an array of types. | |
int | DetermineSubType (int type, const char *str, const char **args[]) |
Determines the sub-type from a known type. | |
int | FindInList (const char *str, const char *list[]) |
Finds specified string in a table of strings. | |
int | DetermineType (const char *str, const char **table[]) |
Determines the root type of a token. | |
int | CompareType (const char *str, const char *typestr) |
Compares a word with a syntax-string to see if it matches the specified syntax. | |
void * | AllocateArray (void *in, int size, int num) |
char ** | Explode (const char *strIn) |
Converts a string into a list of words - array of pointers to strings ending in NULL. | |
void | FreeStrList (char **strList) |
Frees a list of words. |
Definition in file toyparse.c.
|
Convenience function. Allocate a new array if 'in' is NULL, or resize an existing one. Definition at line 380 of file toyparse.c. Referenced by Explode(). |
|
Returns 0 on syntax match, -1 on failure. Definition at line 234 of file toyparse.c. Referenced by FindInList(). |
|
Returns a NULL-terminated array of string tokens on success, NULL on failure. Definition at line 305 of file toyparse.c. References AllocateArray(). Referenced by LineToTypes(). |
Here is the call graph for this function:
|
Returns the array index on match, -1 on failure. Definition at line 207 of file toyparse.c. References CompareType(). Referenced by DetermineSubType(), and DetermineType(). |
Here is the call graph for this function:
|
Returns no values. Definition at line 391 of file toyparse.c. |
|
Returns a tokentype array on success, NULL on failure. Definition at line 140 of file toyparse.c. References DetermineSubType(), DetermineType(), TokenType::subtype, TokenType::token, and TokenType::type. Referenced by LineToTypes(). |
Here is the call graph for this function: