Add Julian Scheid to credits, and add TODO note about character set support.
[vtparse.git] / README
blob5edf8a941d388577623fae69a37db92d092ec43a
2 VTParse - an implementation of Paul Williams' DEC compatible state machine parser
3           <http://www.vt100.net/emu/dec_ansi_parser>
5 Author: Joshua Haberman <joshua@reverberate.org>
7 This code is in the public domain.
9 BUILDING
10 ========
12 Ruby is required at build time to generate the tables in C.  To build the library
13 and test program, just type make:
15 $ make
16 <this will create the test program and libvtparse.a>
18 I have only tested the build on Mac OS X and Linux, but it should build anywhere
19 Ruby and GCC are available.  Other C compilers should work as well, I just haven't
20 tried them.
22 TEST PROGRAM
23 ============
25 The test program shows how to use vtparse.  To see what kind of data is returned
26 by the library, try:
28 --------------------------------
30 $ vim > terminaloutput
31 <type ':q<ENTER>' to exit vim, even though you won't see it>
32 $ ./test < terminaloutput  | head -16
33 Received action ESC_DISPATCH
34 Char: 0x37 ('7')
36 Received action CSI_DISPATCH
37 Char: 0x68 ('h')
38 1 Intermediate chars:
39   0x3f ('?')
40 1 Parameters:
41         47
43 Received action CSI_DISPATCH
44 Char: 0x68 ('h')
45 1 Intermediate chars:
46   0x3f ('?')
47 1 Parameters:
48         1
50 ---------------------------------
52 VERIFYING
53 =========
55 You can also verify the validity of the state tables by running:
57 $ ruby vtparse_check_tables.rb
58 Tables had all necessary transitions defined.
60 This checks to make sure that state transitions are defined for all states, for all
61 characters 0-0xA0.
64 TODO
65 ====
67 One possible enhancement is to allow the client to pass a return value from the
68 callback to say "stop parsing."  The vtparse() function could return the number
69 of bytes consumed from the input buffer.  This would be quite simple to do if
70 someone needed this functionality, but I don't, so I didn't bother.
72 Currently there is no explicit character set support.  I don't know enough about
73 the relevant standards to know if vtparse should have character set support, or
74 what that support would look like.  Suggestions along this vein are very welcome!
76 CREDITS
77 =======
79 Thanks to Julian Scheid for several bugfixes and enhancements.