OMNeT++ NEDXML
5.4.1
Main Page
Modules
Namespaces
Classes
Files
File List
File Members
yydefs.h
Go to the documentation of this file.
1
//==========================================================================
2
// YYDEFS.H - part of
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
#ifndef __OMNETPP_NEDXML_YYDEFS_H
18
#define __OMNETPP_NEDXML_YYDEFS_H
19
20
#include "
nedxmldefs.h
"
21
22
//
23
// misc bison/flex related stuff, shared among *.lex, *.y and nedparser.cc/h files
24
//
25
26
#ifdef YYLTYPE
27
#error 'YYLTYPE defined before yydefs.h -- type clash?'
28
#endif
29
30
namespace
omnetpp
{
31
namespace
nedxml {
32
33
class
ErrorStore;
34
class
SourceDocument;
35
class
ASTNode;
36
37
struct
YYLoc
{
38
int
dummy
;
39
int
first_line
,
first_column
;
40
int
last_line
,
last_column
;
41
char
*
text
;
42
};
43
44
#define YYLTYPE omnetpp::nedxml::YYLoc
45
#define YYSTYPE omnetpp::nedxml::ASTNode*
46
47
//TODO cleanup
48
struct
ParseContext
{
49
bool
parseexpr =
true
;
// whether to parse NED expressions or not
50
bool
msgNewSyntax =
true
;
51
bool
storesrc =
false
;
// whether to fill in sourceCode attributes
52
const
char
*filename =
nullptr
;
// name of file being parsed
53
ErrorStore
*errors =
nullptr
;
// accumulates error messages
54
SourceDocument
*source =
nullptr
;
// represents the source file
55
56
bool
getParseExpressionsFlag
() {
return
parseexpr;}
57
bool
getStoreSourceFlag
() {
return
storesrc;}
58
const
char
*
getFileName
() {
return
filename;}
59
ErrorStore
*
getErrors
() {
return
errors;}
60
SourceDocument
*
getSource
() {
return
source;}
61
void
error(
const
char
*msg,
int
line);
62
};
63
64
typedef
struct
{
int
li
;
int
co;}
LineColumn
;
65
extern
LineColumn
pos
,
prevpos
;
//FIXME into context!
66
67
void
msgLexerSetRecognizeNewKeywords
(
bool
opt);
68
void
msgLexerSetRecognizeObsoleteKeywords
(
bool
opt);
69
70
}
// namespace nedxml
71
}
// namespace omnetpp
72
73
omnetpp::nedxml::ASTNode
*
doParseNed
(
omnetpp::nedxml::ParseContext
*np,
const
char
*
text
);
74
omnetpp::nedxml::ASTNode
*
doParseMsg
(
omnetpp::nedxml::ParseContext
*np,
const
char
*
text
);
75
76
77
#endif
78
79
80
omnetpp::nedxml::YYLoc::text
char * text
Definition:
yydefs.h:41
omnetpp::nedxml::YYLoc::last_line
int last_line
Definition:
yydefs.h:40
omnetpp::nedxml::LineColumn::li
int li
Definition:
yydefs.h:64
omnetpp::nedxml::YYLoc::last_column
int last_column
Definition:
yydefs.h:40
omnetpp::nedxml::YYLoc
Definition:
yydefs.h:37
omnetpp::nedxml::YYLoc::first_column
int first_column
Definition:
yydefs.h:39
omnetpp::nedxml::ParseContext::getSource
SourceDocument * getSource()
Definition:
yydefs.h:60
omnetpp::nedxml::LineColumn
Definition:
yydefs.h:64
omnetpp::nedxml::ParseContext::getFileName
const char * getFileName()
Definition:
yydefs.h:58
omnetpp::nedxml::pos
LineColumn pos
omnetpp::nedxml::YYLoc::first_line
int first_line
Definition:
yydefs.h:39
omnetpp::nedxml::ParseContext
Definition:
yydefs.h:48
doParseMsg
omnetpp::nedxml::ASTNode * doParseMsg(omnetpp::nedxml::ParseContext *np, const char *text)
omnetpp::nedxml::YYLoc::dummy
int dummy
Definition:
yydefs.h:38
omnetpp::nedxml::SourceDocument
Stores the full text of a NED/MSG file.
Definition:
sourcedocument.h:37
nedxmldefs.h
omnetpp
Definition:
astbuilder.h:25
doParseNed
omnetpp::nedxml::ASTNode * doParseNed(omnetpp::nedxml::ParseContext *np, const char *text)
omnetpp::nedxml::ParseContext::getParseExpressionsFlag
bool getParseExpressionsFlag()
Definition:
yydefs.h:56
omnetpp::nedxml::ASTNode
Definition:
astnode.h:75
omnetpp::nedxml::ErrorStore
Definition:
errorstore.h:37
omnetpp::nedxml::ParseContext::getErrors
ErrorStore * getErrors()
Definition:
yydefs.h:59
omnetpp::nedxml::msgLexerSetRecognizeNewKeywords
void msgLexerSetRecognizeNewKeywords(bool opt)
omnetpp::nedxml::msgLexerSetRecognizeObsoleteKeywords
void msgLexerSetRecognizeObsoleteKeywords(bool opt)
omnetpp::nedxml::prevpos
LineColumn prevpos
omnetpp::nedxml::ParseContext::getStoreSourceFlag
bool getStoreSourceFlag()
Definition:
yydefs.h:57
src
nedxml
yydefs.h
Generated on Fri Jun 29 2018 09:26:19 for OMNeT++ NEDXML by
1.8.11