Path: csiph.com!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: Giacinto Cifelli Newsgroups: comp.compilers Subject: Re: Do people create parsers for command line arguments? Date: Mon, 8 Aug 2022 18:25:18 +0200 Organization: Compilers Central Lines: 28 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <22-08-001@comp.compilers> References: <22-07-054@comp.compilers> <22-07-057@comp.compilers> <22-07-059@comp.compilers> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="27550"; mail-complaints-to="abuse@iecc.com" Keywords: parse Posted-Date: 08 Aug 2022 23:17:23 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com In-Reply-To: <22-07-059@comp.compilers> Xref: csiph.com comp.compilers:3150 in general the linux command line arguments are parsed through getopt(3) https://www.man7.org/linux/man-pages/man3/getopt.3.html and it is better not to implement special things on the command line, because it could be pre-parsed or expanded by the shell itself. then if you want to pass a string on the command line, that is different, but then again, it is better to take it from stdin. On Sat, Jul 30, 2022 at 1:00 AM gah4 wrote: > > On Friday, July 29, 2022 at 2:49:38 PM UTC-7, Kaz Kylheku wrote: > > (snip) > > > All of these programs must be parsing. They have phrase structures > > and operator precedence with parentheses right the command line. > > It seems to me that this is the important part. The simplest processing > of a command line might not count as parsing. > > If one processes an arithmetic expression left to right, with no precedence, > that might not count as parsing. Is two different precedence levels enough? > > My first thought of the question was for machine generated vs. > hand written parsers. When does it get complicated enough to make > it worth using a parser generator?