ReactOS  0.4.14-dev-838-g99f979d
lex.c File Reference
#include <assert.h>
#include <limits.h>
#include <math.h>
#include "vbscript.h"
#include "parse.h"
#include "parser.tab.h"
#include "wine/debug.h"
Include dependency graph for lex.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (vbscript)
 
static BOOL is_identifier_char (WCHAR c)
 
static int check_keyword (parser_ctx_t *ctx, const WCHAR *word, const WCHAR **lval)
 
static int check_keywords (parser_ctx_t *ctx, const WCHAR **lval)
 
static int parse_identifier (parser_ctx_t *ctx, const WCHAR **ret)
 
static int parse_string_literal (parser_ctx_t *ctx, const WCHAR **ret)
 
static int parse_numeric_literal (parser_ctx_t *ctx, void **ret)
 
static int hex_to_int (WCHAR c)
 
static int parse_hex_literal (parser_ctx_t *ctx, LONG *ret)
 
static void skip_spaces (parser_ctx_t *ctx)
 
static int comment_line (parser_ctx_t *ctx)
 
static int parse_next_token (void *lval, parser_ctx_t *ctx)
 
int parser_lex (void *lval, parser_ctx_t *ctx)
 

Variables

static const WCHAR andW [] = {'a','n','d',0}
 
static const WCHAR byrefW [] = {'b','y','r','e','f',0}
 
static const WCHAR byvalW [] = {'b','y','v','a','l',0}
 
static const WCHAR callW [] = {'c','a','l','l',0}
 
static const WCHAR caseW [] = {'c','a','s','e',0}
 
static const WCHAR classW [] = {'c','l','a','s','s',0}
 
static const WCHAR constW [] = {'c','o','n','s','t',0}
 
static const WCHAR defaultW [] = {'d','e','f','a','u','l','t',0}
 
static const WCHAR dimW [] = {'d','i','m',0}
 
static const WCHAR doW [] = {'d','o',0}
 
static const WCHAR eachW [] = {'e','a','c','h',0}
 
static const WCHAR elseW [] = {'e','l','s','e',0}
 
static const WCHAR elseifW [] = {'e','l','s','e','i','f',0}
 
static const WCHAR emptyW [] = {'e','m','p','t','y',0}
 
static const WCHAR endW [] = {'e','n','d',0}
 
static const WCHAR eqvW [] = {'e','q','v',0}
 
static const WCHAR errorW [] = {'e','r','r','o','r',0}
 
static const WCHAR exitW [] = {'e','x','i','t',0}
 
static const WCHAR explicitW [] = {'e','x','p','l','i','c','i','t',0}
 
static const WCHAR falseW [] = {'f','a','l','s','e',0}
 
static const WCHAR forW [] = {'f','o','r',0}
 
static const WCHAR functionW [] = {'f','u','n','c','t','i','o','n',0}
 
static const WCHAR getW [] = {'g','e','t',0}
 
static const WCHAR gotoW [] = {'g','o','t','o',0}
 
static const WCHAR ifW [] = {'i','f',0}
 
static const WCHAR impW [] = {'i','m','p',0}
 
static const WCHAR inW [] = {'i','n',0}
 
static const WCHAR isW [] = {'i','s',0}
 
static const WCHAR letW [] = {'l','e','t',0}
 
static const WCHAR loopW [] = {'l','o','o','p',0}
 
static const WCHAR meW [] = {'m','e',0}
 
static const WCHAR modW [] = {'m','o','d',0}
 
static const WCHAR newW [] = {'n','e','w',0}
 
static const WCHAR nextW [] = {'n','e','x','t',0}
 
static const WCHAR notW [] = {'n','o','t',0}
 
static const WCHAR nothingW [] = {'n','o','t','h','i','n','g',0}
 
static const WCHAR nullW [] = {'n','u','l','l',0}
 
static const WCHAR onW [] = {'o','n',0}
 
static const WCHAR optionW [] = {'o','p','t','i','o','n',0}
 
static const WCHAR orW [] = {'o','r',0}
 
static const WCHAR privateW [] = {'p','r','i','v','a','t','e',0}
 
static const WCHAR propertyW [] = {'p','r','o','p','e','r','t','y',0}
 
static const WCHAR publicW [] = {'p','u','b','l','i','c',0}
 
static const WCHAR remW [] = {'r','e','m',0}
 
static const WCHAR resumeW [] = {'r','e','s','u','m','e',0}
 
static const WCHAR selectW [] = {'s','e','l','e','c','t',0}
 
static const WCHAR setW [] = {'s','e','t',0}
 
static const WCHAR stepW [] = {'s','t','e','p',0}
 
static const WCHAR stopW [] = {'s','t','o','p',0}
 
static const WCHAR subW [] = {'s','u','b',0}
 
static const WCHAR thenW [] = {'t','h','e','n',0}
 
static const WCHAR toW [] = {'t','o',0}
 
static const WCHAR trueW [] = {'t','r','u','e',0}
 
static const WCHAR untilW [] = {'u','n','t','i','l',0}
 
static const WCHAR wendW [] = {'w','e','n','d',0}
 
static const WCHAR whileW [] = {'w','h','i','l','e',0}
 
static const WCHAR xorW [] = {'x','o','r',0}
 
struct {
   const WCHAR *   word
 
   int   token
 
keywords []
 

Function Documentation

◆ check_keyword()

static int check_keyword ( parser_ctx_t ctx,
const WCHAR word,
const WCHAR **  lval 
)
static

Definition at line 161 of file lex.c.

162 {
163  const WCHAR *p1 = ctx->ptr;
164  const WCHAR *p2 = word;
165  WCHAR c;
166 
167  while(p1 < ctx->end && *p2) {
168  c = towlower(*p1);
169  if(c != *p2)
170  return c - *p2;
171  p1++;
172  p2++;
173  }
174 
175  if(*p2 || (p1 < ctx->end && is_identifier_char(*p1)))
176  return 1;
177 
178  ctx->ptr = p1;
179  *lval = word;
180  return 0;
181 }
BOOL is_identifier_char(WCHAR c)
Definition: lex.c:81
GLuint GLuint end
Definition: gl.h:1545
const WCHAR * ptr
Definition: parse.h:261
__wchar_t WCHAR
Definition: xmlstorage.h:180
const GLubyte * c
Definition: glext.h:8905
const WCHAR * word
Definition: lex.c:36
#define c
Definition: ke_i.h:80
#define towlower(c)
Definition: wctype.h:97

Referenced by check_keywords().

◆ check_keywords()

static int check_keywords ( parser_ctx_t ctx,
const WCHAR **  lval 
)
static

Definition at line 183 of file lex.c.

184 {
185  int min = 0, max = ARRAY_SIZE(keywords)-1, r, i;
186 
187  while(min <= max) {
188  i = (min+max)/2;
189 
190  r = check_keyword(ctx, keywords[i].word, lval);
191  if(!r)
192  return keywords[i].token;
193 
194  if(r > 0)
195  min = i+1;
196  else
197  max = i-1;
198  }
199 
200  return 0;
201 }
#define max(a, b)
Definition: svc.c:63
static int check_keyword(parser_ctx_t *ctx, const WCHAR *word, const WCHAR **lval)
Definition: lex.c:161
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static const struct @561 keywords[]
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define ARRAY_SIZE(a)
Definition: main.h:24
#define min(a, b)
Definition: monoChain.cc:55
const WCHAR * word
Definition: lex.c:36

Referenced by parse_next_token().

◆ comment_line()

static int comment_line ( parser_ctx_t ctx)
static

Definition at line 395 of file lex.c.

396 {
397  static const WCHAR newlineW[] = {'\n','\r',0};
398  ctx->ptr = wcspbrk(ctx->ptr, newlineW);
399  if(ctx->ptr)
400  ctx->ptr++;
401  else
402  ctx->ptr = ctx->end;
403  return tNL;
404 }
static const WCHAR newlineW[]
Definition: reg.c:81
const WCHAR * ptr
Definition: parse.h:261
__wchar_t WCHAR
Definition: xmlstorage.h:180
const WCHAR * end
Definition: parse.h:262
Definition: ppy.tab.c:216
_Check_return_ _CRTIMP _CONST_RETURN wchar_t *__cdecl wcspbrk(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_Control)

Referenced by parse_next_token().

◆ hex_to_int()

static int hex_to_int ( WCHAR  c)
static

Definition at line 358 of file lex.c.

359 {
360  if('0' <= c && c <= '9')
361  return c-'0';
362  if('a' <= c && c <= 'f')
363  return c+10-'a';
364  if('A' <= c && c <= 'F')
365  return c+10-'A';
366  return -1;
367 }
const GLubyte * c
Definition: glext.h:8905

Referenced by parse_hex_literal().

◆ is_identifier_char()

static BOOL is_identifier_char ( WCHAR  c)
inlinestatic

Definition at line 156 of file lex.c.

157 {
158  return iswalnum(c) || c == '_';
159 }
#define iswalnum(_c)
Definition: ctype.h:671
const GLubyte * c
Definition: glext.h:8905

◆ parse_hex_literal()

static int parse_hex_literal ( parser_ctx_t ctx,
LONG ret 
)
static

Definition at line 369 of file lex.c.

370 {
371  const WCHAR *begin = ctx->ptr;
372  LONG l = 0, d;
373 
374  while((d = hex_to_int(*++ctx->ptr)) != -1)
375  l = l*16 + d;
376 
377  if(begin + 9 /* max digits+1 */ < ctx->ptr || (*ctx->ptr != '&' && is_identifier_char(*ctx->ptr))) {
378  FIXME("invalid literal\n");
379  return 0;
380  }
381 
382  if(*ctx->ptr == '&')
383  ctx->ptr++;
384 
385  *ret = l;
386  return tInt;
387 }
BOOL is_identifier_char(WCHAR c)
Definition: lex.c:81
long LONG
Definition: pedump.c:60
#define FIXME(fmt,...)
Definition: debug.h:110
const WCHAR * ptr
Definition: parse.h:261
static clock_t begin
Definition: xmllint.c:466
static int hex_to_int(WCHAR c)
Definition: lex.c:358
r l[0]
Definition: byte_order.h:167
#define d
Definition: ke_i.h:81
__wchar_t WCHAR
Definition: xmlstorage.h:180
int ret

Referenced by parse_next_token().

◆ parse_identifier()

static int parse_identifier ( parser_ctx_t ctx,
const WCHAR **  ret 
)
static

Definition at line 203 of file lex.c.

204 {
205  const WCHAR *ptr = ctx->ptr++;
206  WCHAR *str;
207  int len;
208 
209  while(ctx->ptr < ctx->end && is_identifier_char(*ctx->ptr))
210  ctx->ptr++;
211  len = ctx->ptr-ptr;
212 
213  str = parser_alloc(ctx, (len+1)*sizeof(WCHAR));
214  if(!str)
215  return 0;
216 
217  memcpy(str, ptr, (len+1)*sizeof(WCHAR));
218  str[len] = 0;
219  *ret = str;
220  return tIdentifier;
221 }
BOOL is_identifier_char(WCHAR c)
Definition: lex.c:81
static PVOID ptr
Definition: dispmode.c:27
const WCHAR * str
const WCHAR * ptr
Definition: parse.h:261
__wchar_t WCHAR
Definition: xmlstorage.h:180
int ret
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
const WCHAR * end
Definition: parse.h:262
static void * parser_alloc(parser_ctx_t *ctx, DWORD size)
Definition: parser.h:58

Referenced by parse_next_token().

◆ parse_next_token()

static int parse_next_token ( void lval,
parser_ctx_t ctx 
)
static

Definition at line 406 of file lex.c.

407 {
408  WCHAR c;
409 
410  skip_spaces(ctx);
411  if(ctx->ptr == ctx->end)
412  return ctx->last_token == tNL ? tEOF : tNL;
413 
414  c = *ctx->ptr;
415 
416  if('0' <= c && c <= '9')
417  return parse_numeric_literal(ctx, lval);
418 
419  if(iswalpha(c)) {
420  int ret = check_keywords(ctx, lval);
421  if(!ret)
422  return parse_identifier(ctx, lval);
423  if(ret != tREM)
424  return ret;
425  c = '\'';
426  }
427 
428  switch(c) {
429  case '\n':
430  case '\r':
431  ctx->ptr++;
432  return tNL;
433  case '\'':
434  return comment_line(ctx);
435  case ':':
436  case ')':
437  case ',':
438  case '=':
439  case '+':
440  case '*':
441  case '/':
442  case '^':
443  case '\\':
444  case '.':
445  case '_':
446  return *ctx->ptr++;
447  case '-':
448  if(ctx->is_html && ctx->ptr[1] == '-' && ctx->ptr[2] == '>')
449  return comment_line(ctx);
450  ctx->ptr++;
451  return '-';
452  case '(':
453  /* NOTE:
454  * We resolve empty brackets in lexer instead of parser to avoid complex conflicts
455  * in call statement special case |f()| without 'call' keyword
456  */
457  ctx->ptr++;
458  skip_spaces(ctx);
459  if(*ctx->ptr == ')') {
460  ctx->ptr++;
461  return tEMPTYBRACKETS;
462  }
463  return '(';
464  case '"':
465  return parse_string_literal(ctx, lval);
466  case '&':
467  if(*++ctx->ptr == 'h' || *ctx->ptr == 'H')
468  return parse_hex_literal(ctx, lval);
469  return '&';
470  case '<':
471  switch(*++ctx->ptr) {
472  case '>':
473  ctx->ptr++;
474  return tNEQ;
475  case '=':
476  ctx->ptr++;
477  return tLTEQ;
478  case '!':
479  if(ctx->is_html && ctx->ptr[1] == '-' && ctx->ptr[2] == '-')
480  return comment_line(ctx);
481  }
482  return '<';
483  case '>':
484  if(*++ctx->ptr == '=') {
485  ctx->ptr++;
486  return tGTEQ;
487  }
488  return '>';
489  default:
490  FIXME("Unhandled char %c in %s\n", *ctx->ptr, debugstr_w(ctx->ptr));
491  }
492 
493  return 0;
494 }
static int comment_line(parser_ctx_t *ctx)
Definition: lex.c:395
static void skip_spaces(parser_ctx_t *ctx)
Definition: lex.c:389
static int parse_string_literal(parser_ctx_t *ctx, const WCHAR **ret)
Definition: lex.c:223
#define iswalpha(_c)
Definition: ctype.h:664
static int parse_numeric_literal(parser_ctx_t *ctx, void **ret)
Definition: lex.c:266
static int check_keywords(parser_ctx_t *ctx, const WCHAR **lval)
Definition: lex.c:183
static int parse_identifier(parser_ctx_t *ctx, const WCHAR **ret)
Definition: lex.c:203
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
const WCHAR * ptr
Definition: parse.h:261
__wchar_t WCHAR
Definition: xmlstorage.h:180
const GLubyte * c
Definition: glext.h:8905
int ret
const WCHAR * end
Definition: parse.h:262
Definition: ppy.tab.c:216
static int parse_hex_literal(parser_ctx_t *ctx, LONG *ret)
Definition: lex.c:369
#define c
Definition: ke_i.h:80
BOOL is_html
Definition: parse.h:266
int last_token
Definition: parse.h:269

Referenced by parser_lex().

◆ parse_numeric_literal()

static int parse_numeric_literal ( parser_ctx_t ctx,
void **  ret 
)
static

Definition at line 266 of file lex.c.

267 {
268  BOOL use_int = TRUE;
269  LONGLONG d = 0, hlp;
270  int exp = 0;
271  double r;
272 
273  if(*ctx->ptr == '0' && !('0' <= ctx->ptr[1] && ctx->ptr[1] <= '9') && ctx->ptr[1] != '.')
274  return *ctx->ptr++;
275 
276  while(ctx->ptr < ctx->end && iswdigit(*ctx->ptr)) {
277  hlp = d*10 + *(ctx->ptr++) - '0';
278  if(d>MAXLONGLONG/10 || hlp<0) {
279  exp++;
280  break;
281  }
282  else
283  d = hlp;
284  }
285  while(ctx->ptr < ctx->end && iswdigit(*ctx->ptr)) {
286  exp++;
287  ctx->ptr++;
288  }
289 
290  if(*ctx->ptr == '.') {
291  use_int = FALSE;
292  ctx->ptr++;
293 
294  while(ctx->ptr < ctx->end && iswdigit(*ctx->ptr)) {
295  hlp = d*10 + *(ctx->ptr++) - '0';
296  if(d>MAXLONGLONG/10 || hlp<0)
297  break;
298 
299  d = hlp;
300  exp--;
301  }
302  while(ctx->ptr < ctx->end && iswdigit(*ctx->ptr))
303  ctx->ptr++;
304  }
305 
306  if(*ctx->ptr == 'e' || *ctx->ptr == 'E') {
307  int e = 0, sign = 1;
308 
309  ctx->ptr++;
310  if(*ctx->ptr == '-') {
311  ctx->ptr++;
312  sign = -1;
313  }else if(*ctx->ptr == '+') {
314  ctx->ptr++;
315  }
316 
317  if(!iswdigit(*ctx->ptr)) {
318  FIXME("Invalid numeric literal\n");
319  return 0;
320  }
321 
322  use_int = FALSE;
323 
324  do {
325  e = e*10 + *(ctx->ptr++) - '0';
326  if(sign == -1 && -e+exp < -(INT_MAX/100)) {
327  /* The literal will be rounded to 0 anyway. */
328  while(iswdigit(*ctx->ptr))
329  ctx->ptr++;
330  *(double*)ret = 0;
331  return tDouble;
332  }
333 
334  if(sign*e + exp > INT_MAX/100) {
335  FIXME("Invalid numeric literal\n");
336  return 0;
337  }
338  } while(iswdigit(*ctx->ptr));
339 
340  exp += sign*e;
341  }
342 
343  if(use_int && (LONG)d == d) {
344  *(LONG*)ret = d;
345  return tInt;
346  }
347 
348  r = exp>=0 ? d*pow(10, exp) : d/pow(10, -exp);
349  if(isinf(r)) {
350  FIXME("Invalid numeric literal\n");
351  return 0;
352  }
353 
354  *(double*)ret = r;
355  return tDouble;
356 }
static size_t double int int int * sign
Definition: printf.c:69
#define TRUE
Definition: types.h:120
#define INT_MAX
Definition: limits.h:40
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define iswdigit(_c)
Definition: ctype.h:667
#define MAXLONGLONG
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
float pow(float __x, int __y)
Definition: _cmath.h:458
#define e
Definition: ke_i.h:82
#define FIXME(fmt,...)
Definition: debug.h:110
const WCHAR * ptr
Definition: parse.h:261
int64_t LONGLONG
Definition: typedefs.h:66
#define d
Definition: ke_i.h:81
int isinf(double x)
int ret
const WCHAR * end
Definition: parse.h:262
DWORD exp
Definition: msg.c:16038

Referenced by parse_next_token().

◆ parse_string_literal()

static int parse_string_literal ( parser_ctx_t ctx,
const WCHAR **  ret 
)
static

Definition at line 223 of file lex.c.

224 {
225  const WCHAR *ptr = ++ctx->ptr;
226  WCHAR *rptr;
227  int len = 0;
228 
229  while(ctx->ptr < ctx->end) {
230  if(*ctx->ptr == '\n' || *ctx->ptr == '\r') {
231  FIXME("newline inside string literal\n");
232  return 0;
233  }
234 
235  if(*ctx->ptr == '"') {
236  if(ctx->ptr[1] != '"')
237  break;
238  len--;
239  ctx->ptr++;
240  }
241  ctx->ptr++;
242  }
243 
244  if(ctx->ptr == ctx->end) {
245  FIXME("unterminated string literal\n");
246  return 0;
247  }
248 
249  len += ctx->ptr-ptr;
250 
251  *ret = rptr = parser_alloc(ctx, (len+1)*sizeof(WCHAR));
252  if(!rptr)
253  return 0;
254 
255  while(ptr < ctx->ptr) {
256  if(*ptr == '"')
257  ptr++;
258  *rptr++ = *ptr++;
259  }
260 
261  *rptr = 0;
262  ctx->ptr++;
263  return tString;
264 }
#define FIXME(fmt,...)
Definition: debug.h:110
static PVOID ptr
Definition: dispmode.c:27
const WCHAR * ptr
Definition: parse.h:261
__wchar_t WCHAR
Definition: xmlstorage.h:180
int ret
GLenum GLsizei len
Definition: glext.h:6722
const WCHAR * end
Definition: parse.h:262
static void * parser_alloc(parser_ctx_t *ctx, DWORD size)
Definition: parser.h:58

Referenced by parse_next_token().

◆ parser_lex()

int parser_lex ( void lval,
parser_ctx_t ctx 
)

Definition at line 496 of file lex.c.

497 {
498  int ret;
499 
500  if (ctx->last_token == tEXPRESSION)
501  {
502  ctx->last_token = tNL;
503  return tEXPRESSION;
504  }
505 
506  while(1) {
507  ret = parse_next_token(lval, ctx);
508  if(ret == '_') {
509  skip_spaces(ctx);
510  if(*ctx->ptr != '\n' && *ctx->ptr != '\r') {
511  FIXME("'_' not followed by newline\n");
512  return 0;
513  }
514  if(*ctx->ptr == '\r')
515  ctx->ptr++;
516  if(*ctx->ptr == '\n')
517  ctx->ptr++;
518  continue;
519  }
520  if(ret != tNL || ctx->last_token != tNL)
521  break;
522 
523  ctx->last_nl = ctx->ptr-ctx->code;
524  }
525 
526  return (ctx->last_token = ret);
527 }
static void skip_spaces(parser_ctx_t *ctx)
Definition: lex.c:389
#define FIXME(fmt,...)
Definition: debug.h:110
const WCHAR * ptr
Definition: parse.h:261
static int parse_next_token(void *lval, parser_ctx_t *ctx)
Definition: lex.c:406
const WCHAR * code
Definition: parse.h:260
int ret
Definition: ppy.tab.c:216
unsigned last_nl
Definition: parse.h:270
int last_token
Definition: parse.h:269

◆ skip_spaces()

static void skip_spaces ( parser_ctx_t ctx)
static

Definition at line 389 of file lex.c.

390 {
391  while(*ctx->ptr == ' ' || *ctx->ptr == '\t')
392  ctx->ptr++;
393 }
const WCHAR * ptr
Definition: parse.h:261

Referenced by parse_next_token(), and parser_lex().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( vbscript  )

Variable Documentation

◆ andW

const WCHAR andW[] = {'a','n','d',0}
static

Definition at line 35 of file lex.c.

◆ byrefW

const WCHAR byrefW[] = {'b','y','r','e','f',0}
static

Definition at line 36 of file lex.c.

◆ byvalW

const WCHAR byvalW[] = {'b','y','v','a','l',0}
static

Definition at line 37 of file lex.c.

◆ callW

const WCHAR callW[] = {'c','a','l','l',0}
static

Definition at line 38 of file lex.c.

◆ caseW

const WCHAR caseW[] = {'c','a','s','e',0}
static

Definition at line 39 of file lex.c.

◆ classW

◆ constW

const WCHAR constW[] = {'c','o','n','s','t',0}
static

Definition at line 41 of file lex.c.

◆ defaultW

◆ dimW

const WCHAR dimW[] = {'d','i','m',0}
static

Definition at line 43 of file lex.c.

◆ doW

const WCHAR doW[] = {'d','o',0}
static

Definition at line 44 of file lex.c.

◆ eachW

const WCHAR eachW[] = {'e','a','c','h',0}
static

Definition at line 45 of file lex.c.

◆ elseifW

const WCHAR elseifW[] = {'e','l','s','e','i','f',0}
static

Definition at line 47 of file lex.c.

◆ elseW

const WCHAR elseW[] = {'e','l','s','e',0}
static

Definition at line 46 of file lex.c.

◆ emptyW

const WCHAR emptyW[] = {'e','m','p','t','y',0}
static

Definition at line 48 of file lex.c.

◆ endW

const WCHAR endW[] = {'e','n','d',0}
static

Definition at line 49 of file lex.c.

Referenced by reader_parse_stag().

◆ eqvW

const WCHAR eqvW[] = {'e','q','v',0}
static

Definition at line 50 of file lex.c.

◆ errorW

const WCHAR errorW[] = {'e','r','r','o','r',0}
static

Definition at line 51 of file lex.c.

◆ exitW

const WCHAR exitW[] = {'e','x','i','t',0}
static

Definition at line 52 of file lex.c.

Referenced by event_end_dialog(), and wmain().

◆ explicitW

const WCHAR explicitW[] = {'e','x','p','l','i','c','i','t',0}
static

Definition at line 53 of file lex.c.

◆ falseW

const WCHAR falseW[] = {'f','a','l','s','e',0}
static

Definition at line 54 of file lex.c.

◆ forW

const WCHAR forW[] = {'f','o','r',0}
static

Definition at line 55 of file lex.c.

◆ functionW

const WCHAR functionW[] = {'f','u','n','c','t','i','o','n',0}
static

Definition at line 56 of file lex.c.

◆ getW

const WCHAR getW[] = {'g','e','t',0}
static

Definition at line 57 of file lex.c.

◆ gotoW

const WCHAR gotoW[] = {'g','o','t','o',0}
static

Definition at line 58 of file lex.c.

◆ ifW

const WCHAR ifW[] = {'i','f',0}
static

Definition at line 59 of file lex.c.

◆ impW

const WCHAR impW[] = {'i','m','p',0}
static

Definition at line 60 of file lex.c.

◆ inW

const WCHAR inW[] = {'i','n',0}
static

◆ isW

const WCHAR isW[] = {'i','s',0}
static

Definition at line 62 of file lex.c.

◆ keywords

const { ... } keywords[]

Referenced by check_keywords().

◆ letW

const WCHAR letW[] = {'l','e','t',0}
static

Definition at line 63 of file lex.c.

◆ loopW

const WCHAR loopW[] = {'l','o','o','p',0}
static

Definition at line 64 of file lex.c.

◆ meW

const WCHAR meW[] = {'m','e',0}
static

Definition at line 65 of file lex.c.

◆ modW

const WCHAR modW[] = {'m','o','d',0}
static

Definition at line 66 of file lex.c.

Referenced by a_to_w_callback(), and EnumerateLoadedModulesW64().

◆ newW

const WCHAR newW[] = {'n','e','w',0}
static

Definition at line 67 of file lex.c.

◆ nextW

const WCHAR nextW[] = {'n','e','x','t',0}
static

Definition at line 68 of file lex.c.

◆ nothingW

const WCHAR nothingW[] = {'n','o','t','h','i','n','g',0}
static

Definition at line 70 of file lex.c.

◆ notW

const WCHAR notW[] = {'n','o','t',0}
static

Definition at line 69 of file lex.c.

◆ nullW

const WCHAR nullW[] = {'n','u','l','l',0}
static

Definition at line 71 of file lex.c.

◆ onW

const WCHAR onW[] = {'o','n',0}
static

Definition at line 72 of file lex.c.

Referenced by COMM_ParseOnOff(), HTMLDocument_put_designMode(), and update_window_doc().

◆ optionW

const WCHAR optionW[] = {'o','p','t','i','o','n',0}
static

Definition at line 73 of file lex.c.

◆ orW

const WCHAR orW[] = {'o','r',0}
static

Definition at line 74 of file lex.c.

◆ privateW

const WCHAR privateW[] = {'p','r','i','v','a','t','e',0}
static

Definition at line 75 of file lex.c.

◆ propertyW

const WCHAR propertyW[] = {'p','r','o','p','e','r','t','y',0}
static

Definition at line 76 of file lex.c.

◆ publicW

const WCHAR publicW[] = {'p','u','b','l','i','c',0}
static

Definition at line 77 of file lex.c.

◆ remW

const WCHAR remW[] = {'r','e','m',0}
static

Definition at line 78 of file lex.c.

◆ resumeW

const WCHAR resumeW[] = {'r','e','s','u','m','e',0}
static

Definition at line 79 of file lex.c.

◆ selectW

const WCHAR selectW[] = {'s','e','l','e','c','t',0}
static

Definition at line 80 of file lex.c.

◆ setW

const WCHAR setW[] = {'s','e','t',0}
static

Definition at line 81 of file lex.c.

◆ stepW

const WCHAR stepW[] = {'s','t','e','p',0}
static

Definition at line 82 of file lex.c.

◆ stopW

const WCHAR stopW[] = {'s','t','o','p',0}
static

Definition at line 83 of file lex.c.

Referenced by COMM_BuildNewCommDCB().

◆ subW

const WCHAR subW[] = {'s','u','b',0}
static

Definition at line 84 of file lex.c.

◆ thenW

const WCHAR thenW[] = {'t','h','e','n',0}
static

Definition at line 85 of file lex.c.

◆ token

int token

Definition at line 95 of file lex.c.

◆ toW

const WCHAR toW[] = {'t','o',0}
static

Definition at line 86 of file lex.c.

Referenced by COMM_BuildNewCommDCB().

◆ trueW

const WCHAR trueW[] = {'t','r','u','e',0}
static

Definition at line 87 of file lex.c.

◆ untilW

const WCHAR untilW[] = {'u','n','t','i','l',0}
static

Definition at line 88 of file lex.c.

◆ wendW

const WCHAR wendW[] = {'w','e','n','d',0}
static

Definition at line 89 of file lex.c.

◆ whileW

const WCHAR whileW[] = {'w','h','i','l','e',0}
static

Definition at line 90 of file lex.c.

◆ word

const WCHAR* word

Definition at line 94 of file lex.c.

◆ xorW

const WCHAR xorW[] = {'x','o','r',0}
static

Definition at line 91 of file lex.c.