32 #ifndef _QORE_ABSTRACTSTATEMENT_H
34 #define _QORE_ABSTRACTSTATEMENT_H
42 #define PF_RETURN_VALUE_IGNORED (1 << 0)
43 #define PF_BACKGROUND (1 << 1)
44 #define PF_RETHROW_OK (1 << 2)
45 #define PF_FOR_ASSIGNMENT (1 << 3)
46 #define PF_CONST_EXPRESSION (1 << 4)
47 #define PF_TOP_LEVEL (1 << 5)
48 #define PF_BREAK_OK (1 << 6)
49 #define PF_CONTINUE_OK (1 << 7)
50 #define PF_NO_TOP_LEVEL_LVARS (1 << 8)
59 class qore_program_private_base;
61 class AbstractStatement {
63 volatile bool breakpointFlag;
64 QoreBreakpointList_t *breakpoints;
67 DLLLOCAL
virtual int parseInitImpl(LocalVar* oflag,
int pflag = 0) = 0;
69 friend class qore_program_private;
78 const QoreProgramLocation* loc;
79 hashdecl ParseWarnOptions pwo;
81 DLLLOCAL AbstractStatement(qore_program_private_base* p);
83 DLLLOCAL AbstractStatement(
const QoreProgramLocation* loc);
84 DLLLOCAL AbstractStatement(
int sline,
int eline);
85 DLLLOCAL
virtual ~AbstractStatement();
88 DLLLOCAL
int parseInit(LocalVar* oflag,
int pflag = 0);
90 DLLLOCAL
void finalizeBlock(
int sline,
int eline);
92 DLLLOCAL
bool getBreakpointFlag()
const {
93 return breakpointFlag;
98 DLLLOCAL
virtual bool endsBlock()
const {
103 DLLLOCAL
virtual bool isParseDeclaration()
const {
108 DLLLOCAL
virtual bool isDeclaration()
const {
112 DLLLOCAL
virtual bool hasFinalReturn()
const {
116 DLLLOCAL
virtual void parseCommit(
QoreProgram* pgm);
119 DLLLOCAL
void push_cvar(
const char* name);
120 DLLLOCAL
void pop_cvar();
121 DLLLOCAL LocalVar* pop_local_var(
bool set_unassigned =
false);
122 DLLLOCAL
int pop_local_var_get_id();
124 DLLLOCAL
void push_local_var(LocalVar* lv,
const QoreProgramLocation* loc);
136 DLLLOCAL LocalVar* push_local_var(
const char* name,
const QoreProgramLocation* loc,
const QoreTypeInfo* typeInfo,
bool is_auto =
true,
int n_refs = 0,
int pflag = 0);
138 DLLLOCAL LocalVar* find_local_var(
const char* name,
bool &in_closure);
140 #endif // _QORE_ABSTRACTSTATEMENT_H