1/* -*- Mode: C -*- */
2
3/**
4 * \file pseudo.def
5 *
6 * This file is part of AutoGen.
7 *  AutoGen Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
8 *
9 * AutoGen is free software: you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation, either version 3 of the License, or
12 * (at your option) any later version.
13 *
14 * AutoGen is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 * See the GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program.  If not, see <http://www.gnu.org/licenses/>.
21 *
22 *  This defines the finite state transition table for parsing the
23 *  pseudo-macro at the head of every template
24 */
25AutoGen Definitions fsm;
26
27/* "method" is not defined -- produce a header only */
28
29prefix = pm;
30
31event = ed_mode;     /* the -*- mode marker */
32event = marker;      /* a start or end macro mark */
33event = end_pseudo;  /* newline found in end_mark state */
34
35event = "autogen";   /* "autogen" */
36event = template;    /* "template" */
37event = suffix;      /* a string other than the above */
38event = scheme;      /* a scheme expression to process */
39
40state = st_mark;     /* start marker processed */
41state = agen;        /* "autogen5" processed   */
42state = templ;       /* "template" processed   */
43state = end_mark;    /* end marker processed   */
44
45ed-mode = '-*-';
46
47/*
48 *  No-op transition.  Applies to all states and does not change state.
49 */
50transition = { tst = '*';       tev = ed_mode;    ttype = skip_ed_mode; };
51/*
52 *  Disable the ed_mode transition in the end_mark state tho
53 */
54transition = { tst = end_mark;  tev = ed_mode;    ttype = invalid;   };
55
56/*
57 *  Meaningful transitions
58 */
59transition = { tst = init;     tev = marker;     next = st_mark;  };
60transition = { tst = st_mark;  tev = "autogen";  next = agen;  ttype = noop; };
61transition = { tst = agen;     tev = template;   next = templ; ttype = noop; };
62transition = { tst = templ;    tev = suffix; };
63transition = { tst = templ;    tev = scheme; };
64transition = { tst = templ;    tev = marker;     next = end_mark; };
65transition = { tst = end_mark; tev = end_pseudo; next = done;  ttype = noop; };
66
67/* end of agen5/pseudo.def */
68