2 This is a description of Gazelle's bytecode file format.
4 The file format itself is "Bitcode," a generic bytecode format
5 developed as part of the LLVM project. It is documented here:
6 http://llvm.cs.uiuc.edu/docs/BitCodeFormat.html
8 This file describes the meaning of the information that Gazelle
9 puts into the bytecode.
11 Bitcode file, application magic number = "GH"
12 All offsets are 0-based.
14 STRINGS -- all strings are put into the STRINGS block, and referenced
15 by offset in other parts of the file
16 [STRING, <ascii array of chars>]
17 [STRING, <ascii array of chars>]
20 INTFAS -- the list of all IntFAs (lexing DFAs)
22 [INTFA_STATE, # of transitions] <-- first state is assumed to be start state
23 [INTFA_STATE, # of transitions]
24 [INTFA_FINAL_STATE, # of transitions, terminal_name_int]
26 (states are identified by their offset in this list)
28 [INTFA_TRANSITION, edge val, dest state offset]
29 [INTFA_TRANSITION_RANGE, edge val low, edge val high, dest state offset]
31 (transitions are identified by their offset in this list)
35 [GLA_STATE, intfa #, # of transitions]
36 [GLA_FINAL_STATE, should return?, <array of rtn alt offsets>]
39 [GLA_TRANSITION, terminal_name_int, dest GLA state offset]
42 RTNS -- a list of all the RTNs
44 [RTN_INFO, nonterm_name_int, # of slots]
46 [RTN_IGNORE, terminal_name_int]
49 [RTN_STATE, # of transitions, intfa#, is final]
50 [RTN_STATE_WITH_GLA, # of transitions, gla#, is final]
53 [RTN_TRANSITION_TERMINAL, terminal_name_int, dest RTN state offset, slotname_int, slotnum]
54 [RTN_TRANSITION_NONTERM, rtn_offset, dest RTN state offset, slotname_int, slotnum]