2
* Copyright (c) ? - 2000 Lehrstuhl fuer Informatik VII, RWTH Aachen
3
* Copyright (c) 2000 - 2002 Burak Emir
4
* This file is part of the libAMoRE library.
6
* libAMoRE is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public
8
* License as published by the Free Software Foundation; either
9
* version 2.1 of the License, or (at your option) any later version.
10
* You should have received a copy of the GNU Lesser General Public
11
* License along with the GNU C Library; if not, write to the Free
12
* Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
22
/* #include "obj.h" */
25
#include "rexFromString.h"
32
#include "genrex2nfa.h"
37
#include "debugPrint.h"
39
//char *rexstr = "aba*ab";
40
char *rexstr = "(aba*)-(abaaa)";
44
extern PARSE_RESULT errorParseResult;
48
int constr_rexFromString() {
49
printf("\nconstructing RegExp r:");
50
r1 = rexFromString(2, rexstr);
51
printf("result: %s\n",r1->exprex);
57
int transf_rex2nfa(regex r) {
58
printf("\n transforming Rex to Nfa");
65
int transf_genrex2nfa(regex r) {
66
printf("\n transforming GenRex to Nfa");
75
int transf_nfa2dfa() {
76
printf("\n transforming to Dfa");
83
void transf_dfa2mindfa() {
84
printf("\n minimizing dfa");
85
d1 = dfamdfa( d1, TRUE );
92
void transf_dfa2mon() {
93
printf("\n transforming dfa to monoid:");
100
int clone_dfa(dfa d) {
102
printf("Testing clonedfa...\n");
109
int clone_nfa(nfa n) {
111
printf("Testing clonenfa...\n");
118
void regexp_errorMess() {
121
a = rexFromString(2,"abcdefg"); // only a, b allowed
122
b = rexFromString(2,"aUbUc[;'{"); // illegal char
123
c = rexFromString(2,"Uab");//illegal syntax
126
int main(int argc, char **argv) {
131
constr_rexFromString();
132
transf_genrex2nfa( r1 );