32 #ifndef _QORE_SWITCHSTATEMENT_H
34 #define _QORE_SWITCHSTATEMENT_H
36 #include "qore/intern/AbstractStatement.h"
37 #include "qore/intern/StatementBlock.h"
41 DLLLOCAL
virtual bool isCaseNodeImpl()
const;
44 const QoreProgramLocation* loc;
47 CaseNode* next =
nullptr;
50 DLLLOCAL CaseNode(
const QoreProgramLocation* loc,
QoreValue v, StatementBlock* c,
bool def =
false)
51 : loc(loc), val(v), code(c), def(def) {
54 DLLLOCAL
virtual ~CaseNode();
58 DLLLOCAL
virtual bool isDefault()
const {
62 DLLLOCAL
bool isCaseNode()
const;
65 class SwitchStatement :
public AbstractStatement {
67 LVList* lvars =
nullptr;
70 DLLLOCAL SwitchStatement(CaseNode* f);
71 DLLLOCAL
virtual ~SwitchStatement();
73 DLLLOCAL
void addCase(CaseNode* c);
76 DLLLOCAL
virtual bool hasFinalReturn()
const {
79 DLLLOCAL
virtual void parseCommit(
QoreProgram* pgm);
82 CaseNode* head =
nullptr, *tail =
nullptr;
84 CaseNode* deflt =
nullptr;
86 DLLLOCAL
virtual int parseInitImpl(QoreParseContext& parse_context0);
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:48
supports parsing and executing Qore-language code, reference counted, dynamically-allocated only
Definition: QoreProgram.h:127
The main value class in Qore, designed to be passed by value.
Definition: QoreValue.h:275