diff --git a/apps/antelope/aql-parser.c b/apps/antelope/aql-parser.c index eecf31f8f..076ae2265 100644 --- a/apps/antelope/aql-parser.c +++ b/apps/antelope/aql-parser.c @@ -99,36 +99,15 @@ static const char *error_function; } \ } while(0) - -/* - * The grammar of this language is defined in Extended Backus-Naur Form, - * where capitalized strings correspond to lexical tokens defined in - * aql.h and interpreted in lexer.c. - * - * operand = LEFT_PAREN, expr, RIGHT_PAREN | INTEGER | FLOAT | - * IDENTIFIER | STRING ; - * operator = ADD | SUB | MUL | DIV ; - * expr = operand, operator, operand ; - * - * comparison-operator = GE | GEQ | LE | LEQ | EQ | NEQ ; - * comparison = expr, comparison-operator, expr ; - * condition = comparison, [(AND | OR), comparison] ; - * relation-list = IDENTIFIER, {COMMA, relation-list} ; - * attribute-list = IDENTIFIER, {COMMA, attribute-list} ; - * select = SELECT, attribute-list, FROM, relation-list, WHERE, condition, END ; - * - * value = INTEGER | FLOAT | STRING ; - * value-list = value, {COMMA, value} ; - * insert = INSERT, LEFT_PAREN, value-list, RIGHT_PAREN, INTO, IDENTIFIER, END ; - * - * sqrl = select | insert ; - */ - +/* The parsing of AQL results in this aql_adt_t object. */ static aql_adt_t *adt; +/* Conditional statements are compiled into VM bytecode, which is stored in + an instance of the LogicVM. */ static lvm_instance_t p; -static unsigned char vmcode[128]; +static unsigned char vmcode[DB_VM_BYTECODE_SIZE]; +/* Parsing functions for AQL. */ PARSER_TOKEN(cmp) { NEXT; diff --git a/apps/antelope/db-options.h b/apps/antelope/db-options.h index 7f4dce4cc..42d6bc3d7 100644 --- a/apps/antelope/db-options.h +++ b/apps/antelope/db-options.h @@ -87,6 +87,10 @@ #endif /* DB_MAX_ELEMENT_SIZE */ +#ifndef DB_VM_BYTECODE_SIZE +#define DB_VM_BYTECODE_SIZE 128 +#endif /* DB_VM_BYTECODE_SIZE */ + /* Language options. */ #ifndef AQL_MAX_QUERY_LENGTH #define AQL_MAX_QUERY_LENGTH 128