From nycbug-talk at reynolds.users.panix.com Thu Oct 8 14:13:20 2020 From: nycbug-talk at reynolds.users.panix.com (Brian Reynolds) Date: Thu, 8 Oct 2020 14:13:20 -0400 Subject: [talk] FreeBSD laptop advice Message-ID: <20201008181320.GB8915@panix.com> As luck would have it my laptop died at the beginning of Stay At Home. I'm looking for advice on a laptop to buy that will run FreeBSD RELEASE. I know about the FreeBSD wiki Laptop page, and NYC BUG's dmesg site, but I'm hoping to hear additional real world experience from folks running FreeBSD as their daily machine. This laptop will mostly be used for web browsing, command line email, and administrating my home network. I expect to boot ZFS (hence FreeBSD), and tinker with virtualbox, jails, and maybe bhyve, but I have a desktop for any heavy lifting. I want an IPS display with a resolution of at least 1920x1080. I'd prefer a 15-inch display, but might settle for 13-inch. I need wireless to work. The whole point is to be able to take the laptop around the house, and not be stuck in my computer room. I also want suspend/resume to work. I don't care if bluetooth works. I guess if the trackpad is crappy enough I'd use a wireless mouse, but I don't mind using a Logitech mouse with one of their non-bluetooth USB dongles. I really want a three button mouse/trackpad, so I could wind up with a wireless mouse even if the trackpad is OK. Integrated graphics are fine. It would be nice if it's user upgradable, but I don't mind soldered RAM and storage so long as I know in advance, and can change my configuration when purchasing. My older daughter has a Dell Latitude 5490 from school that I know does not work (at least with FreeBSD 12.1-RELEASE). Dell also has Modern Standby (hibernation) issues with the XPS line. (At least under Windows 10 closing your Dell XPS 9570 and then putting it into a bag will void your warranty. ) I've heard good things about Lenovo, especially the Thinkpad X1 Carbon. However it looks like their current wifi is not supported on FreeBSD. Lenovo recently announced support for Linux on all their machines, but their website only lists four models, and of course Linux support doesn't mean FreeBSD works. I would prefer to buy a new, current model so that I can get warranty service for the hardware if needed. I really don't want to pay more than what a Mac Book Pro costs. If new machines aren't well supported, what specific used machines do people recommend? How about a suggestion as to where to buy other than Amazon, Micro Center, or Newegg? I've used them before, but maybe I'm overlooking a better place. I'd love to find a place that I could walk into, and plug in my FreeBSD USB stick to test the hardware, but online is OK. The places I've gone to lock the machines down, and won't let you boot your own OS. Other than ebay and Craig's List, where are good places to find used machines in good condition? So does anyone have any suggestions for a good daily laptop running FreeBSD? -- Brian Reynolds -- reynolds at panix.com "Long ago, it was the way of my people to travel to the Moon. My people travelled to the Moon in a ship called 'Apollo.' I tell the story of Apollo in the hope that some day, my people will again travel to the Moon." P. Alway From pete at nomadlogic.org Thu Oct 8 15:15:29 2020 From: pete at nomadlogic.org (Pete Wright) Date: Thu, 8 Oct 2020 12:15:29 -0700 Subject: [talk] FreeBSD laptop advice In-Reply-To: <20201008181320.GB8915@panix.com> References: <20201008181320.GB8915@panix.com> Message-ID: <96be086b-796a-1686-752c-adeaa0620487@nomadlogic.org> On 10/8/20 11:13 AM, Brian Reynolds wrote: > As luck would have it my laptop died at the beginning of Stay At Home. > > I'm looking for advice on a laptop to buy that will run FreeBSD > RELEASE. I know about the FreeBSD wiki Laptop page, and NYC BUG's > dmesg site, but I'm hoping to hear additional real world experience > from folks running FreeBSD as their daily machine. > > This laptop will mostly be used for web browsing, command line email, > and administrating my home network. I expect to boot ZFS (hence > FreeBSD), and tinker with virtualbox, jails, and maybe bhyve, but I > have a desktop for any heavy lifting. > > I want an IPS display with a resolution of at least 1920x1080. I'd > prefer a 15-inch display, but might settle for 13-inch. I need > wireless to work. The whole point is to be able to take the laptop > around the house, and not be stuck in my computer room. I also want > suspend/resume to work. > > I don't care if bluetooth works. I guess if the trackpad is crappy > enough I'd use a wireless mouse, but I don't mind using a Logitech > mouse with one of their non-bluetooth USB dongles. I really want a > three button mouse/trackpad, so I could wind up with a wireless mouse > even if the trackpad is OK. Integrated graphics are fine. It would > be nice if it's user upgradable, but I don't mind soldered RAM and > storage so long as I know in advance, and can change my configuration > when purchasing. > > My older daughter has a Dell Latitude 5490 from school that I know > does not work (at least with FreeBSD 12.1-RELEASE). Dell also has > Modern Standby (hibernation) issues with the XPS line. (At least > under Windows 10 closing your Dell XPS 9570 and then putting it into a > bag will void your warranty. > ) > > I've heard good things about Lenovo, especially the Thinkpad X1 > Carbon. However it looks like their current wifi is not supported on > FreeBSD. Lenovo recently announced support for Linux on all their > machines, but their website only lists four models, and of course > Linux support doesn't mean FreeBSD works. I have a Lenovo Thinkpad P43s that I run CURRENT on as my daily driver for work.? It is an interesting system b/c it has 2 GPU's, and integrated Intel this is the primary one and drives the display as well as a secondary Nvidia GPU which can be used on a per app basis.? I've got this working pretty good with some out of tree patches that I'm hoping to get merged at some point. Now to be honest I wouldn't recommend this as a general purpose laptop though due to the Nvidia secondary CPU - *but* I can report that pretty much all the hardware in that laptop including the wireless NIC is well supported.? So it might be worth seeing if there is a comparable system in the "mobile workstation" range from Lenovo without the second Nvidia GPU that is in your price range. In terms of hardware durability, the screen and battery life it's a Thinkpad and still has the build quality you'd expect IMHO. There is also System76 who has some interesting gear.? Unfortunately they are very Linux-centric but they have hardware that is mostly compatible with FreeBSD at a good price point.? I'm not sure about their Coreboot implementation supporting FreeBSD, but I had a Gazelle with a traditional BIOS and it worked well. Cheers, -pete -- Pete Wright pete at nomadlogic.org @nomadlogicLA From kmsujit at gmail.com Fri Oct 9 08:10:46 2020 From: kmsujit at gmail.com (Sujit K M) Date: Fri, 9 Oct 2020 17:40:46 +0530 Subject: [talk] FreeBSD laptop advice In-Reply-To: <20201008181320.GB8915@panix.com> References: <20201008181320.GB8915@panix.com> Message-ID: On Fri, Oct 9, 2020, 12:30 AM Brian Reynolds < nycbug-talk at reynolds.users.panix.com> wrote: > As luck would have it my laptop died at the beginning of Stay At Home. > > I'm looking for advice on a laptop to buy that will run FreeBSD > RELEASE. I know about the FreeBSD wiki Laptop page, and NYC BUG's > dmesg site, but I'm hoping to hear additional real world experience > from folks running FreeBSD as their daily machine. > You should be extra careful. My laptop old doesn't install freebsd 10+. > > This laptop will mostly be used for web browsing, command line email, > and administrating my home network. I expect to boot ZFS (hence > FreeBSD), and tinker with virtualbox, jails, and maybe bhyve, but I > have a desktop for any heavy lifting. > > I want an IPS display with a resolution of at least 1920x1080. I'd > prefer a 15-inch display, but might settle for 13-inch. I need > wireless to work. The whole point is to be able to take the laptop > around the house, and not be stuck in my computer room. I also want > suspend/resume to work. > > I don't care if bluetooth works. I guess if the trackpad is crappy > enough I'd use a wireless mouse, but I don't mind using a Logitech > mouse with one of their non-bluetooth USB dongles. I really want a > three button mouse/trackpad, so I could wind up with a wireless mouse > even if the trackpad is OK. Integrated graphics are fine. It would > be nice if it's user upgradable, but I don't mind soldered RAM and > storage so long as I know in advance, and can change my configuration > when purchasing. > > My older daughter has a Dell Latitude 5490 from school that I know > does not work (at least with FreeBSD 12.1-RELEASE). Dell also has > Modern Standby (hibernation) issues with the XPS line. (At least > under Windows 10 closing your Dell XPS 9570 and then putting it into a > bag will void your warranty. > >) > > I've heard good things about Lenovo, especially the Thinkpad X1 > Carbon. However it looks like their current wifi is not supported on > FreeBSD. Lenovo recently announced support for Linux on all their > machines, but their website only lists four models, and of course > Linux support doesn't mean FreeBSD works. > > I would prefer to buy a new, current model so that I can get warranty > service for the hardware if needed. > > I really don't want to pay more than what a Mac Book Pro costs. > > If new machines aren't well supported, what specific used machines do > people recommend? > > How about a suggestion as to where to buy other than Amazon, Micro > Center, or Newegg? I've used them before, but maybe I'm overlooking a > better place. I'd love to find a place that I could walk into, and > plug in my FreeBSD USB stick to test the hardware, but online is OK. > The places I've gone to lock the machines down, and won't let you boot > your own OS. > > Other than ebay and Craig's List, where are good places to find used > machines in good condition? > > So does anyone have any suggestions for a good daily laptop running > FreeBSD? > > -- > Brian Reynolds -- reynolds at panix.com > "Long ago, it was the way of my people to travel to the Moon. My people > travelled to the Moon in a ship called 'Apollo.' I tell the story of Apollo > in the hope that some day, my people will again travel to the Moon." P. > Alway > > _______________________________________________ > talk mailing list > talk at lists.nycbug.org > http://lists.nycbug.org:8080/mailman/listinfo/talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From imp at bsdimp.com Fri Oct 9 13:20:55 2020 From: imp at bsdimp.com (Warner Losh) Date: Fri, 9 Oct 2020 11:20:55 -0600 Subject: [talk] FreeBSD laptop advice In-Reply-To: References: <20201008181320.GB8915@panix.com> Message-ID: On Fri, Oct 9, 2020 at 6:14 AM Sujit K M wrote: > > > On Fri, Oct 9, 2020, 12:30 AM Brian Reynolds < > nycbug-talk at reynolds.users.panix.com> wrote: > >> As luck would have it my laptop died at the beginning of Stay At Home. >> >> I'm looking for advice on a laptop to buy that will run FreeBSD >> RELEASE. I know about the FreeBSD wiki Laptop page, and NYC BUG's >> dmesg site, but I'm hoping to hear additional real world experience >> from folks running FreeBSD as their daily machine. >> > > You should be extra careful. My laptop old doesn't install freebsd 10+. > Which one do you have? I have several older laptops that work just fine with -current. Warner >> This laptop will mostly be used for web browsing, command line email, >> and administrating my home network. I expect to boot ZFS (hence >> FreeBSD), and tinker with virtualbox, jails, and maybe bhyve, but I >> have a desktop for any heavy lifting. >> >> I want an IPS display with a resolution of at least 1920x1080. I'd >> prefer a 15-inch display, but might settle for 13-inch. I need >> wireless to work. The whole point is to be able to take the laptop >> around the house, and not be stuck in my computer room. I also want >> suspend/resume to work. >> >> I don't care if bluetooth works. I guess if the trackpad is crappy >> enough I'd use a wireless mouse, but I don't mind using a Logitech >> mouse with one of their non-bluetooth USB dongles. I really want a >> three button mouse/trackpad, so I could wind up with a wireless mouse >> even if the trackpad is OK. Integrated graphics are fine. It would >> be nice if it's user upgradable, but I don't mind soldered RAM and >> storage so long as I know in advance, and can change my configuration >> when purchasing. >> >> My older daughter has a Dell Latitude 5490 from school that I know >> does not work (at least with FreeBSD 12.1-RELEASE). Dell also has >> Modern Standby (hibernation) issues with the XPS line. (At least >> under Windows 10 closing your Dell XPS 9570 and then putting it into a >> bag will void your warranty. >> > >) >> >> I've heard good things about Lenovo, especially the Thinkpad X1 >> Carbon. However it looks like their current wifi is not supported on >> FreeBSD. Lenovo recently announced support for Linux on all their >> machines, but their website only lists four models, and of course >> Linux support doesn't mean FreeBSD works. >> >> I would prefer to buy a new, current model so that I can get warranty >> service for the hardware if needed. >> >> I really don't want to pay more than what a Mac Book Pro costs. >> >> If new machines aren't well supported, what specific used machines do >> people recommend? >> >> How about a suggestion as to where to buy other than Amazon, Micro >> Center, or Newegg? I've used them before, but maybe I'm overlooking a >> better place. I'd love to find a place that I could walk into, and >> plug in my FreeBSD USB stick to test the hardware, but online is OK. >> The places I've gone to lock the machines down, and won't let you boot >> your own OS. >> >> Other than ebay and Craig's List, where are good places to find used >> machines in good condition? >> >> So does anyone have any suggestions for a good daily laptop running >> FreeBSD? >> >> -- >> Brian Reynolds -- reynolds at panix.com >> "Long ago, it was the way of my people to travel to the Moon. My people >> travelled to the Moon in a ship called 'Apollo.' I tell the story of >> Apollo >> in the hope that some day, my people will again travel to the Moon." P. >> Alway >> >> _______________________________________________ >> talk mailing list >> talk at lists.nycbug.org >> http://lists.nycbug.org:8080/mailman/listinfo/talk >> > _______________________________________________ > talk mailing list > talk at lists.nycbug.org > http://lists.nycbug.org:8080/mailman/listinfo/talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nonesuch at longcount.org Fri Oct 9 14:25:39 2020 From: nonesuch at longcount.org (Mark Saad) Date: Fri, 9 Oct 2020 14:25:39 -0400 Subject: [talk] FreeBSD laptop advice In-Reply-To: <96be086b-796a-1686-752c-adeaa0620487@nomadlogic.org> References: <20201008181320.GB8915@panix.com> <96be086b-796a-1686-752c-adeaa0620487@nomadlogic.org> Message-ID: Brian In a similar vein as Pete I have a Thinkpad x250 i picked up second hand on ebay for about 200 USD. It runs FreeBSD and OpenBSD with much issue. The biggest headache is the touchpad. See this site for some good advice on FreeBSD on the x250 but much of it applies to other models in general. https://www.c0ffee.net/blog/freebsd-on-a-laptop/ Other than that it came with a 1440x900 something lcd and 250G spinning disk. I swapped out the LCD for the 1080p which I found on amazon for ~75USD and I used my old desktop SSD . All in all I spent about 250 - 275 I don't exactly remember. But in short I am happy with this Thinkpad as a FreeBSD laptop. I have used HP, Dell and Acer laptops in the past, I personally think the Thinkpad had the least amount of weird crap . On Thu, Oct 8, 2020 at 3:16 PM Pete Wright wrote: > > > > On 10/8/20 11:13 AM, Brian Reynolds wrote: > > As luck would have it my laptop died at the beginning of Stay At Home. > > > > I'm looking for advice on a laptop to buy that will run FreeBSD > > RELEASE. I know about the FreeBSD wiki Laptop page, and NYC BUG's > > dmesg site, but I'm hoping to hear additional real world experience > > from folks running FreeBSD as their daily machine. > > > > This laptop will mostly be used for web browsing, command line email, > > and administrating my home network. I expect to boot ZFS (hence > > FreeBSD), and tinker with virtualbox, jails, and maybe bhyve, but I > > have a desktop for any heavy lifting. > > > > I want an IPS display with a resolution of at least 1920x1080. I'd > > prefer a 15-inch display, but might settle for 13-inch. I need > > wireless to work. The whole point is to be able to take the laptop > > around the house, and not be stuck in my computer room. I also want > > suspend/resume to work. > > > > I don't care if bluetooth works. I guess if the trackpad is crappy > > enough I'd use a wireless mouse, but I don't mind using a Logitech > > mouse with one of their non-bluetooth USB dongles. I really want a > > three button mouse/trackpad, so I could wind up with a wireless mouse > > even if the trackpad is OK. Integrated graphics are fine. It would > > be nice if it's user upgradable, but I don't mind soldered RAM and > > storage so long as I know in advance, and can change my configuration > > when purchasing. > > > > My older daughter has a Dell Latitude 5490 from school that I know > > does not work (at least with FreeBSD 12.1-RELEASE). Dell also has > > Modern Standby (hibernation) issues with the XPS line. (At least > > under Windows 10 closing your Dell XPS 9570 and then putting it into a > > bag will void your warranty. > > ) > > > > I've heard good things about Lenovo, especially the Thinkpad X1 > > Carbon. However it looks like their current wifi is not supported on > > FreeBSD. Lenovo recently announced support for Linux on all their > > machines, but their website only lists four models, and of course > > Linux support doesn't mean FreeBSD works. > > I have a Lenovo Thinkpad P43s that I run CURRENT on as my daily driver > for work. It is an interesting system b/c it has 2 GPU's, and > integrated Intel this is the primary one and drives the display as well > as a secondary Nvidia GPU which can be used on a per app basis. I've > got this working pretty good with some out of tree patches that I'm > hoping to get merged at some point. > > Now to be honest I wouldn't recommend this as a general purpose laptop > though due to the Nvidia secondary CPU - *but* I can report that pretty > much all the hardware in that laptop including the wireless NIC is well > supported. So it might be worth seeing if there is a comparable system > in the "mobile workstation" range from Lenovo without the second Nvidia > GPU that is in your price range. In terms of hardware durability, the > screen and battery life it's a Thinkpad and still has the build quality > you'd expect IMHO. > > > There is also System76 who has some interesting gear. Unfortunately > they are very Linux-centric but they have hardware that is mostly > compatible with FreeBSD at a good price point. I'm not sure about their > Coreboot implementation supporting FreeBSD, but I had a Gazelle with a > traditional BIOS and it worked well. > > Cheers, > -pete > > -- > Pete Wright > pete at nomadlogic.org > @nomadlogicLA > > _______________________________________________ > talk mailing list > talk at lists.nycbug.org > http://lists.nycbug.org:8080/mailman/listinfo/talk -- mark saad | nonesuch at longcount.org From kmsujit at gmail.com Fri Oct 9 23:09:12 2020 From: kmsujit at gmail.com (Sujit K M) Date: Sat, 10 Oct 2020 08:39:12 +0530 Subject: [talk] FreeBSD laptop advice In-Reply-To: References: <20201008181320.GB8915@panix.com> Message-ID: On Fri, Oct 9, 2020, 10:51 PM Warner Losh wrote: > > > On Fri, Oct 9, 2020 at 6:14 AM Sujit K M wrote: > >> >> >> On Fri, Oct 9, 2020, 12:30 AM Brian Reynolds < >> nycbug-talk at reynolds.users.panix.com> wrote: >> >>> As luck would have it my laptop died at the beginning of Stay At Home. >>> >>> I'm looking for advice on a laptop to buy that will run FreeBSD >>> RELEASE. I know about the FreeBSD wiki Laptop page, and NYC BUG's >>> dmesg site, but I'm hoping to hear additional real world experience >>> from folks running FreeBSD as their daily machine. >>> >> >> You should be extra careful. My laptop old doesn't install freebsd 10+. >> > > Which one do you have? I have several older laptops that work just fine > with -current. > Dell Inspiron. I used to have freebsd installed till 10. I think it's more to do with upgrade rather than reinstall. > > Warner > > >>> This laptop will mostly be used for web browsing, command line email, >>> and administrating my home network. I expect to boot ZFS (hence >>> FreeBSD), and tinker with virtualbox, jails, and maybe bhyve, but I >>> have a desktop for any heavy lifting. >>> >>> I want an IPS display with a resolution of at least 1920x1080. I'd >>> prefer a 15-inch display, but might settle for 13-inch. I need >>> wireless to work. The whole point is to be able to take the laptop >>> around the house, and not be stuck in my computer room. I also want >>> suspend/resume to work. >>> >>> I don't care if bluetooth works. I guess if the trackpad is crappy >>> enough I'd use a wireless mouse, but I don't mind using a Logitech >>> mouse with one of their non-bluetooth USB dongles. I really want a >>> three button mouse/trackpad, so I could wind up with a wireless mouse >>> even if the trackpad is OK. Integrated graphics are fine. It would >>> be nice if it's user upgradable, but I don't mind soldered RAM and >>> storage so long as I know in advance, and can change my configuration >>> when purchasing. >>> >>> My older daughter has a Dell Latitude 5490 from school that I know >>> does not work (at least with FreeBSD 12.1-RELEASE). Dell also has >>> Modern Standby (hibernation) issues with the XPS line. (At least >>> under Windows 10 closing your Dell XPS 9570 and then putting it into a >>> bag will void your warranty. >>> < >>> https://www.dell.com/community/XPS/FAQ-Modern-Standby/m-p/7514448#M55308 >>> >) >>> >>> I've heard good things about Lenovo, especially the Thinkpad X1 >>> Carbon. However it looks like their current wifi is not supported on >>> FreeBSD. Lenovo recently announced support for Linux on all their >>> machines, but their website only lists four models, and of course >>> Linux support doesn't mean FreeBSD works. >>> >>> I would prefer to buy a new, current model so that I can get warranty >>> service for the hardware if needed. >>> >>> I really don't want to pay more than what a Mac Book Pro costs. >>> >>> If new machines aren't well supported, what specific used machines do >>> people recommend? >>> >>> How about a suggestion as to where to buy other than Amazon, Micro >>> Center, or Newegg? I've used them before, but maybe I'm overlooking a >>> better place. I'd love to find a place that I could walk into, and >>> plug in my FreeBSD USB stick to test the hardware, but online is OK. >>> The places I've gone to lock the machines down, and won't let you boot >>> your own OS. >>> >>> Other than ebay and Craig's List, where are good places to find used >>> machines in good condition? >>> >>> So does anyone have any suggestions for a good daily laptop running >>> FreeBSD? >>> >>> -- >>> Brian Reynolds -- reynolds at panix.com >>> "Long ago, it was the way of my people to travel to the Moon. My people >>> travelled to the Moon in a ship called 'Apollo.' I tell the story of >>> Apollo >>> in the hope that some day, my people will again travel to the Moon." P. >>> Alway >>> >>> _______________________________________________ >>> talk mailing list >>> talk at lists.nycbug.org >>> http://lists.nycbug.org:8080/mailman/listinfo/talk >>> >> _______________________________________________ >> talk mailing list >> talk at lists.nycbug.org >> http://lists.nycbug.org:8080/mailman/listinfo/talk >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From factotum at rclayton.org Wed Oct 28 19:25:41 2020 From: factotum at rclayton.org (R. Clayton) Date: Wed, 28 Oct 2020 19:25:41 -0400 Subject: [talk] lex start conditions. Message-ID: I'm working with a 40-year-old lex program that uses statements like BEGIN PROGRAM + 1; I understand what BEGIN PROGRAM; does, but what is the intention of the "+ 1"? Does it skip the first rule in the context? The generated code suggests not, but I haven't dug into it too deeply. Does it select the context listed after the context? That seems slightly more plausible, but a test lex program doesn't support that intention (it's likely the test program is ineffectively written). I'm using flex, not a 40-year-old version of lex. For completeness, here's the test program: $ cat t.lex %s A B C %% BEGIN A; [BC] if (yytext[0] == 'B') BEGIN B + 1; else BEGIN C; . printf("A: '%c'\n", yytext[0]); [AC] if (yytext[0] == 'A') BEGIN A; else BEGIN C; . printf("B: '%c'\n", yytext[0]); [AB] if (yytext[0] == 'A') BEGIN A; else BEGIN B; . printf("C: '%c'\n", yytext[0]); %% main() { yylex(); } $ echo abcBabc | ./a.out A: 'a' A: 'b' A: 'c' B: 'a' B: 'b' B: 'c' $ From imp at bsdimp.com Wed Oct 28 21:04:09 2020 From: imp at bsdimp.com (Warner Losh) Date: Wed, 28 Oct 2020 19:04:09 -0600 Subject: [talk] lex start conditions. In-Reply-To: References: Message-ID: 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... Warner On Wed, Oct 28, 2020 at 6:31 PM R. Clayton wrote: > I'm working with a 40-year-old lex program that uses statements like > > BEGIN PROGRAM + 1; > > I understand what > > BEGIN PROGRAM; > > does, but what is the intention of the "+ 1"? Does it skip the first rule > in > the context? The generated code suggests not, but I haven't dug > into > it too deeply. Does it select the context listed after the > context? > That seems slightly more plausible, but a test lex program doesn't support > that > intention (it's likely the test program is ineffectively written). I'm > using > flex, not a 40-year-old version of lex. > > For completeness, here's the test program: > > $ cat t.lex > %s A B C > > %% > BEGIN A; > > [BC] if (yytext[0] == 'B') BEGIN B + 1; else BEGIN C; > . printf("A: '%c'\n", yytext[0]); > > [AC] if (yytext[0] == 'A') BEGIN A; else BEGIN C; > . printf("B: '%c'\n", yytext[0]); > > [AB] if (yytext[0] == 'A') BEGIN A; else BEGIN B; > . printf("C: '%c'\n", yytext[0]); > > %% > > main() { yylex(); } > > $ echo abcBabc | ./a.out > A: 'a' > A: 'b' > A: 'c' > B: 'a' > B: 'b' > B: 'c' > > $ > > _______________________________________________ > talk mailing list > talk at lists.nycbug.org > http://lists.nycbug.org:8080/mailman/listinfo/talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From factotum at rclayton.org Wed Oct 28 21:44:46 2020 From: factotum at rclayton.org (R. Clayton) Date: Wed, 28 Oct 2020 21:44:46 -0400 Subject: [talk] lex start conditions. In-Reply-To: (message from Warner Losh on Wed, 28 Oct 2020 19:04:09 -0600) References: Message-ID: It's van Wyk's thesis work under Knuth on Ideal, a constraint-based little language for describing pictures, so I'm guessing it's from whatever they had going at Stanford in the late '70s. I'm hoping it's a common-knowledge idiom that has subsided into obscurity over time, and I'm trying to find long-timer who will look at it and say "Oh yeah, that...". I've got the v7 lex source, but I want to avoid as much software archaeology as possible (sez the person trying to resurrect 40-year-old software). I've looked at the flex-generated code and it's baffling to me; maybe the lex-generated code will be simpler, but I though I might do everything else before I do the right thing, as Churchill said. Thanks for your reply. From pete at nomadlogic.org Thu Oct 29 12:31:43 2020 From: pete at nomadlogic.org (Pete Wright) Date: Thu, 29 Oct 2020 09:31:43 -0700 Subject: [talk] lex start conditions. In-Reply-To: References: Message-ID: <37f68984-bc8b-ce8b-a424-e18d41d96a20@nomadlogic.org> On 10/28/20 6:44 PM, R. Clayton wrote: > It's van Wyk's thesis work under Knuth on Ideal, a constraint-based little > language for describing pictures, so I'm guessing it's from whatever they had > going at Stanford in the late '70s. I'm hoping it's a common-knowledge idiom > that has subsided into obscurity over time, and I'm trying to find long-timer > who will look at it and say "Oh yeah, that...". If you aren't already subscribed to TUHS (https://minnie.tuhs.org/mailman/listinfo/tuhs) it might be worth sending a message to that list.? I've found it really useful resource for things like this, often getting information directly from the people involved. -p -- Pete Wright pete at nomadlogic.org @nomadlogicLA From imp at bsdimp.com Thu Oct 29 15:34:16 2020 From: imp at bsdimp.com (Warner Losh) Date: Thu, 29 Oct 2020 13:34:16 -0600 Subject: [talk] lex start conditions. In-Reply-To: <37f68984-bc8b-ce8b-a424-e18d41d96a20@nomadlogic.org> References: <37f68984-bc8b-ce8b-a424-e18d41d96a20@nomadlogic.org> Message-ID: On Thu, Oct 29, 2020 at 10:31 AM Pete Wright wrote: > > > On 10/28/20 6:44 PM, R. Clayton wrote: > > It's van Wyk's thesis work under Knuth on Ideal, a constraint-based > little > > language for describing pictures, so I'm guessing it's from whatever > they had > > going at Stanford in the late '70s. I'm hoping it's a common-knowledge > idiom > > that has subsided into obscurity over time, and I'm trying to find > long-timer > > who will look at it and say "Oh yeah, that...". > > If you aren't already subscribed to TUHS > (https://minnie.tuhs.org/mailman/listinfo/tuhs) it might be worth > sending a message to that list. I've found it really useful resource > for things like this, often getting information directly from the people > involved. > Late 70's would be either the PWB version of lex, or the V7 version. But looking at the V7 version, we see header.c: fprintf(fout,"# define BEGIN yybgin = yysvec + 1 +\n"); but today's flex generates: #define BEGIN (yy_start) = 1 + 2 * so the +1 could get to the other half. Lex generates #defines for each of these states that are sequential. Rummaging around in the code a bit, I see that yy_at_bol is used when we're at the start of the line. It's 1 at start of line and 0 otherwise. So my best guess is that the PROGRAM+1 transitions to the parser state as if it were the start of the line (or is trying to) even if it really isn't at the start of a line. The matches this that I found in the flex manual: The macro yy_set_bol(at_bol) can be used to control whether the current buffer's scanning context for the next token match is done as though at the beginning of a line. A non-zero macro argument makes rules anchored with '^' active, while a zero argument makes '^' rules inactive. The macro YY_AT_BOL() returns true if the next token scanned from the current buffer will have '^' rules active, false otherwise. as well as scattered references to line based parsing. The next layer of details, though, requires more study than I have time for right now :) Reading your grammar that way, does it track? Warner -------------- next part -------------- An HTML attachment was scrubbed... URL: