#include "system.h"
#include <rpmbuild.h>
#include <rpmlib.h>
#include "debug.h"
Go to the source code of this file.
Compounds | |
struct | _parseState |
Parser state. More... | |
struct | _value |
Encapsulation of a "value". More... | |
Parser tokens | |
#define | TOK_EOF 1 |
#define | TOK_INTEGER 2 |
#define | TOK_STRING 3 |
#define | TOK_IDENTIFIER 4 |
#define | TOK_ADD 5 |
#define | TOK_MINUS 6 |
#define | TOK_MULTIPLY 7 |
#define | TOK_DIVIDE 8 |
#define | TOK_OPEN_P 9 |
#define | TOK_CLOSE_P 10 |
#define | TOK_EQ 11 |
#define | TOK_NEQ 12 |
#define | TOK_LT 13 |
#define | TOK_LE 14 |
#define | TOK_GT 15 |
#define | TOK_GE 16 |
#define | TOK_NOT 17 |
#define | TOK_LOGICAL_AND 18 |
#define | TOK_LOGICAL_OR 19 |
Defines | |
#define | DEBUG(x) |
#define | valueIsInteger(v) ((v)->type == VALUE_TYPE_INTEGER) |
#define | valueIsString(v) ((v)->type == VALUE_TYPE_STRING) |
#define | valueSameType(v1, v2) ((v1)->type == (v2)->type) |
#define | EXPRBUFSIZ BUFSIZ |
Typedefs | |
typedef struct _value * | Value |
Encapsulation of a "value". | |
typedef struct _parseState * | ParseState |
Parser state. | |
Functions | |
Value | valueMakeInteger (int i) |
Value | valueMakeString (const char *s) |
void | valueFree (Value v) |
int | rdToken (ParseState state) |
Value | doLogical (ParseState state) |
Value | doPrimary (ParseState state) |
Value | doMultiplyDivide (ParseState state) |
Value | doAddSubtract (ParseState state) |
Value | doRelational (ParseState state) |
int | parseExpressionBoolean (Spec spec, const char *expr) |
char* | parseExpressionString (Spec spec, const char *expr) |
This module implements a basic expression parser with support for integer and string datatypes. For ease of programming, we use the top-down "recursive descent" method of parsing. While a table-driven bottom-up parser might be faster, it does not really matter for the expressions we will be parsing.
Copyright (C) 1998 Tom Dyas <tdyas@eden.rutgers.edu> This work is provided under the GPL or LGPL at your choice.
Definition in file expression.c.
|
Value: Definition at line 27 of file expression.c. Referenced by doAddSubtract(), doLogical(), doMultiplyDivide(), doPrimary(), doRelational(), parseExpressionBoolean(), parseExpressionString(), and rdToken(). |
|
Definition at line 132 of file expression.c. |
|
Definition at line 115 of file expression.c. |
|
Definition at line 120 of file expression.c. |
|
Definition at line 118 of file expression.c. |
|
Definition at line 111 of file expression.c. |
|
Definition at line 121 of file expression.c. |
|
Definition at line 126 of file expression.c. |
|
Definition at line 125 of file expression.c. |
|
Definition at line 114 of file expression.c. |
|
Definition at line 112 of file expression.c. |
|
Definition at line 124 of file expression.c. |
|
Definition at line 128 of file expression.c. |
|
Definition at line 129 of file expression.c. |
|
Definition at line 123 of file expression.c. |
|
Definition at line 116 of file expression.c. |
|
Definition at line 117 of file expression.c. |
|
Definition at line 122 of file expression.c. |
|
Definition at line 127 of file expression.c. |
|
Definition at line 119 of file expression.c. |
|
Definition at line 113 of file expression.c. |
|
Definition at line 90 of file expression.c. Referenced by doAddSubtract(), doLogical(), doMultiplyDivide(), doPrimary(), and doRelational(). |
|
Definition at line 91 of file expression.c. |
|
Definition at line 92 of file expression.c. Referenced by doAddSubtract(), doLogical(), doMultiplyDivide(), and doRelational(). |
|
Parser state.
|
|
Encapsulation of a "value".
|
|
Definition at line 439 of file expression.c. Referenced by doRelational(). |
|
Definition at line 588 of file expression.c. Referenced by doPrimary(), parseExpressionBoolean(), and parseExpressionString(). |
|
Definition at line 390 of file expression.c. Referenced by doAddSubtract(). |
|
Definition at line 314 of file expression.c. Referenced by doMultiplyDivide(). |
|
Definition at line 497 of file expression.c. Referenced by doLogical(). |
|
Definition at line 178 of file expression.c. Referenced by doAddSubtract(), doLogical(), doMultiplyDivide(), doPrimary(), doRelational(), parseExpressionBoolean(), and parseExpressionString(). |
|
Definition at line 67 of file expression.c. Referenced by doAddSubtract(), doLogical(), doMultiplyDivide(), doRelational(), parseExpressionBoolean(), and parseExpressionString(). |
|
Definition at line 43 of file expression.c. Referenced by doAddSubtract(), doLogical(), doMultiplyDivide(), doPrimary(), doRelational(), and rdToken(). |
|
Definition at line 55 of file expression.c. Referenced by doAddSubtract(), doPrimary(), and rdToken(). |