diff options
author | rizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-04-27 17:00:09 +0000 |
---|---|---|
committer | rizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-04-27 17:00:09 +0000 |
commit | c57318b3f1afa2e1c19d20d504b16b2772f0eac2 (patch) | |
tree | 560006c04a1bf6c548b00aa19b61ab50263f4bfd /pbx/ael/ael.flex | |
parent | 4c3d554f4f6cab8bf130bcf610bfd117ce8a5f89 (diff) |
add some comments to the code
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@22869 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx/ael/ael.flex')
-rw-r--r-- | pbx/ael/ael.flex | 15 |
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; } |