Friday, February 6, 2009

Haskell FreeType binding

Copperbox revision 456.

More work on the Outline API.

Haskell FreeType binding

Copperbox revision 455.

I've changed the representation of the type FT_Outline.

The corresponding C type is not an opaque handle, its a struct so it needs filling out. I hadn't really been sure what to do about this - most of the FFI examples I've looked at a fortunate enough to have to deal with opaque handles for a lot of the crossing over into C. I did find a nice example idiom that does what I want in the the Time library on Hackage (the getCTimeval function in the Data.Time.Clock.CTimeval module) .

GLSL syntax library

Copperbox revision 454.

I've changed the syntax tree to use Data.Seq rather than lists, Seq allows snoc-ing (adding to the right), so this means that I can take out the revlist productions from the parser (which only reversed a backwards list). This gets the parser back to being almost identical to the grammar.

Also I've filled out the pretty printer so all the datatypes have a corresponding Pretty instance.

Thursday, February 5, 2009

GLSL syntax library

Copperbox revision 453.

The GLSL parser is now complete, that's to say all the productions of the grammar are implemented and there are no actions with undefined. There is one shift reduce conflict and there could certainly be errors.

The lexer isn't complete, and the abstract syntax tree isn't very abstract. It looks like I'll have to consider the current syntax tree to be nearer the concrete syntax and do a rewriting step after parsing. The main problem is declartors aren't very pleasing, the abstract syntax tree will probably have to remove coalescing so that:


int a, b = 0;


becomes


int a;
int b = 0;

GLSL syntax library

Copperbox revision 452.

The parser now compiles, but there are quite a lot of undefined's as actions. So it still is some way off working.

GLSL syntax library

Copperbox revision 451.

More work on the parser. All the productions are now in place, but still quite a bit of the AST needs defining.

Wednesday, February 4, 2009

GLSL syntax library

Copperbox revision 450.

More work on the parser - about half the productions are now stubbed.

Blog Archive

About Me

My photo
Disambiguating biog as there are a few Stephen Tetley's in the world. I'm neither a cage fighter or yachtsman. I studied Fine Art in the nineties (foundation Bradford 1992, degree Cheltenham 1992 - 95) then Computing part-time at Leeds Met graduating in 2003. I'm the Stephen Tetley on Haskell Cafe and Stackoverflow.