testing int with yyleng

This commit is contained in:
Partho Bhattacharya
2025-02-13 19:28:38 -05:00
parent 90407da44c
commit 3c6d3be9b4
6 changed files with 9 additions and 3 deletions

BIN
flex.o

Binary file not shown.

View File

@ -824,7 +824,7 @@ do_action: /* This label is used only to access EOF actions. */
case 1: case 1:
YY_RULE_SETUP YY_RULE_SETUP
#line 27 "lexicalStructure.lex" #line 27 "lexicalStructure.lex"
{if(DEBUG) {printf( "T_INTEGER: %s (%d)\n", yytext, T_INTEGER);} else {return T_INTEGER;}} {if(DEBUG) {printf( "T_INTEGER: %s (%d)\n", yytext, T_INTEGER);} else {column_number=column_number+yyleng; return T_INTEGER;}}
YY_BREAK YY_BREAK
case 2: case 2:
YY_RULE_SETUP YY_RULE_SETUP

View File

@ -23,7 +23,7 @@ SCHAR \\n|\\t|\\\"|[^\"\n\\]
%% %%
"integer" {if(DEBUG) {printf( "T_INTEGER: %s (%d)\n", yytext, T_INTEGER);} else {return T_INTEGER;}} "integer" {if(DEBUG) {printf( "T_INTEGER: %s (%d)\n", yytext, T_INTEGER);} else {column_number=column_number+yyleng; return T_INTEGER;}}
"address" {if(DEBUG) {printf( "T_ADDRESS: %s (%d)\n", yytext, T_ADDRESS);} else {return T_ADDRESS;}} "address" {if(DEBUG) {printf( "T_ADDRESS: %s (%d)\n", yytext, T_ADDRESS);} else {return T_ADDRESS;}}
"Boolean" {if(DEBUG) {printf( "T_BOOLEAN: %s (%d)\n", yytext, T_BOOLEAN);} else {return T_BOOLEAN;}} "Boolean" {if(DEBUG) {printf( "T_BOOLEAN: %s (%d)\n", yytext, T_BOOLEAN);} else {return T_BOOLEAN;}}
"character" {if(DEBUG) {printf( "T_CHARACTER: %s (%d)\n", yytext, T_CHARACTER);} else {return T_CHARACTER;}} "character" {if(DEBUG) {printf( "T_CHARACTER: %s (%d)\n", yytext, T_CHARACTER);} else {return T_CHARACTER;}}

BIN
runner

Binary file not shown.

View File

@ -1,3 +1,8 @@
1 1 301 "45" 1 1 301 "45"
2 1 301 "123" 2 1 301 "123"
3 1 301 "8392" 3 1 301 "8392"
4 1 301 "40"
4 2 301 "40"
5 2 301 "200"
5 3 301 "50"
5 4 301 "21783"

View File

@ -1,4 +1,5 @@
45 45
123 123
8392 8392
40 40
200 50 21783