Look Ma, so semicolons!

Thread Starter

ApacheKid

Joined Jan 12, 2015
1,619
I've taken a short break from some of the stuff I was doing with IPL and revisited some of the early grammar assumptions. Being derived from PL/I meant that I unquestioningly incorporated the semicolon statement terminator and this works fine but I decided to explore options for eliminating it.

It's too early to say if this is workable but I have devised an alternative lexical approach and it seems to be OK.

This test code parses:

1676918679833.png

Yielding this parse tree:

1676918710441.png

I'm now looking to see if there are any grammatical forms in IPL that might not work in these scheme, if there are I will see if they can be modified to work in this semicolon free world.

The above grammar is very simplified, it does however show keywords being used as identifiers. This baby grammar being used just to prove the point, but the core take aways here are

1. No semicolon is required to terminate statements
2. No continuation character is needed to spread statements across multiple lines
3. No semicolon is required if we have multiple statements on the same line.

If I can pull this off it'll be good, having no semicolons is definitely an improvement.
 
Top