Category Archives: Language Design

Structured statements and expressions in Ocean

Now that I have my general parsing worked out and understand how I want to use indents and line breaks to give a two dimensional structure to my language, I need to think about the details of some of the … Continue reading

Posted in Language Design | Leave a comment

A case for multiple completed items in LR parser states.

In my earlier note about LR parsing I observed that  many simple grammars will only ever have at most one REDUCE action in any given state. This means that there is no need for an “action table” to list which … Continue reading

Posted in Language Design | Leave a comment

Line breaks – a reprise.

In two previous articles I explored an approach to enhancing an LR parser to work with indents and line breaks.  While I discovered some useful ideas and produced some code that seemed to work, I’ve subsequently discovered some serious flaws … Continue reading

Posted in Language Design | Leave a comment

Linebreaks in a two-dimensional language

My previous note introduced the problem of parsing a two-dimensional language and the need to pay attention to indenting and line breaks and use them to guide the parsing of the language, both to enhance error detection, and to resolve … Continue reading

Posted in Language Design | Leave a comment

Parsing a two-dimensional language.

Many programming languages are essentially one dimensional.  The parser treats them simply as a linear sequence of tokens.  A program could all be written on a single line, or with each token on a separate line and the parser or … Continue reading

Posted in Language Design | 1 Comment

Parsing LR grammars

It is time for another diversion, but it is leading towards the language design – honest. LR grammars are a tool for specifying the grammar for a language, and it is fairly easy to automatically generate a parsing tool from … Continue reading

Posted in Language Design | 2 Comments

Lexical Structure

It is traditional to divide the parsing of a program into two conceptually separate stages – the lexical analysis which extracts a stream of tokens from a stream of characters, and the grammar matching stage which gathers those tokens into … Continue reading

Posted in Language Design | 4 Comments

Literate programming?

I was going to start out by describing the lexical structure of Ocean, but as I thought more about it, I realised there was something that needed to come first.  And that something is literate programming. Literate programming is the … Continue reading

Posted in Language Design | Leave a comment

The naming of a language

“The naming of cats is a difficult matter, It isn’t just one of your holiday games.”  The naming of programming languages is also important.  As with any project a name is needed to be able to refer to, and it … Continue reading

Posted in Language Design | 3 Comments

An exercise in Language Design

When I was doing my honours year in Computer Science (UNSW, 1986) I wanted to design a new programming language.  That would be a rather large project for an honours year and naturally it didn’t happen.  I have remained interested … Continue reading

Posted in Language Design | Leave a comment