-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathlex.automata.m
More file actions
57 lines (46 loc) · 1.94 KB
/
lex.automata.m
File metadata and controls
57 lines (46 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
%-----------------------------------------------------------------------------%
% vim: ts=4 sw=4 et tw=0 wm=0 ff=unix
%-----------------------------------------------------------------------------%
% lex.automata.m
% Copyright (C) 2001 Ralph Becket <rbeck@microsoft.com>
% Copyright (C) 2002, 2010 The University of Melbourne
%
% This file may only be copied under the terms of the GNU Library General
% Public License - see the file COPYING.LIB in the Mercury distribution.
%
% Fri Aug 18 15:48:09 BST 2000
%
% Basic types and insts etc. for DFAs and NFAs over chars.
%
% THIS FILE IS HEREBY CONTRIBUTED TO THE MERCURY PROJECT TO
% BE RELEASED UNDER WHATEVER LICENCE IS DEEMED APPROPRIATE
% BY THE ADMINISTRATORS OF THE MERCURY PROJECT.
%
%-----------------------------------------------------------------------------%
:- module lex.automata.
:- interface.
:- import_module list.
:- import_module set.
%-----------------------------------------------------------------------------%
% States are labelled with non-negative integers.
%
:- type state_no == int.
:- type state_mc
---> state_mc(
smc_start_state :: state_no,
smc_stop_states :: set(state_no),
smc_state_transitions :: list(transition)
).
:- inst null_transition_free_state_mc
== bound(state_mc(ground, ground, atom_transitions)).
:- type transitions == list(transition).
:- inst atom_transitions == list_skel(atom_transition).
:- inst null_transitions == list_skel(null_transition).
:- type transition
---> null(state_no, state_no)
; trans(state_no, charset, state_no).
:- inst atom_transition == bound(trans(ground, ground, ground)).
:- inst null_transition == bound(null(ground, ground)).
%-----------------------------------------------------------------------------%
:- end_module lex.automata.
%-----------------------------------------------------------------------------%