mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
Adds: - analyzer/FlowControlScope: Registers a break/continue scope - analyzer/FlowControlScopes: Registry for break/continue scopes - ast/LabelableStatement: Base class for AST nodes that can be labelled (loops and case) - ast/LoopStatement: Base class for AST nodes for loops (have a break and continue label) - ast/WhileLoop: AST node for a while loop
34 lines
887 B
C++
34 lines
887 B
C++
#ifndef POLSERVER_FLOWCONTROLSCOPE_H
|
|
#define POLSERVER_FLOWCONTROLSCOPE_H
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
namespace Pol::Bscript::Compiler
|
|
{
|
|
class FlowControlLabel;
|
|
class FlowControlScopes;
|
|
class SourceLocation;
|
|
|
|
class FlowControlScope
|
|
{
|
|
public:
|
|
FlowControlScope( FlowControlScopes&, const SourceLocation&, std::string name,
|
|
std::shared_ptr<FlowControlLabel> );
|
|
~FlowControlScope();
|
|
FlowControlScope( const FlowControlScope& ) = delete;
|
|
FlowControlScope& operator=( const FlowControlScope& ) = delete;
|
|
|
|
const SourceLocation& source_location;
|
|
const std::string name;
|
|
const std::shared_ptr<FlowControlLabel> flow_control_label;
|
|
const unsigned local_variables_size;
|
|
const FlowControlScope* const parent_scope;
|
|
|
|
private:
|
|
FlowControlScopes& flow_control_scopes;
|
|
};
|
|
|
|
} // namespace Pol::Bscript::Compiler
|
|
|
|
#endif // POLSERVER_FLOWCONTROLSCOPE_H
|