| Line 41... |
Line 41... |
| 41 |
size_t utf8strlen(const char * _s);
|
41 |
size_t utf8strlen(const char * _s);
|
| 42 |
size_t yyuoffset, yyuleng;
|
42 |
size_t yyuoffset, yyuleng;
|
| 43 |
|
43 |
|
| 44 |
//keep track of the current utf-8 character (not byte) offset and token length
|
44 |
//keep track of the current utf-8 character (not byte) offset and token length
|
| 45 |
#define YY_USER_ACTION { yyuoffset += yyuleng; yyuleng = utf8strlen(yytext); }
|
45 |
#define YY_USER_ACTION { yyuoffset += yyuleng; yyuleng = utf8strlen(yytext); }
|
| - |
|
46 |
//ignore the output of unmatched characters
|
| - |
|
47 |
#define ECHO {}
|
| 46 |
%}
|
48 |
%}
|
| 47 |
%option noyywrap
|
49 |
%option noyywrap
|
| 48 |
%option nounput
|
50 |
%option nounput
|
| 49 |
%option case-sensitive
|
51 |
%option case-sensitive
|
| 50 |
|
52 |
|
| Line 75... |
Line 77... |
| 75 |
{keyword} { return RPT_RESERVED_WORD; } /* all R reserved keywords */
|
77 |
{keyword} { return RPT_RESERVED_WORD; } /* all R reserved keywords */
|
| 76 |
{functions}/{fun} { return RPT_RESERVED_WORD; } /* all R reserved functions */
|
78 |
{functions}/{fun} { return RPT_RESERVED_WORD; } /* all R reserved functions */
|
| 77 |
|
79 |
|
| 78 |
{variable}/{fun} { return RPT_OTHER; } /* non-reserved functions */
|
80 |
{variable}/{fun} { return RPT_OTHER; } /* non-reserved functions */
|
| 79 |
|
81 |
|
| - |
|
82 |
{variable}/{decl} { BEGIN(varequation); return RPT_VARIABLE; } /* R variables before operator */
|
| - |
|
83 |
<varequation>{decl} { BEGIN(INITIAL); return RPT_OTHER; }
|
| - |
|
84 |
|
| 80 |
{variable}/{ops} { BEGIN(varequation); return RPT_VARIABLE; } /* R variables before operator */
|
85 |
{variable}/{ops} { BEGIN(varequation); return RPT_VARIABLE; } /* R variables before operator */
|
| 81 |
<varequation>{ops} { BEGIN(INITIAL); return RPT_OTHER; }
|
86 |
<varequation>{ops} { BEGIN(INITIAL); return RPT_OTHER; }
|
| 82 |
{variable} { return RPT_VARIABLE; } /* R variables */
|
87 |
{variable} { return RPT_VARIABLE; } /* R variables */
|
| 83 |
|
88 |
|
| 84 |
{numeric}/{ops} { BEGIN(equation); return RPT_NUMERIC; } /* numeric before operator */
|
89 |
{numeric}/{ops} { BEGIN(equation); return RPT_NUMERIC; } /* numeric before operator */
|