| 1 |
(* lex-output-spec.sml |
| 2 |
* |
| 3 |
* COPYRIGHT (c) 2005 |
| 4 |
* John Reppy (http://www.cs.uchicago.edu/~jhr) |
| 5 |
* Aaron Turon ([email protected]) |
| 6 |
* All rights reserved. |
| 7 |
* |
| 8 |
* Specification produced by LexGen |
| 9 |
*) |
| 10 |
|
| 11 |
structure LexOutputSpec = |
| 12 |
struct |
| 13 |
|
| 14 |
datatype dfa_state |
| 15 |
= State of { |
| 16 |
id : int, |
| 17 |
startState : bool, |
| 18 |
label : RegExp.re Vector.vector, |
| 19 |
final : int list, (* action vector indices *) |
| 20 |
next : (RegExp.sym_set * dfa_state) list ref |
| 21 |
} |
| 22 |
|
| 23 |
fun sameState (State {id = id1, ...}, State {id = id2, ...}) = |
| 24 |
id1 = id2 |
| 25 |
|
| 26 |
type action = string |
| 27 |
|
| 28 |
datatype spec = Spec of { |
| 29 |
decls : string, |
| 30 |
header : string, |
| 31 |
arg : string, |
| 32 |
actions : action vector, |
| 33 |
dfa : dfa_state list, |
| 34 |
startStates : (string * dfa_state) list, |
| 35 |
eofRules : (string * action) list |
| 36 |
} |
| 37 |
|
| 38 |
end |