* configure.ac: Output src/tgbaparse/Makefile.

* src/Makefile.am (SUBDIRS): Add tgbaparse.
(libspot_la_LDADD): Add tgbaparse/libtgbaparse.la.
* src/tgba/tgbaexplicit.cc (tgba_explicit::get_condition,
tgba_explicit::get_promise, tgba_explicit::add_neg_condition,
tgba_explicit::add_neg_promise): New methods.
* src/tgba/tgbaexplicit.hh: Declare them.
* src/tgbaparse/Makefile.am, src/tgbaparse/fmterror.cc,
src/tgbaparse/parsedecl.hh, src/tgbaparse/public.hh,
src/tgbaparse/tgbaparse.yy, src/tgbaparse/tgbascan.ll,
src/tgbatest/tgbaread.cc, src/tgbatest/tgbaread.test: New files.
* src/tgbatest/Makefile.am (check_PROGRAMS): Add tgbaread.
(TESTS): Add tgbaread.cc.
(CLEANFILES): Add input.
(tgbaread_SOURCES): New variable.
This commit is contained in:
Alexandre Duret-Lutz 2003-06-05 15:22:42 +00:00
parent cebffb11e8
commit 6884a7f985
18 changed files with 495 additions and 14 deletions

81
src/tgbaparse/tgbascan.ll Normal file
View file

@ -0,0 +1,81 @@
%option noyywrap
%option prefix="tgbayy"
%option outfile="lex.yy.c"
%{
#include <string>
#include "parsedecl.hh"
#define YY_USER_ACTION \
yylloc->columns(yyleng);
#define YY_USER_INIT \
do { \
yylloc->begin.filename = current_file; \
yylloc->end.filename = current_file; \
} while (0)
#define YY_NEVER_INTERACTIVE 1
static std::string current_file;
%}
eol \n|\r|\n\r|\r\n
%%
%{
yylloc->step ();
%}
\"[^\"]*\" {
yylval->str = new std::string(yytext + 1,
yyleng - 2);
return STRING;
}
[a-zA-Z][a-zA-Z0-9_]* {
yylval->str = new std::string(yytext);
return IDENT;
}
/* discard whitespace */
{eol} yylloc->lines(yyleng); yylloc->step();
[ \t]+ yylloc->step();
. return *yytext;
%{
/* Dummy use of yyunput to shut up a gcc warning. */
(void) &yyunput;
%}
%%
namespace spot
{
int
tgbayyopen(const std::string &name)
{
if (name == "-")
{
yyin = stdin;
current_file = "standard input";
}
else
{
yyin = fopen (name.c_str (), "r");
current_file = name;
if (!yyin)
return 1;
}
return 0;
}
void
tgbayyclose()
{
fclose(yyin);
}
}