mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
* Add cppdap debugger library and simple server (#508) * Add cppdap library * Add cppdap server * fixup cmake scripts for windows * Enable caching of cppdap on GitHub actions * Fix CMake for cppdap target * Wait 1s for session close before thread ends * Address review comments - Remove unnecessary use of wait_for - Fix wait_for method * Do not use SocketClientThread for cppdap clients * Address review comments - Cleanup object ownership * Add authorization and event handling (#510) * Add authorization and event handling [WIP] * Use std::weak_ptr; Only allow one debugger conn * Only attach debugger if dbg file exists * Cleanup weak_ptr; Fix listeners; Add handler stubs * Address review comments - PolLock on uoexec and weakptr access - Use make_shared when creating client thread * Add ExecutorDebugListener on_destroy callback * Use cppdap sockets instead of clib sockets * Update cppdap repository to 2703cf4 * Implement server address binding * Update cppdap repository to eeca5ce * Fix warnings * Use weak_from_this * Fix stalled executors on disconnect * Fix stalled executors on re-attach * Clear uoexec weakptr on all debugger detaches * Move server to gamestate * move DapDebugServer into Network namespace * move DapDebugServer into GameState for storage * Move DapDebugServer into NetworkManager * Fix missing memory include * Add more events (#513) * Add more events * Implement dbg_step_out * Fix breakpoint clearing * Add even more events (#515) * add launch request * Add custom `processes` command * fixup loop * Refactoring to move handlers to member functions * Add VariablesRequest and ScopesRequest * use std::varaint for Handles * add pollocks * refactor Handles to new file * move custom messages to proto.h * move clientthread * some formatting / cleanup * Add missing PolLock * move dap variables creation to Handles * appobj members * rename ClientThread to DebugClientThread * rename LaunchRequest args to arg * Fix compiler error on size_t * Add support for EvaluateRequest and SetVariableRequest (#519) * Update grammar for evaluateUnit * Cleanup various compiler code * Add support for EvaluateRequest Only supports values, variables, element access, member access * Add report clearing to reinitialize state * Add support for SetVariableRequest * Fix CI build errors * Move ExpressionEvaluator to Bscript * Fix formatting * Fix include * Refactor global and frame variable references * Encapsulate Executor debugging environment; Fix step over (#524) * Fix step over * Some cleanup of executor - Remove unused debug states - Rename members for consistency * move debugging environment to new class * Move instruction inspection to class * Cleanup slashes on Windows; Add Executor state to processes response (#527) * Fix backspaces in script names on Windows * Fix compilation warnings with data loss * Use boost::icontains for string comparison * Add Executor state to processes response * Updates for libfmt * Fix tests; Fix cppdap build for Mac universal binary (#607) * fix tests * fix cppdap build for mac universal binary * Update cppdap to 2a4c7cf * Add tests; Modify launch behavior to not stop at entry (redo) (#609) * Remove unused setExceptionBreakpoints handler * Add debugger tests * Launching a script should not set attaching state * Add launch tests * Do not check for connection in debugger tests * Rename `program` to `script` in protocol structs * Fix launch stopAtEntry; quote string var values * Fix compilation error on Windows * Add configfiles doc entry * Various fixes for finishing touches; Add core-changes (#610) * switch cmake projects * simple docs * cmake move make_directory * Fix launch request with relative, absolute, package paths * make relative paths as absolute in source request * Add true, false, uninit to ExpressionEvaluator * Re-add setExceptionBreakpoints to avoid unhandled message errors * Better debug thread logging with instance numbers * launched scripts should terminate on disconnect (according to DAP spec) * Properly handle exited event in client thread * Add core-changes * Address Discord comments - Mention vscode-escript in core-changes - Re-add "cppdap already built" in cmake * change cmake escriptgrammarlib visibility to public
108 lines
3.9 KiB
C++
108 lines
3.9 KiB
C++
#ifndef POLSERVER_EXPRESSIONBUILDER_H
|
|
#define POLSERVER_EXPRESSIONBUILDER_H
|
|
|
|
#include "bscript/compiler/astbuilder/ValueBuilder.h"
|
|
|
|
#ifndef __TOKENS_H
|
|
#include "bscript/tokens.h"
|
|
#endif
|
|
|
|
namespace Pol::Bscript::Compiler
|
|
{
|
|
class Argument;
|
|
class ArrayInitializer;
|
|
class BinaryOperator;
|
|
class ConditionalOperator;
|
|
class DictionaryInitializer;
|
|
class ElementAccess;
|
|
class ElvisOperator;
|
|
class ErrorInitializer;
|
|
class Expression;
|
|
class FormatExpression;
|
|
class FunctionCall;
|
|
class InterpolateString;
|
|
class MemberAccess;
|
|
class MethodCall;
|
|
class UnaryOperator;
|
|
|
|
class ExpressionBuilder : public ValueBuilder
|
|
{
|
|
public:
|
|
ExpressionBuilder( const SourceFileIdentifier&, BuilderWorkspace& );
|
|
|
|
[[noreturn]] static void unhandled_operator( const SourceLocation& );
|
|
|
|
std::unique_ptr<ArrayInitializer> array_initializer(
|
|
EscriptGrammar::EscriptParser::BareArrayInitializerContext* );
|
|
std::unique_ptr<ArrayInitializer> array_initializer(
|
|
EscriptGrammar::EscriptParser::ExplicitArrayInitializerContext* );
|
|
|
|
std::unique_ptr<Expression> binary_operator(
|
|
EscriptGrammar::EscriptParser::ExpressionContext*, bool consume );
|
|
|
|
BTokenId binary_operator_token( EscriptGrammar::EscriptParser::ExpressionContext* );
|
|
|
|
std::unique_ptr<DictionaryInitializer> dictionary_initializer(
|
|
EscriptGrammar::EscriptParser::ExplicitDictInitializerContext* );
|
|
|
|
std::unique_ptr<ElementAccess> element_access(
|
|
std::unique_ptr<Expression> lhs, EscriptGrammar::EscriptParser::ExpressionListContext* );
|
|
|
|
std::unique_ptr<ElvisOperator> elvis_operator(
|
|
EscriptGrammar::EscriptParser::ExpressionContext* );
|
|
|
|
std::unique_ptr<ConditionalOperator> conditional_operator(
|
|
EscriptGrammar::EscriptParser::ExpressionContext* );
|
|
|
|
std::unique_ptr<ErrorInitializer> error(
|
|
EscriptGrammar::EscriptParser::ExplicitErrorInitializerContext* );
|
|
|
|
std::unique_ptr<Expression> expression( EscriptGrammar::EscriptParser::ExpressionContext*,
|
|
bool consume = false );
|
|
|
|
std::vector<std::unique_ptr<Expression>> expressions(
|
|
EscriptGrammar::EscriptParser::ArrayInitializerContext* );
|
|
std::vector<std::unique_ptr<Expression>> expressions(
|
|
EscriptGrammar::EscriptParser::ExpressionListContext* );
|
|
std::vector<std::unique_ptr<Expression>> expressions(
|
|
std::vector<EscriptGrammar::EscriptParser::InterpolatedStringPartContext*> );
|
|
|
|
std::unique_ptr<FunctionCall> function_call( EscriptGrammar::EscriptParser::FunctionCallContext*,
|
|
const std::string& scope );
|
|
|
|
std::unique_ptr<MethodCall> method_call(
|
|
std::unique_ptr<Expression> lhs, EscriptGrammar::EscriptParser::MethodCallSuffixContext* );
|
|
|
|
std::unique_ptr<MemberAccess> navigation(
|
|
std::unique_ptr<Expression> lhs, EscriptGrammar::EscriptParser::NavigationSuffixContext* );
|
|
std::unique_ptr<Expression> expression_suffix(
|
|
std::unique_ptr<Expression> lhs,
|
|
EscriptGrammar::EscriptParser::ExpressionSuffixContext* );
|
|
|
|
std::unique_ptr<Expression> prefix_unary_operator(
|
|
EscriptGrammar::EscriptParser::ExpressionContext* );
|
|
|
|
std::unique_ptr<Expression> postfix_unary_operator(
|
|
EscriptGrammar::EscriptParser::ExpressionContext* );
|
|
|
|
std::unique_ptr<Expression> primary( EscriptGrammar::EscriptParser::PrimaryContext* );
|
|
|
|
std::unique_ptr<FunctionCall> scoped_function_call(
|
|
EscriptGrammar::EscriptParser::ScopedFunctionCallContext* );
|
|
|
|
std::unique_ptr<Expression> struct_initializer(
|
|
EscriptGrammar::EscriptParser::ExplicitStructInitializerContext* );
|
|
|
|
std::vector<std::unique_ptr<Argument>> value_arguments(
|
|
EscriptGrammar::EscriptParser::ExpressionListContext* );
|
|
|
|
std::unique_ptr<InterpolateString> interpolate_string(
|
|
EscriptGrammar::EscriptParser::InterpolatedStringContext* );
|
|
|
|
std::unique_ptr<Expression> format_expression(
|
|
std::unique_ptr<Expression>, antlr4::tree::TerminalNode* );
|
|
};
|
|
|
|
} // namespace Pol::Bscript::Compiler
|
|
|
|
#endif // POLSERVER_EXPRESSIONBUILDER_H
|