/* * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 * Heikki Tauriainen * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ %{ #include #include "Configuration.h" #include "Config-parse.h" extern int config_file_line_number; %} %option case-insensitive %option never-interactive %option noyywrap %option nounput %x ATTR EQ VAL SQSTR [^\'\n]* DQSTR ([^\"\\\n]|\\.)* UQC [^\'\"\\ \t\n] UQSTR ({UQC}+|\\.)({UQC}*|\\.)* OKVAL \'{SQSTR}\'|\"{DQSTR}\"|{UQSTR} %% <*>[ \t]* { /* Skip whitespace everywhere. */ } <*>"#".*$ { /* Skip comments everywhere. */ } "\n" { /* Skip newlines, but update the line number. */ config_file_line_number++; } "{" { BEGIN(ATTR); return CFG_LBRACE; } algorithm|implementation|translator { return CFG_ALGORITHM; } globaloptions { return CFG_GLOBALOPTIONS; } statespaceoptions { return CFG_STATESPACEOPTIONS; } formulaoptions { return CFG_FORMULAOPTIONS; } [^ \t\n]+ { return CFG_UNKNOWN; } enabled { BEGIN(EQ); return CFG_ENABLED; } name { BEGIN(EQ); return CFG_NAME; } parameters { BEGIN(EQ); return CFG_PARAMETERS; } path { BEGIN(EQ); return CFG_PROGRAMPATH; } comparisoncheck { BEGIN(EQ); return CFG_COMPARISONTEST; } comparisontest { BEGIN(EQ); return CFG_COMPARISONTEST; } consistencycheck { BEGIN(EQ); return CFG_CONSISTENCYTEST; } consistencytest { BEGIN(EQ); return CFG_CONSISTENCYTEST; } interactive { BEGIN(EQ); return CFG_INTERACTIVE; } intersectioncheck { BEGIN(EQ); return CFG_INTERSECTIONTEST; } intersectiontest { BEGIN(EQ); return CFG_INTERSECTIONTEST; } modelcheck { BEGIN(EQ); return CFG_MODELCHECK; } rounds { BEGIN(EQ); return CFG_ROUNDS; } translatortimeout { BEGIN(EQ); return CFG_TRANSLATORTIMEOUT; } verbosity { BEGIN(EQ); return CFG_VERBOSITY; } edgeprobability { BEGIN(EQ); return CFG_EDGEPROBABILITY; } propositions { BEGIN(EQ); return CFG_PROPOSITIONS; } size { BEGIN(EQ); return CFG_SIZE; } truthprobability { BEGIN(EQ); return CFG_TRUTHPROBABILITY; } changeinterval { BEGIN(EQ); return CFG_CHANGEINTERVAL; } randomseed { BEGIN(EQ); return CFG_RANDOMSEED; } abbreviatedoperators { BEGIN(EQ); return CFG_ABBREVIATEDOPERATORS; } andpriority { BEGIN(EQ); return CFG_ANDPRIORITY; } beforepriority { BEGIN(EQ); return CFG_BEFOREPRIORITY; } defaultoperatorpriority { BEGIN(EQ); return CFG_DEFAULTOPERATORPRIORITY; } equivalencepriority { BEGIN(EQ); return CFG_EQUIVALENCEPRIORITY; } falsepriority { BEGIN(EQ); return CFG_FALSEPRIORITY; } finallypriority { BEGIN(EQ); return CFG_FINALLYPRIORITY; } generatemode { BEGIN(EQ); return CFG_GENERATEMODE; } globallypriority { BEGIN(EQ); return CFG_GLOBALLYPRIORITY; } implicationpriority { BEGIN(EQ); return CFG_IMPLICATIONPRIORITY; } nextpriority { BEGIN(EQ); return CFG_NEXTPRIORITY; } notpriority { BEGIN(EQ); return CFG_NOTPRIORITY; } orpriority { BEGIN(EQ); return CFG_ORPRIORITY; } outputmode { BEGIN(EQ); return CFG_OUTPUTMODE; } propositionpriority { BEGIN(EQ); return CFG_PROPOSITIONPRIORITY; } releasepriority { BEGIN(EQ); return CFG_RELEASEPRIORITY; } strongreleasepriority { BEGIN(EQ); return CFG_STRONGRELEASEPRIORITY; } truepriority { BEGIN(EQ); return CFG_TRUEPRIORITY; } untilpriority { BEGIN(EQ); return CFG_UNTILPRIORITY; } weakuntilpriority { BEGIN(EQ); return CFG_WEAKUNTILPRIORITY; } xorpriority { BEGIN(EQ); return CFG_XORPRIORITY; } "}" { BEGIN(INITIAL); return CFG_RBRACE; } "="?[^= \t\n]* { return CFG_UNKNOWN; } "=" { BEGIN(VAL); return CFG_EQUALS; } . { return CFG_UNKNOWN; } \\|{OKVAL}+(\\)? { yylval.value = yytext; BEGIN(ATTR); return CFG_VALUE; } {OKVAL}*(\'{SQSTR}|\"{DQSTR})(\\)? { throw Configuration::ConfigurationException (config_file_line_number, "unmatched quotes"); } "\n" { return CFG_UNKNOWN; } %%