Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 04 Jan 1999 17:42:19 +0900
From:      "Daniel C. Sobral" <dcs@newsguy.com>
To:        Andrzej Bialecki <abial@nask.pl>, freebsd-hackers@FreeBSD.ORG
Subject:   Re: FICL & Perl
Message-ID:  <36907EEB.1CDA8F55@newsguy.com>
References:  <Pine.BSF.4.02A.9901040841050.28333-100000@korin.warman.org.pl>

next in thread | previous in thread | raw e-mail | index | archive | help
Andrzej Bialecki wrote:
> 
> > Well, it is about as readable as a state machine can be. I didn't
> 
> Ok, after this introduction, it begins to look scary to me.. :-) _What_
> it's actually like, a 1.5MB Forth program? ;-)

:-)

Hey, if it is replacing a perl script, it can only be a state
machine. I could do it in lex, it would become much more readable, I
suppose. It might have been done in awk or with sh+sed, but I'm not
sure you could call it readable. :-)

It is a 10 Kb C program (plus a 1 Kb shell script with two CAT
<<EOF, one echo and a call to the C program), consisting basically
of a big loop through a nineteen states state machine (switch).

This program, as well as the script it replaces, is a preprocessor
whose basic function is transforming <line> into "<line>\n", but
with a few additional functions to annoy everyone's life (in
particular, converting //-style comments into C-style comments, and
quote-escaping).

--
Daniel C. Sobral			(8-DCS)
dcs@newsguy.com

	"Heart like a Gabriel, pure and white as ivory,
	soul like a lucifer, black and cold as a piece of lead."


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?36907EEB.1CDA8F55>