dlvhex  2.5.0
include/dlvhex2/HexGrammar.h File Reference

Grammar for parsing HEX using boost::spirit. More...

#include <boost/spirit/include/qi.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/logical.hpp>
#include <boost/type_traits.hpp>
#include <boost/version.hpp>
#include "dlvhex2/PlatformDefinitions.h"
#include "dlvhex2/fwd.h"
#include "dlvhex2/ID.h"
Include dependency graph for HexGrammar.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  HexParserSkipperGrammar< Iterator >
 Skip parser for parsing hex (eliminates spaces and comments). More...
struct  sem< Tag >
 Generic semantic action processor which creates useful compile-time error messages. More...
struct  SemanticActionBase< ManagerClass, TargetAttribute, Tag >
 Base class for semantic actions. More...
class  HexGrammarSemantics
 Grammar for parsing HEX using boost::spirit. More...
struct  HexGrammarBase< Iterator, Skipper >
 Basic HEX Grammar. More...
struct  HexGrammarBase< Iterator, Skipper >::Rule< Attrib, Dummy >
 Helper struct for creating rule types. More...
struct  HexGrammarBase< Iterator, Skipper >::Rule< void, Dummy >
struct  HexGrammar< Iterator, Skipper >
 Implements the standard HEX-syntax. More...

Defines

#define DLVHEX_DEFINE_SEMANTIC_ACTION(name, targettype)

Typedefs

typedef std::string::iterator HexParserIterator
 concrete iterator type used
typedef
HexParserSkipperGrammar
< HexParserIterator
HexParserSkipper
 concrete skip parser used
typedef
boost::spirit::qi::grammar
< HexParserIterator, ID(),
HexParserSkipper
HexParserModuleGrammar
 concrete type for grammars used in parser modules
typedef boost::shared_ptr
< HexParserModuleGrammar
HexParserModuleGrammarPtr

Detailed Description

Grammar for parsing HEX using boost::spirit.

Author:
Peter Schller
Date:
Wed Jul 8 14:00:48 CEST 2009

We code everything as intended by boost::spirit (use templates) however we explicitly instantiate the template paramters in a separate compilation unit HexGrammar.cpp to 1) have faster compilation, and 2) allow us to extend parsers by plugins from shared libraries (i.e., during runtime).

Definition in file HexGrammar.h.


Define Documentation

#define DLVHEX_DEFINE_SEMANTIC_ACTION (   name,
  targettype 
)
Value:
struct name: \
        SemanticActionBase<HexGrammarSemantics, targettype, name> \
        { \
            name(HexGrammarSemantics& mgr): name ::base_type(mgr) {} \
        };

Definition at line 194 of file HexGrammar.h.


Typedef Documentation

typedef std::string::iterator HexParserIterator

concrete iterator type used

Definition at line 125 of file HexGrammar.h.

typedef boost::spirit::qi::grammar<HexParserIterator, ID(), HexParserSkipper> HexParserModuleGrammar

concrete type for grammars used in parser modules

Definition at line 133 of file HexGrammar.h.

Definition at line 135 of file HexGrammar.h.

concrete skip parser used

Definition at line 128 of file HexGrammar.h.