[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Software fault forces Ford recall

Lawrence Dickson wrote:

> Adrian's discussion of people's reasons for disliking
> occam syntax was, I thought, excellent. Isn't it
> really a non-problem, in the sense that a preprocessor
> could take in C-looking input and output standard
> occam?
>    (1) Indentation could be replaced by end-of-block
> symbols .
>    I used to use --END SEQ and similar a lot, to clarify
> depth of multiple indentations.
>    (2) C-to-occam translation, like curly bracket for
> SEQ and close curly bracket for --END SEQ
>    Something special for PAR... ?
>    (3) Semicolons to replace newlines, etc.
> There are many other details of course, but that would
> fix the most obvious visible differences.
>    I am in total agreement on fold editors. Those who
> object to them haven't used them (or don't write
> structured code). I rarely use any other.

Having written the grand total of one compiler, I am neither beginner nor expert on compiler implementation. But I will
say this of occam compilers: changing the concrete grammar *should* be easy. Kroc and Spoc could easily exist with two
syntax variants, without complicating the build and test suites overly much. What is needed is someone to define the
grammar for the new syntax variant such that the abstract syntax tree remains unchanged. Once this has been done, adding
a new parser is not hard.

So my assertion is that the hard part is agreeing on the new grammar. The easy part is implementing it.

For my own preference: I like the uppercase keywords, I don't care all that much for indentation: curlies are ok (but
wouldn't it be nice if everyone put the { on a new line!), I don't like occam's line-continuation rules. Also, in my own
compiler, it turned out much easier to implement a grammar that recognised ';' as the end-of-statement marker.

Folding editors are a useful convenience, like syntax-colouring editors. They're not essential but rather nice to have.


tel;pager:ICQ: 56840977
tel;cell:MSN/Hotmail: richardbeton@xxxxxxxxxxx
tel;fax:01794 833434
tel;work:01794 833458
org:Roke Manor Research Limited;Internet Technology & Networks
adr:;;Roke Manor: http://www.roke.co.uk/;;;SO51 0ZN;UK
title:Internet Consultant
note;quoted-printable:The information contained in this e-mail is confidential and must =0D=0Anot be passed to any third party without permission. This =0D=0Acommunication is for information only and shall not create =0D=0Aor change any contractual relationship. =0D=0A
fn:Rick Beton

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature