Copperbox revision 79.
Quite a big update to Bala. The directory structure has been reorganized and the Midi and Base libraries have been extended.
Saturday, December 29, 2007
Tuesday, November 27, 2007
Sound.Bala
Copperbox revisions 77 & 78.
The sound modules are now under a project named Bala (/libs/sound/Sound/Bala).
Check-in 77 left a few files in the wrong place - these were moved with check-in 78.
The sound modules are now under a project named Bala (/libs/sound/Sound/Bala).
Check-in 77 left a few files in the wrong place - these were moved with check-in 78.
Sunday, November 25, 2007
Temp: JSON
Copperbox revision 76.
I have added a JSON parser in temp/JSON.hs. JSON seems like a good candidate for a Humdrum-like notation to use with the sound tools.
I have added a JSON parser in temp/JSON.hs. JSON seems like a good candidate for a Humdrum-like notation to use with the sound tools.
Monday, October 1, 2007
Sound: ABC
Copperbox revision 75.
Minor updates to the Abc library - the `L`field (field-default-length) had the wrong length type.
I now have a test harness - the parser runs for the simplest of files, but the pretty printer generates ill-formed output.
Minor updates to the Abc library - the `L`field (field-default-length) had the wrong length type.
I now have a test harness - the parser runs for the simplest of files, but the pretty printer generates ill-formed output.
Sunday, September 30, 2007
Sound: ABC
Copperbox revision 74.
Updated the Abc parser and datatypes. The parser is now written with the applicative combinators. The datatypes have been made a bit more uniform, although this has only been done for the `data` definitions and not the `type` synonyms.
Added a pretty printing module and a top-level module.
Updated the Abc parser and datatypes. The parser is now written with the applicative combinators. The datatypes have been made a bit more uniform, although this has only been done for the `data` definitions and not the `type` synonyms.
Added a pretty printing module and a top-level module.
Sunday, September 23, 2007
Sound: ABC
Copperbox revision 73.
Renamed the `midifile` directory to `sound` and added a new sub-directory `Abc`, with a parser for Abc notation. This parser is a rough prototype at the moment.
Renamed the `midifile` directory to `sound` and added a new sub-directory `Abc`, with a parser for Abc notation. This parser is a rough prototype at the moment.
Monday, September 17, 2007
Sunday, September 16, 2007
Midi Lib
Copperbox revision 71.
Replaced the Midi file library with a new version. The new version has error handling - undoubtedly a big plus. It is still a quite rough at the edges as I'm working out how much to use the combinators from Control.Applicative and how much to use my own combinators.
Replaced the Midi file library with a new version. The new version has error handling - undoubtedly a big plus. It is still a quite rough at the edges as I'm working out how much to use the combinators from Control.Applicative and how much to use my own combinators.
Sunday, August 12, 2007
C Front End
(aka Frown: c2hs parser)
Copperbox revision 70.
The declaration printer (CDeclr) wasn't printing qualifiers for array declarations, it now does. I've also removed the previous pretty-print combinator libraries as they are no longer used.
Copperbox revision 70.
The declaration printer (CDeclr) wasn't printing qualifiers for array declarations, it now does. I've also removed the previous pretty-print combinator libraries as they are no longer used.
Saturday, August 11, 2007
Frown: c2hs parser
Copperbox revision 69.
Phew! The new pretty printer is now working properly, so I've update the C printer to use it. There is still quite a bit of work to do on the both parts, but I think I am generally happy with both of them.
Phew! The new pretty printer is now working properly, so I've update the C printer to use it. There is still quite a bit of work to do on the both parts, but I think I am generally happy with both of them.
Thursday, August 9, 2007
Frown: c2hs parser
Copperbox revision 68.
I have added another `empty biased` pretty printer - this one is based on Control.Applicative and is very much a work-in-progress.
Last weekend, I attempted to add layout styles to the C pretty printer using the monadic pretty printer. However the monadic interface wasn't as usable as I had imagined; the new applicative version will hopefully overcome some of its predecessors shortcomings.
I have added another `empty biased` pretty printer - this one is based on Control.Applicative and is very much a work-in-progress.
Last weekend, I attempted to add layout styles to the C pretty printer using the monadic pretty printer. However the monadic interface wasn't as usable as I had imagined; the new applicative version will hopefully overcome some of its predecessors shortcomings.
Sunday, July 22, 2007
Frown: c2hs parser
Copperbox revision 67.
Added a reader monad interface to the pretty printer as per Language.Haskell.Pretty.
This will allow the pretty printer to have different indent and bracing styles.
Added a reader monad interface to the pretty printer as per Language.Haskell.Pretty.
This will allow the pretty printer to have different indent and bracing styles.
Saturday, July 21, 2007
Frown: c2hs parser
Copperbox revision 66.
Cosmetic updates to the pretty printers again. But I wanted to get a working version committed now as the next step is to try a reader monad version that can handle indent preferences, etc.
Cosmetic updates to the pretty printers again. But I wanted to get a working version committed now as the next step is to try a reader monad version that can handle indent preferences, etc.
Friday, July 20, 2007
Thursday, July 19, 2007
Tuesday, July 10, 2007
Applicative Packrat Parser
Copperbox revision 62.
Added the usual combinators (satisfy, char, anyChar, manyof aka many, manyone, literal) to the packrat parser.
PS. I rather suspect I am not handling the recursion properly and the parses backtrack when they shouldn't. This makes them plain backtracking parsers rather packrat parsers.
Added the usual combinators (satisfy, char, anyChar, manyof aka many, manyone, literal) to the packrat parser.
PS. I rather suspect I am not handling the recursion properly and the parses backtrack when they shouldn't. This makes them plain backtracking parsers rather packrat parsers.
Monday, July 9, 2007
Applicative Packrat Parser
Copperbox revision 61.
Updated the packrat parser so that it parses the example given in Bryan Ford's ICFP'02 paper.
Updated the packrat parser so that it parses the example given in Bryan Ford's ICFP'02 paper.
Sunday, July 8, 2007
Applicative Packrat Parser
Copperbox revision 60
Added an parser in the packrat style that uses Control.Applicative.
Hopefully the parser is genuinely a packrat parser (that's to say it memoizes results properly rather than uses backtracking), but I'm not sure it is fully lazy. The code is only an experiment so it might get deleted from the repository head at some point, but the nice thing about version control is that it will live on. (Forever?)
Added an parser in the packrat style that uses Control.Applicative.
Hopefully the parser is genuinely a packrat parser (that's to say it memoizes results properly rather than uses backtracking), but I'm not sure it is fully lazy. The code is only an experiment so it might get deleted from the repository head at some point, but the nice thing about version control is that it will live on. (Forever?)
Sunday, July 1, 2007
Frown: c2hs parser
Copperbox revision 59
Adding the new 'empty biased' pretty printer (show have gone in at revision 58).
Copperbox revision 58
New plain Haskell (not UUAG pretty printer) pretty printer that uses the new pretty printing combinators. The plain version is now as comprehensive as the UUAG version and supersedes it (I will remove UUAG version quite soon).
Adding the new 'empty biased' pretty printer (show have gone in at revision 58).
Copperbox revision 58
New plain Haskell (not UUAG pretty printer) pretty printer that uses the new pretty printing combinators. The plain version is now as comprehensive as the UUAG version and supersedes it (I will remove UUAG version quite soon).
Sunday, June 24, 2007
Frown: c2hs parser
Copperbox revision 57.
Updates to the pretty printer and pretty-print combinators. The combinators now have combinators for prefixing and suffixing. Also the symbols have been changed on the infix combinators, which makes them more pleasant I'd say.
Updates to the pretty printer and pretty-print combinators. The combinators now have combinators for prefixing and suffixing. Also the symbols have been changed on the infix combinators, which makes them more pleasant I'd say.
Sunday, June 17, 2007
Frown: c2hs parser
Copperbox revision 56
Minor updates to the pretty printer to remove the `optEmpty` function - this was a relic from the old PPrint based pretty printer. Correct a mistake where space char wasn't being printed properly in declarations.
Minor updates to the pretty printer to remove the `optEmpty` function - this was a relic from the old PPrint based pretty printer. Correct a mistake where space char wasn't being printed properly in declarations.
Sunday, June 10, 2007
Frown: c2hs parser
Copperbox revision 55.
The pretty printer has been substantially revised, it should now better handle 'empty' documents.
To do this I've introduced a new pretty printing library based on Daan Leijen's PPrint but which is 'empty biased':
Paraphrasing Haskell into something I can type into Blogger:
empty `space` doc results in (doc), whereas with the usual pretty printers it would result in (space, doc).
At the moment the output is less pretty than the previous revision and the new infix combinators have symbols that may be changed, but overall I think it is a good bit simpler for printing C where there are many AST elements that have optional properties.
The pretty printer has been substantially revised, it should now better handle 'empty' documents.
To do this I've introduced a new pretty printing library based on Daan Leijen's PPrint but which is 'empty biased':
Paraphrasing Haskell into something I can type into Blogger:
empty `space` doc results in (doc), whereas with the usual pretty printers it would result in (space, doc).
At the moment the output is less pretty than the previous revision and the new infix combinators have symbols that may be changed, but overall I think it is a good bit simpler for printing C where there are many AST elements that have optional properties.
Sunday, June 3, 2007
Frown: c2hs parser
Copperbox revision 54.
Missed update to Demo.hs - should have gone in with the last commit.
Copperbox revision 53.
Added Pretty instances to the AG pretty printer - this means that syntax tree elements can be individually printed.
Missed update to Demo.hs - should have gone in with the last commit.
Copperbox revision 53.
Added Pretty instances to the AG pretty printer - this means that syntax tree elements can be individually printed.
Frown: c2hs parser
Copperbox revision 52.
Updated the AG pretty printer to use Norman Ramsey's technique for avoiding Lisp-like parens overload.
Updated the AG pretty printer to use Norman Ramsey's technique for avoiding Lisp-like parens overload.
Tuesday, May 29, 2007
Sunday, May 27, 2007
Wednesday, May 23, 2007
Frown: c2hs parser
Copperbox revision 49.
Ahem, __attribute__ had been missing as a token from the lexer so attributes wouldn't parse - now corrected.
Added initial support for pretty printing attributes on structs and enums, though it looks like this is incorrect. I think enums and structs can have prefix and suffix attributes, currently they attributes are only printed in prefix position.
Ahem, __attribute__ had been missing as a token from the lexer so attributes wouldn't parse - now corrected.
Added initial support for pretty printing attributes on structs and enums, though it looks like this is incorrect. I think enums and structs can have prefix and suffix attributes, currently they attributes are only printed in prefix position.
Tuesday, May 22, 2007
Frown: c2hs parser
Copperbox revision 48.
Improved the handling of attribute specifiers in CDecl's - decls can have attributes specs in prefix and suffix positions so now they are separated accordingly.
By the way, yesterday I felt like it was time for an announcement
http://www.haskell.org/pipermail/libraries/2007-May/007537.html
Improved the handling of attribute specifiers in CDecl's - decls can have attributes specs in prefix and suffix positions so now they are separated accordingly.
By the way, yesterday I felt like it was time for an announcement
http://www.haskell.org/pipermail/libraries/2007-May/007537.html
Sunday, May 20, 2007
Frown: c2hs parser
Copperbox revision 44.
Some improvements to the pretty print, plus added initial support for GCC attributes. There is still going to be quite a bit of work to support attributes, some lists seemingly have their elements attributed which might mean the elements will have to be tupled.
Some improvements to the pretty print, plus added initial support for GCC attributes. There is still going to be quite a bit of work to support attributes, some lists seemingly have their elements attributed which might mean the elements will have to be tupled.
Saturday, May 19, 2007
Frown: c2hs parser
Copperbox revision 43 - Fixed 'typo' in the Frown parser where enterScope and leaveScope actions were on the wrong productions. Improved the pretty printing quite a bit though there is still much to do.
Sunday, May 13, 2007
Frown: c2hs parser
Copperbox revision 40.
Added UUAG attribute grammar support. Because we start with Haskell datatypes the UUAG support is a little bit convoluted (as it needs wrappers over the datatypes), but it is certainly workable.
Started a new AG-based pretty printer for the C syntax.
Added UUAG attribute grammar support. Because we start with Haskell datatypes the UUAG support is a little bit convoluted (as it needs wrappers over the datatypes), but it is certainly workable.
Started a new AG-based pretty printer for the C syntax.
Frown: c2hs parser
Copperbox revision 39 - added Haddock comment formatting to the Language.C modules
Saturday, May 12, 2007
Frown: c2hs parser
Copperbox revision 38 - the Frown version now has the proper typedef from the Happy original, and the typedef.i test file in the C2Hs distribution now parses.
Frown: c2hs parser
Revision 36 - Added expected option to the parser, so that it reports expected tokens on parse failure. Changed the directory layout of the dependent taken from C2Hs so that they resemble Language.Haskell from the hierarchical libraries. Now in the folder:
http://copperbox.googlecode.com/svn/trunk/tools/LanguageC/
Wednesday, May 9, 2007
Frown: c2hs parser
(Copperbox - Revision 34) - Restored attrs to the C abstract syntax tree. This makes the frown version pretty much equivalent to the Happy original. Of course there may be errors tucked away, and the lexer is still minimal...
Frown: c2hs parser
Typedef handling added.
I have added in the typedef handling from the original Happy parser - at present I have not added the shadowing that was in the original.
copperbox/tools/c2hs_frown revision 30.
I have added in the typedef handling from the original Happy parser - at present I have not added the shadowing that was in the original.
copperbox/tools/c2hs_frown revision 30.
Frown: c2hs parser
The Frown parser currently doesn't handle typdefs. As a prelude to adding them I've changed the hand rolled Alex monad into and ErrorT / State monad using the hierarchical libraries.
Sunday, May 6, 2007
Frown: c2hs parser
The Frown version of the c2hs parser now works (thats to say it works as far as it has been tested).
In tools directory of the Copperbox project - revision 28.
http://copperbox.googlecode.com/svn/trunk/tools/c2hs_frown/
In tools directory of the Copperbox project - revision 28.
http://copperbox.googlecode.com/svn/trunk/tools/c2hs_frown/
Frown: c2hs parser
Correction - now all productions really do have actions, though parsing declarators has a bug that needs tracking down.
Saturday, May 5, 2007
Frown: c2hs parser
Updated the parser - now all actions are implemented.
The lexer has been updated, though it is still very much demo quality.
The lexer has been updated, though it is still very much demo quality.
Sunday, April 29, 2007
Alex / Frown
Added a new Alex template to copperbox/tools/alex_frown that has prettier error messages (at the expense of tracking more state).
Frown: c2hs parser
I have been working on a Frown version of the c2hs C Parser. This is the initial check-in.
The code compiles though the parser has no actions, so it does not build a parse tree. The lexer is also incomplete - white space is the most obvious omission. Getting the code to compile has been over 4 days work, so I'm commiting this draft now.
GHC is taxed by the code that Frown generates. In particular Frown's compact format will not compile even though the code is smaller - the absence of type signatures on such a large file makes trouble for GHC's type inferencing.
The code compiles though the parser has no actions, so it does not build a parse tree. The lexer is also incomplete - white space is the most obvious omission. Getting the code to compile has been over 4 days work, so I'm commiting this draft now.
GHC is taxed by the code that Frown generates. In particular Frown's compact format will not compile even though the code is smaller - the absence of type signatures on such a large file makes trouble for GHC's type inferencing.
Sunday, April 15, 2007
Saturday, April 7, 2007
Sunday, April 1, 2007
Sunday, March 25, 2007
Copperbox
I have a new google code repository to hold projects:
http://code.google.com/p/copperbox/
Currently it holds NuevoAsdl, my Haskell implementation of AsdlGen that generates much of the code for Cil Pickle.
http://code.google.com/p/copperbox/
Currently it holds NuevoAsdl, my Haskell implementation of AsdlGen that generates much of the code for Cil Pickle.
Sunday, February 4, 2007
Parsec - a combinator to drop 'water'
Poor man's island parsing with Parsec, water drops lines until the parser p succeeds.
(Somehow Blogger seems to drop the whitespace before where)
water :: Parser a -> Parser a
water p = p <|> do { line; water p }
where line = manyTill anyChar newline
(Somehow Blogger seems to drop the whitespace before where)
water :: Parser a -> Parser a
water p = p <|> do { line; water p }
where line = manyTill anyChar newline
Sunday, January 28, 2007
Cil Pickle - commit
Tidied up the OCaml ATerm code a bit (at some point this will be generated from the ASDL definition of the CIL AST).
Monday, January 22, 2007
Cil Pickle - commit
Float pickling added (untested).
Note this converts the float to a string then pickles that, this might contradict what the original ASDL does.
Note this converts the float to a string then pickles that, this might contradict what the original ASDL does.
Sunday, January 21, 2007
Cil Pickle - commit
Success - Test01 now runs.
This means that Cil/OCaml to ASDL pickle; ASDL pickle to Haskell now works to some degree.
Caveat - floats aren't handled and no doubt there are some bugs lurking where the ASDL description of the CIL AST is slightly different to the OCaml one (it doesn't use 'anonymous' tuples as much as the original OCaml AST).
But... As I'm working out Subversion as I go along I've tagged the code as Release-0.1 (after several attempts - by the time I've got a useful release I should be 'useful' with Subversion).
This means that Cil/OCaml to ASDL pickle; ASDL pickle to Haskell now works to some degree.
Caveat - floats aren't handled and no doubt there are some bugs lurking where the ASDL description of the CIL AST is slightly different to the OCaml one (it doesn't use 'anonymous' tuples as much as the original OCaml AST).
But... As I'm working out Subversion as I go along I've tagged the code as Release-0.1 (after several attempts - by the time I've got a useful release I should be 'useful' with Subversion).
Cil Pickle - commit
Latest changes:
- added first test (it fails!)
- updated the Haskell unpickling modules
- added first test (it fails!)
- updated the Haskell unpickling modules
Wednesday, January 17, 2007
Cil Pickle - commit
Better naming for the aterm pickler code. Conversion to ATerms are done by functions prefixed to_aterm_ .
Sunday, January 14, 2007
Cil Pickle - commit
Added generated Haskell AST and pickler code - completely untested.
The code is generated by my own version of ASDLgen which, like cil pickle, is pretty unstable at the moment.
The code is generated by my own version of ASDLgen which, like cil pickle, is pretty unstable at the moment.
Saturday, January 13, 2007
src-code: Cil pickle
cil-pickle project notes
http://code.google.com/p/cil-pickle/
The code is pre-pre-alpha and is of no practical use in its current state...
..but I wanted it to be under version control and using Google Code seemed more convenient than setting up a version control system at home.
Please bear with me.
http://code.google.com/p/cil-pickle/
The code is pre-pre-alpha and is of no practical use in its current state...
..but I wanted it to be under version control and using Google Code seemed more convenient than setting up a version control system at home.
Please bear with me.
Subscribe to:
Posts (Atom)
Blog Archive
About Me
- Stephen Tetley
- 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.