Unix text files

Bill Vaughn bill at ur-cvsvax.UUCP
Thu Oct 31 07:55:29 AEST 1985


> > "Text consists of an ordered sequence of characters, with lines delimited
> > by newline characters.  Text is normally terminated by a newline.  This
> > newline should be considered to be followed by a (nonexistant) null line.
> > The null line should not be considered to be part of the text.
> > 	"If the last character of the text is not a newline, then consider
> > the text to be terminated by a newline - null line pair; however, this
> > newline - null line pair should not be considered to have been part of
> > the file.
> > 
> > I *think* that's right...
> > 							Kay.
> 
> Perhaps that is the best interpretation, but it sure is hard
> to put all that into a formal grammar, whereas the original
> concept was very simple:
> 
> file		::=	binary_file	|	text_file
> binary_file	::=	{ byte }*
> byte		::=	<primitive unit of data, at least 8 bits>
> text_file	::=	{ text_line }*
> text_line	::=	{ text_char }* newline
> text_char	::=	<7-bit ASCII character excluding NUL and newline>
> newline	::=	<ASCII LF character>

Won't this change do it:

text_file	::=	{ text_line }*  { text_char }*

I'm assuming that { something }*  means zero or more occurences
of 'something'.  I don't mean to imply that the change is desirable or
trivial, but it doesn't seem to be 'hard'.

Bill Vaughn
Univ. of Rochester



More information about the Comp.unix mailing list