static int tab=0; /* First indentation found */
int included=0; /* Is current file included? */
+int lineno = 1;
%}
%%
return key;
}
-\n[ \f\t]*/"--" {/* Line with only a comment, don't set tab */}
+\n[ \f\t]*/"--" {/* Line with only a comment, don't set tab */
+ lineno++;
+ }
\n[ \f\t]* {
+ lineno++;
ind=indentation(yytext+1);
if (tab==0)
tab=ind;
while (*l<'0' || *l>'9') l++;
- yylineno=0;
+ lineno=0;
while ('0'<=*l && *l<='9')
- yylineno=yylineno*10+(*l++ - '0');
+ lineno=lineno*10+(*l++ - '0');
- yylineno--;
+ lineno--;
while (*l++!='"');
void init_builtins();
char *strcpy();
-extern int yylineno, LLsymb;
+extern int lineno, LLsymb;
union type_info info, none;
}
%token AFTER, ALLOCATE, ALT, AND, ANY, BYTE, CHAN, DEF, FALSE, FOR, IF, LOAD;
guard(&F) process { branch(END);
Label(F);
}
- | ALT { line=yylineno; oind=ind; }
- [ %if (line==yylineno)
+ | ALT { line=lineno; oind=ind; }
+ [ %if (line==lineno)
replicator(&v, &e1, &e2)
{ rep_init(v, e1, e2, &to_test); }
guarded_process(END)
{ branch(END);
Label(F);
}
- | IF { line=yylineno; oind=ind; }
- [ %if (line==yylineno)
+ | IF { line=lineno; oind=ind; }
+ [ %if (line==lineno)
replicator(&v, &e1, &e2)
{ rep_init(v, e1, e2, &to_test); }
conditional(END)
register line, oind;
int BEGIN=0, END=0, NONZERO;
}:
- SEQ { line=yylineno; oind=ind; }
- [ %if (line==yylineno)
+ SEQ { line=lineno; oind=ind; }
+ [ %if (line==lineno)
replicator(&v, &e1, &e2)
{ rep_init(v, e1, e2, &to_test); }
process
[ %while (tabulated(oind, ind)) process ]*
]
| PRI ?
- [ PAR { line=yylineno; oind=ind;
+ [ PAR { line=lineno; oind=ind;
par_begin();
}
- [ %if (line==yylineno)
+ [ %if (line==lineno)
replicator(&v, &e1, &e2)
{ rep_init(v, e1, e2, &to_test);
NONZERO=0;
{ Label(END);
par_end();
}
- | ALT { line=yylineno; oind=ind;
+ | ALT { line=lineno; oind=ind;
no_deadlock();
Label(new_label(&BEGIN));
}
- [ %if (line==yylineno)
+ [ %if (line==lineno)
replicator(&v, &e1, &e2)
{ rep_init(v, e1, e2, &to_test); }
guarded_process(&END)
Label(END);
}
]
- | IF { line=yylineno; oind=ind; }
- [ %if (line==yylineno)
+ | IF { line=lineno; oind=ind; }
+ [ %if (line==lineno)
replicator(&v, &e1, &e2)
{ rep_init(v, e1, e2, &to_test); }
conditional(&END)
int byte, err=0, subs_call=0;
struct expr_list *elp=nil, **aelp= &elp;
}:
- IDENTIFIER { line=yylineno;
+ IDENTIFIER { line=lineno;
oind=ind;
var=searchall(token.t_sval);
*e=new_var(var);
}
}
- [ %while (line==yylineno || tabulated(oind, ind))
+ [ %while (line==lineno || tabulated(oind, ind))
[ subscript(&byte, &e1)
{ *e=new_node('[', *e, e1, byte); }
| '(' { if (!var_declared(var)) {
*/
#include <system.h>
-extern int err, yylineno;
+extern int err, lineno;
extern char *curr_file;
/*VARARGS1*/
report(fmt, arg1, arg2, arg3) char *fmt;
{
- fprint(STDERR, "%s (%d) F: ", curr_file, yylineno);
+ fprint(STDERR, "%s (%d) F: ", curr_file, lineno);
fprint(STDERR, fmt, arg1, arg2, arg3);
fprint(STDERR,"\n");
err=1;
/*VARARGS1*/
warning(fmt, arg1, arg2, arg3) char *fmt, *arg1;
{
- fprint(STDERR, "%s (%d) E: ", curr_file, yylineno);
+ fprint(STDERR, "%s (%d) E: ", curr_file, lineno);
fprint(STDERR, fmt, arg1, arg2, arg3);
fprint(STDERR,"\n");
}
/*VARARGS1*/
fatal(fmt, arg1, arg2, arg3) char *fmt, *arg1;
{
- fprint(STDERR, "%s (%d) X: ", curr_file, yylineno);
+ fprint(STDERR, "%s (%d) X: ", curr_file, lineno);
fprint(STDERR, fmt, arg1, arg2, arg3);
fprint(STDERR,"\n");
exit(1);