<div dir="ltr"><div>What was the original OS this thing is from? 40 years is 1980, which suggests V7. If so, I'd lookup how to boot V7 on a PDP-11 with simh and compile it there to see what this translates to... If you have the source code and can share off list, I can run it on one of mine...</div><div><br></div><div>Warner</div><div><br></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 28, 2020 at 6:31 PM R. Clayton <<a href="mailto:factotum@rclayton.org">factotum@rclayton.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I'm working with a 40-year-old lex program that uses statements like<br>
<br>
BEGIN PROGRAM + 1;<br>
<br>
I understand what<br>
<br>
BEGIN PROGRAM;<br>
<br>
does, but what is the intention of the "+ 1"? Does it skip the first rule in<br>
the <PROGRAM> context? The generated code suggests not, but I haven't dug into<br>
it too deeply. Does it select the context listed after the <PROGRAM> context?<br>
That seems slightly more plausible, but a test lex program doesn't support that<br>
intention (it's likely the test program is ineffectively written). I'm using<br>
flex, not a 40-year-old version of lex.<br>
<br>
For completeness, here's the test program:<br>
<br>
$ cat t.lex <br>
%s A B C<br>
<br>
%%<br>
BEGIN A;<br>
<br>
<A>[BC] if (yytext[0] == 'B') BEGIN B + 1; else BEGIN C;<br>
<A>. printf("A: '%c'\n", yytext[0]);<br>
<br>
<B>[AC] if (yytext[0] == 'A') BEGIN A; else BEGIN C;<br>
<B>. printf("B: '%c'\n", yytext[0]);<br>
<br>
<C>[AB] if (yytext[0] == 'A') BEGIN A; else BEGIN B;<br>
<C>. printf("C: '%c'\n", yytext[0]);<br>
<br>
%%<br>
<br>
main() { yylex(); }<br>
<br>
$ echo abcBabc | ./a.out <br>
A: 'a'<br>
A: 'b'<br>
A: 'c'<br>
B: 'a'<br>
B: 'b'<br>
B: 'c'<br>
<br>
$<br>
<br>
_______________________________________________<br>
talk mailing list<br>
<a href="mailto:talk@lists.nycbug.org" target="_blank">talk@lists.nycbug.org</a><br>
<a href="http://lists.nycbug.org:8080/mailman/listinfo/talk" rel="noreferrer" target="_blank">http://lists.nycbug.org:8080/mailman/listinfo/talk</a><br>
</blockquote></div></div>