#include <glib.h>
Go to the source code of this file.
Data Structures | |
struct | LUAU_parsedLine |
A line of input sorted into its identifier and its arguments. More... | |
Functions | |
LUAU_parsedLine * | lutil_parse_parseLine (char *input) |
Parse a line of input. | |
char | lutil_parse_parseSymbol (const char *input, const GPtrArray *symbols) |
Compare a keyword to a list of valid symbols. | |
char | lutil_parse_parseSymbolArray (const char *input, const char *symbols[]) |
Compare a keyword to a list of valid symbols. | |
void | lutil_parse_freeParsedLine (LUAU_parsedLine *line) |
Free a LUAU_parsedLine pointer. | |
char * | lutil_parse_nextToken (char *input) |
Find the next token in a given line of input. | |
char * | lutil_parse_nextToken_r (char *input, char **ptrptr) |
char * | lutil_parse_deleteWhitespace (char *string) |
Skip leading whitespace and delete trailing whitespace. | |
char * | lutil_parse_skipString (char *input, char *string) |
Skip a string in the given line of input. |
These are used by lutil_parseUpdateFile in parsing downloaded update files, and also by the command-line utility luau
in parsing user input during interactive mode.
Definition in file parse.h.
|
Skip leading whitespace and delete trailing whitespace. Note that this "skips" leading whitespace by just returning a pointer to where the actual text in the string begins - nothing is actually deleted. Trailing whitespace is "deleted" by overwriting it with the null character ('\0').
Definition at line 238 of file parse.c. Referenced by parseGenericInfo(), parsePackage(), and parseSoftware(). |
|
Free a LUAU_parsedLine pointer. Free the memory allocated for a LUAU_parsedLine. Note that this function also frees the structure pointer itself.
Definition at line 126 of file parse.c. References LUAU_parsedLine::args, and LUAU_parsedLine::keyword. |
|
Find the next token in a given line of input. Tokens are separated by whitespace. Tokens can have whitespace in them through the use of escaping (this\ is\ one\ token) or quoting ("this is one token"). Multi-line quotes or even multi-line input is not allowed. To use: Call lutil_parse_nextToken once with the line of input to parse to get the first token.. Then call repeatedly with a NULL argument to retrieve any additional arguments. Returns null when end of line is reached.
Definition at line 154 of file parse.c. References lutil_parse_nextToken_r(). |
|
Definition at line 161 of file parse.c. References ERROR. Referenced by lutil_parse_nextToken(), and lutil_parse_parseLine(). |
|
Parse a line of input.
lutil_parse_parseLine is really a front-end for using lutil_parse_nextToken, which is calls and places the output into a nicely structured LUAU_parsedLine.
Definition at line 46 of file parse.c. References LUAU_parsedLine::args, LUAU_parsedLine::keyword, and lutil_parse_nextToken_r(). |
|
Compare a keyword to a list of valid symbols.
Take a symbol and translate it into its corresponding character as defined by the symbols[0] => "symbol1" symbols[1] => 'a' symbols[2] => "symbol2" symbols[3] => 'b' ...
Definition at line 76 of file parse.c. References lutil_streq(). |
|
Compare a keyword to a list of valid symbols. Like lutil_parse_parseSymbol but using a two dimensional array instead of a GPtrArray
Definition at line 103 of file parse.c. References lutil_streq(). Referenced by parseGenericInfo(), parseLibupdate(), and parseSoftware(). |
|
Skip a string in the given line of input.
Simply returns a pointer that skips the first
|