Deutsch English Français Italiano |
<vhpl9c$14mdr$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Muttley@DastartdlyHQ.org Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc Subject: Re: Command Languages Versus Programming Languages Date: Fri, 22 Nov 2024 10:09:48 -0000 (UTC) Organization: A noiseless patient Spider Lines: 30 Message-ID: <vhpl9c$14mdr$1@dont-email.me> References: <uu54la$3su5b$6@dont-email.me> <87edbtz43p.fsf@tudado.org> <0d2cnVzOmbD6f4z7nZ2dnZfqnPudnZ2d@brightview.co.uk> <uusur7$2hm6p$1@dont-email.me> <vdf096$2c9hb$8@dont-email.me> <87a5fdj7f2.fsf@doppelsaurus.mobileactivedefense.com> <ve83q2$33dfe$1@dont-email.me> <vgsbrv$sko5$1@dont-email.me> <vgtslt$16754$1@dont-email.me> <86frnmmxp7.fsf@red.stonehenge.com> <vhk65t$o5i$1@dont-email.me> <vhkev7$29sc$1@dont-email.me> <20241121110710.49@kylheku.com> Injection-Date: Fri, 22 Nov 2024 11:09:48 +0100 (CET) Injection-Info: dont-email.me; posting-host="db1e6cbba22b211bfa08c9ad697b09ce"; logging-data="1202619"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19kOg2VcK4yqfAVnfT4w1HQ" Cancel-Lock: sha1:VhzWNRP2DjuFH3zhW8YgwRpdSs4= Bytes: 2232 On Thu, 21 Nov 2024 19:12:03 -0000 (UTC) Kaz Kylheku <643-408-1753@kylheku.com> boring babbled: >On 2024-11-20, Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote: >> I'm curious what you mean by Regexps presented in a "procedural" form. >> Can you give some examples? > >Here is an example: using a regex match to capture a C comment /* ... */ >in Lex compared to just recognizing the start sequence /* and handling >the discarding of the comment in the action. > >Without non-greedy repetition matching, the regex for a C comment is >quite obtuse. The procedural handling is straightforward: read >characters until you see a * immediately followed by a /. Its not that simple I'm afraid since comments can be commented out. eg: // int i; /* int j; /* int k; */ ++j; A C99 and C++ compiler would see "int j" and compile it, a regex would simply remove everything from the first /* to */. Also the same probably applies to #ifdef's.