Mercurial > hg > index.cgi
comparison lwbasic/lexer.c @ 36:5325b640424d
First pass expression parsing
author | Lost Wizard (lost@starbug3) |
---|---|
date | Tue, 08 Feb 2011 22:42:12 -0700 |
parents | cdb0175e1063 |
children |
comparison
equal
deleted
inserted
replaced
35:cdb0175e1063 | 36:5325b640424d |
---|---|
70 { "or", token_op_or }, | 70 { "or", token_op_or }, |
71 { "band", token_op_band }, | 71 { "band", token_op_band }, |
72 { "bor", token_op_bor }, | 72 { "bor", token_op_bor }, |
73 { "bxor", token_op_bxor }, | 73 { "bxor", token_op_bxor }, |
74 { "xor", token_op_xor }, | 74 { "xor", token_op_xor }, |
75 { "not", token_op_not }, | |
76 { "bnot", token_op_bnot }, | |
75 { NULL } | 77 { NULL } |
76 }; | 78 }; |
77 | 79 |
78 static char *lexer_token_names[] = | 80 static char *lexer_token_names[] = |
79 { | 81 { |
104 "<plus>", | 106 "<plus>", |
105 "<minus>", | 107 "<minus>", |
106 "<times>", | 108 "<times>", |
107 "<divide>", | 109 "<divide>", |
108 "<modulus>", | 110 "<modulus>", |
111 "<openparen>", | |
112 "<closeparen>", | |
113 "<not>", | |
114 "<bitwisenot>", | |
109 "<identifier>", | 115 "<identifier>", |
110 "<char>", | 116 "<char>", |
111 "<uint>", | 117 "<uint>", |
112 "<int>", | 118 "<int>", |
113 "<eol>", | 119 "<eol>", |
382 | 388 |
383 case '%': | 389 case '%': |
384 state -> lexer_token = token_op_modulus; | 390 state -> lexer_token = token_op_modulus; |
385 return; | 391 return; |
386 | 392 |
393 case '(': | |
394 state -> lexer_token = token_op_oparen; | |
395 return; | |
396 | |
397 case ')': | |
398 state -> lexer_token = token_op_cparen; | |
399 return; | |
387 | 400 |
388 } | 401 } |
389 } | 402 } |
390 else | 403 else |
391 { | 404 { |