dlvhex
2.5.0
|
Grammar for parsing HEX using boost::spirit. More...
#include <include/dlvhex2/HexGrammar.h>
Public Member Functions | |
void | markExternalPropertyIfExternalBody (RegistryPtr registry, Rule &r) |
Checks if r contains external atoms and sets the kind flag appropriately. | |
void | markModulePropertyIfModuleBody (RegistryPtr registry, Rule &r) |
Checks if r contains module atoms and sets the kind flag appropriately. | |
HexGrammarSemantics (ProgramCtx &ctx) | |
Constructor. | |
DLVHEX_DEFINE_SEMANTIC_ACTION (termId, ID) | |
DLVHEX_DEFINE_SEMANTIC_ACTION (termFromCIdent, ID) | |
DLVHEX_DEFINE_SEMANTIC_ACTION (termFromFunctionTerm, ID) | |
DLVHEX_DEFINE_SEMANTIC_ACTION (termFromRange, ID) | |
DLVHEX_DEFINE_SEMANTIC_ACTION (termFromInteger, ID) | |
DLVHEX_DEFINE_SEMANTIC_ACTION (termFromString, ID) | |
DLVHEX_DEFINE_SEMANTIC_ACTION (termFromVariable, ID) | |
DLVHEX_DEFINE_SEMANTIC_ACTION (predFromPredDecl, ID) | |
DLVHEX_DEFINE_SEMANTIC_ACTION (predFromNameOnly, ID) | |
DLVHEX_DEFINE_SEMANTIC_ACTION (predFromString, ID) | |
DLVHEX_DEFINE_SEMANTIC_ACTION (classicalAtomFromPrefix, ID) | |
DLVHEX_DEFINE_SEMANTIC_ACTION (classicalAtomFromTuple, ID) | |
DLVHEX_DEFINE_SEMANTIC_ACTION (builtinTernaryInfix, ID) | |
DLVHEX_DEFINE_SEMANTIC_ACTION (builtinBinaryInfix, ID) | |
DLVHEX_DEFINE_SEMANTIC_ACTION (builtinUnaryPrefix, ID) | |
DLVHEX_DEFINE_SEMANTIC_ACTION (builtinBinaryPrefix, ID) | |
DLVHEX_DEFINE_SEMANTIC_ACTION (builtinTernaryPrefix, ID) | |
DLVHEX_DEFINE_SEMANTIC_ACTION (aggregateAtom, ID) | |
DLVHEX_DEFINE_SEMANTIC_ACTION (externalAtom, ID) | |
DLVHEX_DEFINE_SEMANTIC_ACTION (extSourceProperty, std::vector< std::string >) | |
DLVHEX_DEFINE_SEMANTIC_ACTION (mlpModuleAtom, ID) | |
DLVHEX_DEFINE_SEMANTIC_ACTION (bodyLiteral, ID) | |
DLVHEX_DEFINE_SEMANTIC_ACTION (rule, ID) | |
DLVHEX_DEFINE_SEMANTIC_ACTION (ruleVariableDisjunction, ID) | |
DLVHEX_DEFINE_SEMANTIC_ACTION (constraint, ID) | |
DLVHEX_DEFINE_SEMANTIC_ACTION (weakconstraint, ID) | |
DLVHEX_DEFINE_SEMANTIC_ACTION (weakconstraintaspcore2, ID) | |
DLVHEX_DEFINE_SEMANTIC_ACTION (add, const boost::spirit::unused_type) | |
DLVHEX_DEFINE_SEMANTIC_ACTION (addMLPModuleName, std::string) | |
DLVHEX_DEFINE_SEMANTIC_ACTION (addMLPModuleHeader, const boost::spirit::unused_type) | |
DLVHEX_DEFINE_SEMANTIC_ACTION (ignoreAndWarnIfNotFail, const boost::spirit::unused_type) | |
DLVHEX_DEFINE_SEMANTIC_ACTION (maxint, const boost::spirit::unused_type) | |
Data Fields | |
ProgramCtx & | ctx |
ProgramCtx. | |
std::string | currentModuleName |
Stores module name to prefix pred_decl. | |
int | mlpMode |
Parse also modules. |
Grammar for parsing HEX using boost::spirit.
Definition at line 169 of file HexGrammar.h.
Constructor.
ctx | ProgramCtx. |
Definition at line 61 of file HexGrammar.cpp.
References mlpMode.
HexGrammarSemantics::DLVHEX_DEFINE_SEMANTIC_ACTION | ( | termId | , |
ID | |||
) |
HexGrammarSemantics::DLVHEX_DEFINE_SEMANTIC_ACTION | ( | termFromCIdent | , |
ID | |||
) |
HexGrammarSemantics::DLVHEX_DEFINE_SEMANTIC_ACTION | ( | termFromFunctionTerm | , |
ID | |||
) |
HexGrammarSemantics::DLVHEX_DEFINE_SEMANTIC_ACTION | ( | termFromRange | , |
ID | |||
) |
HexGrammarSemantics::DLVHEX_DEFINE_SEMANTIC_ACTION | ( | termFromInteger | , |
ID | |||
) |
HexGrammarSemantics::DLVHEX_DEFINE_SEMANTIC_ACTION | ( | termFromString | , |
ID | |||
) |
HexGrammarSemantics::DLVHEX_DEFINE_SEMANTIC_ACTION | ( | termFromVariable | , |
ID | |||
) |
HexGrammarSemantics::DLVHEX_DEFINE_SEMANTIC_ACTION | ( | predFromPredDecl | , |
ID | |||
) |
HexGrammarSemantics::DLVHEX_DEFINE_SEMANTIC_ACTION | ( | predFromNameOnly | , |
ID | |||
) |
HexGrammarSemantics::DLVHEX_DEFINE_SEMANTIC_ACTION | ( | predFromString | , |
ID | |||
) |
HexGrammarSemantics::DLVHEX_DEFINE_SEMANTIC_ACTION | ( | classicalAtomFromPrefix | , |
ID | |||
) |
HexGrammarSemantics::DLVHEX_DEFINE_SEMANTIC_ACTION | ( | classicalAtomFromTuple | , |
ID | |||
) |
HexGrammarSemantics::DLVHEX_DEFINE_SEMANTIC_ACTION | ( | builtinTernaryInfix | , |
ID | |||
) |
HexGrammarSemantics::DLVHEX_DEFINE_SEMANTIC_ACTION | ( | builtinBinaryInfix | , |
ID | |||
) |
HexGrammarSemantics::DLVHEX_DEFINE_SEMANTIC_ACTION | ( | builtinUnaryPrefix | , |
ID | |||
) |
HexGrammarSemantics::DLVHEX_DEFINE_SEMANTIC_ACTION | ( | builtinBinaryPrefix | , |
ID | |||
) |
HexGrammarSemantics::DLVHEX_DEFINE_SEMANTIC_ACTION | ( | builtinTernaryPrefix | , |
ID | |||
) |
HexGrammarSemantics::DLVHEX_DEFINE_SEMANTIC_ACTION | ( | aggregateAtom | , |
ID | |||
) |
HexGrammarSemantics::DLVHEX_DEFINE_SEMANTIC_ACTION | ( | externalAtom | , |
ID | |||
) |
HexGrammarSemantics::DLVHEX_DEFINE_SEMANTIC_ACTION | ( | extSourceProperty | , |
std::vector< std::string > | |||
) |
HexGrammarSemantics::DLVHEX_DEFINE_SEMANTIC_ACTION | ( | mlpModuleAtom | , |
ID | |||
) |
HexGrammarSemantics::DLVHEX_DEFINE_SEMANTIC_ACTION | ( | bodyLiteral | , |
ID | |||
) |
HexGrammarSemantics::DLVHEX_DEFINE_SEMANTIC_ACTION | ( | ruleVariableDisjunction | , |
ID | |||
) |
HexGrammarSemantics::DLVHEX_DEFINE_SEMANTIC_ACTION | ( | constraint | , |
ID | |||
) |
HexGrammarSemantics::DLVHEX_DEFINE_SEMANTIC_ACTION | ( | weakconstraint | , |
ID | |||
) |
HexGrammarSemantics::DLVHEX_DEFINE_SEMANTIC_ACTION | ( | weakconstraintaspcore2 | , |
ID | |||
) |
HexGrammarSemantics::DLVHEX_DEFINE_SEMANTIC_ACTION | ( | add | , |
const boost::spirit::unused_type | |||
) |
HexGrammarSemantics::DLVHEX_DEFINE_SEMANTIC_ACTION | ( | addMLPModuleName | , |
std::string | |||
) |
HexGrammarSemantics::DLVHEX_DEFINE_SEMANTIC_ACTION | ( | addMLPModuleHeader | , |
const boost::spirit::unused_type | |||
) |
HexGrammarSemantics::DLVHEX_DEFINE_SEMANTIC_ACTION | ( | ignoreAndWarnIfNotFail | , |
const boost::spirit::unused_type | |||
) |
HexGrammarSemantics::DLVHEX_DEFINE_SEMANTIC_ACTION | ( | maxint | , |
const boost::spirit::unused_type | |||
) |
void HexGrammarSemantics::markExternalPropertyIfExternalBody | ( | RegistryPtr | registry, |
Rule & | r | ||
) |
Checks if r
contains external atoms and sets the kind flag appropriately.
Definition at line 68 of file HexGrammar.cpp.
References Rule::body, Rule::kind, and ID::PROPERTY_RULE_EXTATOMS.
Referenced by sem< HexGrammarSemantics::rule >::operator()(), sem< HexGrammarSemantics::ruleVariableDisjunction >::operator()(), sem< HexGrammarSemantics::constraint >::operator()(), sem< HexGrammarSemantics::weakconstraint >::operator()(), and sem< HexGrammarSemantics::weakconstraintaspcore2 >::operator()().
void HexGrammarSemantics::markModulePropertyIfModuleBody | ( | RegistryPtr | registry, |
Rule & | r | ||
) |
Checks if r
contains module atoms and sets the kind flag appropriately.
Definition at line 78 of file HexGrammar.cpp.
References Rule::body, Rule::kind, and ID::PROPERTY_RULE_MODATOMS.
Referenced by sem< HexGrammarSemantics::rule >::operator()(), sem< HexGrammarSemantics::ruleVariableDisjunction >::operator()(), sem< HexGrammarSemantics::constraint >::operator()(), sem< HexGrammarSemantics::weakconstraint >::operator()(), and sem< HexGrammarSemantics::weakconstraintaspcore2 >::operator()().
Definition at line 173 of file HexGrammar.h.
Referenced by sem< HexGrammarSemantics::termFromCIdent >::operator()(), sem< HexGrammarSemantics::termFromFunctionTerm >::operator()(), sem< HexGrammarSemantics::termFromRange >::operator()(), sem< HexGrammarSemantics::termFromInteger >::operator()(), sem< HexGrammarSemantics::termFromString >::operator()(), sem< HexGrammarSemantics::termFromVariable >::operator()(), sem< ConditionalParserModuleSemantics::conditionalLieral >::operator()(), sem< HigherOrderParserModuleSemantics::higherOrderAtom >::operator()(), sem< ChoiceParserModuleSemantics::choiceRule >::operator()(), sem< StrongNegationParserModuleSemantics::stronglyNegatedPrefixAtom >::operator()(), sem< QueryParserModuleSemantics::queryBody >::operator()(), sem< HexGrammarSemantics::predFromPredDecl >::operator()(), sem< ChoiceParserModuleSemantics::choiceHead >::operator()(), sem< HexGrammarSemantics::predFromNameOnly >::operator()(), sem< HexGrammarSemantics::predFromString >::operator()(), sem< HexGrammarSemantics::classicalAtomFromPrefix >::operator()(), sem< ChoiceParserModuleSemantics::choiceElement >::operator()(), sem< HexGrammarSemantics::classicalAtomFromTuple >::operator()(), sem< HexGrammarSemantics::builtinTernaryInfix >::operator()(), sem< HexGrammarSemantics::builtinBinaryInfix >::operator()(), sem< HexGrammarSemantics::builtinUnaryPrefix >::operator()(), sem< HexGrammarSemantics::builtinBinaryPrefix >::operator()(), sem< HexGrammarSemantics::builtinTernaryPrefix >::operator()(), sem< HexGrammarSemantics::aggregateAtom >::operator()(), sem< HexGrammarSemantics::externalAtom >::operator()(), sem< FunctionParserModuleTermSemantics::functionTermConstruct >::operator()(), sem< ManualEvalHeuristicsParserModuleSemantics::evalUnit >::operator()(), sem< HexGrammarSemantics::mlpModuleAtom >::operator()(), sem< FunctionParserModuleAtomSemantics::functionTermEval >::operator()(), sem< HexGrammarSemantics::rule >::operator()(), sem< HexGrammarSemantics::ruleVariableDisjunction >::operator()(), sem< HexGrammarSemantics::constraint >::operator()(), sem< HexGrammarSemantics::weakconstraint >::operator()(), sem< HexGrammarSemantics::weakconstraintaspcore2 >::operator()(), sem< HexGrammarSemantics::addMLPModuleHeader >::operator()(), sem< HexGrammarSemantics::add >::operator()(), sem< HexGrammarSemantics::maxint >::operator()(), and storePredicate().
std::string HexGrammarSemantics::currentModuleName |
Stores module name to prefix pred_decl.
Definition at line 175 of file HexGrammar.h.
Referenced by sem< HexGrammarSemantics::predFromPredDecl >::operator()(), sem< HexGrammarSemantics::addMLPModuleName >::operator()(), and sem< HexGrammarSemantics::addMLPModuleHeader >::operator()().
Parse also modules.
Definition at line 177 of file HexGrammar.h.
Referenced by HexGrammarSemantics(), sem< ChoiceParserModuleSemantics::choiceRule >::operator()(), sem< HexGrammarSemantics::predFromNameOnly >::operator()(), sem< HexGrammarSemantics::predFromString >::operator()(), sem< HexGrammarSemantics::classicalAtomFromPrefix >::operator()(), sem< HexGrammarSemantics::addMLPModuleName >::operator()(), and sem< HexGrammarSemantics::add >::operator()().