OMNeT++ NEDXML 6.1
Discrete Event Simulation Library
dtdvalidationutils.h
Go to the documentation of this file.
1 //==========================================================================
2 // dtdvalidationutils.h -
3 //
4 // OMNeT++/OMNEST
5 // Discrete System Simulation in C++
6 //
7 //==========================================================================
8 
9 /*--------------------------------------------------------------*
10  Copyright (C) 2002-2017 Andras Varga
11  Copyright (C) 2006-2017 OpenSim Ltd.
12 
13  This file is distributed WITHOUT ANY WARRANTY. See the file
14  `license' for details on this and other legal matters.
15 *--------------------------------------------------------------*/
16 
17 
18 #ifndef __OMNETPP_NEDXML_DTDVALIDATIONUTILS_H
19 #define __OMNETPP_NEDXML_DTDVALIDATIONUTILS_H
20 
21 #include "nedxmldefs.h"
22 
23 namespace omnetpp {
24 namespace nedxml {
25 
26 class ASTNode;
27 class ErrorStore;
28 
35 {
36  protected:
38  void tryCheckChoice(ASTNode *node, ASTNode *&curchild, int tags[], char mult);
39 
40  public:
41  struct Choice {
42  int tags[20]; // array terminated by NED_NULL (increase size if needed)
43  char mult;
44  };
45 
46  public:
47  DtdValidationUtils(ErrorStore *e) : errors(e) {}
48  void checkSequence(ASTNode *node, int tags[], char mult[]);
49  void checkChoice(ASTNode *node, int tags[], char mult);
50  void checkSeqOfChoices(ASTNode *node, Choice choices[], int n);
51  void checkEmpty(ASTNode *node);
52  void checkRequiredAttribute(ASTNode *node, const char *attr);
53  void checkEnumeratedAttribute(ASTNode *node, const char *attr, const char *vals[], int n);
54  void checkNameAttribute(ASTNode *node, const char *attr);
55  void checkCommentAttribute(ASTNode *node, const char *attr);
56 };
57 
58 } // namespace nedxml
59 } // namespace omnetpp
60 
61 
62 #endif
63 
omnetpp::nedxml::DtdValidationUtils::Choice::mult
char mult
Definition: dtdvalidationutils.h:43
NEDXML_API
#define NEDXML_API
Definition: nedxmldefs.h:31
omnetpp::nedxml::DtdValidationUtils::Choice
Definition: dtdvalidationutils.h:41
omnetpp
Definition: astbuilder.h:25
omnetpp::nedxml::DtdValidationUtils
Definition: dtdvalidationutils.h:34
omnetpp::nedxml::DtdValidationUtils::errors
ErrorStore * errors
Definition: dtdvalidationutils.h:37
omnetpp::nedxml::ASTNode
Definition: astnode.h:87
nedxmldefs.h
omnetpp::nedxml::ErrorStore
Definition: errorstore.h:37
omnetpp::nedxml::DtdValidationUtils::DtdValidationUtils
DtdValidationUtils(ErrorStore *e)
Definition: dtdvalidationutils.h:47