Version: 9.15.0
YACS::codetypeParser Struct Reference

Class for code parser in inline nodes. More...

#include <codeParsers.hxx>

Inheritance diagram for YACS::codetypeParser:
Collaboration diagram for YACS::codetypeParser:

Public Member Functions

virtual void onStart (const XML_Char *el, const XML_Char **attr)
 
virtual void onEnd (const char *el, parser *child)
 
virtual void pre ()
 
virtual void code (const std::string &s)
 
virtual myfunc post ()
 
- Public Member Functions inherited from YACS::parser
 parser ()
 
virtual ~parser ()
 
virtual void SetUserDataAndPush (parser *pp)
 
virtual void charData (const XML_Char *s, int len)
 
virtual void endParser ()
 
virtual void init ()
 
virtual void incrCount (const XML_Char *elem)
 
virtual void checkOrder (std::string &el)
 
virtual void maxcount (std::string name, int max, std::string &el)
 
virtual void mincount (std::string name, int min)
 
virtual void maxchoice (std::string *names, int max, std::string &el)
 
virtual void minchoice (std::string *names, int min)
 
virtual void required (const std::string &name, const XML_Char **attr)
 
virtual void buildAttr (const XML_Char **attr)
 
std::stack< parser * > & getStack ()
 
template<class T >
post ()
 
void logError (const std::string &reason)
 

Public Attributes

std::string _code
 
myfunc _func
 
- Public Attributes inherited from YACS::parser
std::string _file
 
std::string _content
 
std::map< std::string, int > * _counts
 
std::map< std::string, int > _orders
 
int _orderState
 
int _level
 
std::stack< std::map< std::string, int > * > _stackCount
 
std::stack< int > _stackOrder
 
std::map< std::string, parser * > * _defaultParsersMap
 

Static Public Attributes

static codetypeParser codeParser
 
- Static Public Attributes inherited from YACS::parser
static parser main_parser
 
static std::stack< parser * > _stackParser
 

Additional Inherited Members

- Static Public Member Functions inherited from YACS::parser
static void XMLCALL start_document (void *data)
 
static void XMLCALL end_document (void *data)
 
static void XMLCALL start_element (void *data, const xmlChar *name, const xmlChar **p)
 
static void XMLCALL end_element (void *data, const xmlChar *name)
 
static void XMLCALL characters (void *data, const xmlChar *ch, int len)
 
static void XMLCALL comment (void *data, const xmlChar *value)
 
static void XMLCALL cdata_block (void *data, const xmlChar *value, int len)
 
static void XMLCALL warning (void *data, const char *fmt,...)
 
static void XMLCALL error (void *data, const char *fmt,...)
 
static void XMLCALL fatal_error (void *data, const char *fmt,...)
 
static void XML_SetUserData (_xmlParserCtxt *ctxt, parser *par)
 

Detailed Description

Class for code parser in inline nodes.

Definition at line 34 of file codeParsers.hxx.

Member Function Documentation

◆ code()

virtual void YACS::codetypeParser::code ( const std::string &  s)
inlinevirtual

Definition at line 53 of file codeParsers.hxx.

54  {
55  if(_code == "")
56  _code=s;
57  else
58  _code=_code + '\n' + s;
59  }

References _code.

Referenced by onEnd().

◆ onEnd()

virtual void YACS::codetypeParser::onEnd ( const char *  el,
parser child 
)
inlinevirtual

Reimplemented from YACS::parser.

Definition at line 47 of file codeParsers.hxx.

48  {
49  std::string element(el);
50  if(element == "code")code(((stringtypeParser*)child)->post());
51  }
virtual void code(const std::string &s)
Definition: codeParsers.hxx:53
virtual myfunc post()
Definition: codeParsers.hxx:60

References code(), and post().

◆ onStart()

virtual void YACS::codetypeParser::onStart ( const XML_Char el,
const XML_Char **  attr 
)
inlinevirtual

Reimplemented from YACS::parser.

Definition at line 37 of file codeParsers.hxx.

38  {
39  std::string element(el);
41  if(element == "code")pp=&stringtypeParser::stringParser;
42  this->SetUserDataAndPush(pp);
43  pp->init();
44  pp->pre();
45  pp->buildAttr(attr);
46  }
virtual void SetUserDataAndPush(parser *pp)
Definition: parserBase.cxx:55
static parser main_parser
Definition: parserBase.hxx:41
static stringtypeParser stringParser
Definition: dataParsers.hxx:33

References YACS::parser::buildAttr(), YACS::parser::init(), YACS::parser::main_parser, YACS::parser::pre(), YACS::parser::SetUserDataAndPush(), and YACS::stringtypeParser::stringParser.

◆ post()

virtual myfunc YACS::codetypeParser::post ( )
inlinevirtual

Reimplemented in YACS::functypeParser.

Definition at line 60 of file codeParsers.hxx.

61  {
62  _func._name="script";
64  return _func;
65  }
std::string _code
Definition: factory.hxx:104
std::string _name
Definition: factory.hxx:103

References _code, myfunc::_code, _func, and myfunc::_name.

Referenced by onEnd().

◆ pre()

virtual void YACS::codetypeParser::pre ( )
inlinevirtual

Reimplemented from YACS::parser.

Definition at line 52 of file codeParsers.hxx.

52 {_code="";}

References _code.

Member Data Documentation

◆ _code

std::string YACS::codetypeParser::_code

Definition at line 66 of file codeParsers.hxx.

Referenced by code(), post(), YACS::functypeParser::post(), and pre().

◆ _func

myfunc YACS::codetypeParser::_func

Definition at line 67 of file codeParsers.hxx.

Referenced by YACS::functypeParser::name(), post(), and YACS::functypeParser::post().

◆ codeParser

codetypeParser YACS::codetypeParser::codeParser
static

The documentation for this struct was generated from the following files: