Blitz Lexer and Beautifier

Community Forums/Showcase/Blitz Lexer and Beautifier

Steve Hill(Posted 2003) [#1]
I just uploaded a lexical analyser and Blitz "beautifier" to the misc. section of the Code Archives.

The former lets you write code to do things like pre-process Blitz code. The latter is an example of what you can do. The beautifier takes Blitz source and creates what it considers to be a beautiful version of the code.

Its likely that if your code is already pretty it will uglify it!

I hope someone finds these useful.

Steve ... no fancy sig.


Mystik(Posted 2003) [#2]
This is great thanks. I was just about to start making a source code converter for a little project I'm working on. This will save me loads of time.

One small problem, it converts => to = > in IF statements and that causes an error.

Steve.


Rob Farley(Posted 2003) [#3]
Just tried it out on a couple of bits of my code... it's really good!

Not come across any bugs yet, but I'm sure if I fire a few of my more complex bits of code through it some errors might pop out the other end!

One additional feature would be to beautify ; statements too, make sure there's plenty of room round them, if there's a bunch of them bunched up then keep them bunched but make sure there's a space after the ; and spacing above and below.

Just a thought, fantastic work though.


Steve Hill(Posted 2003) [#4]

One small problem, it converts => to = > in IF statements and that causes an error.



My fault ... I only use >=

Its easy to fix. I'll fix it when I next get a chance.

Cheers,

Steve.


Qcat(Posted 2003) [#5]
Steve

Nice tool it definitely dues a good job of making my ugly code beautiful! I am with Dr Av about statement tidying has well,

It is a really good tool and definitely one I will be using on a regular basses

Thanks
Qcat


Steve Hill(Posted 2003) [#6]
I have now added support for operators ><, => and =< which are (undocumented so far as I can tell) variants of <>, >= and <=, so the Beautifier shouldn't split them up any more.

Thanks for the positive feedbacks. I'll see what I can do about the requests, but I really ought to get on with some 3D stuff!!

Steve.


Qcat(Posted 2003) [#7]
Cool thanks