Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
630 changes: 630 additions & 0 deletions nvse/nvse/Compiler/AST/AST.h

Large diffs are not rendered by default.

65 changes: 65 additions & 0 deletions nvse/nvse/Compiler/AST/ASTForward.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#pragma once

#include <nvse/ScriptUtils.h>

namespace Compiler {
struct AST;

struct Statement;
struct Expr;

using ExprPtr = std::shared_ptr<Expr>;
using StmtPtr = std::shared_ptr<Statement>;

namespace Statements {
struct Begin;
struct UDFDecl;
struct VarDecl;

struct ExpressionStatement;
struct For;
struct ForEach;
struct If;
struct Return;
struct Continue;
struct Break;
struct While;
struct Block;
struct ShowMessage;
}

namespace Expressions {
struct AssignmentExpr;
struct TernaryExpr;
struct InExpr;
struct BinaryExpr;
struct UnaryExpr;
struct SubscriptExpr;
struct CallExpr;
struct GetExpr;
struct BoolExpr;
struct NumberExpr;
struct StringExpr;
struct IdentExpr;
struct MapLiteralExpr;
struct ArrayLiteralExpr;
struct GroupingExpr;
struct LambdaExpr;
}

struct VarInfo {
size_t index;
std::string original_name;
std::string remapped_name;
bool pre_existing = false;

Script::VariableType type;
Token_Type detailed_type;

struct {
bool is_lambda;
std::vector<NVSEParamType> param_types{};
Token_Type return_type = kTokenType_Invalid;
} lambda_type_info;
};
}
Loading