Skip to content

Commit 3e4d150

Browse files
indianlarrympictor
authored andcommitted
yylineno fixed to properly track parser line numbers
git-svn-id: https://brlcad.svn.sourceforge.net/svnroot/brlcad/brlcad/trunk/src/other/step@34193 2f96ce8b-6d43-0410-b8df-bffccc660ffb
1 parent 447a17d commit 3e4d150

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

include/express/lexact.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ SCANnextchar(char* buffer)
164164
#endif
165165
buffer[0] = *(SCANcurrent++);
166166
if (!isascii(buffer[0])) {
167-
ERRORreport_with_line(ERROR_nonascii_char,expyylineno,
167+
ERRORreport_with_line(ERROR_nonascii_char,yylineno,
168168
0xff & buffer[0]);
169169
buffer[0] = ' '; /* substitute space */
170170
}

include/express/memory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ char *nnew();
7474
/* space allocation macros with error package: */
7575
/***********************************************/
7676

77-
extern int expyylineno;
77+
extern int yylineno;
7878

7979
/* CALLOC grabs and initializes to all 0s space for the indicated */
8080
/* number of instances of the indicated type */

include/express/symbol.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ GLOBAL struct freelist_head SYMBOL_fl;
9393
#define SYMBOL_new() (struct Symbol_ *)MEM_new(&SYMBOL_fl)
9494
#define SYMBOL_destroy(x) MEM_destroy(&SYMBOL_fl,(Freelist *)(Generic)x)
9595

96-
#define SYMBOLset(obj) obj->symbol.line = expyylineno; \
96+
#define SYMBOLset(obj) obj->symbol.line = yylineno; \
9797
obj->symbol.filename = current_filename
9898
/* for backwards compatibility only, no one should ever need this */
9999
#define SYMBOLget_name(sym) ((sym)->name)

src/express/lexact.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ static char rcsid[] = "$Id: lexact.c,v 1.10 1997/09/24 20:05:38 dar Exp $";
6666
#include "dict.h"
6767
#include "memory.h"
6868

69-
extern int expyylineno;
69+
extern int yylineno;
7070
extern FILE* yyin;
7171

7272
#ifdef FLEX
@@ -219,8 +219,8 @@ void
219219
SCANpush_buffer(char *filename,FILE *fp)
220220
{
221221
SCANbuffer.savedPos = SCANcurrent;
222-
SCANbuffer.lineno = expyylineno;
223-
expyylineno = 1;
222+
SCANbuffer.lineno = yylineno;
223+
yylineno = 1;
224224
++SCAN_current_buffer;
225225
#ifdef keep_nul
226226
SCANbuffer.numRead = 0;
@@ -240,7 +240,7 @@ SCANpop_buffer()
240240
fclose(SCANbuffer.file);
241241
--SCAN_current_buffer;
242242
SCANcurrent = SCANbuffer.savedPos;
243-
expyylineno = SCANbuffer.lineno; /* DEL */
243+
yylineno = SCANbuffer.lineno; /* DEL */
244244
current_filename = SCANbuffer.filename;
245245
}
246246

@@ -371,7 +371,7 @@ SCANprocess_identifier_or_keyword(void)
371371
} else {
372372
#endif
373373

374-
yylval.symbol =SYMBOLcreate(test_string,expyylineno,current_filename);
374+
yylval.symbol =SYMBOLcreate(test_string,yylineno,current_filename);
375375
if (k) {
376376
/* built-in function/procedure */
377377
return(k->token);
@@ -442,12 +442,12 @@ SCANprocess_encoded_string(void)
442442
count = 0;
443443
for (s = yylval.string;*s;s++,count++) {
444444
if (!isxdigit(*s)) {
445-
ERRORreport_with_line(ERROR_encoded_string_bad_digit,expyylineno,*s);
445+
ERRORreport_with_line(ERROR_encoded_string_bad_digit,yylineno,*s);
446446
}
447447
}
448448

449449
if (0 != (count%8)) {
450-
ERRORreport_with_line(ERROR_encoded_string_bad_count,expyylineno,count);
450+
ERRORreport_with_line(ERROR_encoded_string_bad_count,yylineno,count);
451451
}
452452

453453
return TOK_STRING_LITERAL_ENCODED;
@@ -548,11 +548,11 @@ SCANinclude_file(char *filename)
548548
FILE *fp;
549549

550550
if ((fp = fopen(filename, "r")) == NULL) {
551-
ERRORreport_with_line(ERROR_include_file, expyylineno);
551+
ERRORreport_with_line(ERROR_include_file, yylineno);
552552
} else {
553553
if (print_objects_while_running & OBJ_SCHEMA_BITS) {
554554
fprintf(stderr,"parse: including %s at line %d of %s\n",
555-
filename,expyylineno,SCANbuffer.filename);
555+
filename,yylineno,SCANbuffer.filename);
556556
}
557557
SCANpush_buffer(filename,fp);
558558
}
@@ -586,5 +586,5 @@ SCANstrdup(char *s)
586586

587587
long
588588
SCANtell() {
589-
return expyylineno;
589+
return yylineno;
590590
}

src/express/symbol.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ char *filename;
5858
{
5959
Symbol *sym = SYMBOL_new();
6060
sym->name = name;
61-
sym->line = expyylineno;
61+
sym->line = line;
6262
sym->filename = current_filename;
6363
return sym;
6464
}

0 commit comments

Comments
 (0)