dlvhex
2.5.0
|
Parses HEX-programs, extendable by parser modules. More...
#include <include/dlvhex2/HexParser.h>
Public Member Functions | |
virtual void | registerModule (HexParserModulePtr module) |
Adds an additional module the the parser. | |
virtual void | parse (InputProviderPtr in, ProgramCtx &out) |
Parses in into out using the registered modules. | |
Protected Attributes | |
std::vector< HexParserModulePtr > | modules |
Currently registered modules. |
Parses HEX-programs, extendable by parser modules.
Definition at line 62 of file HexParser.h.
void ModuleHexParser::parse | ( | InputProviderPtr | in, |
ProgramCtx & | out | ||
) | [virtual] |
Parses in
into out
using the registered modules.
in | InputProvider to parse from. |
out | ProgramCtx to receive EDB and IDB of the parsed program. |
Implements HexParser.
Definition at line 64 of file HexParser.cpp.
References HexParserModule::BODYATOM, DBGLOG, ProgramCtx::edb, HexParserModule::HEADATOM, ProgramCtx::idb, LOG, modules, HexGrammarBase< Iterator, Skipper >::registerBodyAtomModule(), HexGrammarBase< Iterator, Skipper >::registerHeadAtomModule(), HexGrammarBase< Iterator, Skipper >::registerTermModule(), HexGrammarBase< Iterator, Skipper >::registerToplevelModule(), ProgramCtx::registry(), HexParserModule::TERM, HexParserModule::TOPLEVEL, and WARNING().
Referenced by BOOST_AUTO_TEST_CASE(), ExternalLearningHelper::getIDOfLearningRule(), main(), ProgramExt1ProgramCtxFixture::ProgramExt1ProgramCtxFixture(), ProgramMCSMedDProgramCtxFixture::ProgramMCSMedDProgramCtxFixture(), ProgramMCSMedEQProgramCtxFixture::ProgramMCSMedEQProgramCtxFixture(), testABBAProgram(), testAFinProgram(), testCardinalityProgram(), testComplexProgram(), testCsProgram(), testDisjunctionProgram(), testHanoiProgram(), testInconsistentProgram(), testIndirectionProgram(), testIStratified2Program(), testIStratifiedProgram(), testNegationProgram(), testNoticStratifiedProgram(), testOneMainModules(), testReachabilityNonGroundProgram(), testSimple(), testTwoMainModules(), testTwoModuleCalls1(), and testTwoModuleCalls2().
void ModuleHexParser::registerModule | ( | HexParserModulePtr | module | ) | [virtual] |
Adds an additional module the the parser.
Modules are used to parse special non-standard HEX-syntax as supported e.g. by plugins.
module | ParserModule to add. |
Definition at line 58 of file HexParser.cpp.
References modules.
std::vector<HexParserModulePtr> ModuleHexParser::modules [protected] |
Currently registered modules.
Definition at line 81 of file HexParser.h.
Referenced by parse(), and registerModule().