summaryrefslogtreecommitdiff
path: root/pbx/ael/ael.flex
diff options
context:
space:
mode:
authorLuigi Rizzo <rizzo@icir.org>2006-04-27 17:00:09 +0000
committerLuigi Rizzo <rizzo@icir.org>2006-04-27 17:00:09 +0000
commite51725d6d4bb9f980bdce9510488b3eab5612843 (patch)
tree560006c04a1bf6c548b00aa19b61ab50263f4bfd /pbx/ael/ael.flex
parent7422c5495bc33f0e7c4f3b0afc2392bbc9d86a0f (diff)
add some comments to the code
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@22869 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'pbx/ael/ael.flex')
-rw-r--r--pbx/ael/ael.flex15
1 files changed, 10 insertions, 5 deletions
diff --git a/pbx/ael/ael.flex b/pbx/ael/ael.flex
index e56b1b738..faead9bb2 100644
--- a/pbx/ael/ael.flex
+++ b/pbx/ael/ael.flex
@@ -34,8 +34,8 @@ static int pbcpos = 0;
static int parencount = 0;
static int commaout = 0;
-static int my_lineno = 1;
-static int my_col = 0;
+static int my_lineno = 1; /* current line in the source */
+static int my_col = 0; /* current column in the source */
char *my_file = 0; /* used also in the bison code */
char *prev_word;
#define MAX_INCLUDE_DEPTH 50
@@ -56,10 +56,17 @@ struct stackelement {
static struct stackelement include_stack[MAX_INCLUDE_DEPTH];
static int include_stack_index = 0;
+/*
+ * if we use the @n feature of bison, we must supply the start/end
+ * location of tokens in the structure pointed by yylloc.
+ * Simple tokens are just assumed to be on the same line, so
+ * the line number is constant, and the column is incremented
+ * by the length of the token.
+ */
#define STORE_POS do { \
yylloc->first_line = yylloc->last_line = my_lineno; \
- yylloc->last_column=my_col+yyleng-1; \
yylloc->first_column=my_col; \
+ yylloc->last_column=my_col+yyleng-1; \
my_col+=yyleng; \
} while (0)
%}
@@ -129,8 +136,6 @@ includes { STORE_POS; return KW_INCLUDES;}
[-a-zA-Z0-9'"_/.\<\>\*\+!$#\[\]][-a-zA-Z0-9'"_/.!\*\+\<\>\{\}$#\[\]]* {
STORE_POS;
yylval->str = strdup(yytext);
- /* printf("\nGot WORD %s[%d][%d:%d]\n",
- yylval->str, my_lineno ,yylloc->first_column,yylloc->last_column ); */
prev_word = yylval->str;
return word;
}